Skip to content

Commit

Permalink
Merge pull request #19241 from jmchilton/avoid_unhelpful_formats
Browse files Browse the repository at this point in the history
[24.2] Avoid a class of unhelpful accepted format drop downs.
  • Loading branch information
ahmedhamidawan authored Dec 3, 2024
2 parents f5e146d + d59861f commit ef82f8f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/src/components/Form/Elements/FormData/FormData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ const dragTarget: Ref<EventTarget | null> = ref(null);
const collectionModalShow = ref(false);
const collectionModalType = ref<"list" | "list:paired" | "paired">("list");
const { currentHistoryId } = storeToRefs(useHistoryStore());
const restrictsExtensions = computed(() => {
const extensions = props.extensions;
if (!extensions || extensions.length == 0 || extensions.indexOf("data") >= 0) {
return false;
} else {
return true;
}
});
/** Store options which need to be preserved **/
const keepOptions: Record<string, SelectOption> = {};
Expand Down Expand Up @@ -649,7 +657,7 @@ const noOptionsWarningMessage = computed(() => {
</BButton>
</BButtonGroup>
</BButtonGroup>
<div v-if="extensions && extensions.length > 0">
<div v-if="restrictsExtensions">
<BButton :id="formatsButtonId" class="ui-link" @click="formatsVisible = !formatsVisible">
accepted formats
<FontAwesomeIcon v-if="formatsVisible" :icon="faCaretUp" />
Expand Down

0 comments on commit ef82f8f

Please sign in to comment.