-
Notifications
You must be signed in to change notification settings - Fork 197
feat: Alert preference for deployment failures #2568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||
| <script> | ||||||
| import { CardGrid } from "$lib/components"; | ||||||
| import { InputChoice } from "$lib/elements/forms"; | ||||||
| import { Container } from "$lib/layout"; | ||||||
| import { sdk } from '$lib/stores/sdk'; | ||||||
| import { user } from '$lib/stores/user'; | ||||||
| import { Layout } from "@appwrite.io/pink-svelte"; | ||||||
| let deploymentFailedEmailAlert = $user.prefs.deploymentFailedEmailAlert ?? true; | ||||||
| function toggleDeploymentFailedEmailAlert() { | ||||||
| deploymentFailedEmailAlert = !deploymentFailedEmailAlert; | ||||||
| const newPrefs = { | ||||||
| ...$user.prefs, | ||||||
| deploymentFailedEmailAlert: deploymentFailedEmailAlert | ||||||
| }; | ||||||
| sdk.forConsole.account.updatePrefs({ prefs: newPrefs }); | ||||||
| } | ||||||
| </script> | ||||||
| <Container> | ||||||
| <CardGrid> | ||||||
| <svelte:fragment slot="title">Email Alerts</svelte:fragment> | ||||||
| Toggle email preferences to receive notifications when certain events occur. | ||||||
| <svelte:fragment slot="aside"> | ||||||
| <Layout.Stack gap="xl"> | ||||||
| <InputChoice | ||||||
| on:change={toggleDeploymentFailedEmailAlert} | ||||||
| type="switchbox" | ||||||
| id="mfa" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix incorrect ID attribute. The Apply this diff: - id="mfa"
+ id="deploymentFailedEmailAlert"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| label="Deployment Failed" | ||||||
| value={deploymentFailedEmailAlert} /> | ||||||
| </Layout.Stack> | ||||||
| </svelte:fragment> | ||||||
| </CardGrid> | ||||||
| </Container> | ||||||
|
Comment on lines
+1
to
+38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix code formatting. The pipeline indicates Prettier formatting issues. Run 🧰 Tools🪛 GitHub Actions: Tests[warning] 1-1: Code style issues found by Prettier. Run 'prettier --write' to fix. 🤖 Prompt for AI Agents |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,11 @@ | |
| title: 'Organizations', | ||
| event: 'organizations', | ||
| hasChildren: true | ||
| }, | ||
| { | ||
| href: `${path}/alerts`, | ||
| title: 'Alerts', | ||
| event: 'alerts', | ||
| } | ||
|
Comment on lines
+36
to
41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix code formatting. The pipeline indicates Prettier formatting issues. Run 🤖 Prompt for AI Agents |
||
| ]; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling and await the API call.
The
updatePrefscall has several issues:Consider this approach: