Skip to content

Commit

Permalink
Add email subscription chip
Browse files Browse the repository at this point in the history
  • Loading branch information
barshathakuri committed Dec 20, 2024
1 parent 2a4bf0a commit f4b878d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/views/MySubscriptions/SubscriptionTableItem/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"subscriptionUrgency": "Urgency",
"subscriptionCertainty": "Certainty",
"subscriptionSeverity": "Severity",
"subscriptionCategory": "Category"
"subscriptionCategory": "Category",
"subscriptionEmail": "Email Subscription",
"subscriptionYes": "Yes",
"subscriptionNo": "No"
}
}
29 changes: 29 additions & 0 deletions src/views/MySubscriptions/SubscriptionTableItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface Props {
filterAlertCategories: string[];
filterAlertCountry: string;
filterAlertAdmin1s: string[];
notifyByEmail: boolean;
actions: React.ReactNode;
}

Expand All @@ -35,6 +36,7 @@ function SubscriptionTableItem(props: Props) {
filterAlertSeverities,
filterAlertAdmin1s,
filterAlertCountry,
notifyByEmail,
actions,
} = props;

Expand Down Expand Up @@ -141,6 +143,33 @@ function SubscriptionTableItem(props: Props) {
/>
)}
/>
{notifyByEmail ? (
<Chip
name={undefined}
variant="tertiary"
className={styles.filterItem}
label={(
<TextOutput
label={strings.subscriptionEmail}
value="Yes"
strongLabel
/>
)}
/>
) : (
<Chip
name={undefined}
variant="tertiary"
className={styles.filterItem}
label={(
<TextOutput
label={strings.subscriptionEmail}
value={strings.subscriptionNo}
strongLabel
/>
)}
/>
)}
</Container>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/MySubscriptions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export function Component() {
filterAlertAdmin1s: value?.filterAlertAdmin1sDisplay?.map(
(admin) => admin.name,
),
isActive: value?.isActive,
notifyByEmail: value.notifyByEmail,
actions: <ActiveTableActions
onArchiveClick={() => handleArchiveUnarchive(value.id, false)}
onEditClick={() => handleEditSubscription(key)}
Expand All @@ -360,7 +360,7 @@ export function Component() {
filterAlertAdmin1s: value?.filterAlertAdmin1sDisplay?.map(
(admin) => admin.name,
),
isActive: value?.isActive,
notifyByEmail: value.notifyByEmail,
actions: <ArchiveTableActions
onUnArchive={() => handleArchiveUnarchive(value.id, true)}
onSubscriptionRemove={() => handleDeleteSubscription(value.id)}
Expand Down

0 comments on commit f4b878d

Please sign in to comment.