-
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 all 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
42 changes: 42 additions & 0 deletions
42
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,42 @@ | ||
| <script lang="ts"> | ||
| import MetadataDecoder from '$lib/components/event/metadata-decoder.svelte'; | ||
| import WorkflowStatus from '$lib/components/workflow-status.svelte'; | ||
| import { translate } from '$lib/i18n/translate'; | ||
| import { groupEvents } from '$lib/models/event-groups'; | ||
| import { fullEventHistory } from '$lib/stores/events'; | ||
| import { workflowRun } from '$lib/stores/workflow-run'; | ||
| const { workflow } = $derived($workflowRun); | ||
| const metadataGroups = $derived( | ||
| groupEvents( | ||
| $fullEventHistory, | ||
| 'ascending', | ||
| workflow?.pendingActivities, | ||
| workflow?.pendingNexusOperations, | ||
| ).filter((group) => group.userMetadata?.summary), | ||
| ); | ||
| </script> | ||
|
|
||
| {#if !metadataGroups.length} | ||
| <div class="px-6 text-secondary/70"> | ||
| <p class="text-sm italic">No events with metadata</p> | ||
| </div> | ||
| {/if} | ||
| <div class="flex flex-col gap-2"> | ||
| {#each metadataGroups as group} | ||
| <div | ||
| class="flex items-center justify-between gap-4 border-b border-subtle px-3 pb-1 text-lg" | ||
| > | ||
| <div class="flex items-center gap-2"> | ||
| <p class="w-32 min-w-32 text-sm font-medium">{group.label}</p> | ||
| <MetadataDecoder | ||
| value={group.userMetadata.summary} | ||
| fallback={translate('events.decode-failed')} | ||
| let:decodedValue | ||
| > | ||
| <span class="text-sm">{decodedValue}</span> | ||
| </MetadataDecoder> | ||
| </div> | ||
| <WorkflowStatus status={group.finalClassification} /> | ||
| </div> | ||
| {/each} | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <script lang="ts"> | ||
| import PayloadDecoder from '$lib/components/event/payload-decoder.svelte'; | ||
| import CodeBlock from '$lib/holocene/code-block.svelte'; | ||
| import { translate } from '$lib/i18n/translate'; | ||
| import { workflowRun } from '$lib/stores/workflow-run'; | ||
|
|
||
| const { workflow } = $derived($workflowRun); | ||
| </script> | ||
|
|
||
| <div class="mt-4 flex flex-col gap-2"> | ||
| <h3>{translate('common.memo')}</h3> | ||
| {#if workflow?.memo} | ||
| <PayloadDecoder value={{ memo: workflow.memo }} key="memo"> | ||
| {#snippet children(decodedValue)} | ||
| <CodeBlock | ||
| content={decodedValue} | ||
| copyIconTitle={translate('common.copy-icon-title')} | ||
| copySuccessIconTitle={translate('common.copy-success-icon-title')} | ||
| /> | ||
| {/snippet} | ||
| </PayloadDecoder> | ||
| {:else} | ||
| <p>{translate('events.empty-memo-attributes')}</p> | ||
| {/if} | ||
| </div> |
30 changes: 30 additions & 0 deletions
30
src/lib/components/workflow/metadata/workflow-search-attributes.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,30 @@ | ||
| <script lang="ts"> | ||
| import PayloadDecoder from '$lib/components/event/payload-decoder.svelte'; | ||
| import CodeBlock from '$lib/holocene/code-block.svelte'; | ||
| import { translate } from '$lib/i18n/translate'; | ||
| import { workflowRun } from '$lib/stores/workflow-run'; | ||
|
|
||
| const { workflow } = $derived($workflowRun); | ||
| </script> | ||
|
|
||
| <div class="mt-4 flex flex-col gap-2"> | ||
| <h3> | ||
| {translate('events.attribute-group.search-attributes')} | ||
| </h3> | ||
| {#if workflow?.searchAttributes} | ||
| <PayloadDecoder | ||
| value={{ searchAttributes: workflow.searchAttributes }} | ||
| key="searchAttributes" | ||
| > | ||
| {#snippet children(decodedValue)} | ||
| <CodeBlock | ||
| content={decodedValue} | ||
| copyIconTitle={translate('common.copy-icon-title')} | ||
| copySuccessIconTitle={translate('common.copy-success-icon-title')} | ||
| /> | ||
| {/snippet} | ||
| </PayloadDecoder> | ||
| {:else} | ||
| <p>{translate('events.empty-search-attributes')}</p> | ||
| {/if} | ||
| </div> |
62 changes: 43 additions & 19 deletions
62
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,53 @@ | ||
| <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; | ||
| import MetadataEvents from './metadata-events.svelte'; | ||
|
|
||
| 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 class="flex h-full flex-1 flex-col bg-primary"> | ||
| <div> | ||
| <div class="surface-information w-full px-6 py-2"> | ||
| <h3 data-testid="user-metadata-summary-heading"> | ||
| {translate('workflows.summary')} | ||
| </h3> | ||
| </div> | ||
| {#if open && summary} | ||
| <h3>{translate('workflows.summary')}</h3> | ||
| <Markdown content={summary} /> | ||
| {#if summary} | ||
| <Markdown className="p-3" overrideTheme="primary" content={summary} /> | ||
| {:else} | ||
| <div class="py-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> | ||
| <div class="surface-information w-full px-6 py-2"> | ||
| <h3 data-testid="user-metadata-summary-heading"> | ||
| {translate('workflows.details')} | ||
| </h3> | ||
| </div> | ||
| {#if details} | ||
| <Markdown className="p-3" overrideTheme="primary" content={details} /> | ||
| {:else} | ||
| <div class="py-6 pl-6 text-secondary/70"> | ||
| <p class="text-sm italic"> | ||
| {translate('workflows.no-details-available')} | ||
| </p> | ||
| </div> | ||
| {/if} | ||
| </AccordionLight> | ||
| {/if} | ||
| </div> | ||
| <div> | ||
| <div class="surface-information w-full px-6 py-2"> | ||
| <h3 data-testid="user-metadata-summary-heading">Events with Metadata</h3> | ||
| </div> | ||
| <div class="py-6"> | ||
| <MetadataEvents /> | ||
| </div> | ||
| </div> | ||
| </div> |
9 changes: 9 additions & 0 deletions
9
src/lib/components/workflow/metadata/workflow-user-metadata.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,9 @@ | ||
| <script> | ||
| import WorkflowCurrentDetails from '$lib/components/workflow/metadata/workflow-current-details.svelte'; | ||
| import WorkflowSummaryAndDetails from '$lib/components/workflow/metadata/workflow-summary-and-details.svelte'; | ||
| </script> | ||
|
|
||
| <div class="flex flex-col bg-primary lg:flex-row"> | ||
| <WorkflowSummaryAndDetails /> | ||
| <WorkflowCurrentDetails /> | ||
| </div> |
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.