-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Schedule search attributes (#2241) * Add search attributes to create schedule UI * Add search attributes to edit schedule UI * Fix search attribute inputs based on search attribute type * Add search attributes to schedule view UI * Use custom datetime input with UTC * Small UI and copy fixes * Fix attribute value to always update on attribute change * Fix label spacing and update custom search attribute table to be list instead * Update schedule advanced settings to be list * Fix search attribute view/create/update * Fix type * Add expandable prop to search attribute Accordion --------- Co-authored-by: Alex Tideman <[email protected]> * Add ability to query schedules (#2272) * Refactor FilterSearch to component for reuse on Schedules page * Rename filter search to search attribute filter * Make schedules table headers configurable * Add back schedule name search input * Fix responsiveness * Only add starts with option to TextFilter if attribute is a Keyword * Fix empty state * update testId * Add onError callback * Remove schedule name search input * Add search attribute type map * Add ScheduleId filter option and rename table header * Use Input required prop on schedule form * Add isCloud check for ScheduleId * Add unspecified search attribute type --------- Co-authored-by: Alex Tideman <[email protected]>
- Loading branch information
1 parent
6f842c2
commit 25b4795
Showing
73 changed files
with
1,543 additions
and
971 deletions.
There are no files selected for viewing
This file contains 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 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
37 changes: 37 additions & 0 deletions
37
src/lib/components/schedule/schedule-search-attributes.svelte
This file contains 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,37 @@ | ||
<script lang="ts"> | ||
import Accordion from '$lib/holocene/accordion.svelte'; | ||
import { translate } from '$lib/i18n/translate'; | ||
import type { SearchAttribute } from '$lib/types'; | ||
import { decodePayloadAttributes } from '$lib/utilities/decode-payload'; | ||
import { pluralize } from '$lib/utilities/pluralize'; | ||
export let searchAttributes: SearchAttribute; | ||
$: decodedSearchAttributes = decodePayloadAttributes({ searchAttributes }); | ||
$: indexedFields = | ||
decodedSearchAttributes?.searchAttributes.indexedFields ?? {}; | ||
$: searchAttributeCount = Object.keys(indexedFields).length; | ||
</script> | ||
|
||
<Accordion | ||
title={translate('events.custom-search-attributes')} | ||
subtitle={`${searchAttributeCount} ${translate( | ||
'events.custom-search', | ||
)} ${pluralize(translate('events.attribute'), searchAttributeCount)}`} | ||
expandable={searchAttributeCount > 0} | ||
> | ||
{#if searchAttributeCount} | ||
<ul class="w-full"> | ||
{#each Object.entries(indexedFields) as [searchAttrName, searchAttrValue]} | ||
<li | ||
class="flex flex-wrap items-center gap-2 border-b py-2 last-of-type:border-b-0" | ||
> | ||
<span class="break-all">{searchAttrName}</span> | ||
<span class="surface-subtle select-all rounded-sm p-1 leading-4" | ||
>{searchAttrValue}</span | ||
> | ||
</li> | ||
{/each} | ||
</ul> | ||
{/if} | ||
</Accordion> |
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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.