diff --git a/client/src/components/History/Content/ContentItem.vue b/client/src/components/History/Content/ContentItem.vue index 7edbed222fc2..149a5332902c 100644 --- a/client/src/components/History/Content/ContentItem.vue +++ b/client/src/components/History/Content/ContentItem.vue @@ -43,7 +43,11 @@ - + {{ id }}: {{ name }} @@ -169,6 +173,8 @@ export default { state() { if (this.isPlaceholder) { return "placeholder"; + } else if (this.item.element_count !== undefined && this.item.element_count === 0) { + return "emptyCollection"; } if (this.item.job_state_summary) { for (const state of HIERARCHICAL_COLLECTION_JOB_STATES) { diff --git a/client/src/components/History/Content/model/StatesInfo.vue b/client/src/components/History/Content/model/StatesInfo.vue index 43d3a718af35..c2b150f6f25e 100644 --- a/client/src/components/History/Content/model/StatesInfo.vue +++ b/client/src/components/History/Content/model/StatesInfo.vue @@ -34,9 +34,12 @@ function onFilter(value: string) {
- {{ key }} + {{ key }}
{{ helpText[key] || state.text }}
diff --git a/client/src/components/History/Content/model/stateTypes.d.ts b/client/src/components/History/Content/model/stateTypes.d.ts index 3ef3a45c4456..368690474bd9 100644 --- a/client/src/components/History/Content/model/stateTypes.d.ts +++ b/client/src/components/History/Content/model/stateTypes.d.ts @@ -5,6 +5,7 @@ export type State = { text?: string; icon?: string; spin?: boolean; + nonDb?: boolean; }; export type States = { diff --git a/client/src/components/History/Content/model/states.ts b/client/src/components/History/Content/model/states.ts index 2994100c6c0b..9855de688587 100644 --- a/client/src/components/History/Content/model/states.ts +++ b/client/src/components/History/Content/model/states.ts @@ -2,13 +2,14 @@ import type { components } from "@/api/schema"; type DatasetState = components["schemas"]["DatasetState"]; // The 'failed' state is for the collection job state summary, not a dataset state. -type State = DatasetState | "failed" | "placeholder"; +type State = DatasetState | "failed" | "placeholder" | "emptyCollection"; interface StateRepresentation { status: "success" | "warning" | "info" | "danger" | "secondary"; text?: string; icon?: string; spin?: boolean; + nonDb?: boolean; } type StateMap = { @@ -103,6 +104,14 @@ export const STATES: StateMap = { text: "This dataset is being fetched.", icon: "spinner", spin: true, + nonDb: true, + }, + /** the collection is empty. This state is only visual and transitional, it does not exist in the database. */ + emptyCollection: { + status: "secondary", + text: "This is an empty list/collection.", + icon: "exclamation-triangle", + nonDb: true, }, } as const satisfies StateMap; diff --git a/client/src/components/History/CurrentCollection/CollectionPanel.vue b/client/src/components/History/CurrentCollection/CollectionPanel.vue index 7269918545a7..f7502afa0b41 100644 --- a/client/src/components/History/CurrentCollection/CollectionPanel.vue +++ b/client/src/components/History/CurrentCollection/CollectionPanel.vue @@ -115,7 +115,11 @@ watch(
+ + This is an empty list/collection. + !excludeStates.includes(state)); const validFilters = {