Skip to content

Commit 0441874

Browse files
committed
Updated dialogs to support showing operation counts.
1 parent a6de76a commit 0441874

File tree

7 files changed

+123
-25
lines changed

7 files changed

+123
-25
lines changed
Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<script lang="ts">
2+
import Number from '$comp/formatters/Number.svelte';
23
import * as AlertDialog from '$comp/ui/alert-dialog';
34
import { buttonVariants } from '$comp/ui/button';
45
56
interface Props {
7+
count?: number;
68
open: boolean;
79
remove: () => Promise<void>;
810
}
911
10-
let { open = $bindable(), remove }: Props = $props();
12+
let { count = 1, open = $bindable(), remove }: Props = $props();
1113
1214
async function onSubmit() {
1315
await remove();
@@ -18,12 +20,33 @@
1820
<AlertDialog.Root bind:open>
1921
<AlertDialog.Content>
2022
<AlertDialog.Header>
21-
<AlertDialog.Title>Delete Event</AlertDialog.Title>
22-
<AlertDialog.Description>Are you sure you want to delete this event?</AlertDialog.Description>
23+
<AlertDialog.Title>
24+
Delete
25+
{#if count === 1}
26+
Event
27+
{:else}
28+
<Number value={count} /> Events
29+
{/if}
30+
</AlertDialog.Title>
31+
<AlertDialog.Description>
32+
Are you sure you want to delete
33+
{#if count === 1}
34+
this event
35+
{:else}
36+
<Number value={count} /> events
37+
{/if}?
38+
</AlertDialog.Description>
2339
</AlertDialog.Header>
2440
<AlertDialog.Footer>
2541
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
26-
<AlertDialog.Action class={buttonVariants({ variant: 'destructive' })} onclick={onSubmit}>Delete Event</AlertDialog.Action>
42+
<AlertDialog.Action class={buttonVariants({ variant: 'destructive' })} onclick={onSubmit}>
43+
Delete
44+
{#if count === 1}
45+
Event
46+
{:else}
47+
<Number value={count} /> Events
48+
{/if}
49+
</AlertDialog.Action>
2750
</AlertDialog.Footer>
2851
</AlertDialog.Content>
2952
</AlertDialog.Root>

src/Exceptionless.Web/ClientApp/src/lib/features/events/components/table/EventsBulkActionsDropdownMenu.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@
5555
</DropdownMenu.Root>
5656

5757
{#if openRemoveEventDialog}
58-
<RemoveEventDialog bind:open={openRemoveEventDialog} {remove} />
58+
<RemoveEventDialog bind:open={openRemoveEventDialog} {remove} count={ids.length} />
5959
{/if}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@
137137
</DropdownMenu.Root>
138138

139139
{#if openMarkStackDiscardedDialog}
140-
<MarkStackDiscardedDialog bind:open={openMarkStackDiscardedDialog} discard={markDiscarded} />
140+
<MarkStackDiscardedDialog bind:open={openMarkStackDiscardedDialog} discard={markDiscarded} count={ids.length} />
141141
{/if}
142142
{#if openMarkStackFixedInVersionDialog}
143-
<MarkStackFixedInVersionDialog bind:open={openMarkStackFixedInVersionDialog} save={markFixed} />
143+
<MarkStackFixedInVersionDialog bind:open={openMarkStackFixedInVersionDialog} save={markFixed} count={ids.length} />
144144
{/if}
145145
{#if openRemoveStackDialog}
146-
<RemoveStackDialog bind:open={openRemoveStackDialog} {remove} />
146+
<RemoveStackDialog bind:open={openRemoveStackDialog} {remove} count={ids.length} />
147147
{/if}
Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<script lang="ts">
2+
import Number from '$comp/formatters/Number.svelte';
23
import * as AlertDialog from '$comp/ui/alert-dialog';
34
import { buttonVariants } from '$comp/ui/button';
45
56
interface Props {
7+
count?: number;
68
discard: () => Promise<void>;
79
open: boolean;
810
}
911
10-
let { discard, open = $bindable() }: Props = $props();
12+
let { count = 1, discard, open = $bindable() }: Props = $props();
1113
1214
async function onSubmit() {
1315
await discard();
@@ -18,13 +20,35 @@
1820
<AlertDialog.Root bind:open>
1921
<AlertDialog.Content>
2022
<AlertDialog.Header>
21-
<AlertDialog.Title>Discard Stack</AlertDialog.Title>
22-
<AlertDialog.Description>Are you sure you want to all current stack events and discard any future stack events?</AlertDialog.Description>
23+
<AlertDialog.Title>
24+
Discard
25+
{#if count === 1}
26+
Stack
27+
{:else}
28+
<Number value={count} /> Stacks
29+
{/if}
30+
</AlertDialog.Title>
31+
<AlertDialog.Description>
32+
Are you sure you want to discard all current
33+
{#if count === 1}
34+
stack events
35+
{:else}
36+
<Number value={count} /> stacks events
37+
{/if}
38+
and discard any future events?
39+
</AlertDialog.Description>
2340
</AlertDialog.Header>
2441
All future occurrences will be discarded and will not count against your event limit.
2542
<AlertDialog.Footer>
2643
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
27-
<AlertDialog.Action class={buttonVariants({ variant: 'destructive' })} onclick={onSubmit}>Discard Stack</AlertDialog.Action>
44+
<AlertDialog.Action class={buttonVariants({ variant: 'destructive' })} onclick={onSubmit}>
45+
Discard
46+
{#if count === 1}
47+
Stack
48+
{:else}
49+
<Number value={count} /> Stacks
50+
{/if}
51+
</AlertDialog.Action>
2852
</AlertDialog.Footer>
2953
</AlertDialog.Content>
3054
</AlertDialog.Root>

src/Exceptionless.Web/ClientApp/src/lib/features/stacks/components/dialogs/MarkStackFixedInVersionDialog.svelte

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import Number from '$comp/formatters/Number.svelte';
23
import { A, P } from '$comp/typography';
34
import * as AlertDialog from '$comp/ui/alert-dialog';
45
import * as Form from '$comp/ui/form';
@@ -11,11 +12,12 @@
1112
import { FixedInVersionForm } from '../../models';
1213
1314
interface Props {
15+
count?: number;
1416
open: boolean;
1517
save: (version?: string) => Promise<void>;
1618
}
1719
18-
let { open = $bindable(), save }: Props = $props();
20+
let { count = 1, open = $bindable(), save }: Props = $props();
1921
2022
const form = superForm(defaults(new FixedInVersionForm(), classvalidatorClient(FixedInVersionForm)), {
2123
dataType: 'json',
@@ -66,15 +68,32 @@
6668
<AlertDialog.Content class="sm:max-w-[425px]">
6769
<form method="POST" use:enhance>
6870
<AlertDialog.Header>
69-
<AlertDialog.Title>Mark Fixed</AlertDialog.Title>
70-
<AlertDialog.Description
71-
>Marks the stack as fixed. This will also prevent error occurrences from being displayed in the dashboard.</AlertDialog.Description
72-
>
71+
<AlertDialog.Title>
72+
{#if count === 1}
73+
Mark Stack As Fixed
74+
{:else}
75+
Mark <Number value={count} /> Stacks As Fixed
76+
{/if}
77+
</AlertDialog.Title>
78+
<AlertDialog.Description>
79+
Marks
80+
{#if count === 1}
81+
the stack
82+
{:else}
83+
<Number value={count} /> stacks
84+
{/if}
85+
as fixed. This will also prevent error occurrences from being displayed in the dashboard.
86+
</AlertDialog.Description>
7387
</AlertDialog.Header>
7488

7589
<P class="pb-4">
76-
<strong>Optional:</strong> Please enter the version in which the stack has been fixed. Any submitted occurrences with a lower version will not
77-
cause a regression.
90+
<strong>Optional:</strong> Please enter the version in which
91+
{#if count === 1}
92+
the stack has
93+
{:else}
94+
these stacks have
95+
{/if}
96+
been fixed. Any submitted occurrences with a lower version will not cause a regression.
7897
<A class="inline-flex" href="https://exceptionless.com/docs/versioning/" target="_blank" title="Versioning Documentation"
7998
><IconDocumentation /></A
8099
>
@@ -93,7 +112,15 @@
93112

94113
<AlertDialog.Footer>
95114
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
96-
<AlertDialog.Action>Mark Fixed</AlertDialog.Action>
115+
<AlertDialog.Action>
116+
Mark
117+
{#if count === 1}
118+
Stack
119+
{:else}
120+
<Number value={count} /> Stacks
121+
{/if}
122+
Fixed
123+
</AlertDialog.Action>
97124
</AlertDialog.Footer>
98125
</form>
99126
</AlertDialog.Content>
Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<script lang="ts">
2+
import Number from '$comp/formatters/Number.svelte';
23
import * as AlertDialog from '$comp/ui/alert-dialog';
34
import { buttonVariants } from '$comp/ui/button';
45
56
interface Props {
7+
count?: number;
68
open: boolean;
79
remove: () => Promise<void>;
810
}
911
10-
let { open = $bindable(), remove }: Props = $props();
12+
let { count = 1, open = $bindable(), remove }: Props = $props();
1113
1214
async function onSubmit() {
1315
await remove();
@@ -18,12 +20,34 @@
1820
<AlertDialog.Root bind:open>
1921
<AlertDialog.Content>
2022
<AlertDialog.Header>
21-
<AlertDialog.Title>Delete Stack</AlertDialog.Title>
22-
<AlertDialog.Description>Are you sure you want to delete this stack (includes all stack events)?</AlertDialog.Description>
23+
<AlertDialog.Title>
24+
Delete
25+
{#if count === 1}
26+
Stack
27+
{:else}
28+
<Number value={count} /> Stacks
29+
{/if}
30+
</AlertDialog.Title>
31+
<AlertDialog.Description>
32+
Are you sure you want to delete
33+
{#if count === 1}
34+
stack
35+
{:else}
36+
<Number value={count} /> stacks
37+
{/if}
38+
(including all related events)?
39+
</AlertDialog.Description>
2340
</AlertDialog.Header>
2441
<AlertDialog.Footer>
2542
<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>
26-
<AlertDialog.Action class={buttonVariants({ variant: 'destructive' })} onclick={onSubmit}>Delete Stack</AlertDialog.Action>
43+
<AlertDialog.Action class={buttonVariants({ variant: 'destructive' })} onclick={onSubmit}>
44+
Delete
45+
{#if count === 1}
46+
Stack
47+
{:else}
48+
<Number value={count} /> Stacks
49+
{/if}
50+
</AlertDialog.Action>
2751
</AlertDialog.Footer>
2852
</AlertDialog.Content>
2953
</AlertDialog.Root>

src/Exceptionless.Web/ClientApp/src/routes/(app)/issues/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import { shouldRefreshPersistentEventChanged } from '$features/events/components/filters';
1414
import EventsDataTable from '$features/events/components/table/EventsDataTable.svelte';
1515
import { getTableContext } from '$features/events/components/table/options.svelte';
16-
import TableStacksBulkActionsDropdownMenu from '$features/stacks/components/TableStacksBulkActionsDropdownMenu.svelte';
16+
import TableStacksBulkActionsDropdownMenu from '$features/stacks/components/StacksBulkActionsDropdownMenu.svelte';
1717
import { type WebSocketMessageValue } from '$features/websockets/models';
1818
import { useFetchClientStatus } from '$shared/api/api.svelte';
1919
import { persisted } from '$shared/persisted.svelte';

0 commit comments

Comments
 (0)