From 490aec02dff086608583a53743cf2b2a074c088d Mon Sep 17 00:00:00 2001 From: Ronni Skansing Date: Sat, 22 Nov 2025 09:56:32 +0100 Subject: [PATCH] improve campaign ui Signed-off-by: Ronni Skansing --- frontend/src/lib/components/IconButton.svelte | 153 ++++++ .../src/routes/campaign/[id]/+page.svelte | 440 +++++++++--------- 2 files changed, 376 insertions(+), 217 deletions(-) create mode 100644 frontend/src/lib/components/IconButton.svelte diff --git a/frontend/src/lib/components/IconButton.svelte b/frontend/src/lib/components/IconButton.svelte new file mode 100644 index 0000000..c1ac466 --- /dev/null +++ b/frontend/src/lib/components/IconButton.svelte @@ -0,0 +1,153 @@ + + + diff --git a/frontend/src/routes/campaign/[id]/+page.svelte b/frontend/src/routes/campaign/[id]/+page.svelte index 6a0680a..5c4fa9f 100644 --- a/frontend/src/routes/campaign/[id]/+page.svelte +++ b/frontend/src/routes/campaign/[id]/+page.svelte @@ -44,6 +44,7 @@ import { globalButtonDisabledAttributes } from '$lib/utils/form'; import FileField from '$lib/components/FileField.svelte'; import ConditionalDisplay from '$lib/components/ConditionalDisplay.svelte'; + import IconButton from '$lib/components/IconButton.svelte'; // services const appStateService = AppStateService.instance; @@ -1210,61 +1211,88 @@ -
- -
- -
-

- Details -

-
- Status: + +
+ +
+

+ Campaign Details +

+
+
+ Status: {toEvent(campaign.notableEventName).name} +
- Template: - - - +
+ Template: + +
- Groups: - +
+ Groups: +
{#each campaign.recipientGroups as group, i} {group}{#if i !== (campaign.recipientGroups?.length ?? 0) - 1} - ,  - {/if} + >{#if i !== (campaign.recipientGroups?.length ?? 0) - 1}, {/if} {/each} - +
+
- Type: +
+ Type: {isSelfManaged ? 'Self Managed' : 'Scheduled'} +
- - +
+ Webhook: + + {campaign.webhookID ? 'Yes' : 'None'} + +
+ +
+ Data Saving: + + {campaign.saveSubmittedData ? 'Enabled' : 'Disabled'} + +
+ +
+ Test: + {campaign.isTest ? 'Yes' : 'No'} +
+ + +
+ {campaign?.allowDeny ? (allowedFilter ? 'Allow' : 'Deny') : ''} IP Filters: - +
{#if campaign.allowDeny?.length} {#each campaign.allowDeny as allowDeny, i} {allowDeny.name} @@ -1273,238 +1301,216 @@ {/if} {/each} {:else} - None + None {/if} - - +
+
- - Deny Page: +
+ Deny Page: - {#if campaign.denyPage} - {campaign.denyPage.name} - {:else} - None - {/if} + {campaign.denyPage ? campaign.denyPage.name : 'None'} - +
- - Evasion Page: +
+ Evasion Page: - {#if campaign.evasionPage} - {campaign.evasionPage.name} - {:else} - None - {/if} + {campaign.evasionPage ? campaign.evasionPage.name : 'None'} - +
- Webhook: - - {#if campaign.webhookID} - Yes - {:else} - None - {/if} - - - Data Saving: - - {campaign.saveSubmittedData ? 'Enabled' : 'Disabled'} - - - - Metadata: +
+ Metadata: {campaign.saveBrowserMetadata ? 'Enabled' : 'Disabled'} - - - Test: - {campaign.isTest ? 'Yes' : 'No'} -
+
+
+
-
-

- Timeline -

-
- Created: - +
+

+ Timeline +

+
+
+ Created: + +
- {#if !isSelfManaged} - Delivery start: - + Delivery start: + +
- Delivery finish: - + Delivery finish: + - {/if} +
+ {/if} - Close At: - + Close At: + +
- Closed: - + Closed: + +
- Anonymize At: - + Anonymize At: + +
- Anonymized: - + Anonymized: +
- - {#if campaign.constraintWeekDays} -
-
- -
-
- Schedule: -
-
- {#each formatWeekDays(campaign.constraintWeekDays).days as day} -
-
- {day.short} -
-
- {/each} -
- {#if formatWeekDays(campaign.constraintWeekDays).summary} -
- {formatWeekDays(campaign.constraintWeekDays).summary} -
- {/if} -
- - - {#if campaign.constraintStartTime && campaign.constraintEndTime} -
-
- - -
-
-
- {formatTimeConstraint(campaign.constraintStartTime, $timeFormat)} -
- - - -
- {formatTimeConstraint(campaign.constraintEndTime, $timeFormat)} -
-
-
- {/if} -
-
-
 
- {/if}
-
- -
-
-
-

- Actions -

-
- -
- {#if !campaignUpdateDisabledAndTitle(campaign).disabled} - +
+ {/if} +
+ {/if} +
+ + +
+

+ Actions +

+
+ +
+

+ Manage +

+
+ {#if !campaignUpdateDisabledAndTitle(campaign).disabled} + + Update + {/if} - - +
+
- -
- - + +
+

+ Export +

+
+ + Export Events + + + Export Submitters +
+
- -
-
- - Upload Reported CSV - -

- CSV format: "Reported by" (email), "Date reported(UTC+02:00)" -

-
-
+ +
+

+ Import +

+ Reported CSV +

+ Format: "Reported by" (email), "Date reported(UTC+02:00)" +