Skip to content

Commit

Permalink
remove useless "Cancel" buttons, add upload message
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Dec 3, 2024
1 parent 5dbf3b0 commit 82b410a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 56 deletions.
23 changes: 6 additions & 17 deletions client/src/components/Collections/ListCollectionCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -491,30 +491,25 @@ function renameElement(element: any, name: string) {
<a class="cancel-text" href="javascript:void(0)" role="button" @click="emit('on-cancel')">
{{ localize("cancel") }}
</a>
{{ localize("and reselect new elements.") }}
{{ localize("and reselect new elements, or upload datasets.") }}
</BAlert>

<div class="float-left">
<button class="cancel-create btn" tabindex="-1" @click="emit('on-cancel')">
{{ localize("Cancel") }}
</button>
</div>
</div>
<div v-else-if="allElementsAreInvalid">
<BAlert v-if="!fromSelection" show variant="warning">
{{
localize(
"No elements in your history are valid for this list. You may need to switch to a different history."
"No elements in your history are valid for this list. \
You may need to switch to a different history or upload valid datasets."
)
}}
<span v-if="extensions?.length">
<div v-if="extensions?.length">
{{ localize("The following extensions are required for this list: ") }}
<ul>
<li v-for="extension in extensions" :key="extension">
{{ extension }}
</li>
</ul>
</span>
</div>
</BAlert>
<BAlert v-else show variant="warning" dismissible>
{{ localize("The following selections could not be included due to problems:") }}
Expand All @@ -527,14 +522,8 @@ function renameElement(element: any, name: string) {
<a class="cancel-text" href="javascript:void(0)" role="button" @click="emit('on-cancel')">
{{ localize("cancel") }}
</a>
{{ localize("and reselect new elements.") }}
{{ localize("and reselect new elements, or upload valid datasets.") }}
</BAlert>

<div class="float-left">
<button class="cancel-create btn" tabindex="-1" @click="emit('on-cancel')">
{{ localize("Cancel") }}
</button>
</div>
</div>
<div v-else-if="fromSelection">
<div class="collection-elements-controls">
Expand Down
29 changes: 6 additions & 23 deletions client/src/components/Collections/PairCollectionCreator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,6 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
{{ localize("and reselect new elements.") }}
</span>
</BAlert>

<div v-if="fromSelection" class="float-left">
<button class="cancel-create btn" tabindex="-1" @click="emit('on-cancel')">
{{ localize("Cancel") }}
</button>
</div>
</div>

<CollectionCreator
Expand Down Expand Up @@ -443,30 +437,25 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
<a class="cancel-text" href="javascript:void(0)" role="button" @click="emit('on-cancel')">
{{ localize("cancel") }}
</a>
{{ localize("and reselect new elements.") }}
{{ localize("and reselect new elements, or upload datasets.") }}
</BAlert>

<div class="float-left">
<button class="cancel-create btn" tabindex="-1" @click="emit('on-cancel')">
{{ localize("Cancel") }}
</button>
</div>
</div>
<div v-else-if="allElementsAreInvalid">
<BAlert v-if="!fromSelection" show variant="warning">
{{
localize(
"No elements in your history are valid for this pair. You may need to switch to a different history."
"No elements in your history are valid for this pair. \
You may need to switch to a different history or upload valid datasets."
)
}}
<span v-if="extensions?.length">
<div v-if="extensions?.length">
{{ localize("The following extensions are required for this pair: ") }}
<ul>
<li v-for="extension in extensions" :key="extension">
{{ extension }}
</li>
</ul>
</span>
</div>
</BAlert>
<BAlert v-else show variant="warning" dismissible>
{{ localize("The following selections could not be included due to problems:") }}
Expand All @@ -479,14 +468,8 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
<a class="cancel-text" href="javascript:void(0)" role="button" @click="emit('on-cancel')">
{{ localize("cancel") }}
</a>
{{ localize("and reselect new elements.") }}
{{ localize("and reselect new elements, or upload datasets.") }}
</BAlert>

<div class="float-left">
<button class="cancel-create btn" tabindex="-1" @click="emit('on-cancel')">
{{ localize("Cancel") }}
</button>
</div>
</div>
<div v-else>
<div class="collection-elements-controls">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const emit = defineEmits<{
const noElementsHeader = props.fromSelection ? localize("No elements selected") : localize("No elements available");
const allInvalidElementsPartTwo = props.fromSelection
? localize("and reselect new elements.")
: localize("and change your current history or add valid datasets for this collection.");
: localize("and change your current history or upload valid datasets for this collection.");
// Flags
const state = ref<"build" | "error" | "duplicates">("build");
Expand Down Expand Up @@ -1005,11 +1005,6 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
</a>
{{ allInvalidElementsPartTwo }}
</BAlert>
<div class="float-left">
<button class="cancel-create btn" tabindex="-1" @click="emit('on-cancel')">
{{ CANCEL_TEXT }}
</button>
</div>
</div>
<div v-else-if="allElementsAreInvalid">
<BAlert v-if="!fromSelection" show variant="warning">
Expand Down Expand Up @@ -1040,11 +1035,6 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
</a>
{{ allInvalidElementsPartTwo }}
</BAlert>
<div class="float-left">
<button class="cancel-create btn" tabindex="-1" @click="emit('on-cancel')">
{{ CANCEL_TEXT }}
</button>
</div>
</div>
<div v-else-if="tooFewElementsSelected">
<div v-if="returnInvalidElementsLength">
Expand All @@ -1064,11 +1054,6 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) {
</a>
{{ allInvalidElementsPartTwo }}
</BAlert>
<div class="float-left">
<button class="cancel-create btn" tabindex="-1" @click="emit('on-cancel')">
{{ CANCEL_TEXT }}
</button>
</div>
</div>
<div v-else>
<BCard no-body class="mb-2">
Expand Down

0 comments on commit 82b410a

Please sign in to comment.