From 4cf38996b37584d2b428763a875cf15e252ac99f Mon Sep 17 00:00:00 2001 From: Ronni Skansing Date: Tue, 21 Oct 2025 18:55:50 +0200 Subject: [PATCH] simply campaign wizard Signed-off-by: Ronni Skansing --- frontend/src/routes/campaign/+page.svelte | 207 ++++++++++++---------- 1 file changed, 117 insertions(+), 90 deletions(-) diff --git a/frontend/src/routes/campaign/+page.svelte b/frontend/src/routes/campaign/+page.svelte index cc2fd81..b0349a3 100644 --- a/frontend/src/routes/campaign/+page.svelte +++ b/frontend/src/routes/campaign/+page.svelte @@ -149,6 +149,8 @@ let allowDenyType = 'none'; let allAllowDeny = []; let showSecurityOptions = false; + let showAdvancedOptionsStep3 = false; + let showAdvancedOptionsStep4 = false; // reactive statement to enable security options when deny page is set $: if (formValues.denyPageValue && formValues.denyPageValue.trim() !== '') { @@ -818,6 +820,8 @@ allowDenyType = 'none'; spreadOption = SPREAD_MANUAL; modalError = ''; + showAdvancedOptionsStep3 = false; + showAdvancedOptionsStep4 = false; }; const onChangeScheduleType = () => { @@ -952,6 +956,16 @@ formValues.denyPageValue = campaign.denyPage.name; } + // set advanced options visibility based on campaign configuration + showAdvancedOptionsStep3 = !!(campaign.closeAt || campaign.anonymizeAt); + + showAdvancedOptionsStep4 = !!( + campaign.webhookID || + campaign.denyPage || + campaign.evasionPage || + campaign.allowDeny?.length + ); + if (campaign.evasionPage) { formValues.evasionPageValue = campaign.evasionPage.name; } @@ -1226,15 +1240,6 @@ bind:value={formValues.template} options={Array.from(templateMap.values())}>Template -
- -
{:else if currentStep === 2} @@ -1358,22 +1363,6 @@ {/if} - - Delivery sort by - - Delivery sort order {:else if scheduleType === 'schedule'}

Delivery start and end

@@ -1403,22 +1392,6 @@ >
- Delivery by - - Delivery order -

Delivery days

@@ -1496,29 +1469,59 @@ {/if}
- Close Campaign + {#if !showAdvancedOptionsStep3} +
+ +
+ {/if} - Delivery sort by + + Delivery order + + Anonymize Data + : formValues.sendStartAt + ? new Date(formValues.sendStartAt) + : new Date()} + optional + toolTipText="After this time, no more events are saved." + >Close Campaign + + Anonymize Data + {/if}
@@ -1526,6 +1529,16 @@ {:else if currentStep === 4} +
+ +
+
-
- Webhook -
+ {#if !showAdvancedOptionsStep4} +
+ +
+ {/if} -
- { - if (!showSecurityOptions) { - formValues.denyPageValue = ''; - formValues.evasionPageValue = ''; - allowDenyType = 'none'; - formValues.allowDeny = []; - } - }} - /> -
+ {#if showAdvancedOptionsStep4} +
+ Webhook +
- {#if showSecurityOptions} +
+ { + if (!showSecurityOptions) { + formValues.denyPageValue = ''; + formValues.evasionPageValue = ''; + allowDenyType = 'none'; + formValues.allowDeny = []; + } + }} + /> +
+ {/if} + + {#if showAdvancedOptionsStep4 && showSecurityOptions}