Skip to content

Commit 14833d4

Browse files
committed
Add explicit display names to dataset states, minor cleanup
1 parent b089848 commit 14833d4

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

client/src/components/Dataset/DatasetState.vue

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,17 @@ const contentCls = computed(() => {
2727
}
2828
});
2929
30-
// Compute short display text - capitalize the state name
3130
const displayText = computed(() => {
32-
if (!dataset.value) {
33-
return "n/a";
34-
}
35-
const state = dataset.value.state;
36-
if (!state) {
37-
return "n/a";
31+
if (contentState.value?.displayName) {
32+
return contentState.value.displayName;
3833
}
3934
40-
// Capitalize first letter and replace underscores with spaces
41-
return state.charAt(0).toUpperCase() + state.slice(1).replace(/_/g, " ");
35+
const state = dataset.value?.state;
36+
return state ? state.replace(/_/g, " ") : "n/a";
4237
});
4338
44-
// Get the full descriptive text for tooltip
45-
const tooltipText = computed(() => {
46-
return contentState.value?.text || null;
47-
});
39+
const tooltipText = computed(() => contentState.value?.text || null);
4840
49-
// Ref for the state badge element
5041
const stateBadgeRef = ref<HTMLElement | null>(null);
5142
</script>
5243

client/src/components/Dataset/DatasetView.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ watch(
291291
.dataset-title-row {
292292
display: flex;
293293
align-items: baseline;
294-
min-width: 0; // Allow to shrink below content
295-
flex: 1 1 auto; // Allow to grow and shrink
294+
min-width: 0;
295+
flex: 1 1 auto;
296296
}
297297
298298
.dataset-hid {
@@ -302,13 +302,13 @@ watch(
302302
303303
.dataset-name {
304304
word-break: break-word;
305-
min-width: 0; // Allow text to wrap
305+
min-width: 0;
306306
}
307307
308308
.dataset-state-header {
309309
font-size: $h5-font-size;
310-
flex: 0 0 auto; // Don't grow or shrink
311-
white-space: nowrap; // Prevent state badge from wrapping internally
310+
flex: 0 0 auto;
311+
white-space: nowrap;
312312
}
313313
314314
.tab-content-panel {

client/src/components/History/Content/model/states.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type State =
1414
interface StateRepresentation {
1515
status: "success" | "warning" | "info" | "danger" | "secondary";
1616
text?: string;
17+
displayName?: string;
1718
icon?: string;
1819
spin?: boolean;
1920
nonDb?: boolean;
@@ -31,84 +32,98 @@ export const STATES: StateMap = {
3132
/** has successfully completed running */
3233
ok: {
3334
status: "success",
35+
displayName: "ok",
3436
},
3537
/** has no data */
3638
empty: {
3739
status: "success",
3840
text: "No data.",
41+
displayName: "empty",
3942
},
4043
/** was created without a tool */
4144
new: {
4245
status: "warning",
4346
text: "This is a new dataset and not all of its data are available yet.",
47+
displayName: "new",
4448
icon: "clock",
4549
},
4650
/** the job that will produce the dataset queued in the runner */
4751
queued: {
4852
status: "warning",
4953
text: "This job is waiting to run.",
54+
displayName: "queued",
5055
icon: "clock",
5156
},
5257
/** the job that will produce the dataset is running */
5358
running: {
5459
status: "warning",
5560
text: "This job is currently running.",
61+
displayName: "running",
5662
icon: "spinner",
5763
spin: true,
5864
},
5965
/** metadata for the dataset is being discovered/set */
6066
setting_metadata: {
6167
status: "warning",
6268
text: "Metadata is being auto-detected.",
69+
displayName: "setting metadata",
6370
icon: "spinner",
6471
spin: true,
6572
},
6673
/** is uploading and not ready */
6774
upload: {
6875
status: "warning",
6976
text: "This dataset is currently uploading.",
77+
displayName: "uploading",
7078
icon: "spinner",
7179
spin: true,
7280
},
7381
/** remote dataset */
7482
deferred: {
7583
status: "info",
7684
text: "This dataset is remote, has not been ingested by Galaxy, and full metadata may not be available.",
85+
displayName: "deferred",
7786
icon: "cloud",
7887
},
7988
/** the job that will produce the dataset paused */
8089
paused: {
8190
status: "info",
8291
text: "This job is paused. Use the 'Resume Paused Jobs' in the history menu to resume.",
92+
displayName: "paused",
8393
icon: "pause",
8494
},
8595
/** deleted while uploading */
8696
discarded: {
8797
status: "danger",
8898
text: "This dataset is discarded - the job creating it may have been cancelled or it may have been imported without file data.",
99+
displayName: "discarded",
89100
icon: "exclamation-triangle",
90101
},
91102
/** the tool producing this dataset has errored */
92103
error: {
93104
status: "danger",
94105
text: "An error occurred with this dataset.",
106+
displayName: "error",
95107
icon: "exclamation-triangle",
96108
},
97109
/** metadata discovery/setting failed or errored (but otherwise ok) */
98110
failed_metadata: {
99111
status: "danger",
100112
text: "Metadata generation failed. Please retry.",
113+
displayName: "failed metadata",
101114
icon: "exclamation-triangle",
102115
},
103116
/** the job has failed, this is not a dataset but a job state used in the collection job state summary. */
104117
failed: {
105118
status: "danger",
119+
displayName: "failed",
106120
icon: "exclamation-triangle",
107121
},
108122
/** the dataset is not yet loaded in the UI. This state is only visual and transitional, it does not exist in the database. */
109123
placeholder: {
110124
status: "secondary",
111125
text: "This dataset is being fetched.",
126+
displayName: "loading",
112127
icon: "spinner",
113128
spin: true,
114129
nonDb: true,
@@ -117,19 +132,22 @@ export const STATES: StateMap = {
117132
failed_populated_state: {
118133
status: "danger",
119134
text: "Failed to populate the collection.",
135+
displayName: "failed",
120136
icon: "exclamation-triangle",
121137
nonDb: true,
122138
},
123139
/** the `populated_state: new`. This state is only visual and transitional, it does not exist in the database. */
124140
new_populated_state: {
125141
status: "warning",
126142
text: "This is a new collection and not all of its data are available yet.",
143+
displayName: "new",
127144
icon: "clock",
128145
nonDb: true,
129146
},
130147
inaccessible: {
131148
status: "warning",
132149
text: "User not allowed to access this dataset.",
150+
displayName: "inaccessible",
133151
icon: "lock",
134152
nonDb: true,
135153
},

0 commit comments

Comments
 (0)