Skip to content

Commit

Permalink
Remove individual collection builders from history dropdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Jan 9, 2025
1 parent 416f5a8 commit 7f2b5cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 +207,15 @@ describe("History Selection Operations", () => {
});

it("should display collection building options only on active (non-deleted) items", async () => {
const buildListOption = '[data-description="build list"]';
const buildListOfPairsOption = '[data-description="build list of pairs"]';
const buildListOption = '[data-description="auto build list"]';
await wrapper.setProps({ filterText: "visible:true deleted:false" });
expect(wrapper.find(buildListOption).exists()).toBe(true);
expect(wrapper.find(buildListOfPairsOption).exists()).toBe(true);
await wrapper.setProps({ filterText: "deleted:true" });
expect(wrapper.find(buildListOption).exists()).toBe(false);
expect(wrapper.find(buildListOfPairsOption).exists()).toBe(false);
await wrapper.setProps({ filterText: "visible:any deleted:false" });
expect(wrapper.find(buildListOption).exists()).toBe(true);
expect(wrapper.find(buildListOfPairsOption).exists()).toBe(true);
await wrapper.setProps({ filterText: "deleted:any" });
expect(wrapper.find(buildListOption).exists()).toBe(false);
expect(wrapper.find(buildListOfPairsOption).exists()).toBe(false);
});

it("should display list building option when all are selected", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,35 +64,6 @@
<b-dropdown-item v-if="showBuildOptions" data-description="advanced build list" @click="listWizard(true)">
<span v-localize>Advanced Build List</span>
</b-dropdown-item>
<b-dropdown-group header-classes="subtle-header" header="Advanced">
<b-dropdown-item v-if="showBuildOptions" data-description="build list" @click="buildDatasetList">
<span v-localize>Build Dataset List</span>
</b-dropdown-item>
<b-dropdown-item
v-if="showBuildOptions"
data-description="build list of pairs"
@click="buildListOfPairs">
<span v-localize>Build List of Dataset Pairs</span>
</b-dropdown-item>
<b-dropdown-item
v-if="showBuildOptions"
data-description="build list of paires 2"
@click="buildListOfPairsV2">
<span v-localize>Build List of Dataset Pairs (v2)</span>
</b-dropdown-item>
<b-dropdown-item
v-if="showBuildOptions"
data-description="build list of paired_or_unpaired"
@click="buildListOfMixedPaired">
<span v-localize>Build List with Optional Pairing</span>
</b-dropdown-item>
<b-dropdown-item
v-if="showBuildOptions"
data-description="build collection from rules"
@click="buildCollectionFromRules">
<span v-localize>Build Collection from Rules</span>
</b-dropdown-item>
</b-dropdown-group>
</b-dropdown>

<b-modal id="hide-selected-content" title="Hide Selected Content?" title-tag="h2" @ok="hideSelected">
Expand Down Expand Up @@ -168,7 +139,6 @@
:collection-type="collectionModalType"
:filter-text="filterText"
:selected-items="collectionSelection"
:use-beta-components="useBetaComponents"
:show-modal.sync="collectionModalShow"
hide-modal-on-create
default-hide-source-items
Expand All @@ -193,12 +163,9 @@ import { DatatypesProvider, DbKeyProvider } from "components/providers";
import SingleItemSelector from "components/SingleItemSelector";
import { StatelessTags } from "components/Tags";
import { createDatasetCollection } from "@/components/History/model/queries";
import { useConfig } from "@/composables/config";
import { useCollectionBuilderItemSelection } from "@/stores/collectionBuilderItemsStore";
import { buildRuleCollectionModal } from "../../adapters/buildCollectionModal";
import CollectionCreatorModal from "@/components/Collections/CollectionCreatorModal.vue";
export default {
Expand Down Expand Up @@ -230,7 +197,6 @@ export default {
selectedDbKey: { id: "?", text: "unspecified (?)" },
selectedDatatype: { id: "auto", text: "Auto-detect" },
selectedTags: [],
useBetaComponents: false,
};
},
computed: {
Expand Down Expand Up @@ -407,48 +373,11 @@ export default {
onSelectedDatatype(datatype) {
this.selectedDatatype = datatype;
},
// collection creation, fires up a modal
buildDatasetList() {
this.collectionModalType = "list";
this.collectionSelection = Array.from(this.contentSelection.values());
this.collectionModalShow = true;
},
buildDatasetListAll() {
this.collectionModalType = "list";
this.collectionSelection = undefined;
this.collectionModalShow = true;
},
buildListOfPairs() {
this.collectionModalType = "list:paired";
this.collectionSelection = Array.from(this.contentSelection.values());
this.useBetaComponents = false;
this.collectionModalShow = true;
},
buildListOfPairsV2() {
this.collectionModalType = "list:paired";
this.collectionSelection = Array.from(this.contentSelection.values());
this.useBetaComponents = true;
this.collectionModalShow = true;
},
buildListOfMixedPaired() {
this.collectionModalType = "list:paired_or_unpaired";
this.collectionSelection = Array.from(this.contentSelection.values());
this.collectionModalShow = true;
},
createdCollection(collection) {
this.$emit("reset-selection");
},
async buildCollectionFromRules() {
const modalResult = await buildRuleCollectionModal(this.contentSelection, this.history.id);
await createDatasetCollection(this.history, modalResult);
// have to hide the source items if that was requested
if (modalResult.hide_source_items) {
this.$emit("hide-selection", this.contentSelection);
}
this.$emit("reset-selection");
},
},
};
</script>
Expand Down

0 comments on commit 7f2b5cb

Please sign in to comment.