diff --git a/.env b/.env new file mode 100644 index 0000000..53d2fa0 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +VITE_API_KEY=I0FJ8VwuqLSVxfW586ICMpgzdT1m7miU \ No newline at end of file diff --git a/lib/components/common/tutorial.tsx b/lib/components/common/tutorial.tsx index ec76c07..28de804 100644 --- a/lib/components/common/tutorial.tsx +++ b/lib/components/common/tutorial.tsx @@ -112,6 +112,7 @@ export const tutorial: TutorialType = { title: 'Most suitable mapping', content: 'Based on previous mappings, the first suggestion is the one that is the most suitable mapping. Browse other suggestions if you don’t think this is the most suitable.', target: '.suggestion-details', + placement: 'bottom' }, { target: '.suggestions__expand-btn', @@ -172,21 +173,21 @@ export const tutorial: TutorialType = { content: 'Dealing with possibly hundreds of column headers, simply search the name of a column header or mapped CDEs here.', target: '.mapping__search-input' }, - { - target: '.mapping__filter-btn', - title: 'Click to open filter options', - content: 'Filter through column headers and only showing those that are relevant to you.', - spotlightClicks: true, - hideFooter: true, - placement: 'bottom-end' - }, - { - content: 'Filter through column headers and only showing those that are relevant to you.', - title: 'Filter', - target: '.mapping__filter-popover', - placement: 'right', - hideBackButton: true - }, + // { + // target: '.mapping__filter-btn', + // title: 'Click to open filter options', + // content: 'Filter through column headers and only showing those that are relevant to you.', + // spotlightClicks: true, + // hideFooter: true, + // placement: 'bottom-end' + // }, + // { + // content: 'Filter through column headers and only showing those that are relevant to you.', + // title: 'Filter', + // target: '.mapping__filter-popover', + // placement: 'right', + // hideBackButton: true + // }, { title: 'Sort by Unmapped or Mapped first', content: diff --git a/lib/components/steps/mapping/CollectionsTab.tsx b/lib/components/steps/mapping/CollectionsTab.tsx index 07af81f..02c68c0 100644 --- a/lib/components/steps/mapping/CollectionsTab.tsx +++ b/lib/components/steps/mapping/CollectionsTab.tsx @@ -60,7 +60,7 @@ function CollectionsTab({ changeToNextTab, setDefaultCollection }: CollectionsPr This can be changed at any time during the process. - + {collectionKeys.map(key => ( void; + handleTourNextStepClick?: () => void; } -export default function MappingSearch({onChange}: MappingSearchProps) { +export default function MappingSearch({onChange, handleTourNextStepClick}: MappingSearchProps) { const [searchString, setSearchString] = useState(''); @@ -20,9 +21,10 @@ export default function MappingSearch({onChange}: MappingSearchProps) { onChange() }; - const handleFiltersClose = () => { - setAnchorEl(null); + const handleFiltersClose = (event: React.MouseEvent) => { + setAnchorEl(event.currentTarget); onChange() + handleTourNextStepClick?.() }; const open = Boolean(anchorEl); const id = open ? 'filter-popover' : undefined; @@ -33,6 +35,7 @@ export default function MappingSearch({onChange}: MappingSearchProps) { fullWidth variant="outlined" placeholder="Search column headers or mapped CDEs..." + className="mapping__search-input" InputProps={{ startAdornment: }} @@ -42,6 +45,7 @@ export default function MappingSearch({onChange}: MappingSearchProps) { ) : tabIndex === TabsEnum.Mapping && (<> - { - const {datasetMapping, headerIndexes, collections, handleUpdateDatasetMappingRow} = useCdeContext(); + const {datasetMapping, headerIndexes, collections, handleUpdateDatasetMappingRow, isTourOpen} = useCdeContext(); const [visibleRows, setVisibleRows] = useState([]); const [selectableCollections, setSelectableCollections] = useState([]); const [searchResultsDictionary, setSearchResultsDictionary] = useState<{ [id: string]: Option }>({}); + const [stepIndex, setStepIndex] = useState(0); + const [togglePreview, setTogglePreview] = useState(false); useEffect(() => { @@ -109,6 +113,11 @@ const MappingTab = ({defaultCollection}: MappingProps) => { setSelectableCollections(initialSelectedCollections); }, [collections, defaultCollection]); + const handleTourNextStepClick = () => { + if(isTourOpen){ + setStepIndex((prevStepIndex) => prevStepIndex + 1) + } + }; const handleCollectionSelect = (selectedCollection: SelectableCollection) => { setSelectableCollections(prevCollections => @@ -218,15 +227,15 @@ const MappingTab = ({defaultCollection}: MappingProps) => { const searchText = "Search in " + (selectableCollections.length === 1 ? `${selectableCollections[0].name} collection` : 'multiple collections'); return ( - <> + - + - + Column headers from dataset @@ -241,10 +250,10 @@ const MappingTab = ({defaultCollection}: MappingProps) => { {Object.keys(datasetMapping).map((variableName, index) => ( - + {getChipComponent(variableName)} - + { - + { - - + + setTogglePreview(false)} + /> + ) } diff --git a/lib/components/steps/suggestions/SuggestionDetailUI.tsx b/lib/components/steps/suggestions/SuggestionDetailUI.tsx index 390fddb..fd0c035 100644 --- a/lib/components/steps/suggestions/SuggestionDetailUI.tsx +++ b/lib/components/steps/suggestions/SuggestionDetailUI.tsx @@ -28,7 +28,7 @@ function SuggestionDetailUI({row, header, headerIndexes}: SuggestionDetailUIProp })); return ( - +