mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Improve SelectPreferredStore.vue.
This commit is contained in:
@@ -60,4 +60,27 @@ describe("SelectPreferredStore.vue", () => {
|
||||
const emitted = wrapper.emitted();
|
||||
expect(emitted["updated"][0][0]).toEqual(null);
|
||||
});
|
||||
|
||||
it("updates object store to on non-null selection", async () => {
|
||||
const wrapper = mountComponent();
|
||||
await flushPromises();
|
||||
const els = wrapper.findAll(PREFERENCES.object_store_selection.option_buttons.selector);
|
||||
expect(els.length).toBe(3);
|
||||
const galaxyDefaultOption = wrapper.find(
|
||||
PREFERENCES.object_store_selection.option_button({ object_store_id: "object_store_2" }).selector
|
||||
);
|
||||
expect(galaxyDefaultOption.exists()).toBeTruthy();
|
||||
axiosMock
|
||||
.onPut(
|
||||
`/api/histories/${TEST_HISTORY_ID}`,
|
||||
expect.objectContaining({ preferred_object_store_id: "object_store_2" })
|
||||
)
|
||||
.reply(202);
|
||||
await galaxyDefaultOption.trigger("click");
|
||||
await flushPromises();
|
||||
const errorEl = wrapper.find(".object-store-selection-error");
|
||||
expect(errorEl.exists()).toBeFalsy();
|
||||
const emitted = wrapper.emitted();
|
||||
expect(emitted["updated"][0][0]).toEqual("object_store_2");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,28 +19,26 @@ const props = defineProps({
|
||||
const error = ref<string | null>(null);
|
||||
const selectedObjectStoreId = ref(props.history.preferred_object_store_id);
|
||||
|
||||
const newDatasetsDescription = ref("New dataset outputs from tools and workflows executed in this history");
|
||||
const galaxySelectionDefaultTitle = ref("Use Galaxy Defaults");
|
||||
const galaxySelectionDefaultDescription = ref(
|
||||
"Selecting this will reset Galaxy to default behaviors configured by your Galaxy administrator."
|
||||
);
|
||||
const userSelectionDefaultTitle = ref("Use Your User Preference Defaults");
|
||||
const userSelectionDefaultDescription = ref(
|
||||
"Selecting this will cause the history to not set a default and to fallback to your user preference defined default."
|
||||
);
|
||||
const newDatasetsDescription = "New dataset outputs from tools and workflows executed in this history";
|
||||
const galaxySelectionDefaultTitle = "Use Galaxy Defaults";
|
||||
const galaxySelectionDefaultDescription =
|
||||
"Selecting this will reset Galaxy to default behaviors configured by your Galaxy administrator.";
|
||||
const userSelectionDefaultTitle = "Use Your User Preference Defaults";
|
||||
const userSelectionDefaultDescription =
|
||||
"Selecting this will cause the history to not set a default and to fallback to your user preference defined default.";
|
||||
|
||||
const defaultOptionTitle = computed(() => {
|
||||
if (props.userPreferredObjectStoreId) {
|
||||
return userSelectionDefaultTitle.value;
|
||||
return userSelectionDefaultTitle;
|
||||
} else {
|
||||
return galaxySelectionDefaultTitle.value;
|
||||
return galaxySelectionDefaultTitle;
|
||||
}
|
||||
});
|
||||
const defaultOptionDescription = computed(() => {
|
||||
if (props.userPreferredObjectStoreId) {
|
||||
return userSelectionDefaultDescription.value;
|
||||
return userSelectionDefaultDescription;
|
||||
} else {
|
||||
return galaxySelectionDefaultDescription.value;
|
||||
return galaxySelectionDefaultDescription;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user