mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
code cleanup (#3210)
* code cleanup * rollback changes * remove dead code * remove debug app config * cleanup unused locales * no-unused-vars rule * test fixes and cleanup * remove unnecessary translate modules
This commit is contained in:
+2
-1
@@ -110,7 +110,8 @@
|
|||||||
"@typescript-eslint/prefer-function-type": "error",
|
"@typescript-eslint/prefer-function-type": "error",
|
||||||
"@typescript-eslint/triple-slash-reference": "error",
|
"@typescript-eslint/triple-slash-reference": "error",
|
||||||
"@typescript-eslint/unified-signatures": "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/consistent-type-definitions": "error",
|
||||||
"@typescript-eslint/dot-notation": "off",
|
"@typescript-eslint/dot-notation": "off",
|
||||||
"@typescript-eslint/member-ordering": "off",
|
"@typescript-eslint/member-ordering": "off",
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export class YourExtensionViewerComponent implements ViewerExtensionInterface {
|
|||||||
node: Node;
|
node: Node;
|
||||||
|
|
||||||
|
|
||||||
....YOUR CUSTOM LOGIC
|
// ....YOUR CUSTOM LOGIC
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ import { Locator, Page } from '@playwright/test';
|
|||||||
import { PlaywrightBase } from '../playwright-base';
|
import { PlaywrightBase } from '../playwright-base';
|
||||||
|
|
||||||
export abstract class BaseComponent extends PlaywrightBase {
|
export abstract class BaseComponent extends PlaywrightBase {
|
||||||
private rootElement: string;
|
private readonly rootElement: string;
|
||||||
private overlayElement = this.page.locator('.cdk-overlay-backdrop-showing');
|
private overlayElement = this.page.locator('.cdk-overlay-backdrop-showing');
|
||||||
|
|
||||||
constructor(page: Page, rootElement: string) {
|
protected constructor(page: Page, rootElement: string) {
|
||||||
super(page);
|
super(page);
|
||||||
this.rootElement = rootElement;
|
this.rootElement = rootElement;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,12 +33,12 @@ export interface NavigateOptions {
|
|||||||
remoteUrl?: string;
|
remoteUrl?: string;
|
||||||
}
|
}
|
||||||
export abstract class BasePage extends PlaywrightBase {
|
export abstract class BasePage extends PlaywrightBase {
|
||||||
private pageUrl: string;
|
private readonly pageUrl: string;
|
||||||
private urlRequest: RegExp;
|
private readonly urlRequest: RegExp;
|
||||||
public snackBar: SnackBarComponent;
|
public snackBar: SnackBarComponent;
|
||||||
public spinner: SpinnerComponent;
|
public spinner: SpinnerComponent;
|
||||||
|
|
||||||
constructor(page: Page, pageUrl: string, urlRequest?: RegExp) {
|
protected constructor(page: Page, pageUrl: string, urlRequest?: RegExp) {
|
||||||
super(page);
|
super(page);
|
||||||
this.pageUrl = pageUrl;
|
this.pageUrl = pageUrl;
|
||||||
this.urlRequest = urlRequest;
|
this.urlRequest = urlRequest;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export abstract class PlaywrightBase {
|
|||||||
public page: Page;
|
public page: Page;
|
||||||
public logger: LoggerLike;
|
public logger: LoggerLike;
|
||||||
|
|
||||||
constructor(page: Page) {
|
protected constructor(page: Page) {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
this.logger = new GenericLogger(process.env.PLAYWRIGHT_CUSTOM_LOG_LEVEL);
|
this.logger = new GenericLogger(process.env.PLAYWRIGHT_CUSTOM_LOG_LEVEL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ describe('Locked Files - available actions : ', () => {
|
|||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await adminApiActions.createUser({ username });
|
await adminApiActions.createUser({ username });
|
||||||
userActions.login(username, username);
|
await userActions.login(username, username);
|
||||||
|
|
||||||
parentId = await userApi.createFolder(parentName);
|
parentId = await userApi.createFolder(parentName);
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ describe('Edit offline', () => {
|
|||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await adminApiActions.createUser({ username });
|
await adminApiActions.createUser({ username });
|
||||||
userActions.login(username, username);
|
await userActions.login(username, username);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('on Personal Files', () => {
|
describe('on Personal Files', () => {
|
||||||
@@ -76,7 +76,7 @@ describe('Edit offline', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
userActions.login(username, username);
|
await userActions.login(username, username);
|
||||||
await userActions.deleteNodes([parentPFId]);
|
await userActions.deleteNodes([parentPFId]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -71,15 +71,15 @@ describe('Upload files', () => {
|
|||||||
it('[T14752064] Close the upload dialog ', async () => {
|
it('[T14752064] Close the upload dialog ', async () => {
|
||||||
await page.uploadFilesDialog.closeUploadButton.click();
|
await page.uploadFilesDialog.closeUploadButton.click();
|
||||||
await page.uploadFilesDialog.uploadDialog.isPresent();
|
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 () => {
|
it('[T14752051] Minimize / maximize the upload dialog ', async () => {
|
||||||
await page.uploadFilesDialog.minimizeButton.click();
|
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 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 () => {
|
it('[T14752053] Upload history is expunged on browser login/logout ', async () => {
|
||||||
@@ -87,12 +87,12 @@ describe('Upload files', () => {
|
|||||||
await loginPage.loginWith(username);
|
await loginPage.loginWith(username);
|
||||||
const isUploadDialogVisible = await page.uploadFilesDialog.uploadDialog.isVisible();
|
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 () => {
|
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 page.clickPersonalFiles();
|
||||||
await expect(page.uploadFilesDialog.uploadDialog.isVisible()).toBe(true);
|
expect(page.uploadFilesDialog.uploadDialog.isVisible()).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ describe('Upload new version', () => {
|
|||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await adminActions.createUser({ username });
|
await adminActions.createUser({ username });
|
||||||
userActions.login(username, username);
|
await userActions.login(username, username);
|
||||||
|
|
||||||
parentPFId = await apis.user.createFolder(parentPF);
|
parentPFId = await apis.user.createFolder(parentPF);
|
||||||
parentSFId = await apis.user.createFolder(parentSF);
|
parentSFId = await apis.user.createFolder(parentSF);
|
||||||
@@ -111,7 +111,7 @@ describe('Upload new version', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
userActions.login(username, username);
|
await userActions.login(username, username);
|
||||||
await userActions.deleteNodes([parentPFId, parentSFId, parentRFId, parentFavId, parentSearchId]);
|
await userActions.deleteNodes([parentPFId, parentSFId, parentRFId, parentFavId, parentSearchId]);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ describe('Upload new version', () => {
|
|||||||
fileLockedSearch1Id = await apis.user.createFile(fileLockedSearch1, parentSearchId);
|
fileLockedSearch1Id = await apis.user.createFile(fileLockedSearch1, parentSearchId);
|
||||||
fileLockedSearch2Id = await apis.user.createFile(fileLockedSearch2, 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 });
|
await apis.user.search.waitForNodes(searchRandom, { expect: 6 });
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ describe('General', () => {
|
|||||||
|
|
||||||
describe('on session expire', () => {
|
describe('on session expire', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
adminActions.login();
|
await adminActions.login();
|
||||||
folderId = (await adminActions.nodes.createFolder(folder)).entry.id;
|
folderId = (await adminActions.nodes.createFolder(folder)).entry.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ describe('File / Folder properties', () => {
|
|||||||
await BrowserActions.click(page.toolbar.viewDetailsButton);
|
await BrowserActions.click(page.toolbar.viewDetailsButton);
|
||||||
await infoDrawer.waitForInfoDrawerToOpen();
|
await infoDrawer.waitForInfoDrawerToOpen();
|
||||||
await infoDrawer.expandDetailsButton.click();
|
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 page.clickPersonalFilesAndWait();
|
||||||
await dataTable.selectItem(parent);
|
await dataTable.selectItem(parent);
|
||||||
@@ -262,7 +262,7 @@ describe('File / Folder properties', () => {
|
|||||||
const expectedSelectedTabTitle = 'permissions';
|
const expectedSelectedTabTitle = 'permissions';
|
||||||
const actualSelectedTabTitle = await infoDrawer.selectedTab.getText();
|
const actualSelectedTabTitle = await infoDrawer.selectedTab.getText();
|
||||||
|
|
||||||
await expect(actualSelectedTabTitle.toLowerCase()).toEqual(expectedSelectedTabTitle);
|
expect(actualSelectedTabTitle.toLowerCase()).toEqual(expectedSelectedTabTitle);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -96,10 +96,10 @@ describe('Favorites', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C213226] displays the favorite files and folders', async () => {
|
it('[C213226] displays the favorite files and folders', async () => {
|
||||||
await expect(await dataTable.getRowsCount()).toEqual(4, 'Incorrect number of items displayed');
|
expect(await dataTable.getRowsCount()).toEqual(4, 'Incorrect number of items displayed');
|
||||||
await expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`);
|
expect(await dataTable.isItemPresent(fileName1)).toBe(true, `${fileName1} not displayed`);
|
||||||
await expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`);
|
expect(await dataTable.isItemPresent(fileName2)).toBe(true, `${fileName2} not displayed`);
|
||||||
await expect(await dataTable.isItemPresent(favFolderName)).toBe(true, `${favFolderName} not displayed`);
|
expect(await dataTable.isItemPresent(favFolderName)).toBe(true, `${favFolderName} not displayed`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`[C213228] deleted favorite file does not appear`, async () => {
|
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 () => {
|
it('[C213650] Location column redirect - item in user Home', async () => {
|
||||||
await dataTable.clickItemLocation(favFolderName);
|
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 () => {
|
it('[C280484] Location column redirect - file in folder', async () => {
|
||||||
await dataTable.clickItemLocation(fileName2);
|
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 () => {
|
it('[C280485] Location column redirect - file in site', async () => {
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ describe('File Libraries', () => {
|
|||||||
const sitesList = await dataTable.getSitesNameAndVisibility();
|
const sitesList = await dataTable.getSitesNameAndVisibility();
|
||||||
|
|
||||||
for (const site of Object.keys(expectedSitesVisibility)) {
|
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();
|
const sitesList = await dataTable.getSitesNameAndRole();
|
||||||
|
|
||||||
for (const site of Object.keys(expectedSitesRoles)) {
|
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 () => {
|
it('[C217098] Site ID is displayed when two sites have the same name', async () => {
|
||||||
const expectedSites = [`${siteName} (${siteId1})`, `${siteName} (${siteId2})`];
|
const expectedSites = [`${siteName} (${siteId1})`, `${siteName} (${siteId2})`];
|
||||||
const actualSites = await dataTable.getCellsContainingName(siteName);
|
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 () => {
|
it('[C217096] Tooltip for sites without description', async () => {
|
||||||
|
|||||||
@@ -85,11 +85,11 @@ describe('Personal Files', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('[C217143] has default sorted column', async () => {
|
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 () => {
|
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 () => {
|
it('[C213244] navigates to folder', async () => {
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ describe('Recent Files', () => {
|
|||||||
|
|
||||||
it('[C213176] Location column redirect - file in user Home', async () => {
|
it('[C213176] Location column redirect - file in user Home', async () => {
|
||||||
await dataTable.clickItemLocation(fileName2);
|
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 () => {
|
it('[C280486] Location column redirect - file in folder', async () => {
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ describe('Shared Files', () => {
|
|||||||
|
|
||||||
it('[C213666] Location column redirect - file in user Home', async () => {
|
it('[C213666] Location column redirect - file in user Home', async () => {
|
||||||
await dataTable.clickItemLocation(file4User);
|
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 () => {
|
it('[C280490] Location column redirect - file in folder', async () => {
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ describe('Remember sorting', () => {
|
|||||||
firstElement: await documentListPage.dataTable.getFirstElementDetail('Name')
|
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.clickFavorites();
|
||||||
await browsingPage.clickPersonalFilesAndWait();
|
await browsingPage.clickPersonalFilesAndWait();
|
||||||
@@ -133,7 +133,7 @@ describe('Remember sorting', () => {
|
|||||||
firstElement: await documentListPage.dataTable.getFirstElementDetail('Name')
|
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 () => {
|
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')
|
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 browsingPage.signOut();
|
||||||
await loginPage.loginWith(user1);
|
await loginPage.loginWith(user1);
|
||||||
@@ -158,7 +158,7 @@ describe('Remember sorting', () => {
|
|||||||
firstElement: await documentListPage.dataTable.getFirstElementDetail('Name')
|
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', () => {
|
describe('Folder actions', () => {
|
||||||
@@ -196,7 +196,7 @@ describe('Remember sorting', () => {
|
|||||||
firstElement: await documentListPage.dataTable.getFirstElementDetail('Name')
|
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 () => {
|
it('[C261139] Sort order is retained when moving a file', async () => {
|
||||||
@@ -218,7 +218,7 @@ describe('Remember sorting', () => {
|
|||||||
firstElement: await documentListPage.dataTable.getFirstElementDetail('Name')
|
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')
|
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 () => {
|
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')
|
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();
|
await browsingPage.clickPersonalFilesAndWait();
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ describe('Remember sorting', () => {
|
|||||||
firstElement: await documentListPage.dataTable.getFirstElementDetail('Name')
|
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 () => {
|
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')
|
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.sortBy('Name', 'desc');
|
||||||
await dataTable.waitForFirstElementToChange(currentPersonalFilesSortDataPage2.firstElement);
|
await dataTable.waitForFirstElementToChange(currentPersonalFilesSortDataPage2.firstElement);
|
||||||
@@ -318,7 +318,7 @@ describe('Remember sorting', () => {
|
|||||||
firstElement: await documentListPage.dataTable.getFirstElementDetail('Name')
|
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 () => {
|
it('[C261150] Sort order is not retained between different users', async () => {
|
||||||
@@ -341,7 +341,7 @@ describe('Remember sorting', () => {
|
|||||||
firstElement: await documentListPage.dataTable.getFirstElementDetail('Name')
|
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();
|
await browsingPage.signOut();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "إلغاء",
|
"CANCEL": "إلغاء",
|
||||||
"UPLOAD": "تحميل"
|
"UPLOAD": "تحميل"
|
||||||
},
|
},
|
||||||
"FORM": {
|
|
||||||
"SUBTITLE": "ما مستوى التغييرات التي تم إجراؤها على هذا الإصدار؟",
|
|
||||||
"VERSION": {
|
|
||||||
"MINOR": "ثانوية (#.1)",
|
|
||||||
"MAJOR": "رئيسية (2.0)"
|
|
||||||
},
|
|
||||||
"COMMENT": {
|
|
||||||
"PLACEHOLDER": "أضف ملاحظات تصف ما تم تغييره"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"SELECTION": {
|
"SELECTION": {
|
||||||
"EMPTY": "يرجى اختيار مستند للاطلاع على إصداراته.",
|
"EMPTY": "يرجى اختيار مستند للاطلاع على إصداراته.",
|
||||||
"NO_PERMISSION": "ليس لديك إذن لإدارة إصدارات هذا المحتوى."
|
"NO_PERMISSION": "ليس لديك إذن لإدارة إصدارات هذا المحتوى."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Zrušit",
|
"CANCEL": "Zrušit",
|
||||||
"UPLOAD": "Odeslat"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Zvolte dokument, u kterého chcete vidět jeho verze.",
|
"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."
|
"NO_PERMISSION": "Nemáte potřebná oprávnění pro správu verzí tohoto obsahu."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Annuller",
|
"CANCEL": "Annuller",
|
||||||
"UPLOAD": "Upload"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Vælg et dokument for at se versionerne af dokumentet.",
|
"EMPTY": "Vælg et dokument for at se versionerne af dokumentet.",
|
||||||
"NO_PERMISSION": "Du har ikke tilladelse til at administrere versionerne af dette indhold."
|
"NO_PERMISSION": "Du har ikke tilladelse til at administrere versionerne af dette indhold."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Abbrechen",
|
"CANCEL": "Abbrechen",
|
||||||
"UPLOAD": "Hochladen"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Wählen Sie ein Dokument aus, um die Versionen davon anzuzeigen.",
|
"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."
|
"NO_PERMISSION": "Sie verfügen nicht über die nötigen Benutzerrechte, um Versionen dieser Inhalte anzuzeigen."
|
||||||
|
|||||||
@@ -479,16 +479,6 @@
|
|||||||
"CANCEL": "Cancel",
|
"CANCEL": "Cancel",
|
||||||
"UPLOAD": "Upload"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Please choose a document to see the versions of it.",
|
"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."
|
"NO_PERMISSION": "You don't have permission to manage the versions of this content."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Cancelar",
|
"CANCEL": "Cancelar",
|
||||||
"UPLOAD": "Cargar"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Por favor, seleccione un documento para ver sus versiones.",
|
"EMPTY": "Por favor, seleccione un documento para ver sus versiones.",
|
||||||
"NO_PERMISSION": "No tiene permiso para gestionar las versiones de este contenido."
|
"NO_PERMISSION": "No tiene permiso para gestionar las versiones de este contenido."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Peruuta",
|
"CANCEL": "Peruuta",
|
||||||
"UPLOAD": "Lataa"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Jos haluat nähdä asiakirjan versiot, valitse haluamasi asiakirja.",
|
"EMPTY": "Jos haluat nähdä asiakirjan versiot, valitse haluamasi asiakirja.",
|
||||||
"NO_PERMISSION": "Sinulla ei ole oikeuksia hallita tämän sisällön versioita."
|
"NO_PERMISSION": "Sinulla ei ole oikeuksia hallita tämän sisällön versioita."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Annuler",
|
"CANCEL": "Annuler",
|
||||||
"UPLOAD": "Importer"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Choisissez un document pour en voir les versions.",
|
"EMPTY": "Choisissez un document pour en voir les versions.",
|
||||||
"NO_PERMISSION": "Vous n'êtes pas autorisé(e) à gérer les versions de ce contenu."
|
"NO_PERMISSION": "Vous n'êtes pas autorisé(e) à gérer les versions de ce contenu."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Annulla",
|
"CANCEL": "Annulla",
|
||||||
"UPLOAD": "Carica"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Selezionare un documento per vedere le versioni.",
|
"EMPTY": "Selezionare un documento per vedere le versioni.",
|
||||||
"NO_PERMISSION": "Non si dispone dell'autorizzazione per gestire le versioni del contenuto."
|
"NO_PERMISSION": "Non si dispone dell'autorizzazione per gestire le versioni del contenuto."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "キャンセル",
|
"CANCEL": "キャンセル",
|
||||||
"UPLOAD": "アップロード"
|
"UPLOAD": "アップロード"
|
||||||
},
|
},
|
||||||
"FORM": {
|
|
||||||
"SUBTITLE": "このバージョンに加えた変更はどのレベルですか?",
|
|
||||||
"VERSION": {
|
|
||||||
"MINOR": "マイナー (#.1)",
|
|
||||||
"MAJOR": "メジャー (2.0)"
|
|
||||||
},
|
|
||||||
"COMMENT": {
|
|
||||||
"PLACEHOLDER": "変更内容の説明を追加してください"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"SELECTION": {
|
"SELECTION": {
|
||||||
"EMPTY": "バージョンを表示する文書を選択してください。",
|
"EMPTY": "バージョンを表示する文書を選択してください。",
|
||||||
"NO_PERMISSION": "このコンテンツのバージョンを管理するための権限がありません。"
|
"NO_PERMISSION": "このコンテンツのバージョンを管理するための権限がありません。"
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Avbryt",
|
"CANCEL": "Avbryt",
|
||||||
"UPLOAD": "Last opp"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Velg et dokument for å se versjonene av det.",
|
"EMPTY": "Velg et dokument for å se versjonene av det.",
|
||||||
"NO_PERMISSION": "Du har ikke tillatelse til å administrere versjonene av dette innholdet."
|
"NO_PERMISSION": "Du har ikke tillatelse til å administrere versjonene av dette innholdet."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Annuleren",
|
"CANCEL": "Annuleren",
|
||||||
"UPLOAD": "Uploaden"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Kies een document om de versies ervan weer te geven.",
|
"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."
|
"NO_PERMISSION": "U hebt geen rechten voor het beheren van de versies van deze content."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Anuluj",
|
"CANCEL": "Anuluj",
|
||||||
"UPLOAD": "Prześlij"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Wybierz dokument, aby zobaczyć jego wersje.",
|
"EMPTY": "Wybierz dokument, aby zobaczyć jego wersje.",
|
||||||
"NO_PERMISSION": "Nie masz uprawnień do zarządzania wersjami tej zawartości."
|
"NO_PERMISSION": "Nie masz uprawnień do zarządzania wersjami tej zawartości."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Cancelar",
|
"CANCEL": "Cancelar",
|
||||||
"UPLOAD": "Carregar"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Escolha um documento para ver suas versões.",
|
"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."
|
"NO_PERMISSION": "Você não tem permissão para gerenciar as versões deste conteúdo."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Отмена",
|
"CANCEL": "Отмена",
|
||||||
"UPLOAD": "Загрузить"
|
"UPLOAD": "Загрузить"
|
||||||
},
|
},
|
||||||
"FORM": {
|
|
||||||
"SUBTITLE": "Изменения какого уровня были выполнены в данной версии?",
|
|
||||||
"VERSION": {
|
|
||||||
"MINOR": "Незначительные (#.1)",
|
|
||||||
"MAJOR": "Значительные (2.0)"
|
|
||||||
},
|
|
||||||
"COMMENT": {
|
|
||||||
"PLACEHOLDER": "Добавьте комментарии с описанием изменений"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"SELECTION": {
|
"SELECTION": {
|
||||||
"EMPTY": "Пожалуйста, выберите документ чтобы просмотреть его версии.",
|
"EMPTY": "Пожалуйста, выберите документ чтобы просмотреть его версии.",
|
||||||
"NO_PERMISSION": "У вас нет разрешения на управление версиями этого контента."
|
"NO_PERMISSION": "У вас нет разрешения на управление версиями этого контента."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "Avbryt",
|
"CANCEL": "Avbryt",
|
||||||
"UPLOAD": "Ladda upp"
|
"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": {
|
"SELECTION": {
|
||||||
"EMPTY": "Välj ett dokument för att se versionerna för det.",
|
"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."
|
"NO_PERMISSION": "Du har inte behörighet att hantera versionerna för det här innehållet."
|
||||||
|
|||||||
@@ -476,16 +476,6 @@
|
|||||||
"CANCEL": "取消",
|
"CANCEL": "取消",
|
||||||
"UPLOAD": "上传"
|
"UPLOAD": "上传"
|
||||||
},
|
},
|
||||||
"FORM": {
|
|
||||||
"SUBTITLE": "对此版本进行了多大程度的变更?",
|
|
||||||
"VERSION": {
|
|
||||||
"MINOR": "次要 (#.1)",
|
|
||||||
"MAJOR": "主要 (2.0)"
|
|
||||||
},
|
|
||||||
"COMMENT": {
|
|
||||||
"PLACEHOLDER": "添加注释,描述变更内容"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"SELECTION": {
|
"SELECTION": {
|
||||||
"EMPTY": "请选定一个文件去看它的版本。",
|
"EMPTY": "请选定一个文件去看它的版本。",
|
||||||
"NO_PERMISSION": "您没有权限管理此内容的版本。"
|
"NO_PERMISSION": "您没有权限管理此内容的版本。"
|
||||||
|
|||||||
@@ -31,13 +31,13 @@ import { AosEditOnlineService, IAosEditOnlineService } from '../aos-extension.se
|
|||||||
import { AosEffects } from './aos.effects';
|
import { AosEffects } from './aos.effects';
|
||||||
|
|
||||||
class AosEditOnlineServiceMock implements IAosEditOnlineService {
|
class AosEditOnlineServiceMock implements IAosEditOnlineService {
|
||||||
onActionEditOnlineAos(_node: MinimalNodeEntryEntity): void {}
|
onActionEditOnlineAos(): void {}
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('AosEffects', () => {
|
describe('AosEffects', () => {
|
||||||
let aosActions$: Observable<AosAction>;
|
let aosActions$: Observable<AosAction>;
|
||||||
let effects: AosEffects;
|
let effects: AosEffects;
|
||||||
let aosEditOnlineServiceMock: AosEditOnlineServiceMock;
|
let aosEditOnlineService: AosEditOnlineService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
aosActions$ = new Observable<AosAction>();
|
aosActions$ = new Observable<AosAction>();
|
||||||
@@ -54,11 +54,11 @@ describe('AosEffects', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
effects = TestBed.inject(AosEffects);
|
effects = TestBed.inject(AosEffects);
|
||||||
aosEditOnlineServiceMock = TestBed.inject(AosEditOnlineService);
|
aosEditOnlineService = TestBed.inject(AosEditOnlineService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call onActionEditOnlineAos on AOS_ACTION', () => {
|
it('should call onActionEditOnlineAos on AOS_ACTION', () => {
|
||||||
const onActionEditOnlineAosSpy = spyOn(aosEditOnlineServiceMock, 'onActionEditOnlineAos');
|
const onActionEditOnlineAosSpy = spyOn(aosEditOnlineService, 'onActionEditOnlineAos');
|
||||||
|
|
||||||
const payload = new MinimalNodeEntryEntity();
|
const payload = new MinimalNodeEntryEntity();
|
||||||
const action = new AosAction(payload);
|
const action = new AosAction(payload);
|
||||||
|
|||||||
@@ -25,15 +25,7 @@
|
|||||||
import { HammerModule } from '@angular/platform-browser';
|
import { HammerModule } from '@angular/platform-browser';
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import {
|
import { TRANSLATION_PROVIDER, CoreModule, AuthGuardEcm, LanguagePickerComponent, NotificationHistoryComponent } from '@alfresco/adf-core';
|
||||||
TRANSLATION_PROVIDER,
|
|
||||||
CoreModule,
|
|
||||||
AppConfigService,
|
|
||||||
DebugAppConfigService,
|
|
||||||
AuthGuardEcm,
|
|
||||||
LanguagePickerComponent,
|
|
||||||
NotificationHistoryComponent
|
|
||||||
} from '@alfresco/adf-core';
|
|
||||||
import {
|
import {
|
||||||
ContentModule,
|
ContentModule,
|
||||||
ContentVersionService,
|
ContentVersionService,
|
||||||
@@ -42,7 +34,7 @@ import {
|
|||||||
LibraryStatusColumnComponent,
|
LibraryStatusColumnComponent,
|
||||||
TrashcanNameColumnComponent
|
TrashcanNameColumnComponent
|
||||||
} from '@alfresco/adf-content-services';
|
} 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 * as rules from '@alfresco/aca-shared/rules';
|
||||||
|
|
||||||
import { FilesComponent } from './components/files/files.component';
|
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 { AppSearchInputModule } from './components/search/search-input.module';
|
||||||
import { DocumentListCustomComponentsModule } from './components/dl-custom-components/document-list-custom-components.module';
|
import { DocumentListCustomComponentsModule } from './components/dl-custom-components/document-list-custom-components.module';
|
||||||
import { AppSearchResultsModule } from './components/search/search-results.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 { FavoritesComponent } from './components/favorites/favorites.component';
|
||||||
import { RecentFilesComponent } from './components/recent-files/recent-files.component';
|
import { RecentFilesComponent } from './components/recent-files/recent-files.component';
|
||||||
import { SharedFilesComponent } from './components/shared-files/shared-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 { ContentUrlService } from './services/content-url.service';
|
||||||
import { HomeComponent } from './components/home/home.component';
|
import { HomeComponent } from './components/home/home.component';
|
||||||
|
|
||||||
import { CommonModule, registerLocaleData } from '@angular/common';
|
import { CommonModule } 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 { LocationLinkComponent } from './components/common/location-link/location-link.component';
|
import { LocationLinkComponent } from './components/common/location-link/location-link.component';
|
||||||
import { LogoutComponent } from './components/common/logout/logout.component';
|
import { LogoutComponent } from './components/common/logout/logout.component';
|
||||||
import { ToggleSharedComponent } from './components/common/toggle-shared/toggle-shared.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 { ShellLayoutComponent, SHELL_NAVBAR_MIN_WIDTH } from '@alfresco/adf-core/shell';
|
||||||
import { UserMenuComponent } from './components/sidenav/user-menu/user-menu.component';
|
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({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
@@ -161,7 +119,6 @@ registerLocaleData(localeSv);
|
|||||||
DocumentListCustomComponentsModule,
|
DocumentListCustomComponentsModule,
|
||||||
AppSearchInputModule,
|
AppSearchInputModule,
|
||||||
AppSearchResultsModule,
|
AppSearchResultsModule,
|
||||||
AppNodeVersionModule,
|
|
||||||
HammerModule,
|
HammerModule,
|
||||||
ViewProfileModule,
|
ViewProfileModule,
|
||||||
AppTrashcanModule,
|
AppTrashcanModule,
|
||||||
@@ -181,7 +138,6 @@ registerLocaleData(localeSv);
|
|||||||
UploadFilesDialogComponent
|
UploadFilesDialogComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: AppConfigService, useClass: DebugAppConfigService },
|
|
||||||
{ provide: ContentVersionService, useClass: ContentUrlService },
|
{ provide: ContentVersionService, useClass: ContentUrlService },
|
||||||
{ provide: DocumentBasePageService, useExisting: ContentManagementService },
|
{ provide: DocumentBasePageService, useExisting: ContentManagementService },
|
||||||
{
|
{
|
||||||
@@ -196,7 +152,7 @@ registerLocaleData(localeSv);
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class ContentServiceExtensionModule {
|
export class ContentServiceExtensionModule {
|
||||||
constructor(public extensions: ExtensionService, public routeExtensionService: RouterExtensionService) {
|
constructor(public extensions: ExtensionService) {
|
||||||
extensions.setAuthGuards({
|
extensions.setAuthGuards({
|
||||||
'app.auth': AuthGuardEcm,
|
'app.auth': AuthGuardEcm,
|
||||||
'app.extensions.dataLoaderGuard': ExtensionsDataLoaderGuard
|
'app.extensions.dataLoaderGuard': ExtensionsDataLoaderGuard
|
||||||
|
|||||||
+2
-9
@@ -26,24 +26,17 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
|||||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||||
import { ContextMenuItemComponent } from './context-menu-item.component';
|
import { ContextMenuItemComponent } from './context-menu-item.component';
|
||||||
import { ContextMenuModule } from './context-menu.module';
|
import { ContextMenuModule } from './context-menu.module';
|
||||||
import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core';
|
|
||||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
describe('ContextMenuComponent', () => {
|
describe('ContextMenuComponent', () => {
|
||||||
let fixture: ComponentFixture<ContextMenuItemComponent>;
|
let fixture: ComponentFixture<ContextMenuItemComponent>;
|
||||||
let component: ContextMenuItemComponent;
|
let component: ContextMenuItemComponent;
|
||||||
let extensionsService;
|
let extensionsService: AppExtensionService;
|
||||||
let contextItem;
|
let contextItem;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [AppTestingModule, ContextMenuModule],
|
||||||
AppTestingModule,
|
|
||||||
ContextMenuModule,
|
|
||||||
TranslateModule.forRoot({
|
|
||||||
loader: { provide: TranslateLoader, useClass: TranslateFakeLoader }
|
|
||||||
})
|
|
||||||
],
|
|
||||||
providers: [AppExtensionService]
|
providers: [AppExtensionService]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable, Injector, ComponentRef } from '@angular/core';
|
import { ComponentRef, Injectable, Injector } from '@angular/core';
|
||||||
import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
|
import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
|
||||||
import { ComponentPortal } from '@angular/cdk/portal';
|
import { ComponentPortal } from '@angular/cdk/portal';
|
||||||
import { ContextMenuOverlayRef } from './context-menu-overlay';
|
import { ContextMenuOverlayRef } from './context-menu-overlay';
|
||||||
@@ -97,7 +97,7 @@ export class ContextMenuService {
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const overlayConfig = new OverlayConfig({
|
return new OverlayConfig({
|
||||||
hasBackdrop: config.hasBackdrop,
|
hasBackdrop: config.hasBackdrop,
|
||||||
backdropClass: config.backdropClass,
|
backdropClass: config.backdropClass,
|
||||||
panelClass: config.panelClass,
|
panelClass: config.panelClass,
|
||||||
@@ -105,7 +105,5 @@ export class ContextMenuService {
|
|||||||
positionStrategy,
|
positionStrategy,
|
||||||
direction: this.direction
|
direction: this.direction
|
||||||
});
|
});
|
||||||
|
|
||||||
return overlayConfig;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,26 +24,34 @@
|
|||||||
|
|
||||||
import { CreateMenuComponent } from './create-menu.component';
|
import { CreateMenuComponent } from './create-menu.component';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { CoreModule } from '@alfresco/adf-core';
|
|
||||||
import { AppCreateMenuModule } from './create-menu.module';
|
import { AppCreateMenuModule } from './create-menu.module';
|
||||||
import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay';
|
import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay';
|
||||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||||
import { ContentActionType } from '@alfresco/adf-extensions';
|
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||||
import { MatMenuModule } from '@angular/material/menu';
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { getContentActionRef } from '../../testing/content-action-ref';
|
import { ContentActionRef, ContentActionType } from '@alfresco/adf-extensions';
|
||||||
|
|
||||||
describe('CreateMenuComponent', () => {
|
describe('CreateMenuComponent', () => {
|
||||||
let fixture: ComponentFixture<CreateMenuComponent>;
|
let fixture: ComponentFixture<CreateMenuComponent>;
|
||||||
let extensionService: AppExtensionService;
|
let extensionService: AppExtensionService;
|
||||||
let getCreateActionsSpy: jasmine.Spy;
|
let getCreateActionsSpy: jasmine.Spy;
|
||||||
|
|
||||||
|
const getContentActionRef = (): ContentActionRef => ({
|
||||||
|
id: 'id',
|
||||||
|
type: ContentActionType.button,
|
||||||
|
title: 'ACTION_TITLE',
|
||||||
|
disabled: false,
|
||||||
|
actions: {
|
||||||
|
click: 'ACTION_CLICK'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [AppTestingModule, CoreModule.forRoot(), AppCreateMenuModule, OverlayModule, MatMenuModule, MatButtonModule]
|
imports: [AppTestingModule, AppCreateMenuModule, OverlayModule, MatMenuModule, MatButtonModule]
|
||||||
});
|
});
|
||||||
|
|
||||||
extensionService = TestBed.inject(AppExtensionService);
|
extensionService = TestBed.inject(AppExtensionService);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import { AppTestingModule } from '../../testing/app-testing.module';
|
|||||||
import { DetailsComponent } from './details.component';
|
import { DetailsComponent } from './details.component';
|
||||||
import { MetadataTabComponent } from '../info-drawer/metadata-tab/metadata-tab.component';
|
import { MetadataTabComponent } from '../info-drawer/metadata-tab/metadata-tab.component';
|
||||||
import { CommentsTabComponent } from '../info-drawer/comments-tab/comments-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 { of, Subject } from 'rxjs';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
@@ -36,16 +36,14 @@ import { AppExtensionService } from '@alfresco/adf-extensions';
|
|||||||
import { ContentApiService } from '@alfresco/aca-shared';
|
import { ContentApiService } from '@alfresco/aca-shared';
|
||||||
import { SetSelectedNodesAction } from '@alfresco/aca-shared/store';
|
import { SetSelectedNodesAction } from '@alfresco/aca-shared/store';
|
||||||
import { NodeEntry } from '@alfresco/js-api';
|
import { NodeEntry } from '@alfresco/js-api';
|
||||||
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
|
|
||||||
describe('DetailsComponent', () => {
|
describe('DetailsComponent', () => {
|
||||||
let component: DetailsComponent;
|
let component: DetailsComponent;
|
||||||
let fixture: ComponentFixture<DetailsComponent>;
|
let fixture: ComponentFixture<DetailsComponent>;
|
||||||
let contentApiService: ContentApiService;
|
let contentApiService: ContentApiService;
|
||||||
let store;
|
let store: Store;
|
||||||
const router: any = {
|
|
||||||
url: '',
|
|
||||||
navigate: jasmine.createSpy('navigate')
|
|
||||||
};
|
|
||||||
const mockStream = new Subject();
|
const mockStream = new Subject();
|
||||||
const storeMock = {
|
const storeMock = {
|
||||||
dispatch: jasmine.createSpy('dispatch'),
|
dispatch: jasmine.createSpy('dispatch'),
|
||||||
@@ -59,10 +57,7 @@ describe('DetailsComponent', () => {
|
|||||||
providers: [
|
providers: [
|
||||||
ContentManagementService,
|
ContentManagementService,
|
||||||
AppExtensionService,
|
AppExtensionService,
|
||||||
{
|
RouterTestingModule,
|
||||||
provide: Router,
|
|
||||||
useValue: router
|
|
||||||
},
|
|
||||||
{ provide: Store, useValue: storeMock },
|
{ provide: Store, useValue: storeMock },
|
||||||
{
|
{
|
||||||
provide: ActivatedRoute,
|
provide: ActivatedRoute,
|
||||||
|
|||||||
+3
-3
@@ -26,13 +26,13 @@ import { CustomNameColumnComponent } from './name-column.component';
|
|||||||
import { DocumentListCustomComponentsModule } from '../document-list-custom-components.module';
|
import { DocumentListCustomComponentsModule } from '../document-list-custom-components.module';
|
||||||
import { Actions } from '@ngrx/effects';
|
import { Actions } from '@ngrx/effects';
|
||||||
import { StoreModule } from '@ngrx/store';
|
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 { CoreModule } from '@alfresco/adf-core';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
describe('CustomNameColumnComponent', () => {
|
describe('CustomNameColumnComponent', () => {
|
||||||
let fixture;
|
let fixture: ComponentFixture<CustomNameColumnComponent>;
|
||||||
let component;
|
let component: CustomNameColumnComponent;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { HomeComponent } from './home.component';
|
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 { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { HttpClientModule } from '@angular/common/http';
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
@@ -34,12 +34,11 @@ describe('HomeComponent', () => {
|
|||||||
let fixture: ComponentFixture<HomeComponent>;
|
let fixture: ComponentFixture<HomeComponent>;
|
||||||
let router: Router;
|
let router: Router;
|
||||||
|
|
||||||
setupTestBed({
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientModule, RouterTestingModule],
|
imports: [HttpClientModule, RouterTestingModule],
|
||||||
providers: [{ provide: AppConfigService, useClass: AppConfigServiceMock }]
|
providers: [{ provide: AppConfigService, useClass: AppConfigServiceMock }]
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(HomeComponent);
|
fixture = TestBed.createComponent(HomeComponent);
|
||||||
router = TestBed.inject(Router);
|
router = TestBed.inject(Router);
|
||||||
appConfig = TestBed.inject(AppConfigService);
|
appConfig = TestBed.inject(AppConfigService);
|
||||||
|
|||||||
+9
-15
@@ -26,10 +26,10 @@ import { MetadataTabComponent } from './metadata-tab.component';
|
|||||||
import { Node } from '@alfresco/js-api';
|
import { Node } from '@alfresco/js-api';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
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 { ContentMetadataModule } from '@alfresco/adf-content-services';
|
||||||
import { Store } from '@ngrx/store';
|
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 { By } from '@angular/platform-browser';
|
||||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
@@ -46,10 +46,12 @@ describe('MetadataTabComponent', () => {
|
|||||||
custom: []
|
custom: []
|
||||||
};
|
};
|
||||||
|
|
||||||
setupTestBed({
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
imports: [CoreModule, AppTestingModule, ContentMetadataModule],
|
imports: [CoreModule, AppTestingModule, ContentMetadataModule],
|
||||||
declarations: [MetadataTabComponent]
|
declarations: [MetadataTabComponent]
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
fixture.destroy();
|
fixture.destroy();
|
||||||
@@ -87,45 +89,37 @@ describe('MetadataTabComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should return true if node is not locked and has update permission', () => {
|
it('should return true if node is not locked and has update permission', () => {
|
||||||
const node = {
|
component.node = {
|
||||||
isLocked: false,
|
isLocked: false,
|
||||||
allowableOperations: ['update']
|
allowableOperations: ['update']
|
||||||
} as Node;
|
} as Node;
|
||||||
|
|
||||||
component.node = node;
|
|
||||||
expect(component.canUpdateNode).toBe(true);
|
expect(component.canUpdateNode).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return false if node is locked', () => {
|
it('should return false if node is locked', () => {
|
||||||
const node = {
|
component.node = {
|
||||||
isLocked: true,
|
isLocked: true,
|
||||||
allowableOperations: ['update']
|
allowableOperations: ['update']
|
||||||
} as Node;
|
} as Node;
|
||||||
|
|
||||||
component.node = node;
|
|
||||||
expect(component.canUpdateNode).toBe(false);
|
expect(component.canUpdateNode).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return false if node has no update permission', () => {
|
it('should return false if node has no update permission', () => {
|
||||||
const node = {
|
component.node = {
|
||||||
isLocked: false,
|
isLocked: false,
|
||||||
allowableOperations: ['other']
|
allowableOperations: ['other']
|
||||||
} as Node;
|
} as Node;
|
||||||
|
|
||||||
component.node = node;
|
|
||||||
expect(component.canUpdateNode).toBe(false);
|
expect(component.canUpdateNode).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return false if node has read only property', () => {
|
it('should return false if node has read only property', () => {
|
||||||
const node = {
|
component.node = {
|
||||||
isLocked: false,
|
isLocked: false,
|
||||||
allowableOperations: ['update'],
|
allowableOperations: ['update'],
|
||||||
properties: {
|
properties: {
|
||||||
'cm:lockType': 'WRITE_LOCK'
|
'cm:lockType': 'WRITE_LOCK'
|
||||||
}
|
}
|
||||||
} as Node;
|
} as Node;
|
||||||
|
|
||||||
component.node = node;
|
|
||||||
expect(component.canUpdateNode).toBe(false);
|
expect(component.canUpdateNode).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
<form novalidate [formGroup]="form" class="form">
|
|
||||||
<p class="form__subtitle">
|
|
||||||
{{ 'VERSION.FORM.SUBTITLE' | translate }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<mat-radio-group formControlName="version" class="form__version">
|
|
||||||
<mat-radio-button
|
|
||||||
class="form__version--option"
|
|
||||||
color="primary"
|
|
||||||
*ngFor="let option of versions"
|
|
||||||
[attr.data-automation-id]="option.value"
|
|
||||||
[value]="option.value"
|
|
||||||
>
|
|
||||||
{{ option.label | translate }}
|
|
||||||
</mat-radio-button>
|
|
||||||
</mat-radio-group>
|
|
||||||
|
|
||||||
<mat-form-field class="form__comment">
|
|
||||||
<textarea
|
|
||||||
matInput
|
|
||||||
placeholder="{{ 'VERSION.FORM.COMMENT.PLACEHOLDER' | translate }}"
|
|
||||||
rows="1"
|
|
||||||
autocomplete="off"
|
|
||||||
formControlName="comment"
|
|
||||||
></textarea>
|
|
||||||
</mat-form-field>
|
|
||||||
</form>
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-66
@@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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<VersionFormEntry> = new EventEmitter();
|
|
||||||
|
|
||||||
form: UntypedFormGroup;
|
|
||||||
|
|
||||||
private onDestroy$: Subject<boolean> = new Subject<boolean>();
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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 {}
|
|
||||||
+1
-2
@@ -81,14 +81,13 @@ export class SearchLibrariesQueryBuilderService {
|
|||||||
buildQuery(): LibrarySearchQuery {
|
buildQuery(): LibrarySearchQuery {
|
||||||
const query = this.userQuery;
|
const query = this.userQuery;
|
||||||
if (query && query.length > 1) {
|
if (query && query.length > 1) {
|
||||||
const resultQuery = {
|
return {
|
||||||
term: query,
|
term: query,
|
||||||
opts: {
|
opts: {
|
||||||
skipCount: this.paging && this.paging.skipCount,
|
skipCount: this.paging && this.paging.skipCount,
|
||||||
maxItems: this.paging && this.paging.maxItems
|
maxItems: this.paging && this.paging.maxItems
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return resultQuery;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -25,7 +25,6 @@
|
|||||||
import { NodeEntry } from '@alfresco/js-api';
|
import { NodeEntry } from '@alfresco/js-api';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { CoreModule } from '@angular/flex-layout';
|
import { CoreModule } from '@angular/flex-layout';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { AppSearchResultsModule } from '../search-results.module';
|
import { AppSearchResultsModule } from '../search-results.module';
|
||||||
import { SearchResultsRowComponent } from './search-results-row.component';
|
import { SearchResultsRowComponent } from './search-results-row.component';
|
||||||
@@ -45,7 +44,7 @@ describe('SearchResultsRowComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), CoreModule, AppTestingModule, AppSearchResultsModule]
|
imports: [CoreModule, AppTestingModule, AppSearchResultsModule]
|
||||||
});
|
});
|
||||||
|
|
||||||
fixture = TestBed.createComponent(SearchResultsRowComponent);
|
fixture = TestBed.createComponent(SearchResultsRowComponent);
|
||||||
|
|||||||
+1
-2
@@ -31,7 +31,6 @@ import { NavigateToFolder, SnackbarErrorAction } from '@alfresco/aca-shared/stor
|
|||||||
import { Pagination, SearchRequest } from '@alfresco/js-api';
|
import { Pagination, SearchRequest } from '@alfresco/js-api';
|
||||||
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
import { SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { BehaviorSubject, Subject } from 'rxjs';
|
import { BehaviorSubject, Subject } from 'rxjs';
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { AppService } from '@alfresco/aca-shared';
|
import { AppService } from '@alfresco/aca-shared';
|
||||||
@@ -50,7 +49,7 @@ describe('SearchComponent', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
params = new BehaviorSubject({ q: 'TYPE: "cm:folder" AND %28=cm: name: email OR cm: name: budget%29' });
|
params = new BehaviorSubject({ q: 'TYPE: "cm:folder" AND %28=cm: name: email OR cm: name: budget%29' });
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), AppTestingModule, CoreModule.forRoot(), AppSearchResultsModule],
|
imports: [AppTestingModule, CoreModule.forRoot(), AppSearchResultsModule],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: AppService,
|
provide: AppService,
|
||||||
|
|||||||
+1
-8
@@ -26,7 +26,6 @@ import { ButtonMenuComponent } from './button-menu.component';
|
|||||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core';
|
|
||||||
import { AppSidenavModule } from '../sidenav.module';
|
import { AppSidenavModule } from '../sidenav.module';
|
||||||
|
|
||||||
describe('ButtonMenuComponent', () => {
|
describe('ButtonMenuComponent', () => {
|
||||||
@@ -36,13 +35,7 @@ describe('ButtonMenuComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [AppTestingModule, AppSidenavModule]
|
||||||
AppTestingModule,
|
|
||||||
AppSidenavModule,
|
|
||||||
TranslateModule.forRoot({
|
|
||||||
loader: { provide: TranslateLoader, useClass: TranslateFakeLoader }
|
|
||||||
})
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ButtonMenuComponent);
|
fixture = TestBed.createComponent(ButtonMenuComponent);
|
||||||
|
|||||||
+1
-8
@@ -26,7 +26,6 @@ import { ExpandMenuComponent } from './expand-menu.component';
|
|||||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { TranslateModule, TranslateLoader, TranslateFakeLoader } from '@ngx-translate/core';
|
|
||||||
import { AppSidenavModule } from '../sidenav.module';
|
import { AppSidenavModule } from '../sidenav.module';
|
||||||
|
|
||||||
describe('ExpandMenuComponent', () => {
|
describe('ExpandMenuComponent', () => {
|
||||||
@@ -36,13 +35,7 @@ describe('ExpandMenuComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [AppTestingModule, AppSidenavModule]
|
||||||
AppTestingModule,
|
|
||||||
AppSidenavModule,
|
|
||||||
TranslateModule.forRoot({
|
|
||||||
loader: { provide: TranslateLoader, useClass: TranslateFakeLoader }
|
|
||||||
})
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
fixture = TestBed.createComponent(ExpandMenuComponent);
|
fixture = TestBed.createComponent(ExpandMenuComponent);
|
||||||
|
|||||||
-38
@@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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' } = {};
|
|
||||||
}
|
|
||||||
+2
-1
@@ -28,6 +28,7 @@ import { PeopleContentService } from '@alfresco/adf-content-services';
|
|||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { UserMenuComponent } from './user-menu.component';
|
import { UserMenuComponent } from './user-menu.component';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
|
import { SharedToolbarModule } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
describe('UserMenuComponent', () => {
|
describe('UserMenuComponent', () => {
|
||||||
let component: UserMenuComponent;
|
let component: UserMenuComponent;
|
||||||
@@ -106,7 +107,7 @@ describe('UserMenuComponent', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [AppTestingModule],
|
imports: [AppTestingModule, SharedToolbarModule],
|
||||||
declarations: [UserMenuComponent],
|
declarations: [UserMenuComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: AuthenticationService, useValue: authServiceStub },
|
{ provide: AuthenticationService, useValue: authServiceStub },
|
||||||
|
|||||||
+1
-2
@@ -25,7 +25,6 @@
|
|||||||
import { DocumentDisplayModeComponent } from './document-display-mode.component';
|
import { DocumentDisplayModeComponent } from './document-display-mode.component';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { CoreModule } from '@angular/flex-layout';
|
import { CoreModule } from '@angular/flex-layout';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
|
|
||||||
@@ -35,7 +34,7 @@ describe('DocumentDisplayModeComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), CoreModule, AppTestingModule]
|
imports: [CoreModule, AppTestingModule]
|
||||||
});
|
});
|
||||||
|
|
||||||
fixture = TestBed.createComponent(DocumentDisplayModeComponent);
|
fixture = TestBed.createComponent(DocumentDisplayModeComponent);
|
||||||
|
|||||||
+1
-2
@@ -30,7 +30,6 @@ import { Store } from '@ngrx/store';
|
|||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { AppHookService, ContentApiService } from '@alfresco/aca-shared';
|
import { AppHookService, ContentApiService } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
describe('ToggleFavoriteLibraryComponent', () => {
|
describe('ToggleFavoriteLibraryComponent', () => {
|
||||||
@@ -46,7 +45,7 @@ describe('ToggleFavoriteLibraryComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), AppTestingModule],
|
imports: [CoreModule.forRoot(), AppTestingModule],
|
||||||
declarations: [ToggleFavoriteLibraryComponent],
|
declarations: [ToggleFavoriteLibraryComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-2
@@ -29,7 +29,6 @@ import { ExtensionService } from '@alfresco/adf-extensions';
|
|||||||
import { CoreModule } from '@alfresco/adf-core';
|
import { CoreModule } from '@alfresco/adf-core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { ContentDirectiveModule } from '@alfresco/adf-content-services';
|
import { ContentDirectiveModule } from '@alfresco/adf-content-services';
|
||||||
|
|
||||||
@@ -51,7 +50,7 @@ describe('ToggleFavoriteComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContentDirectiveModule, AppTestingModule],
|
imports: [CoreModule.forRoot(), ContentDirectiveModule, AppTestingModule],
|
||||||
declarations: [ToggleFavoriteComponent],
|
declarations: [ToggleFavoriteComponent],
|
||||||
providers: [ExtensionService, { provide: Store, useValue: mockStore }, { provide: Router, useValue: mockRouter }]
|
providers: [ExtensionService, { provide: Store, useValue: mockStore }, { provide: Router, useValue: mockRouter }]
|
||||||
});
|
});
|
||||||
|
|||||||
+1
-2
@@ -25,7 +25,6 @@
|
|||||||
import { ToggleInfoDrawerComponent } from './toggle-info-drawer.component';
|
import { ToggleInfoDrawerComponent } from './toggle-info-drawer.component';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { CoreModule } from '@angular/flex-layout';
|
import { CoreModule } from '@angular/flex-layout';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
@@ -40,7 +39,7 @@ describe('ToggleInfoDrawerComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), CoreModule, AppTestingModule],
|
imports: [CoreModule, AppTestingModule],
|
||||||
providers: [{ provide: Store, useValue: storeMock }]
|
providers: [{ provide: Store, useValue: storeMock }]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CanActivate, ActivatedRouteSnapshot } from '@angular/router';
|
import { CanActivate } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { AuthenticationService } from '@alfresco/adf-core';
|
import { AuthenticationService } from '@alfresco/adf-core';
|
||||||
|
|
||||||
@@ -33,11 +33,11 @@ import { AuthenticationService } from '@alfresco/adf-core';
|
|||||||
export class ViewProfileRuleGuard implements CanActivate {
|
export class ViewProfileRuleGuard implements CanActivate {
|
||||||
constructor(private authService: AuthenticationService) {}
|
constructor(private authService: AuthenticationService) {}
|
||||||
|
|
||||||
canActivate(_: ActivatedRouteSnapshot): Observable<boolean> | Promise<boolean> | boolean {
|
canActivate(): Observable<boolean> | Promise<boolean> | boolean {
|
||||||
return this.isEcmLoggedIn() || this.authService.isOauth();
|
return this.isEcmLoggedIn() || this.authService.isOauth();
|
||||||
}
|
}
|
||||||
|
|
||||||
private isEcmLoggedIn() {
|
private isEcmLoggedIn(): boolean {
|
||||||
return this.authService.isEcmLoggedIn() || (this.authService.isECMProvider() && this.authService.isKerberosEnabled());
|
return this.authService.isEcmLoggedIn() || (this.authService.isECMProvider() && this.authService.isKerberosEnabled());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -30,7 +30,6 @@ import { MatDialogModule, MAT_DIALOG_DATA, MatDialogRef } from '@angular/materia
|
|||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { CreateFromTemplate } from '@alfresco/aca-shared/store';
|
import { CreateFromTemplate } from '@alfresco/aca-shared/store';
|
||||||
import { Node } from '@alfresco/js-api';
|
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('');
|
const text = (length: number) => new Array(length).fill(Math.random().toString().substring(2, 3)).join('');
|
||||||
|
|
||||||
@@ -52,7 +51,7 @@ describe('CreateFileFromTemplateDialogComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), AppTestingModule, MatDialogModule],
|
imports: [CoreModule.forRoot(), AppTestingModule, MatDialogModule],
|
||||||
declarations: [CreateFromTemplateDialogComponent],
|
declarations: [CreateFromTemplateDialogComponent],
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ContentServiceExtensionService } from './content-service-extension.service';
|
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 { TestBed } from '@angular/core/testing';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { HttpClientModule } from '@angular/common/http';
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
@@ -32,12 +32,11 @@ describe('ContentServiceExtensionService', () => {
|
|||||||
let service: ContentServiceExtensionService;
|
let service: ContentServiceExtensionService;
|
||||||
let appConfig: AppConfigService;
|
let appConfig: AppConfigService;
|
||||||
|
|
||||||
setupTestBed({
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientModule],
|
imports: [HttpClientModule],
|
||||||
providers: [{ provide: AppConfigService, useClass: AppConfigServiceMock }]
|
providers: [{ provide: AppConfigService, useClass: AppConfigServiceMock }]
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
service = TestBed.inject(ContentServiceExtensionService);
|
service = TestBed.inject(ContentServiceExtensionService);
|
||||||
appConfig = TestBed.inject(AppConfigService);
|
appConfig = TestBed.inject(AppConfigService);
|
||||||
appConfig.config = Object.assign(appConfig.config, {
|
appConfig.config = Object.assign(appConfig.config, {
|
||||||
|
|||||||
@@ -876,7 +876,7 @@ describe('NodeActionsService', () => {
|
|||||||
|
|
||||||
it('should try to move children nodes of a folder to already existing folder with same name', () => {
|
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 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) {
|
if (nodeId === parentFolderToMove.entry.id) {
|
||||||
return throwError(conflictError);
|
return throwError(conflictError);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { Observable, Subject, of, zip, from } from 'rxjs';
|
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 {
|
import {
|
||||||
DocumentListService,
|
DocumentListService,
|
||||||
ContentNodeSelectorComponent,
|
ContentNodeSelectorComponent,
|
||||||
@@ -565,7 +565,7 @@ export class NodeActionsService {
|
|||||||
return !node.isFile && node.nodeType !== 'app:folderlink';
|
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;
|
const entry: MinimalNodeEntryEntity = row.node.entry;
|
||||||
if (!this.contentService.hasAllowableOperations(entry, 'update')) {
|
if (!this.contentService.hasAllowableOperations(entry, 'update')) {
|
||||||
return this.thumbnailService.getMimeTypeIcon('disable/folder');
|
return this.thumbnailService.getMimeTypeIcon('disable/folder');
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ import { UploadService, FileModel } from '@alfresco/adf-content-services';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class UploadEffects {
|
export class UploadEffects {
|
||||||
private fileInput: HTMLInputElement;
|
private readonly fileInput: HTMLInputElement;
|
||||||
private folderInput: HTMLInputElement;
|
private readonly folderInput: HTMLInputElement;
|
||||||
private fileVersionInput: HTMLInputElement;
|
private readonly fileVersionInput: HTMLInputElement;
|
||||||
private readonly uploadMenuButtonSelector = 'app-toolbar-menu button[id="app.toolbar.upload"]';
|
private readonly uploadMenuButtonSelector = 'app-toolbar-menu button[id="app.toolbar.upload"]';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -132,7 +132,7 @@ export class UploadEffects {
|
|||||||
this.contentService
|
this.contentService
|
||||||
.getNodeInfo()
|
.getNodeInfo()
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError((_) => {
|
catchError(() => {
|
||||||
this.store.dispatch(new SnackbarErrorAction('VERSION.ERROR.GENERIC'));
|
this.store.dispatch(new SnackbarErrorAction('VERSION.ERROR.GENERIC'));
|
||||||
return of(null);
|
return of(null);
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ export class ViewerEffects {
|
|||||||
|
|
||||||
let previewLocation = this.router.url;
|
let previewLocation = this.router.url;
|
||||||
if (previewLocation.lastIndexOf('/') > 0) {
|
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, '');
|
previewLocation = previewLocation.replace(/\//g, '');
|
||||||
|
|
||||||
|
|||||||
@@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
|
||||||
import { Observable, of } from 'rxjs';
|
|
||||||
import { getContentActionRef } from './content-action-ref';
|
|
||||||
export class AppExtensionServiceMock {
|
|
||||||
getMainAction(): Observable<ContentActionRef> {
|
|
||||||
return of(getContentActionRef());
|
|
||||||
}
|
|
||||||
|
|
||||||
runActionById(_id: string) {}
|
|
||||||
}
|
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { NgModule } from '@angular/core';
|
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 { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import {
|
import {
|
||||||
TranslationService,
|
TranslationService,
|
||||||
@@ -42,7 +42,6 @@ import { RouterTestingModule } from '@angular/router/testing';
|
|||||||
import { EffectsModule } from '@ngrx/effects';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
import { MaterialModule } from '../material.module';
|
import { MaterialModule } from '../material.module';
|
||||||
import { INITIAL_STATE } from '../store/initial-state';
|
import { INITIAL_STATE } from '../store/initial-state';
|
||||||
import { TranslatePipeMock } from './translate-pipe.directive';
|
|
||||||
import { BehaviorSubject, Observable, of } from 'rxjs';
|
import { BehaviorSubject, Observable, of } from 'rxjs';
|
||||||
import { ContentManagementService } from '../services/content-management.service';
|
import { ContentManagementService } from '../services/content-management.service';
|
||||||
import { DocumentBasePageService } from '@alfresco/aca-shared';
|
import { DocumentBasePageService } from '@alfresco/aca-shared';
|
||||||
@@ -67,12 +66,10 @@ import { DocumentBasePageService } from '@alfresco/aca-shared';
|
|||||||
EffectsModule.forRoot([]),
|
EffectsModule.forRoot([]),
|
||||||
PipeModule
|
PipeModule
|
||||||
],
|
],
|
||||||
declarations: [TranslatePipeMock],
|
exports: [RouterTestingModule, MaterialModule, PipeModule, TranslateModule],
|
||||||
exports: [TranslatePipeMock, RouterTestingModule, MaterialModule, PipeModule],
|
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||||
{ provide: TranslationService, useClass: TranslationMock },
|
{ provide: TranslationService, useClass: TranslationMock },
|
||||||
{ provide: TranslatePipe, useClass: TranslatePipeMock },
|
|
||||||
{ provide: DocumentBasePageService, useExisting: ContentManagementService },
|
{ provide: DocumentBasePageService, useExisting: ContentManagementService },
|
||||||
{
|
{
|
||||||
provide: DiscoveryApiService,
|
provide: DiscoveryApiService,
|
||||||
|
|||||||
@@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Pipe, PipeTransform } from '@angular/core';
|
|
||||||
|
|
||||||
@Pipe({ name: 'translate' })
|
|
||||||
export class TranslatePipeMock implements PipeTransform {
|
|
||||||
transform(value: any) {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -33,8 +33,6 @@ import { of } from 'rxjs';
|
|||||||
|
|
||||||
describe('ActionsService', () => {
|
describe('ActionsService', () => {
|
||||||
let actionsService: ActionsService;
|
let actionsService: ActionsService;
|
||||||
let apiCallSpy;
|
|
||||||
const params = [{}, {}, {}, {}, {}, ['application/json'], ['application/json']];
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -67,10 +65,11 @@ describe('ActionsService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('loadParameterConstraints should send GET request and return formatted observable', async () => {
|
it('loadParameterConstraints should send GET request and return formatted observable', async () => {
|
||||||
|
const params = [{}, {}, {}, {}, {}, ['application/json'], ['application/json']];
|
||||||
const constraintName = dummyConstraints[0].name;
|
const constraintName = dummyConstraints[0].name;
|
||||||
const formattedConstraints = dummyConstraints[0].constraints;
|
const formattedConstraints = dummyConstraints[0].constraints;
|
||||||
|
|
||||||
apiCallSpy = spyOn<any>(actionsService, 'publicApiCall')
|
const apiCallSpy = spyOn<any>(actionsService, 'publicApiCall')
|
||||||
.withArgs(`/action-parameter-constraints/${constraintName}`, 'GET', params)
|
.withArgs(`/action-parameter-constraints/${constraintName}`, 'GET', params)
|
||||||
.and.returnValue(of(rawConstraints));
|
.and.returnValue(of(rawConstraints));
|
||||||
|
|
||||||
@@ -81,7 +80,7 @@ describe('ActionsService', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('loadActionParameterConstraints should load the data into the observable', async () => {
|
it('loadActionParameterConstraints should load the data into the observable', async () => {
|
||||||
spyOn<any>(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();
|
const constraintsPromise = actionsService.parameterConstraints$.pipe(take(2)).toPromise();
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ describe('FolderRulesService', () => {
|
|||||||
const nodeId = owningFolderIdMock;
|
const nodeId = owningFolderIdMock;
|
||||||
const ruleSetId = 'rule-set-id';
|
const ruleSetId = 'rule-set-id';
|
||||||
const mockedRule = ruleMock('rule-mock');
|
const mockedRule = ruleMock('rule-mock');
|
||||||
const { id, ...mockedRuleWithoutId } = mockedRule;
|
const { ...mockedRuleWithoutId } = mockedRule;
|
||||||
const mockedRuleEntry = { entry: mockedRule };
|
const mockedRuleEntry = { entry: mockedRule };
|
||||||
const ruleId = mockedRule.id;
|
const ruleId = mockedRule.id;
|
||||||
const mockedRuleSettingsEntry = { entry: ruleSettingsMock };
|
const mockedRuleSettingsEntry = { entry: ruleSettingsMock };
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import { PreviewComponent } from './preview.component';
|
|||||||
import { BehaviorSubject, Observable, of, throwError } from 'rxjs';
|
import { BehaviorSubject, Observable, of, throwError } from 'rxjs';
|
||||||
import { ContentApiService, AppHookService, DocumentBasePageService } from '@alfresco/aca-shared';
|
import { ContentApiService, AppHookService, DocumentBasePageService } from '@alfresco/aca-shared';
|
||||||
import { Store, StoreModule } from '@ngrx/store';
|
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 { PreviewModule } from '../preview.module';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
@@ -48,10 +48,10 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
|||||||
import { EffectsModule } from '@ngrx/effects';
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
|
|
||||||
class DocumentBasePageServiceMock extends DocumentBasePageService {
|
class DocumentBasePageServiceMock extends DocumentBasePageService {
|
||||||
canUpdateNode(_node: NodeEntry): boolean {
|
canUpdateNode(): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
canUploadContent(_node: Node): boolean {
|
canUploadContent(): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export class TestRuleContext implements RuleContext {
|
|||||||
isEmpty: true
|
isEmpty: true
|
||||||
};
|
};
|
||||||
|
|
||||||
getEvaluator(_key: string): RuleEvaluator {
|
getEvaluator(): RuleEvaluator {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,14 +23,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
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 { By } from '@angular/platform-browser';
|
||||||
import { OpenInAppComponent } from './open-in-app.component';
|
import { OpenInAppComponent } from './open-in-app.component';
|
||||||
import { initialState, LibTestingModule } from '../../testing/lib-testing-module';
|
import { initialState, LibTestingModule } from '../../testing/lib-testing-module';
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { MatIconTestingModule } from '@angular/material/icon/testing';
|
import { MatIconTestingModule } from '@angular/material/icon/testing';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
|
||||||
import { SharedModule } from '@alfresco/aca-shared';
|
import { SharedModule } from '@alfresco/aca-shared';
|
||||||
|
|
||||||
describe('OpenInAppComponent', () => {
|
describe('OpenInAppComponent', () => {
|
||||||
@@ -44,7 +42,7 @@ describe('OpenInAppComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [LibTestingModule, TranslateModule, SharedModule.forRoot(), MatIconModule, MatIconTestingModule],
|
imports: [LibTestingModule, SharedModule.forRoot(), MatIconTestingModule],
|
||||||
providers: [
|
providers: [
|
||||||
provideMockStore({ initialState }),
|
provideMockStore({ initialState }),
|
||||||
{ provide: MAT_DIALOG_DATA, useValue: { redirectUrl: 'mockRedirectUrl' } },
|
{ 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 () => {
|
it('should redirect to app when click on `Open in App` button` ', async () => {
|
||||||
let currentLocation: string | string[];
|
let currentLocation: string | string[];
|
||||||
const windowStub: Window & typeof globalThis = {
|
component.window = {
|
||||||
location: {
|
location: {
|
||||||
set href(value: string | string[]) {
|
set href(value: string | string[]) {
|
||||||
currentLocation = value;
|
currentLocation = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} as Window & typeof globalThis;
|
} as Window & typeof globalThis;
|
||||||
component.window = windowStub;
|
|
||||||
const saveButton = fixture.debugElement.query(By.css('[data-automation-id="open-in-app-button"]')).nativeElement;
|
const saveButton = fixture.debugElement.query(By.css('[data-automation-id="open-in-app-button"]')).nativeElement;
|
||||||
saveButton.dispatchEvent(new Event('click'));
|
saveButton.dispatchEvent(new Event('click'));
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export interface OpenInAppDialogOptions {
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class OpenInAppComponent {
|
export class OpenInAppComponent {
|
||||||
private redirectUrl: string;
|
private readonly redirectUrl: string;
|
||||||
public window: Window & typeof globalThis = window;
|
public window: Window & typeof globalThis = window;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import { TestBed, ComponentFixture } from '@angular/core/testing';
|
|||||||
import { UserPreferencesService, AppConfigService, PaginationComponent, PaginationModel, CoreTestingModule } from '@alfresco/adf-core';
|
import { UserPreferencesService, AppConfigService, PaginationComponent, PaginationModel, CoreTestingModule } from '@alfresco/adf-core';
|
||||||
import { initialState, LibTestingModule } from '../testing/lib-testing-module';
|
import { initialState, LibTestingModule } from '../testing/lib-testing-module';
|
||||||
import { SharedDirectivesModule } from './shared.directives.module';
|
import { SharedDirectivesModule } from './shared.directives.module';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
import { provideMockStore } from '@ngrx/store/testing';
|
import { provideMockStore } from '@ngrx/store/testing';
|
||||||
|
|
||||||
describe('PaginationDirective', () => {
|
describe('PaginationDirective', () => {
|
||||||
@@ -39,7 +38,7 @@ describe('PaginationDirective', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), LibTestingModule, SharedDirectivesModule, CoreTestingModule],
|
imports: [LibTestingModule, SharedDirectivesModule, CoreTestingModule],
|
||||||
providers: [provideMockStore({ initialState })]
|
providers: [provideMockStore({ initialState })]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ describe('AppSharedRuleGuard', () => {
|
|||||||
const guard = new AppSharedRuleGuard(store);
|
const guard = new AppSharedRuleGuard(store);
|
||||||
const emittedSpy = jasmine.createSpy('emitted');
|
const emittedSpy = jasmine.createSpy('emitted');
|
||||||
|
|
||||||
guard.canActivate({} as any).subscribe(emittedSpy);
|
guard.canActivate().subscribe(emittedSpy);
|
||||||
expect(emittedSpy).toHaveBeenCalledWith(true);
|
expect(emittedSpy).toHaveBeenCalledWith(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ describe('AppSharedRuleGuard', () => {
|
|||||||
const guard = new AppSharedRuleGuard(store);
|
const guard = new AppSharedRuleGuard(store);
|
||||||
const emittedSpy = jasmine.createSpy('emitted');
|
const emittedSpy = jasmine.createSpy('emitted');
|
||||||
|
|
||||||
guard.canActivateChild({} as any).subscribe(emittedSpy);
|
guard.canActivateChild().subscribe(emittedSpy);
|
||||||
expect(emittedSpy).toHaveBeenCalledWith(true);
|
expect(emittedSpy).toHaveBeenCalledWith(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CanActivate, ActivatedRouteSnapshot } from '@angular/router';
|
import { CanActivate } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { AppStore, isQuickShareEnabled } from '@alfresco/aca-shared/store';
|
import { AppStore, isQuickShareEnabled } from '@alfresco/aca-shared/store';
|
||||||
@@ -38,11 +38,11 @@ export class AppSharedRuleGuard implements CanActivate {
|
|||||||
this.isQuickShareEnabled$ = store.select(isQuickShareEnabled);
|
this.isQuickShareEnabled$ = store.select(isQuickShareEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
canActivate(_: ActivatedRouteSnapshot): Observable<boolean> {
|
canActivate(): Observable<boolean> {
|
||||||
return this.isQuickShareEnabled$;
|
return this.isQuickShareEnabled$;
|
||||||
}
|
}
|
||||||
|
|
||||||
canActivateChild(route: ActivatedRouteSnapshot): Observable<boolean> {
|
canActivateChild(): Observable<boolean> {
|
||||||
return this.canActivate(route);
|
return this.canActivate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,9 +142,7 @@ export class AppService implements OnDestroy {
|
|||||||
|
|
||||||
const { router } = this;
|
const { router } = this;
|
||||||
|
|
||||||
this.router.events
|
this.router.events.pipe(filter((event) => event instanceof ActivationEnd && event.snapshot.children.length === 0)).subscribe(() => {
|
||||||
.pipe(filter((event) => event instanceof ActivationEnd && event.snapshot.children.length === 0))
|
|
||||||
.subscribe((_event: ActivationEnd) => {
|
|
||||||
this.store.dispatch(new SetCurrentUrlAction(router.url));
|
this.store.dispatch(new SetCurrentUrlAction(router.url));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export const initialState = {
|
|||||||
}),
|
}),
|
||||||
PipeModule
|
PipeModule
|
||||||
],
|
],
|
||||||
|
exports: [TranslateModule],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||||
{ provide: TranslationService, useClass: TranslationMock }
|
{ provide: TranslationService, useClass: TranslationMock }
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import { isPresentAndDisplayed, Utils } from '../../../utilities/utils';
|
|||||||
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
import { BrowserActions, TestElement } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class GenericFilter {
|
export class GenericFilter {
|
||||||
private filterName: string;
|
private readonly filterName: string;
|
||||||
|
|
||||||
constructor(filterName: string) {
|
constructor(filterName: string) {
|
||||||
this.filterName = filterName;
|
this.filterName = filterName;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
import { browser, by } from 'protractor';
|
import { browser, by } from 'protractor';
|
||||||
import { Component } from '../component';
|
import { Component } from '../component';
|
||||||
import { waitForPresence, waitElement } from '../../utilities/utils';
|
import { waitElement, waitForPresence } from '../../utilities/utils';
|
||||||
import { BrowserActions, BrowserVisibility, TestElement } from '@alfresco/adf-testing';
|
import { BrowserActions, BrowserVisibility, TestElement } from '@alfresco/adf-testing';
|
||||||
|
|
||||||
export class SearchInput extends Component {
|
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) {
|
async searchUntilResult(text: string, methodType: 'URL' | 'UI', waitPerSearch: number = 2000, timeout: number = 20000) {
|
||||||
const attempts = Math.round(timeout / waitPerSearch);
|
const attempts = Math.round(timeout / waitPerSearch);
|
||||||
let loopCount = 0;
|
let loopCount = 0;
|
||||||
let myPromise = new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const check = async () => {
|
const check = async () => {
|
||||||
loopCount++;
|
loopCount++;
|
||||||
loopCount >= attempts ? reject('File not found') : methodType === 'UI' ? await this.searchFor(text) : await this.searchByURL(text);
|
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 check();
|
||||||
});
|
});
|
||||||
return myPromise;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { RepoApi } from '../repo-api';
|
import { RepoApi } from '../repo-api';
|
||||||
import { NodeContentTree, flattenNodeContentTree } from './node-content-tree';
|
import { flattenNodeContentTree, NodeContentTree } from './node-content-tree';
|
||||||
import { NodesApi as AdfNodeApi, NodeEntry, NodeChildAssociationPaging } from '@alfresco/js-api';
|
import { NodeChildAssociationPaging, NodeEntry, NodesApi as AdfNodeApi } from '@alfresco/js-api';
|
||||||
import { Utils } from '../../../../utilities/utils';
|
import { Utils } from '../../../../utilities/utils';
|
||||||
|
|
||||||
export class NodesApi extends RepoApi {
|
export class NodesApi extends RepoApi {
|
||||||
@@ -166,8 +166,7 @@ export class NodesApi extends RepoApi {
|
|||||||
try {
|
try {
|
||||||
await names.reduce(async (previous, current) => {
|
await names.reduce(async (previous, current) => {
|
||||||
await previous;
|
await previous;
|
||||||
const req = await this.deleteNodeByPath(`${relativePath}/${current}`, permanent);
|
return await this.deleteNodeByPath(`${relativePath}/${current}`, permanent);
|
||||||
return req;
|
|
||||||
}, Promise.resolve());
|
}, Promise.resolve());
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.handleError(`${this.constructor.name} ${this.deleteNodes.name}`, error);
|
this.handleError(`${this.constructor.name} ${this.deleteNodes.name}`, error);
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ export class AcaViewerComponent implements OnInit, OnDestroy {
|
|||||||
this.displayNode(file.data.entry.id);
|
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() {
|
onViewerVisibilityChanged() {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = async ({github, context, version}) => {
|
|||||||
if (prs?.length > 0) {
|
if (prs?.length > 0) {
|
||||||
const title = prs[0].title;
|
const title = prs[0].title;
|
||||||
const result = title.match(version);
|
const result = title.match(version);
|
||||||
return result?.length > 0 ? true : false;
|
return result?.length > 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,22 +9,22 @@ module.exports = async ({github, dependencyName}) => {
|
|||||||
|
|
||||||
const localVersion = pkg.dependencies[dependencyFullName];
|
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_type: 'npm',
|
||||||
package_name: dependencyName,
|
package_name: dependencyName,
|
||||||
org: organization
|
org: organization
|
||||||
});
|
});
|
||||||
|
|
||||||
const latestPkgToUpdate = availablePakages[0];
|
const latestPkgToUpdate = availablePackages[0];
|
||||||
|
|
||||||
if (localVersion === latestPkgToUpdate?.name) {
|
if (localVersion === latestPkgToUpdate?.name) {
|
||||||
return { hasNewVersion: 'false' };
|
return { hasNewVersion: 'false' };
|
||||||
} else {
|
} else {
|
||||||
const findLocalVerionOnRemote = availablePakages.find((item) => item.name === localVersion);
|
const findLocalVersionOnRemote = availablePackages.find((item) => item.name === localVersion);
|
||||||
let rangeInDays = 'N/A'
|
let rangeInDays = 'N/A'
|
||||||
if (findLocalVerionOnRemote !== undefined) {
|
if (findLocalVersionOnRemote !== undefined) {
|
||||||
var creationLocal = new Date(findLocalVerionOnRemote.created_at);
|
const creationLocal = new Date(findLocalVersionOnRemote.created_at);
|
||||||
var creationLatest = new Date(latestPkgToUpdate.created_at,);
|
const creationLatest = new Date(latestPkgToUpdate.created_at);
|
||||||
rangeInDays = inDays(creationLocal, creationLatest);
|
rangeInDays = inDays(creationLocal, creationLatest);
|
||||||
}
|
}
|
||||||
return { hasNewVersion: 'true', remoteVersion: { name: latestPkgToUpdate?.name, rangeInDays } , localVersion};
|
return { hasNewVersion: 'true', remoteVersion: { name: latestPkgToUpdate?.name, rangeInDays } , localVersion};
|
||||||
|
|||||||
Reference in New Issue
Block a user