-
Notifications
You must be signed in to change notification settings - Fork 173
design: Apply New Table Design in Rill Cloud #9181
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
Open
royendo
wants to merge
35
commits into
main
Choose a base branch
from
royendo/alert-report-table-migrate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
16c2252
Migrate alerts and reports tables to shared `ResourceListRow` component
royendo dc59f2b
Update resource list rows to flat divider style
royendo f8c4500
Add dropdown action menus to alert and report rows
royendo 810eaf6
Use icon-only badges for dashboard, alert, and report rows
royendo 591a518
Align subtitle text with title text in dashboard rows
royendo 5c6dd9f
Wire up dropdown actions for alert and report rows
royendo 576e7fe
prettier
royendo 944a1f4
Merge branch 'main' into royendo/alert-report-table-migrate
royendo 7dce573
revert to badge + label
royendo 8866662
local code review,
royendo 7ce3fdc
Update +page.svelte
royendo 38d7cdc
TODO
royendo 235e909
fix e2e, updated to Dashboards
royendo d951af2
refactor: code review fixes for resource list components
royendo 291dfe1
no more magic
royendo ae7aaeb
Update DashboardsTableCompositeCell.svelte
royendo aab26b0
consolidate resource deletion to single modal
royendo cfdefb0
Merge branch 'main' into royendo/alert-report-table-migrate
royendo 3960a0a
change to confirm on delete
royendo fb1efd3
Merge branch 'main' into royendo/alert-report-table-migrate
royendo f21dd3d
Merge remote-tracking branch 'origin/main' into royendo/alert-report-…
royendo d4b9164
apply filters and table to dashboard,alert,report
royendo 79e3256
prettier
royendo 0793509
refactor: address code review feedback for table redesign
royendo 028d9a5
fix: sort dashboards by `meta.createdOn` for the Newest/Oldest toggle
royendo 1761179
refactor: extract `applyTableFilters` / `toggleArrayValue` helpers
royendo a4d6f7a
Merge `main` into `royendo/alert-report-table-migrate`
royendo 6d07022
refactor: migrate `ProjectLogsPage` to `TableToolbar`
royendo 741ac86
refactor: migrate users, groups, and guests pages to `TableToolbar`
royendo e26e360
fix: address final review feedback for table redesign
royendo 4b1a33a
test: align alert leaderboard assertion with new comparison row format
royendo 4fd84d0
test: force cursor off leaderboard row before asserting
royendo c1303af
Merge remote-tracking branch 'origin/main' into royendo/alert-report-…
royendo 75794e4
as designed, tags need 9283
royendo 04eb4c3
fix web-admin
royendo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
web-admin/src/features/alerts/listing/AlertActionsCell.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| <script lang="ts"> | ||
| import { goto } from "$app/navigation"; | ||
| import { createAdminServiceDeleteAlert } from "@rilldata/web-admin/client"; | ||
| import IconButton from "@rilldata/web-common/components/button/IconButton.svelte"; | ||
| import * as DropdownMenu from "@rilldata/web-common/components/dropdown-menu"; | ||
| import ThreeDot from "@rilldata/web-common/components/icons/ThreeDot.svelte"; | ||
| import DeleteConfirmDialog from "@rilldata/web-common/features/resources/DeleteConfirmDialog.svelte"; | ||
| import { eventBus } from "@rilldata/web-common/lib/event-bus/event-bus"; | ||
| import { getRuntimeServiceListResourcesQueryKey } from "@rilldata/web-common/runtime-client"; | ||
| import { useRuntimeClient } from "@rilldata/web-common/runtime-client/v2"; | ||
| import { useQueryClient } from "@tanstack/svelte-query"; | ||
| import { Pencil, Trash2Icon } from "lucide-svelte"; | ||
|
|
||
| export let organization: string; | ||
| export let project: string; | ||
| export let id: string; | ||
| export let title: string; | ||
| export let isCreatedByCode: boolean; | ||
|
|
||
| const runtimeClient = useRuntimeClient(); | ||
| const queryClient = useQueryClient(); | ||
| const deleteAlert = createAdminServiceDeleteAlert(); | ||
|
|
||
| let isDropdownOpen = false; | ||
| let isDeleteConfirmOpen = false; | ||
|
|
||
| function handleEdit() { | ||
| void goto(`/${organization}/${project}/-/alerts/${id}`); | ||
| } | ||
|
|
||
| async function handleDelete() { | ||
| try { | ||
| await $deleteAlert.mutateAsync({ | ||
| org: organization, | ||
| project, | ||
| name: id, | ||
| }); | ||
| await queryClient.invalidateQueries({ | ||
| queryKey: getRuntimeServiceListResourcesQueryKey( | ||
| runtimeClient.instanceId, | ||
| ), | ||
| }); | ||
| } catch { | ||
| eventBus.emit("notification", { | ||
| message: "Failed to delete alert", | ||
| type: "error", | ||
| }); | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| {#if !isCreatedByCode} | ||
| <div class="flex justify-end" data-no-row-click> | ||
| <DropdownMenu.Root bind:open={isDropdownOpen}> | ||
| <DropdownMenu.Trigger class="flex-none"> | ||
| <IconButton | ||
| rounded | ||
| active={isDropdownOpen} | ||
| ariaLabel={`Actions for ${title}`} | ||
| > | ||
| <ThreeDot size="16px" /> | ||
| </IconButton> | ||
| </DropdownMenu.Trigger> | ||
| <DropdownMenu.Content side="bottom" align="start" class="min-w-[95px]"> | ||
| <DropdownMenu.Item | ||
| class="font-normal flex items-center" | ||
| onclick={handleEdit} | ||
| > | ||
| <Pencil size="12px" /> | ||
| <span class="ml-2">Edit</span> | ||
| </DropdownMenu.Item> | ||
| <DropdownMenu.Item | ||
| class="font-normal flex items-center" | ||
| type="destructive" | ||
| onclick={() => { | ||
| isDeleteConfirmOpen = true; | ||
| }} | ||
| > | ||
| <Trash2Icon size="12px" /> | ||
| <span class="ml-2">Delete</span> | ||
| </DropdownMenu.Item> | ||
| </DropdownMenu.Content> | ||
| </DropdownMenu.Root> | ||
| </div> | ||
|
|
||
| <DeleteConfirmDialog | ||
| bind:open={isDeleteConfirmOpen} | ||
| title="Delete this alert?" | ||
| onDelete={handleDelete} | ||
| > | ||
| The alert "<strong>{title}</strong>" will be permanently deleted and will no | ||
| longer trigger notifications. | ||
| </DeleteConfirmDialog> | ||
| {/if} | ||
15 changes: 0 additions & 15 deletions
15
web-admin/src/features/alerts/listing/AlertOwnerBullet.svelte
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
web-admin/src/features/alerts/listing/AlertOwnerCell.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <script lang="ts"> | ||
| import ProjectAccessControls from "../../projects/ProjectAccessControls.svelte"; | ||
| import { useAlertOwnerName } from "../selectors"; | ||
|
|
||
| export let organization: string; | ||
| export let project: string; | ||
| export let ownerId: string; | ||
|
|
||
| $: ownerName = useAlertOwnerName(organization, project, ownerId); | ||
| </script> | ||
|
|
||
| <ProjectAccessControls {organization} {project}> | ||
| <svelte:fragment slot="manage-project"> | ||
| {#if $ownerName.isSuccess} | ||
| <span class="truncate"> | ||
| {$ownerName.data ?? "Code-defined"} | ||
| </span> | ||
| {:else} | ||
| <span class="text-fg-tertiary">—</span> | ||
| {/if} | ||
| </svelte:fragment> | ||
| </ProjectAccessControls> |
31 changes: 31 additions & 0 deletions
31
web-admin/src/features/alerts/listing/AlertStatusCell.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <script lang="ts"> | ||
| import StatusTextCell from "@rilldata/web-common/features/resources/cells/StatusTextCell.svelte"; | ||
| import { | ||
| V1AssertionStatus, | ||
| type V1Resource, | ||
| } from "@rilldata/web-common/runtime-client"; | ||
|
|
||
| export let resource: V1Resource; | ||
|
|
||
| type Tone = "default" | "muted" | "success" | "destructive"; | ||
|
|
||
| $: ({ label, tone } = describeStatus(resource)); | ||
|
|
||
| function describeStatus(r: V1Resource): { label: string; tone: Tone } { | ||
| const last = r.alert?.state?.executionHistory?.[0]; | ||
| if (!last) return { label: "Pending", tone: "muted" }; | ||
|
|
||
| switch (last.result?.status) { | ||
| case V1AssertionStatus.ASSERTION_STATUS_FAIL: | ||
| return { label: "Triggered", tone: "destructive" }; | ||
| case V1AssertionStatus.ASSERTION_STATUS_PASS: | ||
| return { label: "OK", tone: "success" }; | ||
| case V1AssertionStatus.ASSERTION_STATUS_ERROR: | ||
| return { label: "Error", tone: "destructive" }; | ||
| default: | ||
| return { label: "Pending", tone: "muted" }; | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| <StatusTextCell {label} {tone} /> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: this link should auto open the edit modal