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 +9 −14 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ const props = withDefaults( collectionTypes?: Array<string>; flavor?: string; tag?: string; singleDatasetInput?: boolean; disableBatchInput?: boolean; }>(), { loading: false, Loading @@ -51,13 +51,14 @@ const props = withDefaults( collectionTypes: undefined, flavor: undefined, tag: undefined, singleDatasetInput: false, disableBatchInput: false, } ); const eventStore = useEventStore(); const { datatypesMapper } = useDatatypesMapper(); const $emit = defineEmits(["input", "alert"]); // Determines wether values should be processed as linked or unlinked Loading Loading @@ -224,6 +225,11 @@ const variant = computed(() => { const flavorKey = props.flavor ? `${props.flavor}_` : ""; const multipleKey = props.multiple ? `_multiple` : ""; const variantKey = `${flavorKey}${props.type}${multipleKey}`; if (props.disableBatchInput && VARIANTS[variantKey]) { return VARIANTS[variantKey]!.filter((v) => { return v.batch === BATCH.DISABLED; }); } return VARIANTS[variantKey]; }); Loading Loading @@ -523,19 +529,8 @@ const noOptionsWarningMessage = computed(() => { @dragover.prevent @drop.prevent="onDrop"> <div class="d-flex flex-column"> <BButtonGroup v-if="variant && variant.length > 1" buttons class="align-self-start"> <BButton v-if="props.singleDatasetInput" v-for="(v, index) in variant.slice(0,1)" :key="index" v-b-tooltip.hover.bottom :pressed="currentField === index" :title="v.tooltip" @click="currentField = index"> <FontAwesomeIcon :icon="['far', v.icon]" /> </BButton> <BButtonGroup v-if="variant && variant.length > 0" buttons class="align-self-start"> <BButton v-else v-for="(v, index) in variant" :key="index" v-b-tooltip.hover.bottom Loading client/src/components/Form/FormElement.vue +4 −3 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 @@ -48,7 +49,6 @@ interface FormElementProps { connectedEnableIcon?: string; connectedDisableIcon?: string; workflowBuildingMode?: boolean; singleDatasetInput?: boolean; } const props = withDefaults(defineProps<FormElementProps>(), { Loading @@ -64,7 +64,6 @@ const props = withDefaults(defineProps<FormElementProps>(), { connectedEnableIcon: "fa fa-times", connectedDisableIcon: "fa fa-arrows-alt-h", workflowBuildingMode: false, singleDatasetInput: false, }); const emit = defineEmits<{ Loading @@ -90,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 @@ -300,7 +301,7 @@ function onAlert(value: string | undefined) { :tag="attrs.tag" :type="props.type" :collection-types="attrs.collection_types" :single-dataset-input="props.singleDatasetInput" :disable-batch-input="disableBatchInput" @alert="onAlert" /> <FormDrilldown v-else-if="props.type === 'drill_down'" Loading client/src/components/Form/FormInputs.vue +0 −6 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ :refresh-on-change="false" :disabled="sustainConditionals" :attributes="input.test_param" :single-dataset-input="singleDatasetInput" @change="onChange" /> <div v-for="(caseDetails, caseId) in input.cases" :key="caseId"> <FormNode Loading Loading @@ -60,7 +59,6 @@ :collapsed-disable-icon="collapsedDisableIcon" :loading="loading" :workflow-building-mode="workflowBuildingMode" :single-dataset-input="singleDatasetInput" @change="onChange" /> </div> </div> Loading Loading @@ -131,10 +129,6 @@ export default { type: Boolean, default: false, }, singleDatasetInput: { type: Boolean, default: false, }, }, methods: { getPrefix(name, index) { Loading client/src/components/Form/FormRepeat.vue +1 −5 Original line number Diff line number Diff line Loading @@ -59,10 +59,6 @@ const props = defineProps({ type: String, default: null, }, singleDatasetInput: { type: Boolean, default: true, }, }); const emit = defineEmits<{ Loading Loading @@ -173,7 +169,7 @@ const { keyObject } = useKeyedObjects(); </template> <template v-slot:body> <FormNode v-bind="props.passthroughProps" :inputs="cache" :prefix="getPrefix(cacheId)" :single-dataset-input="props.singleDatasetInput" /> <FormNode v-bind="props.passthroughProps" :inputs="cache" :prefix="getPrefix(cacheId)" /> </template> </FormCard> 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 +9 −14 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ const props = withDefaults( collectionTypes?: Array<string>; flavor?: string; tag?: string; singleDatasetInput?: boolean; disableBatchInput?: boolean; }>(), { loading: false, Loading @@ -51,13 +51,14 @@ const props = withDefaults( collectionTypes: undefined, flavor: undefined, tag: undefined, singleDatasetInput: false, disableBatchInput: false, } ); const eventStore = useEventStore(); const { datatypesMapper } = useDatatypesMapper(); const $emit = defineEmits(["input", "alert"]); // Determines wether values should be processed as linked or unlinked Loading Loading @@ -224,6 +225,11 @@ const variant = computed(() => { const flavorKey = props.flavor ? `${props.flavor}_` : ""; const multipleKey = props.multiple ? `_multiple` : ""; const variantKey = `${flavorKey}${props.type}${multipleKey}`; if (props.disableBatchInput && VARIANTS[variantKey]) { return VARIANTS[variantKey]!.filter((v) => { return v.batch === BATCH.DISABLED; }); } return VARIANTS[variantKey]; }); Loading Loading @@ -523,19 +529,8 @@ const noOptionsWarningMessage = computed(() => { @dragover.prevent @drop.prevent="onDrop"> <div class="d-flex flex-column"> <BButtonGroup v-if="variant && variant.length > 1" buttons class="align-self-start"> <BButton v-if="props.singleDatasetInput" v-for="(v, index) in variant.slice(0,1)" :key="index" v-b-tooltip.hover.bottom :pressed="currentField === index" :title="v.tooltip" @click="currentField = index"> <FontAwesomeIcon :icon="['far', v.icon]" /> </BButton> <BButtonGroup v-if="variant && variant.length > 0" buttons class="align-self-start"> <BButton v-else v-for="(v, index) in variant" :key="index" v-b-tooltip.hover.bottom Loading
client/src/components/Form/FormElement.vue +4 −3 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 @@ -48,7 +49,6 @@ interface FormElementProps { connectedEnableIcon?: string; connectedDisableIcon?: string; workflowBuildingMode?: boolean; singleDatasetInput?: boolean; } const props = withDefaults(defineProps<FormElementProps>(), { Loading @@ -64,7 +64,6 @@ const props = withDefaults(defineProps<FormElementProps>(), { connectedEnableIcon: "fa fa-times", connectedDisableIcon: "fa fa-arrows-alt-h", workflowBuildingMode: false, singleDatasetInput: false, }); const emit = defineEmits<{ Loading @@ -90,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 @@ -300,7 +301,7 @@ function onAlert(value: string | undefined) { :tag="attrs.tag" :type="props.type" :collection-types="attrs.collection_types" :single-dataset-input="props.singleDatasetInput" :disable-batch-input="disableBatchInput" @alert="onAlert" /> <FormDrilldown v-else-if="props.type === 'drill_down'" Loading
client/src/components/Form/FormInputs.vue +0 −6 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ :refresh-on-change="false" :disabled="sustainConditionals" :attributes="input.test_param" :single-dataset-input="singleDatasetInput" @change="onChange" /> <div v-for="(caseDetails, caseId) in input.cases" :key="caseId"> <FormNode Loading Loading @@ -60,7 +59,6 @@ :collapsed-disable-icon="collapsedDisableIcon" :loading="loading" :workflow-building-mode="workflowBuildingMode" :single-dataset-input="singleDatasetInput" @change="onChange" /> </div> </div> Loading Loading @@ -131,10 +129,6 @@ export default { type: Boolean, default: false, }, singleDatasetInput: { type: Boolean, default: false, }, }, methods: { getPrefix(name, index) { Loading
client/src/components/Form/FormRepeat.vue +1 −5 Original line number Diff line number Diff line Loading @@ -59,10 +59,6 @@ const props = defineProps({ type: String, default: null, }, singleDatasetInput: { type: Boolean, default: true, }, }); const emit = defineEmits<{ Loading Loading @@ -173,7 +169,7 @@ const { keyObject } = useKeyedObjects(); </template> <template v-slot:body> <FormNode v-bind="props.passthroughProps" :inputs="cache" :prefix="getPrefix(cacheId)" :single-dataset-input="props.singleDatasetInput" /> <FormNode v-bind="props.passthroughProps" :inputs="cache" :prefix="getPrefix(cacheId)" /> </template> </FormCard> Loading