TagSpaces is an offline, open source, document manager with tagging support
fix e2e add Kanban new created column tags in web
sytolk87aec5c39961
diff --git a/release/app/package-lock.json b/release/app/package-lock.jsonindex 9ca3b0b28..180100c61 100644--- a/release/app/package-lock.json+++ b/release/app/package-lock.json@@ -1,12 +1,12 @@{"name": "tagspaces",- "version": "6.5.1",+ "version": "6.5.2","lockfileVersion": 2,"requires": true,"packages": {"": {"name": "tagspaces",- "version": "6.5.1",+ "version": "6.5.2","hasInstallScript": true,"license": "AGPL-3.0","dependencies": {diff --git a/src/renderer/hooks/DirectoryContentContextProvider.tsx b/src/renderer/hooks/DirectoryContentContextProvider.tsxindex b232770cf..28e637e2d 100644--- a/src/renderer/hooks/DirectoryContentContextProvider.tsx+++ b/src/renderer/hooks/DirectoryContentContextProvider.tsx@@ -418,7 +418,11 @@ export const DirectoryContentContextProvider = ({/// RENAME} else if (action.action === 'update') {let index = currentDirectoryEntries.current.findIndex(- (e) => e.path === action.oldEntryPath,+ (e) =>+ cleanTrailingDirSeparator(cleanFrontDirSeparator(e.path)) ===+ cleanTrailingDirSeparator(+ cleanFrontDirSeparator(action.oldEntryPath),+ ),);if (index !== -1) {currentDirectoryEntries.current[index] = {diff --git a/src/renderer/hooks/IOActionsContextProvider.tsx b/src/renderer/hooks/IOActionsContextProvider.tsxindex ce1d9c4dc..56e748115 100644--- a/src/renderer/hooks/IOActionsContextProvider.tsx+++ b/src/renderer/hooks/IOActionsContextProvider.tsx@@ -2298,61 +2298,63 @@ export const IOActionsContextProvider = ({oldDirPath: string,newDirPath: string,): void {- const parentDirectory = extractContainingDirectoryPath(- //extractParentDirectoryPath(- oldDirPath,- currentLocation?.getDirSeparator(),- );- const oldDir = extractDirectoryName(- oldDirPath,- currentLocation?.getDirSeparator(),- );- currentLocation- .loadMetaDataPromise(parentDirectory)- .then((fsEntryMeta) => {- const customOrder: TS.CustomOrder = fsEntryMeta.customOrder- ? fsEntryMeta.customOrder- : {};-- //let dirs: TS.OrderVisibilitySettings[] = [dir];- if (customOrder.folders && customOrder.folders.length > 0) {- const index = customOrder.folders.findIndex(- (col) => col.name === oldDir,- );- if (index !== -1) {- const newDir = extractDirectoryName(- newDirPath,- currentLocation?.getDirSeparator(),+ if (oldDirPath !== newDirPath) {+ const parentDirectory = extractContainingDirectoryPath(+ //extractParentDirectoryPath(+ oldDirPath,+ currentLocation?.getDirSeparator(),+ );+ const oldDir = extractDirectoryName(+ oldDirPath,+ currentLocation?.getDirSeparator(),+ );+ currentLocation+ .loadMetaDataPromise(parentDirectory)+ .then((fsEntryMeta) => {+ const customOrder: TS.CustomOrder = fsEntryMeta.customOrder+ ? fsEntryMeta.customOrder+ : {};++ //let dirs: TS.OrderVisibilitySettings[] = [dir];+ if (customOrder.folders && customOrder.folders.length > 0) {+ const index = customOrder.folders.findIndex(+ (col) => col.name === oldDir,);- customOrder.folders[index] = {- ...customOrder.folders[index],- name: newDir,- };- const updatedFsEntryMeta = {- ...fsEntryMeta,- customOrder: { ...customOrder, folders: customOrder.folders },- };+ if (index !== -1) {+ const newDir = extractDirectoryName(+ newDirPath,+ currentLocation?.getDirSeparator(),+ );+ customOrder.folders[index] = {+ ...customOrder.folders[index],+ name: newDir,+ };+ const updatedFsEntryMeta = {+ ...fsEntryMeta,+ customOrder: { ...customOrder, folders: customOrder.folders },+ };- saveCurrentLocationMetaData(parentDirectory, updatedFsEntryMeta)- .then(() => {- const folders = updatedFsEntryMeta.customOrder?.folders;- if (folders) {- setCurrentDirectoryDirs(folders);- }- const action: TS.PerspectiveActions = { action: 'reload' };- setActions(action);- })- .catch((err) => {- console.log(- 'Error adding dirs for ' + parentDirectory + ' with ' + err,- );- });+ saveCurrentLocationMetaData(parentDirectory, updatedFsEntryMeta)+ .then(() => {+ const folders = updatedFsEntryMeta.customOrder?.folders;+ if (folders) {+ setCurrentDirectoryDirs(folders);+ }+ const action: TS.PerspectiveActions = { action: 'reload' };+ setActions(action);+ })+ .catch((err) => {+ console.log(+ 'Error adding dirs for ' + parentDirectory + ' with ' + err,+ );+ });+ }}- }- })- .catch((ex) => {- console.log(ex);- });+ })+ .catch((ex) => {+ console.log(ex);+ });+ }}function getDirectoryOrder(diff --git a/src/renderer/utils/CommonLocation.ts b/src/renderer/utils/CommonLocation.tsindex b86cdbca9..7567a1952 100644--- a/src/renderer/utils/CommonLocation.ts+++ b/src/renderer/utils/CommonLocation.ts@@ -494,16 +494,22 @@ export class CommonLocation implements TS.Location {AppConfig.tagDelimiter,this.getDirSeparator(),);+ let entryPath = path;+ if (!isFile && !path.endsWith(this.getDirSeparator())) {+ entryPath = path + this.getDirSeparator();+ }return {uuid: getUuid(),name,isFile,locationID: this.uuid,- extension: extractFileExtension(path, this.getDirSeparator()),+ ...(isFile && {+ extension: extractFileExtension(path, this.getDirSeparator()),+ }),tags,size: 0,lmdt: new Date().getTime(),- path,+ path: entryPath,};};diff --git a/tests/e2e/perspective-kanban.pw.e2e.js b/tests/e2e/perspective-kanban.pw.e2e.jsindex 26a1256e8..9fc740929 100644--- a/tests/e2e/perspective-kanban.pw.e2e.js+++ b/tests/e2e/perspective-kanban.pw.e2e.js@@ -76,6 +76,11 @@ test.beforeEach(async ({ isMinio, isS3, testDataDir }) => {true,5000,);+ await expectElementExist(+ '[data-tid=empty_folderKanBanColumnTID]',+ true,+ 8000,+ );});test.describe('TST49 - Perspective KanBan', () => {@@ -210,6 +215,11 @@ test.describe('TST49 - Perspective KanBan', () => {await createColumn(columnName);await clickOn('[data-tid=' + columnName + 'KanBanColumnActionTID]');await clickOn('[data-tid=showProperties]');+ await expectElementExist(+ '[data-tid=OpenedTID' + dataTidFormat(columnName) + ']',+ true,+ 8000,+ );await AddRemovePropertiesTags(['test-tag1', 'test-tag2'], {add: true,remove: false,