Skip to content

Commit 84e8f89

Browse files
committed
Reuse consistent states for viewable datasets
1 parent b8a8484 commit 84e8f89

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

client/src/components/Dataset/DatasetDisplay.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ watch(
8282
<FontAwesomeIcon :icon="faSpinner" spin />
8383
<span>Waiting for dataset to become available. Please check the history panel for details.</span>
8484
</BAlert>
85-
<BAlert v-else-if="dataset.state !== STATES.OK" show variant="danger">
85+
<BAlert v-else-if="!STATES.OK_STATES.includes(dataset.state)" show variant="danger">
8686
<FontAwesomeIcon :icon="faExclamationTriangle" />
8787
<span>Dataset is unavailable. Please check the history panel for details.</span>
8888
</BAlert>

client/src/components/Dataset/DatasetView.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import { usePersistentToggle } from "@/composables/persistentToggle";
88
import { useDatasetStore } from "@/stores/datasetStore";
99
import { useDatatypesMapperStore } from "@/stores/datatypesMapperStore";
1010
import { useDatatypeStore } from "@/stores/datatypeStore";
11+
import STATES from "@/utils/datasetStates";
1112
import { withPrefix } from "@/utils/redirect";
1213
import { bytesToString } from "@/utils/utils";
13-
import STATES from "@/utils/datasetStates";
1414
1515
import DatasetError from "../DatasetInformation/DatasetError.vue";
1616
import LoadingSpan from "../LoadingSpan.vue";
@@ -81,10 +81,8 @@ const preferredVisualization = computed(
8181
);
8282
8383
// Match dataset state
84-
const showError = computed(
85-
() => dataset.value && STATES.ERROR_STATES.includes(dataset.value.state),
86-
);
87-
const showOk = computed(() => dataset.value && dataset.value.state === STATES.OK);
84+
const showError = computed(() => dataset.value && STATES.ERROR === dataset.value.state);
85+
const showOk = computed(() => dataset.value && STATES.OK_STATES.includes(dataset.value.state));
8886
8987
// Watch for changes to the dataset to fetch datatype info
9088
watch(

client/src/components/History/Content/ContentItem.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { getGalaxyInstance } from "@/app";
1616
import type { ItemUrls } from "@/components/History/Content/Dataset/index";
1717
import { updateContentFields } from "@/components/History/model/queries";
1818
import { useEntryPointStore } from "@/stores/entryPointStore";
19+
import DATASET_STATES from "@/utils/datasetStates";
1920
import { clearDrag } from "@/utils/setDrag";
2021
2122
import { getContentItemState, type State, STATES } from "./model/states";
@@ -174,7 +175,7 @@ const itemUrls = computed<ItemUrls>(() => {
174175
let display = `/datasets/${id}`;
175176
if (props.item.extension == "tool_markdown") {
176177
display = `/datasets/${id}/report`;
177-
} else if (contentState.value !== STATES.ok) {
178+
} else if (!DATASET_STATES.OK_STATES.includes(state.value)) {
178179
display = `/datasets/${id}/details`;
179180
}
180181
return {

client/src/utils/datasetStates.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const STATES = {
4343

4444
export default {
4545
...STATES,
46+
OK_STATES: [STATES.OK, STATES.DEFERRED, STATES.FAILED_METADATA],
4647
READY_STATES: [
4748
STATES.DEFERRED,
4849
STATES.DISCARDED,

0 commit comments

Comments
 (0)