Skip to content
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

fix: Alert get dismissed in the admin/alerts page #2569

Merged
merged 6 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions components/admin/alerts/AdminNewAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Alert from '../../Alert'
import { FormCard } from '../../../components/FormCard'
import ADD_ALERT from '../../../graphql/queries/addAlert'
import { Alert as AlertType } from '../../../graphql'
import noop from '../../../helpers/noop'
import { alertValidation } from '../../../helpers/formValidation'
import { formChange } from '../../../helpers/formChange'
import {
Expand Down Expand Up @@ -80,7 +79,6 @@ export const NewAlert: React.FC<NewAlertProps> = ({ setAlerts }) => {
id: '-1',
...makeGraphqlVariable(alertProperties).variables
}}
onDismiss={noop}
/>
</div>
<div className="text-start">
Expand Down
14 changes: 2 additions & 12 deletions components/admin/alerts/__snapshots__/AdminNewAlert.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ exports[`AdminLewAlert component Should create new alert 1`] = `
class="mb-3"
>
<div
class="fade alert alert-primary alert-dismissible show"
class="fade alert alert-primary show"
role="alert"
>
<button
aria-label="Close alert"
class="btn-close"
type="button"
/>
<div
class="d-flex align-items-center gap-3"
>
Expand Down Expand Up @@ -173,14 +168,9 @@ exports[`AdminLewAlert component Should refuse creating new alert with incomplet
class="mb-3"
>
<div
class="fade alert alert-primary alert-dismissible show"
class="fade alert alert-primary show"
role="alert"
>
<button
aria-label="Close alert"
class="btn-close"
type="button"
/>
<div
class="d-flex align-items-center gap-3"
>
Expand Down
3 changes: 1 addition & 2 deletions pages/admin/alerts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { AdminLayout } from '../../components/admin/AdminLayout'
import { Button } from '../../components/theme/Button'
import REMOVE_ALERT from '../../graphql/queries/removeAlert'
import { withGetApp, GetAppProps, Alert as AlertType } from '../../graphql'
import noop from '../../helpers/noop'
import Card from '../../components/Card'
import { NewAlert } from '../../components/admin/alerts/AdminNewAlert'

Expand All @@ -32,7 +31,7 @@ const AlertRow: React.FC<AlertRowProps> = ({ alerts, alert, setAlerts }) => {
return (
<div className="row">
<div className="d-flex flex-column col-10">
<Alert alert={alert} onDismiss={noop} />
<Alert alert={alert} />
</div>
<div className="d-flex flex-column col-2 mt-3 justify-content-center">
<Button
Expand Down