Skip to content

Commit 97452de

Browse files
authored
Merge pull request #21393 from guerler/fix_content_state_icons
Use icon classes instead of strings for history content item states
2 parents 1a58476 + 7df1716 commit 97452de

File tree

1 file changed

+26
-16
lines changed
  • client/src/components/History/Content/model

1 file changed

+26
-16
lines changed

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

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
import {
2+
faClock,
3+
faCloud,
4+
faExclamationTriangle,
5+
faLock,
6+
faPause,
7+
faSpinner,
8+
type IconDefinition,
9+
} from "@fortawesome/free-solid-svg-icons";
10+
111
import type { DCESummary, HDADetailed, HDCADetailed } from "@/api";
212
import { ERROR_DATASET_STATES, NON_TERMINAL_DATASET_STATES } from "@/api/datasets";
313
import type { HistoryContentsResult } from "@/api/histories";
@@ -34,7 +44,7 @@ interface StateRepresentation {
3444
status: "success" | "warning" | "info" | "danger" | "secondary";
3545
text?: string;
3646
displayName?: string;
37-
icon?: string;
47+
icon?: IconDefinition;
3848
spin?: boolean;
3949
nonDb?: boolean;
4050
}
@@ -64,86 +74,86 @@ export const STATES: StateMap = {
6474
status: "warning",
6575
text: "This is a new dataset and not all of its data are available yet.",
6676
displayName: "new",
67-
icon: "clock",
77+
icon: faClock,
6878
},
6979
/** the job that will produce the dataset queued in the runner */
7080
queued: {
7181
status: "warning",
7282
text: "This job is waiting to run.",
7383
displayName: "queued",
74-
icon: "clock",
84+
icon: faClock,
7585
},
7686
/** the job that will produce the dataset is running */
7787
running: {
7888
status: "warning",
7989
text: "This job is currently running.",
8090
displayName: "running",
81-
icon: "spinner",
91+
icon: faSpinner,
8292
spin: true,
8393
},
8494
/** metadata for the dataset is being discovered/set */
8595
setting_metadata: {
8696
status: "warning",
8797
text: "Metadata is being auto-detected.",
8898
displayName: "setting metadata",
89-
icon: "spinner",
99+
icon: faSpinner,
90100
spin: true,
91101
},
92102
/** is uploading and not ready */
93103
upload: {
94104
status: "warning",
95105
text: "This dataset is currently uploading.",
96106
displayName: "uploading",
97-
icon: "spinner",
107+
icon: faSpinner,
98108
spin: true,
99109
},
100110
/** remote dataset */
101111
deferred: {
102112
status: "info",
103113
text: "This dataset is remote, has not been ingested by Galaxy, and full metadata may not be available.",
104114
displayName: "deferred",
105-
icon: "cloud",
115+
icon: faCloud,
106116
},
107117
/** the job that will produce the dataset paused */
108118
paused: {
109119
status: "info",
110120
text: "This job is paused. Use the 'Resume Paused Jobs' in the history menu to resume.",
111121
displayName: "paused",
112-
icon: "pause",
122+
icon: faPause,
113123
},
114124
/** deleted while uploading */
115125
discarded: {
116126
status: "danger",
117127
text: "This dataset is discarded - the job creating it may have been cancelled or it may have been imported without file data.",
118128
displayName: "discarded",
119-
icon: "exclamation-triangle",
129+
icon: faExclamationTriangle,
120130
},
121131
/** the tool producing this dataset has errored */
122132
error: {
123133
status: "danger",
124134
text: "An error occurred with this dataset.",
125135
displayName: "error",
126-
icon: "exclamation-triangle",
136+
icon: faExclamationTriangle,
127137
},
128138
/** metadata discovery/setting failed or errored (but otherwise ok) */
129139
failed_metadata: {
130140
status: "danger",
131141
text: "Metadata generation failed. Please retry.",
132142
displayName: "failed metadata",
133-
icon: "exclamation-triangle",
143+
icon: faExclamationTriangle,
134144
},
135145
/** the job has failed, this is not a dataset but a job state used in the collection job state summary. */
136146
failed: {
137147
status: "danger",
138148
displayName: "failed",
139-
icon: "exclamation-triangle",
149+
icon: faExclamationTriangle,
140150
},
141151
/** the dataset is not yet loaded in the UI. This state is only visual and transitional, it does not exist in the database. */
142152
placeholder: {
143153
status: "secondary",
144154
text: "This dataset is being fetched.",
145155
displayName: "loading",
146-
icon: "spinner",
156+
icon: faSpinner,
147157
spin: true,
148158
nonDb: true,
149159
},
@@ -152,22 +162,22 @@ export const STATES: StateMap = {
152162
status: "danger",
153163
text: "Failed to populate the collection.",
154164
displayName: "failed",
155-
icon: "exclamation-triangle",
165+
icon: faExclamationTriangle,
156166
nonDb: true,
157167
},
158168
/** the `populated_state: new`. This state is only visual and transitional, it does not exist in the database. */
159169
new_populated_state: {
160170
status: "warning",
161171
text: "This is a new collection and not all of its data are available yet.",
162172
displayName: "new",
163-
icon: "clock",
173+
icon: faClock,
164174
nonDb: true,
165175
},
166176
inaccessible: {
167177
status: "warning",
168178
text: "User not allowed to access this dataset.",
169179
displayName: "inaccessible",
170-
icon: "lock",
180+
icon: faLock,
171181
nonDb: true,
172182
},
173183
} as const satisfies StateMap;

0 commit comments

Comments
 (0)