From 4ea5067ba01b76e6c06a068031020ccf02a22397 Mon Sep 17 00:00:00 2001 From: Tuomas Siipola Date: Thu, 17 Aug 2023 15:27:23 +0300 Subject: [PATCH] Show experimental tag on data search page --- backend/src/entity/CollectionFileResponse.ts | 2 + backend/src/entity/SearchFileResponse.ts | 2 + frontend/src/components/DataSearchResult.vue | 60 +++++++++++++------- frontend/src/views/SearchView.vue | 9 ++- shared/lib/entity/CollectionFileResponse.ts | 1 + shared/lib/entity/SearchFileResponse.ts | 1 + 6 files changed, 55 insertions(+), 20 deletions(-) diff --git a/backend/src/entity/CollectionFileResponse.ts b/backend/src/entity/CollectionFileResponse.ts index 0fcbf9d76..c476dc168 100644 --- a/backend/src/entity/CollectionFileResponse.ts +++ b/backend/src/entity/CollectionFileResponse.ts @@ -12,6 +12,7 @@ export class CollectionFileResponse { size: number; volatile: boolean; legacy: boolean; + experimental: boolean; errorLevel: ErrorLevel | null; constructor(file: RegularFile | ModelFile) { @@ -25,6 +26,7 @@ export class CollectionFileResponse { this.size = parseInt(file.size as unknown as string, 10); this.volatile = file.volatile; this.legacy = file.legacy; + this.experimental = file.product.experimental; this.errorLevel = file.errorLevel; } } diff --git a/backend/src/entity/SearchFileResponse.ts b/backend/src/entity/SearchFileResponse.ts index a89aafa58..7b0ff8502 100644 --- a/backend/src/entity/SearchFileResponse.ts +++ b/backend/src/entity/SearchFileResponse.ts @@ -11,6 +11,7 @@ export class SearchFileResponse { size: number; volatile: boolean; legacy: boolean; + experimental: boolean; errorLevel: ErrorLevel | null; constructor(file: SearchFile) { @@ -23,6 +24,7 @@ export class SearchFileResponse { this.size = file.size; this.volatile = file.volatile; this.legacy = file.legacy; + this.experimental = file.product.experimental; this.errorLevel = file.errorLevel; } } diff --git a/frontend/src/components/DataSearchResult.vue b/frontend/src/components/DataSearchResult.vue index c7012f208..995c508c8 100644 --- a/frontend/src/components/DataSearchResult.vue +++ b/frontend/src/components/DataSearchResult.vue @@ -126,7 +126,9 @@ section#fileTable width: 100% .listLegend - display: inline-block + list-style: none + display: flex + gap: .5em float: right text-align: right @@ -151,10 +153,17 @@ section#fileTable Searching... Found {{ listLength }} results - - volatile - legacy - +

No results

@@ -186,21 +195,26 @@ section#fileTable @row-selected="rowSelected" > props.apiResponse.length); +const hasVolatile = computed(() => + props.apiResponse.some((item) => item.volatile) +); +const hasLegacy = computed(() => props.apiResponse.some((item) => item.legacy)); +const hasExperimental = computed(() => + props.apiResponse.some((item) => item.experimental) +); + function clearPreview() { currentVisualization.value = null; pendingVisualization.value = null; diff --git a/frontend/src/views/SearchView.vue b/frontend/src/views/SearchView.vue index 86df74561..906d11041 100644 --- a/frontend/src/views/SearchView.vue +++ b/frontend/src/views/SearchView.vue @@ -222,6 +222,11 @@ div.checkbox &::after content: '' +.rowtags + display: flex + gap: .25em + justify-content: center + .rowtag display: inline-block min-width: 1em @@ -229,7 +234,6 @@ div.checkbox font-size: 0.9em text-align: center padding: 0.2em - margin-left: 0.5em border-radius: .25rem .volatile @@ -237,6 +241,9 @@ div.checkbox .legacy background: #cecece + +.experimental + background-color: #EC9706