diff --git a/.eslintrc.json b/.eslintrc.json index 08d0081f6c..f29a816de7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -110,7 +110,8 @@ "@typescript-eslint/prefer-function-type": "error", "@typescript-eslint/triple-slash-reference": "error", "@typescript-eslint/unified-signatures": "error", - "@typescript-eslint/no-unused-vars": "warn", + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": "error", "@typescript-eslint/consistent-type-definitions": "error", "@typescript-eslint/dot-notation": "off", "@typescript-eslint/member-ordering": "off", diff --git a/docs/tutorials/custom-viewer.md b/docs/tutorials/custom-viewer.md index fffe97fcc3..f2296c86ae 100644 --- a/docs/tutorials/custom-viewer.md +++ b/docs/tutorials/custom-viewer.md @@ -59,7 +59,7 @@ export class YourExtensionViewerComponent implements ViewerExtensionInterface { node: Node; - ....YOUR CUSTOM LOGIC + // ....YOUR CUSTOM LOGIC } ``` diff --git a/e2e/playwright/shared/page-objects/components/base.component.ts b/e2e/playwright/shared/page-objects/components/base.component.ts index 6623ab191d..3e62d41398 100644 --- a/e2e/playwright/shared/page-objects/components/base.component.ts +++ b/e2e/playwright/shared/page-objects/components/base.component.ts @@ -26,10 +26,10 @@ import { Locator, Page } from '@playwright/test'; import { PlaywrightBase } from '../playwright-base'; export abstract class BaseComponent extends PlaywrightBase { - private rootElement: string; + private readonly rootElement: string; private overlayElement = this.page.locator('.cdk-overlay-backdrop-showing'); - constructor(page: Page, rootElement: string) { + protected constructor(page: Page, rootElement: string) { super(page); this.rootElement = rootElement; } diff --git a/e2e/playwright/shared/page-objects/pages/base.page.ts b/e2e/playwright/shared/page-objects/pages/base.page.ts index b7e47c77ce..e4812d171f 100644 --- a/e2e/playwright/shared/page-objects/pages/base.page.ts +++ b/e2e/playwright/shared/page-objects/pages/base.page.ts @@ -33,12 +33,12 @@ export interface NavigateOptions { remoteUrl?: string; } export abstract class BasePage extends PlaywrightBase { - private pageUrl: string; - private urlRequest: RegExp; + private readonly pageUrl: string; + private readonly urlRequest: RegExp; public snackBar: SnackBarComponent; public spinner: SpinnerComponent; - constructor(page: Page, pageUrl: string, urlRequest?: RegExp) { + protected constructor(page: Page, pageUrl: string, urlRequest?: RegExp) { super(page); this.pageUrl = pageUrl; this.urlRequest = urlRequest; diff --git a/e2e/playwright/shared/page-objects/playwright-base.ts b/e2e/playwright/shared/page-objects/playwright-base.ts index 18e386f9f9..5c4143dd9f 100644 --- a/e2e/playwright/shared/page-objects/playwright-base.ts +++ b/e2e/playwright/shared/page-objects/playwright-base.ts @@ -29,7 +29,7 @@ export abstract class PlaywrightBase { public page: Page; public logger: LoggerLike; - constructor(page: Page) { + protected constructor(page: Page) { this.page = page; this.logger = new GenericLogger(process.env.PLAYWRIGHT_CUSTOM_LOG_LEVEL); } diff --git a/e2e/suites/actions-available/files-folders/locked-files-actions.test.ts b/e2e/suites/actions-available/files-folders/locked-files-actions.test.ts index 5a7717263d..f73efad717 100755 --- a/e2e/suites/actions-available/files-folders/locked-files-actions.test.ts +++ b/e2e/suites/actions-available/files-folders/locked-files-actions.test.ts @@ -50,7 +50,7 @@ describe('Locked Files - available actions : ', () => { beforeAll(async () => { await adminApiActions.createUser({ username }); - userActions.login(username, username); + await userActions.login(username, username); parentId = await userApi.createFolder(parentName); diff --git a/e2e/suites/actions/edit/edit-offline.test.ts b/e2e/suites/actions/edit/edit-offline.test.ts index 0a749a27e3..ce69bc5838 100755 --- a/e2e/suites/actions/edit/edit-offline.test.ts +++ b/e2e/suites/actions/edit/edit-offline.test.ts @@ -45,7 +45,7 @@ describe('Edit offline', () => { beforeAll(async () => { await adminApiActions.createUser({ username }); - userActions.login(username, username); + await userActions.login(username, username); }); describe('on Personal Files', () => { @@ -76,7 +76,7 @@ describe('Edit offline', () => { }); afterAll(async () => { - userActions.login(username, username); + await userActions.login(username, username); await userActions.deleteNodes([parentPFId]); }); diff --git a/e2e/suites/actions/upload-download/upload-file.test.ts b/e2e/suites/actions/upload-download/upload-file.test.ts index 527b1feca7..e8b7a6b4b7 100755 --- a/e2e/suites/actions/upload-download/upload-file.test.ts +++ b/e2e/suites/actions/upload-download/upload-file.test.ts @@ -71,15 +71,15 @@ describe('Upload files', () => { it('[T14752064] Close the upload dialog ', async () => { await page.uploadFilesDialog.closeUploadButton.click(); await page.uploadFilesDialog.uploadDialog.isPresent(); - await expect(await page.uploadFilesDialog.uploadDialog.isVisible()).toBe(false); + expect(await page.uploadFilesDialog.uploadDialog.isVisible()).toBe(false); }); it('[T14752051] Minimize / maximize the upload dialog ', async () => { await page.uploadFilesDialog.minimizeButton.click(); - await expect(await page.uploadFilesDialog.uploadedFiles.waitNotVisible()).toBe(true); + expect(await page.uploadFilesDialog.uploadedFiles.waitNotVisible()).toBe(true); await page.uploadFilesDialog.maximizeButton.click(); - await expect(await page.uploadFilesDialog.uploadedFiles.waitVisible()).toBe(true); + expect(await page.uploadFilesDialog.uploadedFiles.waitVisible()).toBe(true); }); it('[T14752053] Upload history is expunged on browser login/logout ', async () => { @@ -87,12 +87,12 @@ describe('Upload files', () => { await loginPage.loginWith(username); const isUploadDialogVisible = await page.uploadFilesDialog.uploadDialog.isVisible(); - await expect(isUploadDialogVisible).toBe(false); + expect(isUploadDialogVisible).toBe(false); }); it('[T14752052] Upload dialog remains fixed in the browser when user performs other actions in parallel ', async () => { - await expect(page.uploadFilesDialog.uploadDialog.isVisible()).toBe(true); + expect(page.uploadFilesDialog.uploadDialog.isVisible()).toBe(true); await page.clickPersonalFiles(); - await expect(page.uploadFilesDialog.uploadDialog.isVisible()).toBe(true); + expect(page.uploadFilesDialog.uploadDialog.isVisible()).toBe(true); }); }); diff --git a/e2e/suites/actions/upload-download/upload-new-version.test.ts b/e2e/suites/actions/upload-download/upload-new-version.test.ts index eb6639b7f7..f4a216eedf 100755 --- a/e2e/suites/actions/upload-download/upload-new-version.test.ts +++ b/e2e/suites/actions/upload-download/upload-new-version.test.ts @@ -101,7 +101,7 @@ describe('Upload new version', () => { beforeAll(async () => { await adminActions.createUser({ username }); - userActions.login(username, username); + await userActions.login(username, username); parentPFId = await apis.user.createFolder(parentPF); parentSFId = await apis.user.createFolder(parentSF); @@ -111,7 +111,7 @@ describe('Upload new version', () => { }); afterAll(async () => { - userActions.login(username, username); + await userActions.login(username, username); await userActions.deleteNodes([parentPFId, parentSFId, parentRFId, parentFavId, parentSearchId]); }); @@ -126,7 +126,7 @@ describe('Upload new version', () => { fileLockedSearch1Id = await apis.user.createFile(fileLockedSearch1, parentSearchId); fileLockedSearch2Id = await apis.user.createFile(fileLockedSearch2, parentSearchId); - userActions.lockNodes([fileLockedSearch1Id, fileLockedSearch2Id]); + await userActions.lockNodes([fileLockedSearch1Id, fileLockedSearch2Id]); await apis.user.search.waitForNodes(searchRandom, { expect: 6 }); diff --git a/e2e/suites/application/general.test.ts b/e2e/suites/application/general.test.ts index ec6cd461cd..f2f49f4e17 100644 --- a/e2e/suites/application/general.test.ts +++ b/e2e/suites/application/general.test.ts @@ -38,7 +38,7 @@ describe('General', () => { describe('on session expire', () => { beforeAll(async () => { - adminActions.login(); + await adminActions.login(); folderId = (await adminActions.nodes.createFolder(folder)).entry.id; }); diff --git a/e2e/suites/info-drawer/file-folder-properties.test.ts b/e2e/suites/info-drawer/file-folder-properties.test.ts index 2afbb48481..0efdde86df 100755 --- a/e2e/suites/info-drawer/file-folder-properties.test.ts +++ b/e2e/suites/info-drawer/file-folder-properties.test.ts @@ -253,7 +253,7 @@ describe('File / Folder properties', () => { await BrowserActions.click(page.toolbar.viewDetailsButton); await infoDrawer.waitForInfoDrawerToOpen(); await infoDrawer.expandDetailsButton.click(); - await expect(await infoDrawer.expandedDetailsPermissionsTab.isPresent()).toBe(true, 'Permissions tab is not displayed'); + expect(await infoDrawer.expandedDetailsPermissionsTab.isPresent()).toBe(true, 'Permissions tab is not displayed'); await page.clickPersonalFilesAndWait(); await dataTable.selectItem(parent); @@ -262,7 +262,7 @@ describe('File / Folder properties', () => { const expectedSelectedTabTitle = 'permissions'; const actualSelectedTabTitle = await infoDrawer.selectedTab.getText(); - await expect(actualSelectedTabTitle.toLowerCase()).toEqual(expectedSelectedTabTitle); + expect(actualSelectedTabTitle.toLowerCase()).toEqual(expectedSelectedTabTitle); }); }); }); diff --git a/e2e/suites/list-views/favorites.test.ts b/e2e/suites/list-views/favorites.test.ts index f4ab0ba545..649dd7c703 100755 --- a/e2e/suites/list-views/favorites.test.ts +++ b/e2e/suites/list-views/favorites.test.ts @@ -96,10 +96,10 @@ describe('Favorites', () => { }); it('[C213226] displays the favorite files and folders', async () => { - await expect(await dataTable.getRowsCount()).toEqual(4, 'Incorrect number of items displayed'); - await expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`); - await expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`); - await expect(await dataTable.isItemPresent(favFolderName)).toBe(true, `${favFolderName} not displayed`); + expect(await dataTable.getRowsCount()).toEqual(4, 'Incorrect number of items displayed'); + expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`); + expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`); + expect(await dataTable.isItemPresent(favFolderName)).toBe(true, `${favFolderName} not displayed`); }); it(`[C213228] deleted favorite file does not appear`, async () => { @@ -124,12 +124,12 @@ describe('Favorites', () => { it('[C213650] Location column redirect - item in user Home', async () => { await dataTable.clickItemLocation(favFolderName); - await expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']); + expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']); }); it('[C280484] Location column redirect - file in folder', async () => { await dataTable.clickItemLocation(fileName2); - await expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', parentFolder]); + expect(await breadcrumb.getAllItems()).toEqual(['Personal Files', parentFolder]); }); it('[C280485] Location column redirect - file in site', async () => { diff --git a/e2e/suites/list-views/file-libraries.test.ts b/e2e/suites/list-views/file-libraries.test.ts index aa35eddefb..efbeed8183 100755 --- a/e2e/suites/list-views/file-libraries.test.ts +++ b/e2e/suites/list-views/file-libraries.test.ts @@ -124,7 +124,7 @@ describe('File Libraries', () => { const sitesList = await dataTable.getSitesNameAndVisibility(); for (const site of Object.keys(expectedSitesVisibility)) { - await expect(sitesList[site]).toEqual(expectedSitesVisibility[site]); + expect(sitesList[site]).toEqual(expectedSitesVisibility[site]); } }); @@ -139,14 +139,14 @@ describe('File Libraries', () => { const sitesList = await dataTable.getSitesNameAndRole(); for (const site of Object.keys(expectedSitesRoles)) { - await expect(sitesList[site]).toEqual(expectedSitesRoles[site]); + expect(sitesList[site]).toEqual(expectedSitesRoles[site]); } }); it('[C217098] Site ID is displayed when two sites have the same name', async () => { const expectedSites = [`${siteName} (${siteId1})`, `${siteName} (${siteId2})`]; const actualSites = await dataTable.getCellsContainingName(siteName); - await expect(actualSites.sort()).toEqual(expectedSites.sort()); + expect(actualSites.sort()).toEqual(expectedSites.sort()); }); it('[C217096] Tooltip for sites without description', async () => { diff --git a/e2e/suites/list-views/personal-files.test.ts b/e2e/suites/list-views/personal-files.test.ts index aeef9951a7..03d2e83852 100755 --- a/e2e/suites/list-views/personal-files.test.ts +++ b/e2e/suites/list-views/personal-files.test.ts @@ -85,11 +85,11 @@ describe('Personal Files', () => { }); it('[C217143] has default sorted column', async () => { - await expect(await dataTable.getSortedColumnHeaderText()).toBe('Name'); + expect(await dataTable.getSortedColumnHeaderText()).toBe('Name'); }); it('[C213242] has user created content', async () => { - await expect(await dataTable.isItemPresent(userFolder)).toBe(true, 'user folder not displayed'); + expect(await dataTable.isItemPresent(userFolder)).toBe(true, 'user folder not displayed'); }); it('[C213244] navigates to folder', async () => { diff --git a/e2e/suites/list-views/recent-files.test.ts b/e2e/suites/list-views/recent-files.test.ts index 654cb3d1a5..5a9231878f 100755 --- a/e2e/suites/list-views/recent-files.test.ts +++ b/e2e/suites/list-views/recent-files.test.ts @@ -119,7 +119,7 @@ describe('Recent Files', () => { it('[C213176] Location column redirect - file in user Home', async () => { await dataTable.clickItemLocation(fileName2); - await expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']); + expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']); }); it('[C280486] Location column redirect - file in folder', async () => { diff --git a/e2e/suites/list-views/shared-files.test.ts b/e2e/suites/list-views/shared-files.test.ts index 561277fd1d..27b93a4aa7 100755 --- a/e2e/suites/list-views/shared-files.test.ts +++ b/e2e/suites/list-views/shared-files.test.ts @@ -121,7 +121,7 @@ describe('Shared Files', () => { it('[C213666] Location column redirect - file in user Home', async () => { await dataTable.clickItemLocation(file4User); - await expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']); + expect(await breadcrumb.getAllItems()).toEqual(['Personal Files']); }); it('[C280490] Location column redirect - file in folder', async () => { diff --git a/e2e/suites/list-views/sort-list.test.ts b/e2e/suites/list-views/sort-list.test.ts index ae13696d0e..5afb145178 100644 --- a/e2e/suites/list-views/sort-list.test.ts +++ b/e2e/suites/list-views/sort-list.test.ts @@ -122,7 +122,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(expectedSortData).not.toEqual(initialSortState, 'Initial sort did not work'); + expect(expectedSortData).not.toEqual(initialSortState); await browsingPage.clickFavorites(); await browsingPage.clickPersonalFilesAndWait(); @@ -133,7 +133,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(actualSortData).toEqual(expectedSortData, 'Order is different - sorting was not retained'); + expect(actualSortData).toEqual(expectedSortData); }); it('[C261137] Size sort order is retained when user logs out and logs back in', async () => { @@ -147,7 +147,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(expectedSortData).not.toEqual(initialSortState, 'Initial sort did not work'); + expect(expectedSortData).not.toEqual(initialSortState); await browsingPage.signOut(); await loginPage.loginWith(user1); @@ -158,7 +158,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(actualSortData).toEqual(expectedSortData, 'Order is different - sorting was not retained'); + expect(actualSortData).toEqual(expectedSortData); }); describe('Folder actions', () => { @@ -196,7 +196,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(actualSortData).toEqual(expectedSortData, 'Order is different - sorting was not retained'); + expect(actualSortData).toEqual(expectedSortData); }); it('[C261139] Sort order is retained when moving a file', async () => { @@ -218,7 +218,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(actualSortData).toEqual(expectedSortData, 'Order is different - sorting was not retained'); + expect(actualSortData).toEqual(expectedSortData); }); }); @@ -243,7 +243,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(actualSortData).toEqual(expectedSortData, 'Order is different - sorting was not retained'); + expect(actualSortData).toEqual(expectedSortData); }); it('[C261153] Sort order should be remembered separately on each list view', async () => { @@ -268,7 +268,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(favouritesSortData).not.toEqual(personalFilesSortData, 'Order is the same - sorting was retained'); + expect(favouritesSortData).not.toEqual(personalFilesSortData); await browsingPage.clickPersonalFilesAndWait(); @@ -278,7 +278,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(personalFilesSortDataAfterFavSort).toEqual(personalFilesSortData, 'Order is different - sorting was not retained'); + expect(personalFilesSortDataAfterFavSort).toEqual(personalFilesSortData); }); it('[C261147] Sort order is retained when user changes the page from pagination', async () => { @@ -300,7 +300,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(currentPersonalFilesSortDataPage2).toEqual(expectedPersonalFilesSortDataPage2, 'Order is different- sorting was not retained'); + expect(currentPersonalFilesSortDataPage2).toEqual(expectedPersonalFilesSortDataPage2); await dataTable.sortBy('Name', 'desc'); await dataTable.waitForFirstElementToChange(currentPersonalFilesSortDataPage2.firstElement); @@ -318,7 +318,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(expectedPersonalFilesSortDataPage2).toEqual(currentPersonalFilesSortDataPage2, 'Order is different - sorting was not retained'); + expect(expectedPersonalFilesSortDataPage2).toEqual(currentPersonalFilesSortDataPage2); }); it('[C261150] Sort order is not retained between different users', async () => { @@ -341,7 +341,7 @@ describe('Remember sorting', () => { firstElement: await documentListPage.dataTable.getFirstElementDetail('Name') }; - await expect(actualSortData).not.toEqual(expectedSortData, 'Order is the same - sorting was retained'); + expect(actualSortData).not.toEqual(expectedSortData); await browsingPage.signOut(); }); diff --git a/projects/aca-content/assets/i18n/ar.json b/projects/aca-content/assets/i18n/ar.json index efe432d431..cfb3089078 100644 --- a/projects/aca-content/assets/i18n/ar.json +++ b/projects/aca-content/assets/i18n/ar.json @@ -476,16 +476,6 @@ "CANCEL": "إلغاء", "UPLOAD": "تحميل" }, - "FORM": { - "SUBTITLE": "ما مستوى التغييرات التي تم إجراؤها على هذا الإصدار؟", - "VERSION": { - "MINOR": "ثانوية (#.1)", - "MAJOR": "رئيسية (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "أضف ملاحظات تصف ما تم تغييره" - } - }, "SELECTION": { "EMPTY": "يرجى اختيار مستند للاطلاع على إصداراته.", "NO_PERMISSION": "ليس لديك إذن لإدارة إصدارات هذا المحتوى." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "التفاصيل" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "ملف مؤمن" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/cs.json b/projects/aca-content/assets/i18n/cs.json index a3c7314caa..ddd73e97e6 100644 --- a/projects/aca-content/assets/i18n/cs.json +++ b/projects/aca-content/assets/i18n/cs.json @@ -476,16 +476,6 @@ "CANCEL": "Zrušit", "UPLOAD": "Odeslat" }, - "FORM": { - "SUBTITLE": "Jaká úroveň změn proběhla v této verzi?", - "VERSION": { - "MINOR": "Menší (x.1)", - "MAJOR": "Hlavní (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Přidejte poznámky popisující dané změny" - } - }, "SELECTION": { "EMPTY": "Zvolte dokument, u kterého chcete vidět jeho verze.", "NO_PERMISSION": "Nemáte potřebná oprávnění pro správu verzí tohoto obsahu." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Podrobnosti" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "uzamčený soubor" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/da.json b/projects/aca-content/assets/i18n/da.json index b7a9179468..141b78154e 100644 --- a/projects/aca-content/assets/i18n/da.json +++ b/projects/aca-content/assets/i18n/da.json @@ -476,16 +476,6 @@ "CANCEL": "Annuller", "UPLOAD": "Upload" }, - "FORM": { - "SUBTITLE": "Hvilket niveau af ændringer er foretaget i denne version?", - "VERSION": { - "MINOR": "Mindre (#.1)", - "MAJOR": "Større (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Tilføj noter, der beskriver ændringerne" - } - }, "SELECTION": { "EMPTY": "Vælg et dokument for at se versionerne af dokumentet.", "NO_PERMISSION": "Du har ikke tilladelse til at administrere versionerne af dette indhold." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Detaljer" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "låst fil" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/de.json b/projects/aca-content/assets/i18n/de.json index 7b386ac6f1..dbeeda78e8 100644 --- a/projects/aca-content/assets/i18n/de.json +++ b/projects/aca-content/assets/i18n/de.json @@ -476,16 +476,6 @@ "CANCEL": "Abbrechen", "UPLOAD": "Hochladen" }, - "FORM": { - "SUBTITLE": "Welches Ausmaß haben die an dieser Version vorgenommenen Änderungen?", - "VERSION": { - "MINOR": "Nebenversion (x.1)", - "MAJOR": "Hauptversion (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Fügen Sie eine Beschreibung der Änderungen hinzu" - } - }, "SELECTION": { "EMPTY": "Wählen Sie ein Dokument aus, um die Versionen davon anzuzeigen.", "NO_PERMISSION": "Sie verfügen nicht über die nötigen Benutzerrechte, um Versionen dieser Inhalte anzuzeigen." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Details" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "gesperrte Datei" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/en.json b/projects/aca-content/assets/i18n/en.json index 37c712c972..074c8b0709 100644 --- a/projects/aca-content/assets/i18n/en.json +++ b/projects/aca-content/assets/i18n/en.json @@ -479,16 +479,6 @@ "CANCEL": "Cancel", "UPLOAD": "Upload" }, - "FORM": { - "SUBTITLE": "What level of changes were made to this version?", - "VERSION": { - "MINOR": "Minor (#.1)", - "MAJOR": "Major (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Add notes describing what changed" - } - }, "SELECTION": { "EMPTY": "Please choose a document to see the versions of it.", "NO_PERMISSION": "You don't have permission to manage the versions of this content." diff --git a/projects/aca-content/assets/i18n/es.json b/projects/aca-content/assets/i18n/es.json index 46fcb8648e..295c41c0f5 100644 --- a/projects/aca-content/assets/i18n/es.json +++ b/projects/aca-content/assets/i18n/es.json @@ -476,16 +476,6 @@ "CANCEL": "Cancelar", "UPLOAD": "Cargar" }, - "FORM": { - "SUBTITLE": "¿Qué nivel de cambios se hicieron a esta versión?", - "VERSION": { - "MINOR": "Menor (#.1)", - "MAJOR": "Mayor (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Añadir notas describiendo lo que se cambió" - } - }, "SELECTION": { "EMPTY": "Por favor, seleccione un documento para ver sus versiones.", "NO_PERMISSION": "No tiene permiso para gestionar las versiones de este contenido." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Detalles" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "fichero bloqueado" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/fi.json b/projects/aca-content/assets/i18n/fi.json index 82dde112c7..14a75cec32 100644 --- a/projects/aca-content/assets/i18n/fi.json +++ b/projects/aca-content/assets/i18n/fi.json @@ -476,16 +476,6 @@ "CANCEL": "Peruuta", "UPLOAD": "Lataa" }, - "FORM": { - "SUBTITLE": "Millainen muutos tähän versioon tehtiin?", - "VERSION": { - "MINOR": "Vähäinen (#.1)", - "MAJOR": "Merkittävä (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Lisää muutosta koskevia tietoja" - } - }, "SELECTION": { "EMPTY": "Jos haluat nähdä asiakirjan versiot, valitse haluamasi asiakirja.", "NO_PERMISSION": "Sinulla ei ole oikeuksia hallita tämän sisällön versioita." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Tiedot" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "tiedosto lukittu" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/fr.json b/projects/aca-content/assets/i18n/fr.json index dbfa625e8f..94da16f032 100644 --- a/projects/aca-content/assets/i18n/fr.json +++ b/projects/aca-content/assets/i18n/fr.json @@ -476,16 +476,6 @@ "CANCEL": "Annuler", "UPLOAD": "Importer" }, - "FORM": { - "SUBTITLE": "Quel type de changements ont été apportés à cette version ?", - "VERSION": { - "MINOR": "Mineure (#.1)", - "MAJOR": "Majeure (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Ajouter des commentaires décrivant les changements" - } - }, "SELECTION": { "EMPTY": "Choisissez un document pour en voir les versions.", "NO_PERMISSION": "Vous n'êtes pas autorisé(e) à gérer les versions de ce contenu." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Détails" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "fichier verrouillé" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/it.json b/projects/aca-content/assets/i18n/it.json index d09f29bd50..61c5012315 100644 --- a/projects/aca-content/assets/i18n/it.json +++ b/projects/aca-content/assets/i18n/it.json @@ -476,16 +476,6 @@ "CANCEL": "Annulla", "UPLOAD": "Carica" }, - "FORM": { - "SUBTITLE": "Qual è il livello delle modifiche apportate a questa versione?", - "VERSION": { - "MINOR": "Minore (x.1)", - "MAJOR": "Maggiore (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Aggiungere note per descrivere le modifiche" - } - }, "SELECTION": { "EMPTY": "Selezionare un documento per vedere le versioni.", "NO_PERMISSION": "Non si dispone dell'autorizzazione per gestire le versioni del contenuto." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Dettagli" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "File bloccato" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/ja.json b/projects/aca-content/assets/i18n/ja.json index 722cfc7a11..c7e2246545 100644 --- a/projects/aca-content/assets/i18n/ja.json +++ b/projects/aca-content/assets/i18n/ja.json @@ -476,16 +476,6 @@ "CANCEL": "キャンセル", "UPLOAD": "アップロード" }, - "FORM": { - "SUBTITLE": "このバージョンに加えた変更はどのレベルですか?", - "VERSION": { - "MINOR": "マイナー (#.1)", - "MAJOR": "メジャー (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "変更内容の説明を追加してください" - } - }, "SELECTION": { "EMPTY": "バージョンを表示する文書を選択してください。", "NO_PERMISSION": "このコンテンツのバージョンを管理するための権限がありません。" @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "詳細" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "ロックされているファイル" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/nb.json b/projects/aca-content/assets/i18n/nb.json index a68336b194..0a30f1f451 100644 --- a/projects/aca-content/assets/i18n/nb.json +++ b/projects/aca-content/assets/i18n/nb.json @@ -476,16 +476,6 @@ "CANCEL": "Avbryt", "UPLOAD": "Last opp" }, - "FORM": { - "SUBTITLE": "Hvor omfattende endringer ble gjort i denne versjonen?", - "VERSION": { - "MINOR": "Små (#.1)", - "MAJOR": "Store (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Legg til merknader som beskriver hva som er endret" - } - }, "SELECTION": { "EMPTY": "Velg et dokument for å se versjonene av det.", "NO_PERMISSION": "Du har ikke tillatelse til å administrere versjonene av dette innholdet." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Detaljer" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "låst fil" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/nl.json b/projects/aca-content/assets/i18n/nl.json index 8f99abfa82..747d9a8a19 100644 --- a/projects/aca-content/assets/i18n/nl.json +++ b/projects/aca-content/assets/i18n/nl.json @@ -476,16 +476,6 @@ "CANCEL": "Annuleren", "UPLOAD": "Uploaden" }, - "FORM": { - "SUBTITLE": "Welk niveau wijzigingen zijn in deze versie aangebracht?", - "VERSION": { - "MINOR": "Klein (#.1)", - "MAJOR": "Belangrijk (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Voeg opmerkingen toe met een beschrijving van wat er is gewijzigd" - } - }, "SELECTION": { "EMPTY": "Kies een document om de versies ervan weer te geven.", "NO_PERMISSION": "U hebt geen rechten voor het beheren van de versies van deze content." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Gegevens" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "Vergrendeld bestand" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/pl.json b/projects/aca-content/assets/i18n/pl.json index d0beccce3a..cab8250af8 100644 --- a/projects/aca-content/assets/i18n/pl.json +++ b/projects/aca-content/assets/i18n/pl.json @@ -476,16 +476,6 @@ "CANCEL": "Anuluj", "UPLOAD": "Prześlij" }, - "FORM": { - "SUBTITLE": "Jakiego poziomu zmiany zostały dokonane w tej wersji?", - "VERSION": { - "MINOR": "Drobne (#.1)", - "MAJOR": "Istotne (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Dodaj uwagi opisujące, co się zmieniło" - } - }, "SELECTION": { "EMPTY": "Wybierz dokument, aby zobaczyć jego wersje.", "NO_PERMISSION": "Nie masz uprawnień do zarządzania wersjami tej zawartości." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Szczegóły" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "zablokowany plik" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/pt-BR.json b/projects/aca-content/assets/i18n/pt-BR.json index bf5c136ed9..45d8fd4a1d 100644 --- a/projects/aca-content/assets/i18n/pt-BR.json +++ b/projects/aca-content/assets/i18n/pt-BR.json @@ -476,16 +476,6 @@ "CANCEL": "Cancelar", "UPLOAD": "Carregar" }, - "FORM": { - "SUBTITLE": "Qual foi o nível das mudanças feitas nesta versão?", - "VERSION": { - "MINOR": "Poucas (#.1)", - "MAJOR": "Muitas (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Inclua notas descrevendo o que mudou" - } - }, "SELECTION": { "EMPTY": "Escolha um documento para ver suas versões.", "NO_PERMISSION": "Você não tem permissão para gerenciar as versões deste conteúdo." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Detalhes" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "arquivo bloqueado" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/ru.json b/projects/aca-content/assets/i18n/ru.json index f8220b933b..ad9adaa7dd 100644 --- a/projects/aca-content/assets/i18n/ru.json +++ b/projects/aca-content/assets/i18n/ru.json @@ -476,16 +476,6 @@ "CANCEL": "Отмена", "UPLOAD": "Загрузить" }, - "FORM": { - "SUBTITLE": "Изменения какого уровня были выполнены в данной версии?", - "VERSION": { - "MINOR": "Незначительные (#.1)", - "MAJOR": "Значительные (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Добавьте комментарии с описанием изменений" - } - }, "SELECTION": { "EMPTY": "Пожалуйста, выберите документ чтобы просмотреть его версии.", "NO_PERMISSION": "У вас нет разрешения на управление версиями этого контента." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Сведения" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "заблокированный файл" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/sv.json b/projects/aca-content/assets/i18n/sv.json index 74d667b2b5..c2ae20ad05 100644 --- a/projects/aca-content/assets/i18n/sv.json +++ b/projects/aca-content/assets/i18n/sv.json @@ -476,16 +476,6 @@ "CANCEL": "Avbryt", "UPLOAD": "Ladda upp" }, - "FORM": { - "SUBTITLE": "Vilken nivå på ändringarna har gjorts av den här versionen?", - "VERSION": { - "MINOR": "Smärre (#.1)", - "MAJOR": "Större (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "Lägg till noteringar som beskriver vad som har ändrats" - } - }, "SELECTION": { "EMPTY": "Välj ett dokument för att se versionerna för det.", "NO_PERMISSION": "Du har inte behörighet att hantera versionerna för det här innehållet." @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "Detaljer" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "låst fil" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/assets/i18n/zh-CN.json b/projects/aca-content/assets/i18n/zh-CN.json index b8985017bc..17b398a6d0 100644 --- a/projects/aca-content/assets/i18n/zh-CN.json +++ b/projects/aca-content/assets/i18n/zh-CN.json @@ -476,16 +476,6 @@ "CANCEL": "取消", "UPLOAD": "上传" }, - "FORM": { - "SUBTITLE": "对此版本进行了多大程度的变更?", - "VERSION": { - "MINOR": "次要 (#.1)", - "MAJOR": "主要 (2.0)" - }, - "COMMENT": { - "PLACEHOLDER": "添加注释,描述变更内容" - } - }, "SELECTION": { "EMPTY": "请选定一个文件去看它的版本。", "NO_PERMISSION": "您没有权限管理此内容的版本。" @@ -496,7 +486,7 @@ }, "INFO_PANEL": { "TABS": { - + }, "DETAILS": "详细信息" }, @@ -657,4 +647,4 @@ "BASELINE-LOCK-24PX": "锁定的文件" } } -} \ No newline at end of file +} diff --git a/projects/aca-content/ms-office/src/effects/aos.effects.spec.ts b/projects/aca-content/ms-office/src/effects/aos.effects.spec.ts index ef421460bd..1e0c59dec4 100755 --- a/projects/aca-content/ms-office/src/effects/aos.effects.spec.ts +++ b/projects/aca-content/ms-office/src/effects/aos.effects.spec.ts @@ -31,13 +31,13 @@ import { AosEditOnlineService, IAosEditOnlineService } from '../aos-extension.se import { AosEffects } from './aos.effects'; class AosEditOnlineServiceMock implements IAosEditOnlineService { - onActionEditOnlineAos(_node: MinimalNodeEntryEntity): void {} + onActionEditOnlineAos(): void {} } describe('AosEffects', () => { let aosActions$: Observable; let effects: AosEffects; - let aosEditOnlineServiceMock: AosEditOnlineServiceMock; + let aosEditOnlineService: AosEditOnlineService; beforeEach(() => { aosActions$ = new Observable(); @@ -54,11 +54,11 @@ describe('AosEffects', () => { }); effects = TestBed.inject(AosEffects); - aosEditOnlineServiceMock = TestBed.inject(AosEditOnlineService); + aosEditOnlineService = TestBed.inject(AosEditOnlineService); }); it('should call onActionEditOnlineAos on AOS_ACTION', () => { - const onActionEditOnlineAosSpy = spyOn(aosEditOnlineServiceMock, 'onActionEditOnlineAos'); + const onActionEditOnlineAosSpy = spyOn(aosEditOnlineService, 'onActionEditOnlineAos'); const payload = new MinimalNodeEntryEntity(); const action = new AosAction(payload); diff --git a/projects/aca-content/src/lib/aca-content.module.ts b/projects/aca-content/src/lib/aca-content.module.ts index 54a9d082f4..487beffe61 100644 --- a/projects/aca-content/src/lib/aca-content.module.ts +++ b/projects/aca-content/src/lib/aca-content.module.ts @@ -25,15 +25,7 @@ import { HammerModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { - TRANSLATION_PROVIDER, - CoreModule, - AppConfigService, - DebugAppConfigService, - AuthGuardEcm, - LanguagePickerComponent, - NotificationHistoryComponent -} from '@alfresco/adf-core'; +import { TRANSLATION_PROVIDER, CoreModule, AuthGuardEcm, LanguagePickerComponent, NotificationHistoryComponent } from '@alfresco/adf-core'; import { ContentModule, ContentVersionService, @@ -42,7 +34,7 @@ import { LibraryStatusColumnComponent, TrashcanNameColumnComponent } from '@alfresco/adf-content-services'; -import { DocumentBasePageService, ExtensionsDataLoaderGuard, PageLayoutModule, RouterExtensionService, SharedModule } from '@alfresco/aca-shared'; +import { DocumentBasePageService, ExtensionsDataLoaderGuard, PageLayoutModule, SharedModule } from '@alfresco/aca-shared'; import * as rules from '@alfresco/aca-shared/rules'; import { FilesComponent } from './components/files/files.component'; @@ -64,7 +56,6 @@ import { AppCommonModule } from './components/common/common.module'; import { AppSearchInputModule } from './components/search/search-input.module'; import { DocumentListCustomComponentsModule } from './components/dl-custom-components/document-list-custom-components.module'; import { AppSearchResultsModule } from './components/search/search-results.module'; -import { AppNodeVersionModule } from './components/node-version/node-version.module'; import { FavoritesComponent } from './components/favorites/favorites.component'; import { RecentFilesComponent } from './components/recent-files/recent-files.component'; import { SharedFilesComponent } from './components/shared-files/shared-files.component'; @@ -73,23 +64,7 @@ import { DetailsComponent } from './components/details/details.component'; import { ContentUrlService } from './services/content-url.service'; import { HomeComponent } from './components/home/home.component'; -import { CommonModule, registerLocaleData } from '@angular/common'; -import localeFr from '@angular/common/locales/fr'; -import localeDe from '@angular/common/locales/de'; -import localeIt from '@angular/common/locales/it'; -import localeEs from '@angular/common/locales/es'; -import localeJa from '@angular/common/locales/ja'; -import localeNl from '@angular/common/locales/nl'; -import localePt from '@angular/common/locales/pt'; -import localeNb from '@angular/common/locales/nb'; -import localeRu from '@angular/common/locales/ru'; -import localeCh from '@angular/common/locales/zh'; -import localeAr from '@angular/common/locales/ar'; -import localeCs from '@angular/common/locales/cs'; -import localePl from '@angular/common/locales/pl'; -import localeFi from '@angular/common/locales/fi'; -import localeDa from '@angular/common/locales/da'; -import localeSv from '@angular/common/locales/sv'; +import { CommonModule } from '@angular/common'; import { LocationLinkComponent } from './components/common/location-link/location-link.component'; import { LogoutComponent } from './components/common/logout/logout.component'; import { ToggleSharedComponent } from './components/common/toggle-shared/toggle-shared.component'; @@ -120,23 +95,6 @@ import { ContentManagementService } from './services/content-management.service' import { ShellLayoutComponent, SHELL_NAVBAR_MIN_WIDTH } from '@alfresco/adf-core/shell'; import { UserMenuComponent } from './components/sidenav/user-menu/user-menu.component'; -registerLocaleData(localeFr); -registerLocaleData(localeDe); -registerLocaleData(localeIt); -registerLocaleData(localeEs); -registerLocaleData(localeJa); -registerLocaleData(localeNl); -registerLocaleData(localePt); -registerLocaleData(localeNb); -registerLocaleData(localeRu); -registerLocaleData(localeCh); -registerLocaleData(localeAr); -registerLocaleData(localeCs); -registerLocaleData(localePl); -registerLocaleData(localeFi); -registerLocaleData(localeDa); -registerLocaleData(localeSv); - @NgModule({ imports: [ CommonModule, @@ -161,7 +119,6 @@ registerLocaleData(localeSv); DocumentListCustomComponentsModule, AppSearchInputModule, AppSearchResultsModule, - AppNodeVersionModule, HammerModule, ViewProfileModule, AppTrashcanModule, @@ -181,7 +138,6 @@ registerLocaleData(localeSv); UploadFilesDialogComponent ], providers: [ - { provide: AppConfigService, useClass: DebugAppConfigService }, { provide: ContentVersionService, useClass: ContentUrlService }, { provide: DocumentBasePageService, useExisting: ContentManagementService }, { @@ -196,7 +152,7 @@ registerLocaleData(localeSv); ] }) export class ContentServiceExtensionModule { - constructor(public extensions: ExtensionService, public routeExtensionService: RouterExtensionService) { + constructor(public extensions: ExtensionService) { extensions.setAuthGuards({ 'app.auth': AuthGuardEcm, 'app.extensions.dataLoaderGuard': ExtensionsDataLoaderGuard diff --git a/projects/aca-content/src/lib/components/context-menu/context-menu-item.component.spec.ts b/projects/aca-content/src/lib/components/context-menu/context-menu-item.component.spec.ts index c0f2d2be8e..25594b5d06 100644 --- a/projects/aca-content/src/lib/components/context-menu/context-menu-item.component.spec.ts +++ b/projects/aca-content/src/lib/components/context-menu/context-menu-item.component.spec.ts @@ -26,24 +26,17 @@ import { TestBed, ComponentFixture } from '@angular/core/testing'; import { AppTestingModule } from '../../testing/app-testing.module'; import { ContextMenuItemComponent } from './context-menu-item.component'; import { ContextMenuModule } from './context-menu.module'; -import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core'; import { AppExtensionService } from '@alfresco/aca-shared'; describe('ContextMenuComponent', () => { let fixture: ComponentFixture; let component: ContextMenuItemComponent; - let extensionsService; + let extensionsService: AppExtensionService; let contextItem; beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - AppTestingModule, - ContextMenuModule, - TranslateModule.forRoot({ - loader: { provide: TranslateLoader, useClass: TranslateFakeLoader } - }) - ], + imports: [AppTestingModule, ContextMenuModule], providers: [AppExtensionService] }); diff --git a/projects/aca-content/src/lib/components/context-menu/context-menu.service.ts b/projects/aca-content/src/lib/components/context-menu/context-menu.service.ts index 0448fee33e..0719be9e32 100644 --- a/projects/aca-content/src/lib/components/context-menu/context-menu.service.ts +++ b/projects/aca-content/src/lib/components/context-menu/context-menu.service.ts @@ -22,7 +22,7 @@ * from Hyland Software. If not, see . */ -import { Injectable, Injector, ComponentRef } from '@angular/core'; +import { ComponentRef, Injectable, Injector } from '@angular/core'; import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import { ComponentPortal } from '@angular/cdk/portal'; import { ContextMenuOverlayRef } from './context-menu-overlay'; @@ -97,7 +97,7 @@ export class ContextMenuService { } ]); - const overlayConfig = new OverlayConfig({ + return new OverlayConfig({ hasBackdrop: config.hasBackdrop, backdropClass: config.backdropClass, panelClass: config.panelClass, @@ -105,7 +105,5 @@ export class ContextMenuService { positionStrategy, direction: this.direction }); - - return overlayConfig; } } diff --git a/projects/aca-content/src/lib/components/create-menu/create-menu.component.spec.ts b/projects/aca-content/src/lib/components/create-menu/create-menu.component.spec.ts index 716bb697fd..67f5481726 100644 --- a/projects/aca-content/src/lib/components/create-menu/create-menu.component.spec.ts +++ b/projects/aca-content/src/lib/components/create-menu/create-menu.component.spec.ts @@ -24,26 +24,34 @@ import { CreateMenuComponent } from './create-menu.component'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CoreModule } from '@alfresco/adf-core'; import { AppCreateMenuModule } from './create-menu.module'; import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay'; import { AppExtensionService } from '@alfresco/aca-shared'; -import { ContentActionType } from '@alfresco/adf-extensions'; import { By } from '@angular/platform-browser'; import { AppTestingModule } from '../../testing/app-testing.module'; import { MatMenuModule } from '@angular/material/menu'; import { MatButtonModule } from '@angular/material/button'; import { of } from 'rxjs'; -import { getContentActionRef } from '../../testing/content-action-ref'; +import { ContentActionRef, ContentActionType } from '@alfresco/adf-extensions'; describe('CreateMenuComponent', () => { let fixture: ComponentFixture; let extensionService: AppExtensionService; let getCreateActionsSpy: jasmine.Spy; + const getContentActionRef = (): ContentActionRef => ({ + id: 'id', + type: ContentActionType.button, + title: 'ACTION_TITLE', + disabled: false, + actions: { + click: 'ACTION_CLICK' + } + }); + beforeEach(() => { TestBed.configureTestingModule({ - imports: [AppTestingModule, CoreModule.forRoot(), AppCreateMenuModule, OverlayModule, MatMenuModule, MatButtonModule] + imports: [AppTestingModule, AppCreateMenuModule, OverlayModule, MatMenuModule, MatButtonModule] }); extensionService = TestBed.inject(AppExtensionService); diff --git a/projects/aca-content/src/lib/components/details/details.component.spec.ts b/projects/aca-content/src/lib/components/details/details.component.spec.ts index f816086fd8..3a8ba5c618 100644 --- a/projects/aca-content/src/lib/components/details/details.component.spec.ts +++ b/projects/aca-content/src/lib/components/details/details.component.spec.ts @@ -27,7 +27,7 @@ import { AppTestingModule } from '../../testing/app-testing.module'; import { DetailsComponent } from './details.component'; import { MetadataTabComponent } from '../info-drawer/metadata-tab/metadata-tab.component'; import { CommentsTabComponent } from '../info-drawer/comments-tab/comments-tab.component'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute } from '@angular/router'; import { of, Subject } from 'rxjs'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { Store } from '@ngrx/store'; @@ -36,16 +36,14 @@ import { AppExtensionService } from '@alfresco/adf-extensions'; import { ContentApiService } from '@alfresco/aca-shared'; import { SetSelectedNodesAction } from '@alfresco/aca-shared/store'; import { NodeEntry } from '@alfresco/js-api'; +import { RouterTestingModule } from '@angular/router/testing'; describe('DetailsComponent', () => { let component: DetailsComponent; let fixture: ComponentFixture; let contentApiService: ContentApiService; - let store; - const router: any = { - url: '', - navigate: jasmine.createSpy('navigate') - }; + let store: Store; + const mockStream = new Subject(); const storeMock = { dispatch: jasmine.createSpy('dispatch'), @@ -59,10 +57,7 @@ describe('DetailsComponent', () => { providers: [ ContentManagementService, AppExtensionService, - { - provide: Router, - useValue: router - }, + RouterTestingModule, { provide: Store, useValue: storeMock }, { provide: ActivatedRoute, diff --git a/projects/aca-content/src/lib/components/dl-custom-components/name-column/name-column.component.spec.ts b/projects/aca-content/src/lib/components/dl-custom-components/name-column/name-column.component.spec.ts index de14557aac..4a03ffb905 100644 --- a/projects/aca-content/src/lib/components/dl-custom-components/name-column/name-column.component.spec.ts +++ b/projects/aca-content/src/lib/components/dl-custom-components/name-column/name-column.component.spec.ts @@ -26,13 +26,13 @@ import { CustomNameColumnComponent } from './name-column.component'; import { DocumentListCustomComponentsModule } from '../document-list-custom-components.module'; import { Actions } from '@ngrx/effects'; import { StoreModule } from '@ngrx/store'; -import { TestBed } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CoreModule } from '@alfresco/adf-core'; import { TranslateModule } from '@ngx-translate/core'; describe('CustomNameColumnComponent', () => { - let fixture; - let component; + let fixture: ComponentFixture; + let component: CustomNameColumnComponent; beforeEach(() => { TestBed.configureTestingModule({ diff --git a/projects/aca-content/src/lib/components/home/home.component.spec.ts b/projects/aca-content/src/lib/components/home/home.component.spec.ts index e135b0e10e..eac5c12622 100644 --- a/projects/aca-content/src/lib/components/home/home.component.spec.ts +++ b/projects/aca-content/src/lib/components/home/home.component.spec.ts @@ -23,7 +23,7 @@ */ import { HomeComponent } from './home.component'; -import { AppConfigService, AppConfigServiceMock, setupTestBed } from '@alfresco/adf-core'; +import { AppConfigService, AppConfigServiceMock } from '@alfresco/adf-core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; import { HttpClientModule } from '@angular/common/http'; @@ -34,12 +34,11 @@ describe('HomeComponent', () => { let fixture: ComponentFixture; let router: Router; - setupTestBed({ - imports: [HttpClientModule, RouterTestingModule], - providers: [{ provide: AppConfigService, useClass: AppConfigServiceMock }] - }); - beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientModule, RouterTestingModule], + providers: [{ provide: AppConfigService, useClass: AppConfigServiceMock }] + }); fixture = TestBed.createComponent(HomeComponent); router = TestBed.inject(Router); appConfig = TestBed.inject(AppConfigService); diff --git a/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts b/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts index 92be54deb9..4e90415f97 100644 --- a/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts +++ b/projects/aca-content/src/lib/components/info-drawer/metadata-tab/metadata-tab.component.spec.ts @@ -26,10 +26,10 @@ import { MetadataTabComponent } from './metadata-tab.component'; import { Node } from '@alfresco/js-api'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AppTestingModule } from '../../../testing/app-testing.module'; -import { AppConfigService, setupTestBed, CoreModule } from '@alfresco/adf-core'; +import { AppConfigService, CoreModule } from '@alfresco/adf-core'; import { ContentMetadataModule } from '@alfresco/adf-content-services'; import { Store } from '@ngrx/store'; -import { SetInfoDrawerMetadataAspectAction, AppState } from '@alfresco/aca-shared/store'; +import { AppState, SetInfoDrawerMetadataAspectAction } from '@alfresco/aca-shared/store'; import { By } from '@angular/platform-browser'; import { AppExtensionService } from '@alfresco/aca-shared'; @@ -46,9 +46,11 @@ describe('MetadataTabComponent', () => { custom: [] }; - setupTestBed({ - imports: [CoreModule, AppTestingModule, ContentMetadataModule], - declarations: [MetadataTabComponent] + beforeEach(() => { + TestBed.configureTestingModule({ + imports: [CoreModule, AppTestingModule, ContentMetadataModule], + declarations: [MetadataTabComponent] + }); }); afterEach(() => { @@ -87,45 +89,37 @@ describe('MetadataTabComponent', () => { }); it('should return true if node is not locked and has update permission', () => { - const node = { + component.node = { isLocked: false, allowableOperations: ['update'] } as Node; - - component.node = node; expect(component.canUpdateNode).toBe(true); }); it('should return false if node is locked', () => { - const node = { + component.node = { isLocked: true, allowableOperations: ['update'] } as Node; - - component.node = node; expect(component.canUpdateNode).toBe(false); }); it('should return false if node has no update permission', () => { - const node = { + component.node = { isLocked: false, allowableOperations: ['other'] } as Node; - - component.node = node; expect(component.canUpdateNode).toBe(false); }); it('should return false if node has read only property', () => { - const node = { + component.node = { isLocked: false, allowableOperations: ['update'], properties: { 'cm:lockType': 'WRITE_LOCK' } } as Node; - - component.node = node; expect(component.canUpdateNode).toBe(false); }); }); diff --git a/projects/aca-content/src/lib/components/node-version/node-version-form.component.html b/projects/aca-content/src/lib/components/node-version/node-version-form.component.html deleted file mode 100644 index b7d265c964..0000000000 --- a/projects/aca-content/src/lib/components/node-version/node-version-form.component.html +++ /dev/null @@ -1,27 +0,0 @@ -
-

- {{ 'VERSION.FORM.SUBTITLE' | translate }} -

- - - - {{ option.label | translate }} - - - - - - -
diff --git a/projects/aca-content/src/lib/components/node-version/node-version-form.component.scss b/projects/aca-content/src/lib/components/node-version/node-version-form.component.scss deleted file mode 100644 index 27ef9ec9cf..0000000000 --- a/projects/aca-content/src/lib/components/node-version/node-version-form.component.scss +++ /dev/null @@ -1,21 +0,0 @@ -.app-node-version-form__container { - display: flex; - max-width: 400px; - - .form__version { - display: flex; - flex-direction: column; - padding: 20px 0; - } - - .form__version--option:last-child { - padding-top: 20px; - } - - .form { - width: 100%; - padding: 0 10px; - display: flex; - flex-direction: column; - } -} diff --git a/projects/aca-content/src/lib/components/node-version/node-version-form.component.spec.ts b/projects/aca-content/src/lib/components/node-version/node-version-form.component.spec.ts deleted file mode 100644 index 173e61aec8..0000000000 --- a/projects/aca-content/src/lib/components/node-version/node-version-form.component.spec.ts +++ /dev/null @@ -1,66 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * from Hyland Software. If not, see . - */ - -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { AppNodeVersionFormComponent } from './node-version-form.component'; -import { setupTestBed, CoreModule } from '@alfresco/adf-core'; -import { TestBed } from '@angular/core/testing'; -import { TranslateModule } from '@ngx-translate/core'; - -describe('AppNodeVersionFormComponent', () => { - let fixture; - let component; - - setupTestBed({ - imports: [TranslateModule.forRoot(), CoreModule.forRoot(), NoopAnimationsModule], - declarations: [AppNodeVersionFormComponent] - }); - - beforeEach(() => { - fixture = TestBed.createComponent(AppNodeVersionFormComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should have minor version option selected', () => { - const isSelected = fixture.debugElement.nativeElement.querySelectorAll('.form__version--option')[0].classList.contains('mat-radio-checked'); - - expect(isSelected).toBe(true); - }); - - it('should emit form state on changes', () => { - const formData = { - comment: 'some text', - version: true - }; - spyOn(component.update, 'emit'); - - component.form.valueChanges.next(formData); - expect(component.update.emit).toHaveBeenCalledWith(formData); - }); - - it('form should have valid state upon initialization', () => { - expect(component.form.valid).toBe(true); - }); -}); diff --git a/projects/aca-content/src/lib/components/node-version/node-version-form.component.ts b/projects/aca-content/src/lib/components/node-version/node-version-form.component.ts deleted file mode 100644 index 43890fcf2b..0000000000 --- a/projects/aca-content/src/lib/components/node-version/node-version-form.component.ts +++ /dev/null @@ -1,75 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * from Hyland Software. If not, see . - */ - -import { Component, OnDestroy, OnInit, ViewEncapsulation, Output, EventEmitter } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; -import { Subject } from 'rxjs'; -import { takeUntil } from 'rxjs/operators'; - -export interface VersionFormEntry { - comment: string; - version: boolean; -} - -@Component({ - selector: 'app-node-version-form', - templateUrl: './node-version-form.component.html', - styleUrls: ['./node-version-form.component.scss'], - encapsulation: ViewEncapsulation.None, - host: { class: 'app-node-version-form__container' }, - exportAs: 'nodeVersionForm' -}) -export class AppNodeVersionFormComponent implements OnInit, OnDestroy { - @Output() update: EventEmitter = new EventEmitter(); - - form: UntypedFormGroup; - - private onDestroy$: Subject = new Subject(); - private versionOptions = [ - { label: 'VERSION.FORM.VERSION.MINOR', value: false }, - { label: 'VERSION.FORM.VERSION.MAJOR', value: true } - ]; - - constructor(private formBuilder: UntypedFormBuilder) {} - - ngOnInit() { - this.form = this.formBuilder.group({ - comment: [''], - version: [this.versionOptions[0].value] - }); - - this.form.valueChanges.pipe(takeUntil(this.onDestroy$)).subscribe((values: VersionFormEntry) => { - this.update.emit(values); - }); - } - - get versions() { - return this.versionOptions; - } - - ngOnDestroy() { - this.onDestroy$.next(true); - this.onDestroy$.complete(); - } -} diff --git a/projects/aca-content/src/lib/components/node-version/node-version.module.ts b/projects/aca-content/src/lib/components/node-version/node-version.module.ts deleted file mode 100644 index 73321ed1c5..0000000000 --- a/projects/aca-content/src/lib/components/node-version/node-version.module.ts +++ /dev/null @@ -1,54 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * from Hyland Software. If not, see . - */ - -import { AppNodeVersionFormComponent } from './node-version-form.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatButtonModule } from '@angular/material/button'; - -import { CoreModule } from '@alfresco/adf-core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { BrowserModule } from '@angular/platform-browser'; -import { CommonModule } from '@angular/common'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; - -import { NgModule } from '@angular/core'; -@NgModule({ - imports: [ - CoreModule, - MatButtonModule, - MatDialogModule, - FormsModule, - ReactiveFormsModule, - BrowserModule, - CommonModule, - MatRadioModule, - MatFormFieldModule, - MatInputModule - ], - exports: [AppNodeVersionFormComponent], - declarations: [AppNodeVersionFormComponent] -}) -export class AppNodeVersionModule {} diff --git a/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-query-builder.service.ts b/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-query-builder.service.ts index 89556a2f45..2e9122efa3 100644 --- a/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-query-builder.service.ts +++ b/projects/aca-content/src/lib/components/search/search-libraries-results/search-libraries-query-builder.service.ts @@ -81,14 +81,13 @@ export class SearchLibrariesQueryBuilderService { buildQuery(): LibrarySearchQuery { const query = this.userQuery; if (query && query.length > 1) { - const resultQuery = { + return { term: query, opts: { skipCount: this.paging && this.paging.skipCount, maxItems: this.paging && this.paging.maxItems } }; - return resultQuery; } return null; } diff --git a/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.components.spec.ts b/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.components.spec.ts index 94e644585a..d65ac45d10 100644 --- a/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.components.spec.ts +++ b/projects/aca-content/src/lib/components/search/search-results-row/search-results-row.components.spec.ts @@ -25,7 +25,6 @@ import { NodeEntry } from '@alfresco/js-api'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CoreModule } from '@angular/flex-layout'; -import { TranslateModule } from '@ngx-translate/core'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { AppSearchResultsModule } from '../search-results.module'; import { SearchResultsRowComponent } from './search-results-row.component'; @@ -45,7 +44,7 @@ describe('SearchResultsRowComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CoreModule, AppTestingModule, AppSearchResultsModule] + imports: [CoreModule, AppTestingModule, AppSearchResultsModule] }); fixture = TestBed.createComponent(SearchResultsRowComponent); diff --git a/projects/aca-content/src/lib/components/search/search-results/search-results.component.spec.ts b/projects/aca-content/src/lib/components/search/search-results/search-results.component.spec.ts index 322c3d852e..67908e4bde 100644 --- a/projects/aca-content/src/lib/components/search/search-results/search-results.component.spec.ts +++ b/projects/aca-content/src/lib/components/search/search-results/search-results.component.spec.ts @@ -31,7 +31,6 @@ import { NavigateToFolder, SnackbarErrorAction } from '@alfresco/aca-shared/stor import { Pagination, SearchRequest } from '@alfresco/js-api'; import { SearchQueryBuilderService } from '@alfresco/adf-content-services'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; import { BehaviorSubject, Subject } from 'rxjs'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { AppService } from '@alfresco/aca-shared'; @@ -50,7 +49,7 @@ describe('SearchComponent', () => { beforeEach(() => { params = new BehaviorSubject({ q: 'TYPE: "cm:folder" AND %28=cm: name: email OR cm: name: budget%29' }); TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), AppTestingModule, CoreModule.forRoot(), AppSearchResultsModule], + imports: [AppTestingModule, CoreModule.forRoot(), AppSearchResultsModule], providers: [ { provide: AppService, diff --git a/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.spec.ts b/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.spec.ts index 1c10332df7..0cf474d2a8 100644 --- a/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.spec.ts +++ b/projects/aca-content/src/lib/components/sidenav/components/button-menu.component.spec.ts @@ -26,7 +26,6 @@ import { ButtonMenuComponent } from './button-menu.component'; import { TestBed, ComponentFixture } from '@angular/core/testing'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { Router } from '@angular/router'; -import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core'; import { AppSidenavModule } from '../sidenav.module'; describe('ButtonMenuComponent', () => { @@ -36,13 +35,7 @@ describe('ButtonMenuComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - AppTestingModule, - AppSidenavModule, - TranslateModule.forRoot({ - loader: { provide: TranslateLoader, useClass: TranslateFakeLoader } - }) - ] + imports: [AppTestingModule, AppSidenavModule] }); fixture = TestBed.createComponent(ButtonMenuComponent); diff --git a/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.spec.ts b/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.spec.ts index 3eb911b0f9..234b17f7fe 100644 --- a/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.spec.ts +++ b/projects/aca-content/src/lib/components/sidenav/components/expand-menu.component.spec.ts @@ -26,7 +26,6 @@ import { ExpandMenuComponent } from './expand-menu.component'; import { TestBed, ComponentFixture } from '@angular/core/testing'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { Router } from '@angular/router'; -import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core'; import { AppSidenavModule } from '../sidenav.module'; describe('ExpandMenuComponent', () => { @@ -36,13 +35,7 @@ describe('ExpandMenuComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - AppTestingModule, - AppSidenavModule, - TranslateModule.forRoot({ - loader: { provide: TranslateLoader, useClass: TranslateFakeLoader } - }) - ] + imports: [AppTestingModule, AppSidenavModule] }); fixture = TestBed.createComponent(ExpandMenuComponent); diff --git a/projects/aca-content/src/lib/components/sidenav/sidenav-wrapper/sidenav-wrapper.component.ts b/projects/aca-content/src/lib/components/sidenav/sidenav-wrapper/sidenav-wrapper.component.ts deleted file mode 100644 index a1bed62c26..0000000000 --- a/projects/aca-content/src/lib/components/sidenav/sidenav-wrapper/sidenav-wrapper.component.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * from Hyland Software. If not, see . - */ - -import { Component, Input } from '@angular/core'; - -/** - * This wrapper is designated to be used with 'adf-dynamic-component'. - * It forwards the dynamic component inputs to original sidenav. - */ -@Component({ - selector: 'aca-sidenav-wrapper', - templateUrl: './sidenav-wrapper.component.html' -}) -export class SidenavWrapperComponent { - @Input() - data: { mode?: 'collapsed' | 'expanded' } = {}; -} diff --git a/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.spec.ts b/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.spec.ts index 4b6c00ff34..e16d82f9f8 100644 --- a/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.spec.ts +++ b/projects/aca-content/src/lib/components/sidenav/user-menu/user-menu.component.spec.ts @@ -28,6 +28,7 @@ import { PeopleContentService } from '@alfresco/adf-content-services'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { UserMenuComponent } from './user-menu.component'; import { of } from 'rxjs'; +import { SharedToolbarModule } from '@alfresco/aca-shared'; describe('UserMenuComponent', () => { let component: UserMenuComponent; @@ -106,7 +107,7 @@ describe('UserMenuComponent', () => { }; TestBed.configureTestingModule({ - imports: [AppTestingModule], + imports: [AppTestingModule, SharedToolbarModule], declarations: [UserMenuComponent], providers: [ { provide: AuthenticationService, useValue: authServiceStub }, diff --git a/projects/aca-content/src/lib/components/toolbar/document-display-mode/document-display-mode.component.spec.ts b/projects/aca-content/src/lib/components/toolbar/document-display-mode/document-display-mode.component.spec.ts index 6c8e0dd04a..356f2f6afa 100644 --- a/projects/aca-content/src/lib/components/toolbar/document-display-mode/document-display-mode.component.spec.ts +++ b/projects/aca-content/src/lib/components/toolbar/document-display-mode/document-display-mode.component.spec.ts @@ -25,7 +25,6 @@ import { DocumentDisplayModeComponent } from './document-display-mode.component'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CoreModule } from '@angular/flex-layout'; -import { TranslateModule } from '@ngx-translate/core'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { of } from 'rxjs'; @@ -35,7 +34,7 @@ describe('DocumentDisplayModeComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CoreModule, AppTestingModule] + imports: [CoreModule, AppTestingModule] }); fixture = TestBed.createComponent(DocumentDisplayModeComponent); diff --git a/projects/aca-content/src/lib/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.spec.ts b/projects/aca-content/src/lib/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.spec.ts index c680f3615c..61cc8b2bcf 100644 --- a/projects/aca-content/src/lib/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.spec.ts +++ b/projects/aca-content/src/lib/components/toolbar/toggle-favorite-library/toggle-favorite-library.component.spec.ts @@ -30,7 +30,6 @@ import { Store } from '@ngrx/store'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { of } from 'rxjs'; import { Router } from '@angular/router'; -import { TranslateModule } from '@ngx-translate/core'; import { AppHookService, ContentApiService } from '@alfresco/aca-shared'; describe('ToggleFavoriteLibraryComponent', () => { @@ -46,7 +45,7 @@ describe('ToggleFavoriteLibraryComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CoreModule.forRoot(), AppTestingModule], + imports: [CoreModule.forRoot(), AppTestingModule], declarations: [ToggleFavoriteLibraryComponent], providers: [ { diff --git a/projects/aca-content/src/lib/components/toolbar/toggle-favorite/toggle-favorite.component.spec.ts b/projects/aca-content/src/lib/components/toolbar/toggle-favorite/toggle-favorite.component.spec.ts index ae16dc4dc8..543dcbebb9 100644 --- a/projects/aca-content/src/lib/components/toolbar/toggle-favorite/toggle-favorite.component.spec.ts +++ b/projects/aca-content/src/lib/components/toolbar/toggle-favorite/toggle-favorite.component.spec.ts @@ -29,7 +29,6 @@ import { ExtensionService } from '@alfresco/adf-extensions'; import { CoreModule } from '@alfresco/adf-core'; import { Router } from '@angular/router'; import { of } from 'rxjs'; -import { TranslateModule } from '@ngx-translate/core'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { ContentDirectiveModule } from '@alfresco/adf-content-services'; @@ -51,7 +50,7 @@ describe('ToggleFavoriteComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContentDirectiveModule, AppTestingModule], + imports: [CoreModule.forRoot(), ContentDirectiveModule, AppTestingModule], declarations: [ToggleFavoriteComponent], providers: [ExtensionService, { provide: Store, useValue: mockStore }, { provide: Router, useValue: mockRouter }] }); diff --git a/projects/aca-content/src/lib/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.spec.ts b/projects/aca-content/src/lib/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.spec.ts index fb60771220..6f19e0b590 100644 --- a/projects/aca-content/src/lib/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.spec.ts +++ b/projects/aca-content/src/lib/components/toolbar/toggle-info-drawer/toggle-info-drawer.component.spec.ts @@ -25,7 +25,6 @@ import { ToggleInfoDrawerComponent } from './toggle-info-drawer.component'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CoreModule } from '@angular/flex-layout'; -import { TranslateModule } from '@ngx-translate/core'; import { AppTestingModule } from '../../../testing/app-testing.module'; import { Subject } from 'rxjs'; import { Store } from '@ngrx/store'; @@ -40,7 +39,7 @@ describe('ToggleInfoDrawerComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CoreModule, AppTestingModule], + imports: [CoreModule, AppTestingModule], providers: [{ provide: Store, useValue: storeMock }] }); diff --git a/projects/aca-content/src/lib/components/view-profile/view-profile.guard.ts b/projects/aca-content/src/lib/components/view-profile/view-profile.guard.ts index 38774a102f..70a20ec872 100644 --- a/projects/aca-content/src/lib/components/view-profile/view-profile.guard.ts +++ b/projects/aca-content/src/lib/components/view-profile/view-profile.guard.ts @@ -23,7 +23,7 @@ */ import { Injectable } from '@angular/core'; -import { CanActivate, ActivatedRouteSnapshot } from '@angular/router'; +import { CanActivate } from '@angular/router'; import { Observable } from 'rxjs'; import { AuthenticationService } from '@alfresco/adf-core'; @@ -33,11 +33,11 @@ import { AuthenticationService } from '@alfresco/adf-core'; export class ViewProfileRuleGuard implements CanActivate { constructor(private authService: AuthenticationService) {} - canActivate(_: ActivatedRouteSnapshot): Observable | Promise | boolean { + canActivate(): Observable | Promise | boolean { return this.isEcmLoggedIn() || this.authService.isOauth(); } - private isEcmLoggedIn() { + private isEcmLoggedIn(): boolean { return this.authService.isEcmLoggedIn() || (this.authService.isECMProvider() && this.authService.isKerberosEnabled()); } } diff --git a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.spec.ts b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.spec.ts index da8eab0ab8..619ca3370c 100644 --- a/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.spec.ts +++ b/projects/aca-content/src/lib/dialogs/node-template/create-from-template.dialog.spec.ts @@ -30,7 +30,6 @@ import { MatDialogModule, MAT_DIALOG_DATA, MatDialogRef } from '@angular/materia import { Store } from '@ngrx/store'; import { CreateFromTemplate } from '@alfresco/aca-shared/store'; import { Node } from '@alfresco/js-api'; -import { TranslateModule } from '@ngx-translate/core'; const text = (length: number) => new Array(length).fill(Math.random().toString().substring(2, 3)).join(''); @@ -52,7 +51,7 @@ describe('CreateFileFromTemplateDialogComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), CoreModule.forRoot(), AppTestingModule, MatDialogModule], + imports: [CoreModule.forRoot(), AppTestingModule, MatDialogModule], declarations: [CreateFromTemplateDialogComponent], providers: [ { diff --git a/projects/aca-content/src/lib/services/content-service-extension.service.spec.ts b/projects/aca-content/src/lib/services/content-service-extension.service.spec.ts index 9cca1cf49f..9e7b6b9cfc 100644 --- a/projects/aca-content/src/lib/services/content-service-extension.service.spec.ts +++ b/projects/aca-content/src/lib/services/content-service-extension.service.spec.ts @@ -23,7 +23,7 @@ */ import { ContentServiceExtensionService } from './content-service-extension.service'; -import { AppConfigService, AppConfigServiceMock, setupTestBed } from '@alfresco/adf-core'; +import { AppConfigService, AppConfigServiceMock } from '@alfresco/adf-core'; import { TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; import { HttpClientModule } from '@angular/common/http'; @@ -32,12 +32,11 @@ describe('ContentServiceExtensionService', () => { let service: ContentServiceExtensionService; let appConfig: AppConfigService; - setupTestBed({ - imports: [HttpClientModule], - providers: [{ provide: AppConfigService, useClass: AppConfigServiceMock }] - }); - beforeEach(() => { + TestBed.configureTestingModule({ + imports: [HttpClientModule], + providers: [{ provide: AppConfigService, useClass: AppConfigServiceMock }] + }); service = TestBed.inject(ContentServiceExtensionService); appConfig = TestBed.inject(AppConfigService); appConfig.config = Object.assign(appConfig.config, { diff --git a/projects/aca-content/src/lib/services/node-actions.service.spec.ts b/projects/aca-content/src/lib/services/node-actions.service.spec.ts index 2713912c36..b5e349d1ab 100644 --- a/projects/aca-content/src/lib/services/node-actions.service.spec.ts +++ b/projects/aca-content/src/lib/services/node-actions.service.spec.ts @@ -876,7 +876,7 @@ describe('NodeActionsService', () => { it('should try to move children nodes of a folder to already existing folder with same name', () => { const parentFolderToMove = new TestNode('parent-folder', !isFile, 'conflicting-name'); - const moveNodeSpy = spyOn(documentListService, 'moveNode').and.callFake((nodeId: string, _targetParentId: string) => { + const moveNodeSpy = spyOn(documentListService, 'moveNode').and.callFake((nodeId: string) => { if (nodeId === parentFolderToMove.entry.id) { return throwError(conflictError); } diff --git a/projects/aca-content/src/lib/services/node-actions.service.ts b/projects/aca-content/src/lib/services/node-actions.service.ts index ee4f54f325..d928442e44 100644 --- a/projects/aca-content/src/lib/services/node-actions.service.ts +++ b/projects/aca-content/src/lib/services/node-actions.service.ts @@ -25,7 +25,7 @@ import { Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Observable, Subject, of, zip, from } from 'rxjs'; -import { AlfrescoApiService, DataColumn, TranslationService, ThumbnailService } from '@alfresco/adf-core'; +import { AlfrescoApiService, TranslationService, ThumbnailService } from '@alfresco/adf-core'; import { DocumentListService, ContentNodeSelectorComponent, @@ -565,7 +565,7 @@ export class NodeActionsService { return !node.isFile && node.nodeType !== 'app:folderlink'; } - private imageResolver(row: ShareDataRow, _: DataColumn): string | null { + private imageResolver(row: ShareDataRow): string | null { const entry: MinimalNodeEntryEntity = row.node.entry; if (!this.contentService.hasAllowableOperations(entry, 'update')) { return this.thumbnailService.getMimeTypeIcon('disable/folder'); diff --git a/projects/aca-content/src/lib/store/effects/upload.effects.ts b/projects/aca-content/src/lib/store/effects/upload.effects.ts index 18db21aed3..cb6715e50f 100644 --- a/projects/aca-content/src/lib/store/effects/upload.effects.ts +++ b/projects/aca-content/src/lib/store/effects/upload.effects.ts @@ -44,9 +44,9 @@ import { UploadService, FileModel } from '@alfresco/adf-content-services'; @Injectable() export class UploadEffects { - private fileInput: HTMLInputElement; - private folderInput: HTMLInputElement; - private fileVersionInput: HTMLInputElement; + private readonly fileInput: HTMLInputElement; + private readonly folderInput: HTMLInputElement; + private readonly fileVersionInput: HTMLInputElement; private readonly uploadMenuButtonSelector = 'app-toolbar-menu button[id="app.toolbar.upload"]'; constructor( @@ -132,7 +132,7 @@ export class UploadEffects { this.contentService .getNodeInfo() .pipe( - catchError((_) => { + catchError(() => { this.store.dispatch(new SnackbarErrorAction('VERSION.ERROR.GENERIC')); return of(null); }) diff --git a/projects/aca-content/src/lib/store/effects/viewer.effects.ts b/projects/aca-content/src/lib/store/effects/viewer.effects.ts index d1ad25adf1..819d61d2cc 100644 --- a/projects/aca-content/src/lib/store/effects/viewer.effects.ts +++ b/projects/aca-content/src/lib/store/effects/viewer.effects.ts @@ -180,7 +180,7 @@ export class ViewerEffects { let previewLocation = this.router.url; if (previewLocation.lastIndexOf('/') > 0) { - previewLocation = previewLocation.substr(0, this.router.url.indexOf('/', 1)); + previewLocation = previewLocation.substring(0, this.router.url.indexOf('/', 1)); } previewLocation = previewLocation.replace(/\//g, ''); diff --git a/projects/aca-content/src/lib/testing/app-extension-service-mock.ts b/projects/aca-content/src/lib/testing/app-extension-service-mock.ts deleted file mode 100644 index cd15793103..0000000000 --- a/projects/aca-content/src/lib/testing/app-extension-service-mock.ts +++ /dev/null @@ -1,34 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * from Hyland Software. If not, see . - */ - -import { ContentActionRef } from '@alfresco/adf-extensions'; -import { Observable, of } from 'rxjs'; -import { getContentActionRef } from './content-action-ref'; -export class AppExtensionServiceMock { - getMainAction(): Observable { - return of(getContentActionRef()); - } - - runActionById(_id: string) {} -} diff --git a/projects/aca-content/src/lib/testing/app-testing.module.ts b/projects/aca-content/src/lib/testing/app-testing.module.ts index 6907a7e25f..f85f4dba14 100644 --- a/projects/aca-content/src/lib/testing/app-testing.module.ts +++ b/projects/aca-content/src/lib/testing/app-testing.module.ts @@ -23,7 +23,7 @@ */ import { NgModule } from '@angular/core'; -import { TranslatePipe, TranslateModule } from '@ngx-translate/core'; +import { TranslateModule } from '@ngx-translate/core'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslationService, @@ -42,7 +42,6 @@ import { RouterTestingModule } from '@angular/router/testing'; import { EffectsModule } from '@ngrx/effects'; import { MaterialModule } from '../material.module'; import { INITIAL_STATE } from '../store/initial-state'; -import { TranslatePipeMock } from './translate-pipe.directive'; import { BehaviorSubject, Observable, of } from 'rxjs'; import { ContentManagementService } from '../services/content-management.service'; import { DocumentBasePageService } from '@alfresco/aca-shared'; @@ -67,12 +66,10 @@ import { DocumentBasePageService } from '@alfresco/aca-shared'; EffectsModule.forRoot([]), PipeModule ], - declarations: [TranslatePipeMock], - exports: [TranslatePipeMock, RouterTestingModule, MaterialModule, PipeModule], + exports: [RouterTestingModule, MaterialModule, PipeModule, TranslateModule], providers: [ { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }, { provide: TranslationService, useClass: TranslationMock }, - { provide: TranslatePipe, useClass: TranslatePipeMock }, { provide: DocumentBasePageService, useExisting: ContentManagementService }, { provide: DiscoveryApiService, diff --git a/projects/aca-content/src/lib/testing/content-action-ref.ts b/projects/aca-content/src/lib/testing/content-action-ref.ts deleted file mode 100644 index 753725bcbe..0000000000 --- a/projects/aca-content/src/lib/testing/content-action-ref.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * from Hyland Software. If not, see . - */ - -import { ContentActionRef, ContentActionType } from '@alfresco/adf-extensions'; - -export const ACTION_TITLE = 'ACTION_TITLE'; -export const ACTION_CLICK = 'ACTION_CLICK'; - -export const getContentActionRef = (): ContentActionRef => ({ - id: 'id', - type: ContentActionType.button, - title: ACTION_TITLE, - disabled: false, - actions: { - click: ACTION_CLICK - } -}); diff --git a/projects/aca-content/src/lib/testing/translate-pipe.directive.ts b/projects/aca-content/src/lib/testing/translate-pipe.directive.ts deleted file mode 100644 index 2c4e29777a..0000000000 --- a/projects/aca-content/src/lib/testing/translate-pipe.directive.ts +++ /dev/null @@ -1,32 +0,0 @@ -/*! - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. - * - * Alfresco Example Content Application - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * from Hyland Software. If not, see . - */ - -import { Pipe, PipeTransform } from '@angular/core'; - -@Pipe({ name: 'translate' }) -export class TranslatePipeMock implements PipeTransform { - transform(value: any) { - return value; - } -} diff --git a/projects/aca-folder-rules/src/lib/services/actions.service.spec.ts b/projects/aca-folder-rules/src/lib/services/actions.service.spec.ts index 09e2f5ed00..8259bfb557 100644 --- a/projects/aca-folder-rules/src/lib/services/actions.service.spec.ts +++ b/projects/aca-folder-rules/src/lib/services/actions.service.spec.ts @@ -33,8 +33,6 @@ import { of } from 'rxjs'; describe('ActionsService', () => { let actionsService: ActionsService; - let apiCallSpy; - const params = [{}, {}, {}, {}, {}, ['application/json'], ['application/json']]; beforeEach(() => { TestBed.configureTestingModule({ @@ -67,10 +65,11 @@ describe('ActionsService', () => { }); it('loadParameterConstraints should send GET request and return formatted observable', async () => { + const params = [{}, {}, {}, {}, {}, ['application/json'], ['application/json']]; const constraintName = dummyConstraints[0].name; const formattedConstraints = dummyConstraints[0].constraints; - apiCallSpy = spyOn(actionsService, 'publicApiCall') + const apiCallSpy = spyOn(actionsService, 'publicApiCall') .withArgs(`/action-parameter-constraints/${constraintName}`, 'GET', params) .and.returnValue(of(rawConstraints)); @@ -81,7 +80,7 @@ describe('ActionsService', () => { }); it('loadActionParameterConstraints should load the data into the observable', async () => { - spyOn(actionsService, 'getParameterConstraints').and.returnValue(of(dummyConstraints[0].constraints)); + spyOn(actionsService, 'getParameterConstraints').and.returnValue(of(dummyConstraints[0].constraints)); const constraintsPromise = actionsService.parameterConstraints$.pipe(take(2)).toPromise(); diff --git a/projects/aca-folder-rules/src/lib/services/folder-rules.service.spec.ts b/projects/aca-folder-rules/src/lib/services/folder-rules.service.spec.ts index 752e1d7cd2..7631ce2ec2 100644 --- a/projects/aca-folder-rules/src/lib/services/folder-rules.service.spec.ts +++ b/projects/aca-folder-rules/src/lib/services/folder-rules.service.spec.ts @@ -48,7 +48,7 @@ describe('FolderRulesService', () => { const nodeId = owningFolderIdMock; const ruleSetId = 'rule-set-id'; const mockedRule = ruleMock('rule-mock'); - const { id, ...mockedRuleWithoutId } = mockedRule; + const { ...mockedRuleWithoutId } = mockedRule; const mockedRuleEntry = { entry: mockedRule }; const ruleId = mockedRule.id; const mockedRuleSettingsEntry = { entry: ruleSettingsMock }; diff --git a/projects/aca-preview/src/lib/components/preview.component.spec.ts b/projects/aca-preview/src/lib/components/preview.component.spec.ts index 1186fb01f5..36dc3ab01e 100644 --- a/projects/aca-preview/src/lib/components/preview.component.spec.ts +++ b/projects/aca-preview/src/lib/components/preview.component.spec.ts @@ -39,7 +39,7 @@ import { PreviewComponent } from './preview.component'; import { BehaviorSubject, Observable, of, throwError } from 'rxjs'; import { ContentApiService, AppHookService, DocumentBasePageService } from '@alfresco/aca-shared'; import { Store, StoreModule } from '@ngrx/store'; -import { Node, NodePaging, FavoritePaging, SharedLinkPaging, PersonEntry, ResultSetPaging, RepositoryInfo, NodeEntry } from '@alfresco/js-api'; +import { Node, NodePaging, FavoritePaging, SharedLinkPaging, PersonEntry, ResultSetPaging, RepositoryInfo } from '@alfresco/js-api'; import { PreviewModule } from '../preview.module'; import { TranslateModule } from '@ngx-translate/core'; import { RouterTestingModule } from '@angular/router/testing'; @@ -48,10 +48,10 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EffectsModule } from '@ngrx/effects'; class DocumentBasePageServiceMock extends DocumentBasePageService { - canUpdateNode(_node: NodeEntry): boolean { + canUpdateNode(): boolean { return true; } - canUploadContent(_node: Node): boolean { + canUploadContent(): boolean { return true; } } diff --git a/projects/aca-shared/rules/src/test-rule-context.ts b/projects/aca-shared/rules/src/test-rule-context.ts index a60a410bf9..4ed6f77119 100644 --- a/projects/aca-shared/rules/src/test-rule-context.ts +++ b/projects/aca-shared/rules/src/test-rule-context.ts @@ -39,7 +39,7 @@ export class TestRuleContext implements RuleContext { isEmpty: true }; - getEvaluator(_key: string): RuleEvaluator { + getEvaluator(): RuleEvaluator { return undefined; } } diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.spec.ts b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.spec.ts index 80a8b30a45..00998d45ca 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.spec.ts +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.spec.ts @@ -23,14 +23,12 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { By } from '@angular/platform-browser'; import { OpenInAppComponent } from './open-in-app.component'; import { initialState, LibTestingModule } from '../../testing/lib-testing-module'; import { provideMockStore } from '@ngrx/store/testing'; -import { TranslateModule } from '@ngx-translate/core'; import { MatIconTestingModule } from '@angular/material/icon/testing'; -import { MatIconModule } from '@angular/material/icon'; import { SharedModule } from '@alfresco/aca-shared'; describe('OpenInAppComponent', () => { @@ -44,7 +42,7 @@ describe('OpenInAppComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [LibTestingModule, TranslateModule, SharedModule.forRoot(), MatIconModule, MatIconTestingModule], + imports: [LibTestingModule, SharedModule.forRoot(), MatIconTestingModule], providers: [ provideMockStore({ initialState }), { provide: MAT_DIALOG_DATA, useValue: { redirectUrl: 'mockRedirectUrl' } }, @@ -59,14 +57,13 @@ describe('OpenInAppComponent', () => { it('should redirect to app when click on `Open in App` button` ', async () => { let currentLocation: string | string[]; - const windowStub: Window & typeof globalThis = { + component.window = { location: { set href(value: string | string[]) { currentLocation = value; } } } as Window & typeof globalThis; - component.window = windowStub; const saveButton = fixture.debugElement.query(By.css('[data-automation-id="open-in-app-button"]')).nativeElement; saveButton.dispatchEvent(new Event('click')); fixture.detectChanges(); diff --git a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts index 4a6febaedb..873669eff7 100644 --- a/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts +++ b/projects/aca-shared/src/lib/components/open-in-app/open-in-app.component.ts @@ -35,7 +35,7 @@ export interface OpenInAppDialogOptions { encapsulation: ViewEncapsulation.None }) export class OpenInAppComponent { - private redirectUrl: string; + private readonly redirectUrl: string; public window: Window & typeof globalThis = window; constructor( diff --git a/projects/aca-shared/src/lib/directives/pagination.directive.spec.ts b/projects/aca-shared/src/lib/directives/pagination.directive.spec.ts index 7c6f4b4ee0..b6871a3530 100644 --- a/projects/aca-shared/src/lib/directives/pagination.directive.spec.ts +++ b/projects/aca-shared/src/lib/directives/pagination.directive.spec.ts @@ -27,7 +27,6 @@ import { TestBed, ComponentFixture } from '@angular/core/testing'; import { UserPreferencesService, AppConfigService, PaginationComponent, PaginationModel, CoreTestingModule } from '@alfresco/adf-core'; import { initialState, LibTestingModule } from '../testing/lib-testing-module'; import { SharedDirectivesModule } from './shared.directives.module'; -import { TranslateModule } from '@ngx-translate/core'; import { provideMockStore } from '@ngrx/store/testing'; describe('PaginationDirective', () => { @@ -39,7 +38,7 @@ describe('PaginationDirective', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [TranslateModule.forRoot(), LibTestingModule, SharedDirectivesModule, CoreTestingModule], + imports: [LibTestingModule, SharedDirectivesModule, CoreTestingModule], providers: [provideMockStore({ initialState })] }); diff --git a/projects/aca-shared/src/lib/routing/shared.guard.spec.ts b/projects/aca-shared/src/lib/routing/shared.guard.spec.ts index 4f8d47423b..ecd8cbfe6c 100644 --- a/projects/aca-shared/src/lib/routing/shared.guard.spec.ts +++ b/projects/aca-shared/src/lib/routing/shared.guard.spec.ts @@ -33,7 +33,7 @@ describe('AppSharedRuleGuard', () => { const guard = new AppSharedRuleGuard(store); const emittedSpy = jasmine.createSpy('emitted'); - guard.canActivate({} as any).subscribe(emittedSpy); + guard.canActivate().subscribe(emittedSpy); expect(emittedSpy).toHaveBeenCalledWith(true); }); @@ -44,7 +44,7 @@ describe('AppSharedRuleGuard', () => { const guard = new AppSharedRuleGuard(store); const emittedSpy = jasmine.createSpy('emitted'); - guard.canActivateChild({} as any).subscribe(emittedSpy); + guard.canActivateChild().subscribe(emittedSpy); expect(emittedSpy).toHaveBeenCalledWith(true); }); }); diff --git a/projects/aca-shared/src/lib/routing/shared.guard.ts b/projects/aca-shared/src/lib/routing/shared.guard.ts index e7d102a413..701364c4cc 100644 --- a/projects/aca-shared/src/lib/routing/shared.guard.ts +++ b/projects/aca-shared/src/lib/routing/shared.guard.ts @@ -23,7 +23,7 @@ */ import { Injectable } from '@angular/core'; -import { CanActivate, ActivatedRouteSnapshot } from '@angular/router'; +import { CanActivate } from '@angular/router'; import { Observable } from 'rxjs'; import { Store } from '@ngrx/store'; import { AppStore, isQuickShareEnabled } from '@alfresco/aca-shared/store'; @@ -38,11 +38,11 @@ export class AppSharedRuleGuard implements CanActivate { this.isQuickShareEnabled$ = store.select(isQuickShareEnabled); } - canActivate(_: ActivatedRouteSnapshot): Observable { + canActivate(): Observable { return this.isQuickShareEnabled$; } - canActivateChild(route: ActivatedRouteSnapshot): Observable { - return this.canActivate(route); + canActivateChild(): Observable { + return this.canActivate(); } } diff --git a/projects/aca-shared/src/lib/services/app.service.ts b/projects/aca-shared/src/lib/services/app.service.ts index 545a108c26..ff0b80b68e 100644 --- a/projects/aca-shared/src/lib/services/app.service.ts +++ b/projects/aca-shared/src/lib/services/app.service.ts @@ -142,11 +142,9 @@ export class AppService implements OnDestroy { const { router } = this; - this.router.events - .pipe(filter((event) => event instanceof ActivationEnd && event.snapshot.children.length === 0)) - .subscribe((_event: ActivationEnd) => { - this.store.dispatch(new SetCurrentUrlAction(router.url)); - }); + this.router.events.pipe(filter((event) => event instanceof ActivationEnd && event.snapshot.children.length === 0)).subscribe(() => { + this.store.dispatch(new SetCurrentUrlAction(router.url)); + }); this.router.events.pipe(filter((event) => event instanceof NavigationStart)).subscribe(() => { this.store.dispatch(new ResetSelectionAction()); diff --git a/projects/aca-shared/src/lib/testing/lib-testing-module.ts b/projects/aca-shared/src/lib/testing/lib-testing-module.ts index 43f7d991ce..f560d2787d 100644 --- a/projects/aca-shared/src/lib/testing/lib-testing-module.ts +++ b/projects/aca-shared/src/lib/testing/lib-testing-module.ts @@ -87,6 +87,7 @@ export const initialState = { }), PipeModule ], + exports: [TranslateModule], providers: [ { provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }, { provide: TranslationService, useClass: TranslationMock } diff --git a/projects/aca-testing-shared/src/components/search/filters/generic-filter.ts b/projects/aca-testing-shared/src/components/search/filters/generic-filter.ts index 5a9149c403..a3aed6216f 100755 --- a/projects/aca-testing-shared/src/components/search/filters/generic-filter.ts +++ b/projects/aca-testing-shared/src/components/search/filters/generic-filter.ts @@ -27,7 +27,7 @@ import { isPresentAndDisplayed, Utils } from '../../../utilities/utils'; import { BrowserActions, TestElement } from '@alfresco/adf-testing'; export class GenericFilter { - private filterName: string; + private readonly filterName: string; constructor(filterName: string) { this.filterName = filterName; diff --git a/projects/aca-testing-shared/src/components/search/search-input.ts b/projects/aca-testing-shared/src/components/search/search-input.ts index cdd05740c6..abd360ee9c 100755 --- a/projects/aca-testing-shared/src/components/search/search-input.ts +++ b/projects/aca-testing-shared/src/components/search/search-input.ts @@ -24,7 +24,7 @@ import { browser, by } from 'protractor'; import { Component } from '../component'; -import { waitForPresence, waitElement } from '../../utilities/utils'; +import { waitElement, waitForPresence } from '../../utilities/utils'; import { BrowserActions, BrowserVisibility, TestElement } from '@alfresco/adf-testing'; export class SearchInput extends Component { @@ -174,7 +174,7 @@ export class SearchInput extends Component { async searchUntilResult(text: string, methodType: 'URL' | 'UI', waitPerSearch: number = 2000, timeout: number = 20000) { const attempts = Math.round(timeout / waitPerSearch); let loopCount = 0; - let myPromise = new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { const check = async () => { loopCount++; loopCount >= attempts ? reject('File not found') : methodType === 'UI' ? await this.searchFor(text) : await this.searchByURL(text); @@ -182,6 +182,5 @@ export class SearchInput extends Component { }; return check(); }); - return myPromise; } } diff --git a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts index cb766e3b2d..79e9d40db6 100755 --- a/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts +++ b/projects/aca-testing-shared/src/utilities/repo-client/apis/nodes/nodes-api.ts @@ -23,8 +23,8 @@ */ import { RepoApi } from '../repo-api'; -import { NodeContentTree, flattenNodeContentTree } from './node-content-tree'; -import { NodesApi as AdfNodeApi, NodeEntry, NodeChildAssociationPaging } from '@alfresco/js-api'; +import { flattenNodeContentTree, NodeContentTree } from './node-content-tree'; +import { NodeChildAssociationPaging, NodeEntry, NodesApi as AdfNodeApi } from '@alfresco/js-api'; import { Utils } from '../../../../utilities/utils'; export class NodesApi extends RepoApi { @@ -166,8 +166,7 @@ export class NodesApi extends RepoApi { try { await names.reduce(async (previous, current) => { await previous; - const req = await this.deleteNodeByPath(`${relativePath}/${current}`, permanent); - return req; + return await this.deleteNodeByPath(`${relativePath}/${current}`, permanent); }, Promise.resolve()); } catch (error) { this.handleError(`${this.constructor.name} ${this.deleteNodes.name}`, error); diff --git a/projects/aca-viewer/src/lib/components/viewer/viewer.component.ts b/projects/aca-viewer/src/lib/components/viewer/viewer.component.ts index 6ca5f38a31..5bb43c26e2 100644 --- a/projects/aca-viewer/src/lib/components/viewer/viewer.component.ts +++ b/projects/aca-viewer/src/lib/components/viewer/viewer.component.ts @@ -199,7 +199,7 @@ export class AcaViewerComponent implements OnInit, OnDestroy { this.displayNode(file.data.entry.id); }); - this.previewLocation = this.router.url.substr(0, this.router.url.indexOf('/', 1)).replace(/\//g, ''); + this.previewLocation = this.router.url.substring(0, this.router.url.indexOf('/', 1)).replace(/\//g, ''); } onViewerVisibilityChanged() { diff --git a/scripts/gh/update/check-pr-already-exists.js b/scripts/gh/update/check-pr-already-exists.js index 722d7a1a0b..d8fbbf4fb4 100644 --- a/scripts/gh/update/check-pr-already-exists.js +++ b/scripts/gh/update/check-pr-already-exists.js @@ -11,7 +11,7 @@ module.exports = async ({github, context, version}) => { if (prs?.length > 0) { const title = prs[0].title; const result = title.match(version); - return result?.length > 0 ? true : false; + return result?.length > 0; } return false; } diff --git a/scripts/gh/update/latest-version-of.js b/scripts/gh/update/latest-version-of.js index e781a04481..96d4cdf608 100644 --- a/scripts/gh/update/latest-version-of.js +++ b/scripts/gh/update/latest-version-of.js @@ -9,23 +9,23 @@ module.exports = async ({github, dependencyName}) => { const localVersion = pkg.dependencies[dependencyFullName]; - const { data: availablePakages } = await github.rest.packages.getAllPackageVersionsForPackageOwnedByOrg({ + const { data: availablePackages } = await github.rest.packages.getAllPackageVersionsForPackageOwnedByOrg({ package_type: 'npm', package_name: dependencyName, org: organization }); - const latestPkgToUpdate = availablePakages[0]; + const latestPkgToUpdate = availablePackages[0]; if (localVersion === latestPkgToUpdate?.name) { return { hasNewVersion: 'false' }; } else { - const findLocalVerionOnRemote = availablePakages.find((item) => item.name === localVersion); + const findLocalVersionOnRemote = availablePackages.find((item) => item.name === localVersion); let rangeInDays = 'N/A' - if (findLocalVerionOnRemote !== undefined) { - var creationLocal = new Date(findLocalVerionOnRemote.created_at); - var creationLatest = new Date(latestPkgToUpdate.created_at,); - rangeInDays = inDays(creationLocal, creationLatest); + if (findLocalVersionOnRemote !== undefined) { + const creationLocal = new Date(findLocalVersionOnRemote.created_at); + const creationLatest = new Date(latestPkgToUpdate.created_at); + rangeInDays = inDays(creationLocal, creationLatest); } return { hasNewVersion: 'true', remoteVersion: { name: latestPkgToUpdate?.name, rangeInDays } , localVersion}; }