Loading client/src/components/Form/Elements/FormData/FormData.test.js +12 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,18 @@ describe("FormData", () => { expect(wrapper.find(SELECTED_VALUE).text()).toEqual("4: hdaName4"); }); it("regular data no batch input", async () => { const wrapper = createTarget({ value: null, options: defaultOptions, disableBatchInput: true, }); const options = wrapper.find(".btn-group").findAll("button"); expect(options.length).toBe(2); expect(options.at(0).classes()).toContain("active"); expect(options.at(0).attributes("title")).toBe("Single dataset"); }); it("optional dataset", async () => { const wrapper = createTarget({ value: null, Loading client/src/components/Form/Elements/FormData/FormData.vue +3 −2 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ const props = withDefaults( collectionTypes?: Array<string>; flavor?: string; tag?: string; disableBatchInput?: boolean; }>(), { loading: false, Loading @@ -50,13 +51,13 @@ const props = withDefaults( collectionTypes: undefined, flavor: undefined, tag: undefined, disableBatchInput: false, } ); const eventStore = useEventStore(); const { datatypesMapper } = useDatatypesMapper(); const disableBatchInput = getGalaxyInstance().config.disable_batch_input; const $emit = defineEmits(["input", "alert"]); Loading Loading @@ -224,7 +225,7 @@ const variant = computed(() => { const flavorKey = props.flavor ? `${props.flavor}_` : ""; const multipleKey = props.multiple ? `_multiple` : ""; const variantKey = `${flavorKey}${props.type}${multipleKey}`; if (disableBatchInput && VARIANTS[variantKey]) { if (props.disableBatchInput && VARIANTS[variantKey]) { return VARIANTS[variantKey]!.filter((v) => { return v.batch === BATCH.DISABLED; }); Loading client/src/components/Form/FormElement.vue +4 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import { sanitize } from "dompurify"; import type { ComputedRef } from "vue"; import { computed, ref, useAttrs } from "vue"; import { getGalaxyInstance } from "@/app"; import { linkify } from "@/utils/utils"; import type { FormParameterAttributes, FormParameterTypes, FormParameterValue } from "./parameterTypes"; Loading Loading @@ -88,6 +89,8 @@ const collapsed = ref(false); const collapsible = computed(() => !props.disabled && collapsibleValue.value !== undefined); const connectable = computed(() => collapsible.value && Boolean(attrs.value["connectable"])); const disableBatchInput = computed(() => getGalaxyInstance().config.disable_batch_input); // Determines whether to expand or collapse the input { const valueJson = JSON.stringify(props.value); Loading Loading @@ -298,6 +301,7 @@ function onAlert(value: string | undefined) { :tag="attrs.tag" :type="props.type" :collection-types="attrs.collection_types" :disable-batch-input="disableBatchInput" @alert="onAlert" /> <FormDrilldown v-else-if="props.type === 'drill_down'" Loading Loading
client/src/components/Form/Elements/FormData/FormData.test.js +12 −0 Original line number Diff line number Diff line Loading @@ -87,6 +87,18 @@ describe("FormData", () => { expect(wrapper.find(SELECTED_VALUE).text()).toEqual("4: hdaName4"); }); it("regular data no batch input", async () => { const wrapper = createTarget({ value: null, options: defaultOptions, disableBatchInput: true, }); const options = wrapper.find(".btn-group").findAll("button"); expect(options.length).toBe(2); expect(options.at(0).classes()).toContain("active"); expect(options.at(0).attributes("title")).toBe("Single dataset"); }); it("optional dataset", async () => { const wrapper = createTarget({ value: null, Loading
client/src/components/Form/Elements/FormData/FormData.vue +3 −2 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ const props = withDefaults( collectionTypes?: Array<string>; flavor?: string; tag?: string; disableBatchInput?: boolean; }>(), { loading: false, Loading @@ -50,13 +51,13 @@ const props = withDefaults( collectionTypes: undefined, flavor: undefined, tag: undefined, disableBatchInput: false, } ); const eventStore = useEventStore(); const { datatypesMapper } = useDatatypesMapper(); const disableBatchInput = getGalaxyInstance().config.disable_batch_input; const $emit = defineEmits(["input", "alert"]); Loading Loading @@ -224,7 +225,7 @@ const variant = computed(() => { const flavorKey = props.flavor ? `${props.flavor}_` : ""; const multipleKey = props.multiple ? `_multiple` : ""; const variantKey = `${flavorKey}${props.type}${multipleKey}`; if (disableBatchInput && VARIANTS[variantKey]) { if (props.disableBatchInput && VARIANTS[variantKey]) { return VARIANTS[variantKey]!.filter((v) => { return v.batch === BATCH.DISABLED; }); Loading
client/src/components/Form/FormElement.vue +4 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ import { sanitize } from "dompurify"; import type { ComputedRef } from "vue"; import { computed, ref, useAttrs } from "vue"; import { getGalaxyInstance } from "@/app"; import { linkify } from "@/utils/utils"; import type { FormParameterAttributes, FormParameterTypes, FormParameterValue } from "./parameterTypes"; Loading Loading @@ -88,6 +89,8 @@ const collapsed = ref(false); const collapsible = computed(() => !props.disabled && collapsibleValue.value !== undefined); const connectable = computed(() => collapsible.value && Boolean(attrs.value["connectable"])); const disableBatchInput = computed(() => getGalaxyInstance().config.disable_batch_input); // Determines whether to expand or collapse the input { const valueJson = JSON.stringify(props.value); Loading Loading @@ -298,6 +301,7 @@ function onAlert(value: string | undefined) { :tag="attrs.tag" :type="props.type" :collection-types="attrs.collection_types" :disable-batch-input="disableBatchInput" @alert="onAlert" /> <FormDrilldown v-else-if="props.type === 'drill_down'" Loading