From 64060f2b9040a9dbb09a91845fa06dc0a0eb7ffa Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 4 Dec 2024 16:08:52 -0500 Subject: [PATCH] ListPairsUsability - if auto-pairing seems to work just show a clean summary. --- .../PairedListCollectionCreator.vue | 438 +++++++++--------- .../Collections/PairedListSummary.vue | 140 ++++++ .../Collections/common/CollectionCreator.vue | 5 +- 3 files changed, 358 insertions(+), 225 deletions(-) create mode 100644 client/src/components/Collections/PairedListSummary.vue diff --git a/client/src/components/Collections/PairedListCollectionCreator.vue b/client/src/components/Collections/PairedListCollectionCreator.vue index 8fe179718645..1a3efe483d8e 100644 --- a/client/src/components/Collections/PairedListCollectionCreator.vue +++ b/client/src/components/Collections/PairedListCollectionCreator.vue @@ -24,6 +24,7 @@ import type { DatasetPair } from "../History/adapters/buildCollectionModal"; import Heading from "../Common/Heading.vue"; import PairedElementView from "./PairedElementView.vue"; +import PairedListSummary from "./PairedListSummary.vue"; import UnpairedDatasetElementView from "./UnpairedDatasetElementView.vue"; import CollectionCreator from "@/components/Collections/common/CollectionCreator.vue"; @@ -74,6 +75,7 @@ const twoPassAutoPairing = ref(true); const removeExtensions = ref(true); const firstAutoPairDone = ref(false); const showPairingSection = ref(true); +const showSummary = ref(false); // Elements const workingElements = ref([]); @@ -226,8 +228,11 @@ function _elementsSetUp() { _validateElements(); _sortInitialList(); // attempt to autopair - if (props.fromSelection) { - autoPair(); + autoPair(); + if (generatedPairs.value.length > 0) { + showSummary.value = true; + } else { + showSummary.value = false; } } @@ -822,6 +827,16 @@ function _naiveStartingAndEndingLCS(s1: string, s2: string) { } return fwdLCS + revLCS; } + +function correctPairing() { + showSummary.value = false; + showPairingSection.value = true; +} + +function correctIdentifiers() { + showSummary.value = false; + showPairingSection.value = false; +} diff --git a/client/src/components/Collections/PairedListSummary.vue b/client/src/components/Collections/PairedListSummary.vue new file mode 100644 index 000000000000..eb883a082feb --- /dev/null +++ b/client/src/components/Collections/PairedListSummary.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/client/src/components/Collections/common/CollectionCreator.vue b/client/src/components/Collections/common/CollectionCreator.vue index 7e2401d0bd7b..3170a6b78d10 100644 --- a/client/src/components/Collections/common/CollectionCreator.vue +++ b/client/src/components/Collections/common/CollectionCreator.vue @@ -39,12 +39,15 @@ interface Props { extensions?: string[]; extensionsToggle?: boolean; noItems?: boolean; + collectionType?: string; + showHelp?: boolean; } const props = withDefaults(defineProps(), { suggestedName: "", extensions: undefined, extensionsToggle: false, + showHelp: true, }); const emit = defineEmits<{ @@ -146,7 +149,7 @@ watch(
-
+