Skip to content

Commit

Permalink
Add email subscription chip and update PR template.
Browse files Browse the repository at this point in the history
  • Loading branch information
barshathakuri committed Dec 20, 2024
1 parent 2a4bf0a commit cdaa490
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 14 deletions.
31 changes: 20 additions & 11 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
## Addresses:
- XXX
## Summary
Provide a brief description of what this PR addresses and its purpose.

## Depends on:
- XXX
## Addresses
- Issue(s): _List related issues or tickets._

## Depends On
- Other PRs or Dependencies: _List PRs or dependencies this PR relies on._

## Changes
- Detailed list or prose of changes
- Breaking changes
- Changes to configurations

## This PR doesn't introduce:
- [ ] typos
- [ ] conflict markers
- [ ] unwanted comments
- [ ] temporary files, auto-generated files or secret keys
- [ ] `console.log` meant for debugging
- [ ] codegen errors
## This PR Ensures:
- [ ] No typos or grammatical errors
- [ ] No conflict markers left in the code
- [ ] No unwanted comments, temporary files, or auto-generated files
- [ ] No inclusion of secret keys or sensitive data
- [ ] No `console.log` statements meant for debugging
- [ ] `pnpm lint` runs without errors
- [ ] `pnpm typecheck` passes (no type errors)
- [ ] `pnpm knip` passes
- [ ] `pnpm build` completes successfully

## Additional Notes
_Optional: Add any other relevant context, screenshots, or details here._
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={strings.subscriptionYes}
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 cdaa490

Please sign in to comment.