TagSpaces is an offline, open source, document manager with tagging support
e2e-fix
sytolk64b3398bfd17
diff --git a/app/components/DirectoryTreeView.tsx b/app/components/DirectoryTreeView.tsxindex 96b6330e6..0d4289913 100644--- a/app/components/DirectoryTreeView.tsx+++ b/app/components/DirectoryTreeView.tsx@@ -53,7 +53,7 @@ const DirectoryTreeView = forwardRef(const [data, setData] = useState(undefined);const [isExpanded, setExpanded] = useState(false);const showUnixHiddenEntries = useSelector(getShowUnixHiddenEntries);- const dispatch: AppDispatch = useDispatch();+ //const dispatch: AppDispatch = useDispatch();useImperativeHandle(ref, () => ({changeLocation(location: TS.Location) {diff --git a/app/components/LocationManager.tsx b/app/components/LocationManager.tsxindex acbb6acfa..28bd178b5 100644--- a/app/components/LocationManager.tsx+++ b/app/components/LocationManager.tsx@@ -32,6 +32,7 @@ import PlatformIO from '-/services/platform-facade';import { classes, SidePanel } from '-/components/SidePanels.css';import { useTranslation } from 'react-i18next';import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';+import LocationContextMenu from '-/components/menus/LocationContextMenu';const CreateEditLocationDialog = React.lazy(() =>import(@@ -65,7 +66,8 @@ function LocationManager(props: Props) {const {addLocations,editLocation,- selectedLocation+ selectedLocation,+ locationDirectoryContextMenuAnchorEl} = useCurrentLocationContext();const locations: Array<TS.Location> = useSelector(getLocations);// const loading: boolean = useSelector(isLoading);@@ -161,6 +163,12 @@ function LocationManager(props: Props) {}toggleOpenLinkDialog={() => dispatch(AppActions.toggleOpenLinkDialog())}/>+ {locationDirectoryContextMenuAnchorEl && (+ <LocationContextMenu+ setEditLocationDialogOpened={setEditLocationDialogOpened}+ setDeleteLocationDialogOpened={setDeleteLocationDialogOpened}+ />+ )}<ListclassName={classes.locationListArea}data-tid="locationList"diff --git a/app/components/LocationView.tsx b/app/components/LocationView.tsxindex 7a1383b43..860693309 100644--- a/app/components/LocationView.tsx+++ b/app/components/LocationView.tsx@@ -62,7 +62,6 @@ function LocationView(props: Props) {currentLocation,readOnlyMode,setSelectedLocation,- locationDirectoryContextMenuAnchorEl,setLocationDirectoryContextMenuAnchorEl} = useCurrentLocationContext();const { setSelectedEntries } = useSelectedEntriesContext();@@ -73,10 +72,6 @@ function LocationView(props: Props) {} = useDirectoryContentContext();const { showNotification } = useNotificationContext();const directoryTreeRef = useRef<DirectoryTreeViewRef>(null);- /* const [- locationDirectoryContextMenuAnchorEl,- setLocationDirectoryContextMenuAnchorEl- ] = useState<null | HTMLElement>(null);*/const dispatch: AppDispatch = useDispatch();@@ -112,9 +107,9 @@ function LocationView(props: Props) {}};- const closeLocationTree = () => {+ /*const closeLocationTree = () => {directoryTreeRef.current.closeLocation();- };+ };*/const handleLocationContextMenuClick = (event: any, chosenLocation) => {event.preventDefault();@@ -235,13 +230,13 @@ function LocationView(props: Props) {return (/* <div key={location.uuid}> */<SidePanel>- {locationDirectoryContextMenuAnchorEl && (+ {/*{locationDirectoryContextMenuAnchorEl && (<LocationContextMenusetEditLocationDialogOpened={setEditLocationDialogOpened}setDeleteLocationDialogOpened={setDeleteLocationDialogOpened}closeLocationTree={closeLocationTree}/>- )}+ )}*/}<ListItemdata-tid={'location_' + location.name.replace(/ /g, '_')}className={diff --git a/app/components/menus/LocationContextMenu.tsx b/app/components/menus/LocationContextMenu.tsxindex 22ba7e2ad..29b4b1440 100644--- a/app/components/menus/LocationContextMenu.tsx+++ b/app/components/menus/LocationContextMenu.tsx@@ -45,14 +45,14 @@ import { useLocationIndexContext } from '-/hooks/useLocationIndexContext';interface Props {setEditLocationDialogOpened: (open: boolean) => void;setDeleteLocationDialogOpened: (open: boolean) => void;- closeLocationTree: () => void;+ //closeLocationTree: () => void;}function LocationContextMenu(props: Props) {const {setEditLocationDialogOpened,- setDeleteLocationDialogOpened,- closeLocationTree+ setDeleteLocationDialogOpened+ //closeLocationTree} = props;const { t } = useTranslation();@@ -128,7 +128,7 @@ function LocationContextMenu(props: Props) {setLocationDirectoryContextMenuAnchorEl(null);if (selectedLocation && selectedLocation.uuid) {closeLocation(selectedLocation.uuid);- closeLocationTree();+ //closeLocationTree();}};diff --git a/app/hooks/IOActionsContextProvider.tsx b/app/hooks/IOActionsContextProvider.tsxindex 257c70dd4..c7a6f7088 100644--- a/app/hooks/IOActionsContextProvider.tsx+++ b/app/hooks/IOActionsContextProvider.tsx@@ -314,6 +314,7 @@ export const IOActionsContextProvider = ({if (reflect) {// close file opener if this file is openedreflectDeleteFile(filePath);+ removeDirectoryEntries([filePath]);dispatch(AppActions.reflectDeleteEntry(filePath));}// change index@@ -385,6 +386,7 @@ export const IOActionsContextProvider = ({onProgress).then(() => {+ removeDirectoryEntries([path]);console.log('Moving dir from ' + path + ' to ' + targetPath);reflectDeleteEntry(path);dispatch(AppActions.reflectDeleteEntry(path));@@ -411,6 +413,7 @@ export const IOActionsContextProvider = ({]);return renameFilesPromise(moveJobs, onProgress).then(() => {+ removeDirectoryEntries(paths);showNotification(t('core:filesMovedSuccessful'));// moved files should be added to the index, if the target dir in indexreflectDeleteEntries(paths);diff --git a/app/perspectives/common/main-container.tsx b/app/perspectives/common/main-container.tsxindex ae215fc77..e99cea2bb 100644--- a/app/perspectives/common/main-container.tsx+++ b/app/perspectives/common/main-container.tsx@@ -134,7 +134,7 @@ export const renderCell = (openEntry(fsEntry.path);} else {console.log('Handle Grid cell db click, selected path : ', fsEntry.path);- openDirectory(fsEntry.path, true);+ openDirectory(fsEntry.path);}};diff --git a/tests/e2e/fileopener.pw.e2e.js b/tests/e2e/fileopener.pw.e2e.jsindex 7ec45286b..0c7b863df 100644--- a/tests/e2e/fileopener.pw.e2e.js+++ b/tests/e2e/fileopener.pw.e2e.js@@ -195,23 +195,26 @@ test.describe('TST08 - File folder properties', () => {test.skip('TST0806 - Download file [manual]', async () => {});test('TST0808 - Add and remove tags to a file (file names) [web,minio,electron]', async () => {- // await searchEngine('bmp');// open fileProperties- await clickOn(selectorFile);- //Toggle Properties- //await clickOn('[data-tid=fileContainerToggleProperties]');- await clickOn('[data-tid=detailsTabTID]');+ const fileName = 'sample.svg';+ await openContextEntryMenu(+ getGridFileSelector(fileName),+ 'showPropertiesTID'+ );+ /*await clickOn(selectorFile);+ await clickOn('[data-tid=detailsTabTID]');*/await AddRemovePropertiesTags(['test-tag1', 'test-tag2']);});test('TST0809 - Add and remove tag to a file (sidecar files) [web,minio,electron]', async () => {// global.client.setDefaultTimeout(300000);await setSettings('[data-tid=settingsSetPersistTagsInSidecarFile]', true);- // await searchEngine('bmp');// open fileProperties- await clickOn(selectorFile);- //Toggle Properties- await clickOn('[data-tid=detailsTabTID]');+ const fileName = 'sample.bmp';+ await openContextEntryMenu(+ getGridFileSelector(fileName),+ 'showPropertiesTID'+ );await AddRemovePropertiesTags(['test-tag1', 'test-tag2']);await setSettings('[data-tid=settingsSetPersistTagsInSidecarFile]', true);});diff --git a/tests/e2e/perspective-grid-right-button.pw.e2e.js b/tests/e2e/perspective-grid-right-button.pw.e2e.jsindex e0304948f..89073c0d5 100644--- a/tests/e2e/perspective-grid-right-button.pw.e2e.js+++ b/tests/e2e/perspective-grid-right-button.pw.e2e.js@@ -366,7 +366,7 @@ test.describe('TST50** - Right button on a file', () => {// Copy file in parent directoryawait openContextEntryMenu(fileSelector, 'fileMenuMoveCopyFile');// await setInputKeys('targetPathInput', defaultLocationPath);- await clickOn('[data-tid=propsActionsMenuTID]');+ //await clickOn('[data-tid=propsActionsMenuTID]');await clickOn('[data-tid=navigateToParentTID]');await clickOn('[data-tid=confirmCopyFiles]');await clickOn('[data-tid=uploadCloseAndClearTID]');