-
Notifications
You must be signed in to change notification settings - Fork 119
User metadata #2796
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
Merged
Merged
User metadata #2796
Changes from 21 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
da0bb84
Svelte5
Alex-Tideman b9d8bdc
Add search-attributes tab, memo tab, user metadata tab
Alex-Tideman bd41961
add tests
GraceGardner c8af4e8
rm console logs
GraceGardner 6f8511d
rm inspect
GraceGardner 34dd7f4
rm unused mock data
GraceGardner 5bc9a1f
add typing to overrideTheme
GraceGardner 8715bb4
Merge branch 'main' into user-metadata
GraceGardner a0d54a2
center divs
GraceGardner dc9a041
add metadata-tab to translate
GraceGardner 3a0aff2
add markdown override-theme to go
GraceGardner d9445ae
add banner
GraceGardner dd02933
fix function
GraceGardner 99623ee
rm consols
GraceGardner e9451b6
Merge branch 'main' into user-metadata
GraceGardner fe713b7
update event display, fix markdown, make summary and details and curr…
GraceGardner f18c994
quick tweak to view height
GraceGardner 27d1ab3
fix errors caused by runes mode/legacy mismatch
GraceGardner c269080
fix conflicts/merge main
GraceGardner a8026c9
<<Merge branch 'main' into user-metadata
GraceGardner 1b07d4c
add summary back in and remove event id
GraceGardner 31ae005
Do some refactoring, move events into the left side
Alex-Tideman ba71313
move memo into component
GraceGardner 9690395
mv search attr into component
GraceGardner 7e09057
updates from feedback
GraceGardner cf5b784
Merge branch 'main' into user-metadata
GraceGardner dc2a742
put usermetadata into single component
GraceGardner 7b109cc
clean up metadata events
GraceGardner e0159a0
rm ('Metadata groups:', metadataGroups);
GraceGardner 805f0ca
Style updates
Alex-Tideman 67f5def
Move tab
Alex-Tideman bd3d51e
standardize the time stamp with other time formats
GraceGardner 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
84 changes: 84 additions & 0 deletions
84
src/lib/components/workflow/metadata/metadata-events.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,84 @@ | ||
| <script lang="ts"> | ||
| import MetadataDecoder from '$lib/components/event/metadata-decoder.svelte'; | ||
| import Badge from '$lib/holocene/badge.svelte'; | ||
| import Icon from '$lib/holocene/icon/icon.svelte'; | ||
| import TableHeaderRow from '$lib/holocene/table/table-header-row.svelte'; | ||
| import TableRow from '$lib/holocene/table/table-row.svelte'; | ||
| import Table from '$lib/holocene/table/table.svelte'; | ||
| import { translate } from '$lib/i18n/translate'; | ||
| import type { EventGroups } from '$lib/models/event-groups/event-groups'; | ||
| import { relativeTime, timeFormat } from '$lib/stores/time-format'; | ||
| import { formatDate } from '$lib/utilities/format-date'; | ||
| export let groups: EventGroups; | ||
| const getBadgeType = (classification: string) => { | ||
| switch (classification) { | ||
| case 'Completed': | ||
| return 'success'; | ||
| case 'Failed': | ||
| case 'Terminated': | ||
| return 'danger'; | ||
| case 'TimedOut': | ||
| case 'Canceled': | ||
| return 'warning'; | ||
| default: | ||
| return 'default'; | ||
| } | ||
| }; | ||
| </script> | ||
|
|
||
| <div class="overflow-x-auto"> | ||
| <Table class="min-w-full table-fixed" data-testid="metadata-events-table"> | ||
| <caption class="sr-only" slot="caption"> | ||
| {translate('workflows.user-metadata-tab')} | ||
| </caption> | ||
| <TableHeaderRow slot="headers"> | ||
| <th class="w-1/5 px-3 py-3 text-left">{translate('common.event-type')}</th | ||
| > | ||
| <th class="w-1/6 px-3 py-3 text-left">{translate('common.status')}</th> | ||
| <th class="w-1/4 px-3 py-3 text-left">{translate('common.time')}</th> | ||
| <th class="w-auto px-3 py-3 text-left">{translate('common.summary')}</th> | ||
| </TableHeaderRow> | ||
|
|
||
| {#each groups as group} | ||
| <TableRow class="hover:bg-interactive-table-hover"> | ||
| <td class="px-3 py-3 text-left"> | ||
| <div class="flex flex-col gap-1 capitalize"> | ||
| {group.category} | ||
| </div> | ||
| </td> | ||
| <td class="px-3 py-3 text-left"> | ||
| <Badge type={getBadgeType(group.finalClassification)} class="text-xs"> | ||
| {group.finalClassification} | ||
| </Badge> | ||
| </td> | ||
| <td class="px-3 py-3 text-left"> | ||
| <div class="flex items-center gap-2"> | ||
| <Icon name="clock" class="h-3 w-3 text-secondary/60" /> | ||
| <span class="truncate text-sm"> | ||
| {formatDate(group.eventTime, $timeFormat, { | ||
| relative: $relativeTime, | ||
| })} | ||
| </span> | ||
| </div> | ||
| </td> | ||
| <td class="px-3 py-3 text-left"> | ||
| {#if group.userMetadata?.summary} | ||
| <MetadataDecoder | ||
| value={group.userMetadata.summary} | ||
| fallback={translate('events.decode-failed')} | ||
| let:decodedValue | ||
| > | ||
| <span class="font-mono text-sm text-secondary" | ||
| >{decodedValue}</span | ||
| > | ||
| </MetadataDecoder> | ||
| {:else} | ||
| <span class="font-mono text-sm text-secondary">-</span> | ||
| {/if} | ||
| </td> | ||
| </TableRow> | ||
| {/each} | ||
| </Table> | ||
| </div> | ||
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
50 changes: 30 additions & 20 deletions
50
src/lib/components/workflow/metadata/workflow-summary-and-details.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 |
|---|---|---|
| @@ -1,29 +1,39 @@ | ||
| <script lang="ts"> | ||
| import AccordionLight from '$lib/holocene/accordion/accordion-light.svelte'; | ||
| import Icon from '$lib/holocene/icon/icon.svelte'; | ||
| import Markdown from '$lib/holocene/monaco/markdown.svelte'; | ||
| import { translate } from '$lib/i18n/translate'; | ||
| import { workflowRun } from '$lib/stores/workflow-run'; | ||
|
|
||
| $: summary = $workflowRun?.userMetadata?.summary; | ||
| $: details = $workflowRun?.userMetadata?.details; | ||
| $: hasUserMetadata = summary || details; | ||
| const summary = $derived($workflowRun?.userMetadata?.summary); | ||
| const details = $derived($workflowRun?.userMetadata?.details); | ||
| </script> | ||
|
|
||
| {#if hasUserMetadata} | ||
| <AccordionLight let:open> | ||
| <div slot="title" class="flex w-full items-center gap-2 p-2 text-xl"> | ||
| <Icon name="info" class="text-brand" width={32} height={32} />{translate( | ||
| 'workflows.summary-and-details', | ||
| )} | ||
| </div> | ||
| {#if open && summary} | ||
| <h3>{translate('workflows.summary')}</h3> | ||
| <Markdown content={summary} /> | ||
| <div class="flex min-h-full flex-1 flex-col gap-2 p-6"> | ||
| <div class="border border-subtle"> | ||
| <h3 class="pl-6 pt-6" data-testid="user-metadata-summary-heading"> | ||
| {translate('workflows.summary')} | ||
| </h3> | ||
| {#if summary} | ||
| <Markdown className="p-3" overrideTheme="primary" content={summary} /> | ||
| {:else} | ||
| <div class="pb-6 pl-6 text-secondary/70"> | ||
| <p class="text-sm italic"> | ||
| {translate('workflows.no-summary-available')} | ||
| </p> | ||
| </div> | ||
| {/if} | ||
| {#if open && details} | ||
| <h3>{translate('workflows.details')}</h3> | ||
| <Markdown content={details} /> | ||
| </div> | ||
| <div class="border border-subtle"> | ||
| <h3 class="pl-6 pt-6" data-testid="user-metadata-details-heading"> | ||
| {translate('workflows.details')} | ||
| </h3> | ||
| {#if details} | ||
| <Markdown className="p-3" overrideTheme="primary" content={details} /> | ||
| {:else} | ||
| <div class="pb-6 pl-6 text-secondary/70"> | ||
| <p class="text-sm italic"> | ||
| {translate('workflows.no-details-available')} | ||
| </p> | ||
| </div> | ||
| {/if} | ||
| </AccordionLight> | ||
| {/if} | ||
| </div> | ||
| </div> |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.