Skip to content

Commit

Permalink
Use hash strategy in demo shell as the other apps (#6402)
Browse files Browse the repository at this point in the history
* hash startegy

* use hash in e2e

* trigger build

* fix

* fix

* remove children router overwrite crazynes

* Update login.module.ts

* revert not needed changes

* some fixes

* fix

* remove fdescribe

* fix

* fix

* Update share-file.e2e.ts

* Update lock-file.e2e.ts

* Update share-file.e2e.ts

* some fix

* some other fixes

* username as id

* fix after rebase

* username

* fix usernamee

* Fix the errorComponent

* Attempt to fix unit test - to check

* * Fixed circular dependency error while building adf-testing package

* * Fixed failing UT

* fix

* use username

* some fixes

* some fix

* fix

Co-authored-by: Maurizio Vitale <maurizio.vitale@alfresco.com>
Co-authored-by: Vito Albano <vitoalbano@vitoalbano-mbp-0120.local>
Co-authored-by: sivakumar414ram <siva.kumar@muraai.com>
  • Loading branch information
4 people committed Dec 16, 2020
1 parent 3734151 commit 1c51b2a
Show file tree
Hide file tree
Showing 195 changed files with 1,779 additions and 1,465 deletions.
2 changes: 1 addition & 1 deletion demo-shell/src/app.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"silentLogin": true,
"redirectSilentIframeUri": "{protocol}//{hostname}{:port}/assets/silent-refresh.html",
"redirectUri": "/",
"redirectUriLogout": "/logout",
"redirectUriLogout": "#/logout",
"publicUrls": [
"**/preview/s/*",
"**/settings",
Expand Down
11 changes: 9 additions & 2 deletions demo-shell/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ import { ChartsModule } from 'ng2-charts';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations';
import { TranslateModule } from '@ngx-translate/core';
import { AppConfigService, TRANSLATION_PROVIDER, DebugAppConfigService, CoreModule, CoreAutomationService, AuthBearerInterceptor } from '@alfresco/adf-core';
import {
AppConfigService,
TRANSLATION_PROVIDER,
DebugAppConfigService,
CoreModule,
CoreAutomationService,
AuthBearerInterceptor
} from '@alfresco/adf-core';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { AppComponent } from './app.component';
import { MaterialModule } from './material.module';
Expand Down Expand Up @@ -127,7 +134,7 @@ registerLocaleData(localeSv);
BrowserModule,
environment.e2e ? NoopAnimationsModule : BrowserAnimationsModule,
ReactiveFormsModule,
RouterModule.forRoot(appRoutes, { initialNavigation: true }),
RouterModule.forRoot(appRoutes, { useHash: true }),
FormsModule,
HttpClientModule,
MaterialModule,
Expand Down
2 changes: 1 addition & 1 deletion demo-shell/src/app/components/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { LogService } from '@alfresco/adf-core';
})
export class LoginComponent {

customSuccessRouteURI = '';
customSuccessRouteURI = '/home';
customLogoImageURL = './assets/images/alfresco-logo.svg';

disableCsrf = false;
Expand Down
2 changes: 1 addition & 1 deletion demo-shell/src/app/components/logout/logout.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h2>{{ 'APP.LOGOUT.SUB_TITLE' | translate}}</h2>

<div class="app-logout-login">
<a mat-raised-button class="app-logout-docs-button adf-primary-color"
href="/login">{{ 'APP.LOGOUT.LOGIN' | translate}}</a>
href="#/login">{{ 'APP.LOGOUT.LOGIN' | translate}}</a>
</div>
<div class="app-logout-home">
<a mat-raised-button class="app-logout-docs-button adf-primary-color"
Expand Down
9 changes: 8 additions & 1 deletion demo-shell/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@

<head>
<meta charset="utf-8">

<!-- Important: cache busting for index.html -->
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

<title>ACS APS ADF Application with Angular CLI</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96">
Expand Down
2 changes: 1 addition & 1 deletion docs/core/directives/context-menu.directive.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
Title: Context Menu directive
Added: v2.0.0
Status: Active
Status: Deprecated
Last reviewed: 2018-11-20
---

Expand Down
4 changes: 2 additions & 2 deletions e2e/content-services/about-content-services.component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ describe('About Content Services', () => {
beforeAll(async() => {
await apiService.loginWithProfile('admin');
acsUser = await usersActions.createUser();
await apiService.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.email, acsUser.password);
await apiService.login(acsUser.username, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
await navigationBarPage.clickAboutButton();
});

Expand Down
145 changes: 73 additions & 72 deletions e2e/content-services/comments/comment-component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { FileModel } from '../../models/ACS/file.model';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');

describe('Comment Component', () => {
describe('Comment', () => {

const loginPage: LoginPage = new LoginPage();
const contentServicesPage: ContentServicesPage = new ContentServicesPage();
Expand Down Expand Up @@ -68,100 +68,100 @@ describe('Comment Component', () => {
acsUser = await usersActions.createUser();
});

afterAll(async () => {
await navigationBarPage.clickLogoutButton();
});
describe('component', () => {

beforeEach(async () => {
await apiService.login(acsUser.email, acsUser.password);
beforeEach(async () => {
await apiService.login(acsUser.username, acsUser.password);

const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');
const pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, '-my-');

nodeId = pngUploadedFile.entry.id;
nodeId = pngUploadedFile.entry.id;

userFullName = pngUploadedFile.entry.createdByUser.displayName;
userFullName = pngUploadedFile.entry.createdByUser.displayName;

await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);

await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});
await navigationBarPage.navigateToContentServices();
await contentServicesPage.waitForTableBody();
});

afterEach(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(nodeId);
});
afterEach(async () => {
await apiService.loginWithProfile('admin');
await uploadActions.deleteFileOrFolder(nodeId);
await navigationBarPage.clickLogoutButton();
});

it('[C276947] Should be able to add a comment on ACS and view on ADF', async () => {
await apiService.getInstance().core.commentsApi.addComment(nodeId, { content: comments.test });
it('[C276947] Should be able to add a comment on ACS and view on ADF', async () => {
await apiService.getInstance().core.commentsApi.addComment(nodeId, { content: comments.test });

await viewerPage.viewFile(pngFileModel.name);
await viewerPage.viewFile(pngFileModel.name);

await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();

await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsDisplayed();
await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsDisplayed();

await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.test);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
await commentsPage.getTotalNumberOfComments('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.test);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});

it('[C276948] Should be able to add a comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
it('[C276948] Should be able to add a comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);

await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();

await commentsPage.addComment(comments.first);
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.addComment(comments.first);
await commentsPage.checkUserIconIsDisplayed();

await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.first);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
await commentsPage.getTotalNumberOfComments('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.first);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});

it('[C280021] Should be able to add a multiline comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);
it('[C280021] Should be able to add a multiline comment on a file', async () => {
await viewerPage.viewFile(pngFileModel.name);

await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();

await commentsPage.addComment(comments.multiline);
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.addComment(comments.multiline);
await commentsPage.checkUserIconIsDisplayed();

await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.multiline);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
await commentsPage.getTotalNumberOfComments('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.multiline);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);

await commentsPage.addComment(comments.second);
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.addComment(comments.second);
await commentsPage.checkUserIconIsDisplayed();

await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (2)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.second);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
await commentsPage.getTotalNumberOfComments('Comments (2)');
await expect(await commentsPage.getMessage(0)).toEqual(comments.second);
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});

it('[C280022] Should not be able to add an HTML or other code input into the comment input filed', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();
it('[C280022] Should not be able to add an HTML or other code input into the comment input filed', async () => {
await viewerPage.viewFile(pngFileModel.name);
await viewerPage.clickInfoButton();
await viewerPage.checkInfoSideBarIsDisplayed();
await viewerPage.clickOnCommentsTab();

await commentsPage.addComment(comments.codeType);
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.addComment(comments.codeType);
await commentsPage.checkUserIconIsDisplayed();

await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual('First name: Last name:');
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
await commentsPage.getTotalNumberOfComments('Comments (1)');
await expect(await commentsPage.getMessage(0)).toEqual('First name: Last name:');
await expect(await commentsPage.getUserName(0)).toEqual(userFullName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
});

describe('Consumer Permissions', () => {
Expand All @@ -176,13 +176,13 @@ describe('Comment Component', () => {
});

await apiService.getInstance().core.sitesApi.addSiteMember(site.entry.id, {
id: acsUser.email,
id: acsUser.username,
role: CONSTANTS.CS_USER_ROLES.CONSUMER
});

pngUploadedFile = await uploadActions.uploadFile(pngFileModel.location, pngFileModel.name, site.entry.guid);

await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);

await navigationBarPage.navigateToContentServices();
});
Expand All @@ -203,6 +203,7 @@ describe('Comment Component', () => {

await commentsPage.checkCommentsTabIsSelected();
await commentsPage.checkCommentInputIsNotDisplayed();
await viewerPage.clickCloseButton();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('Create folder directive', () => {

acsUser = await usersActions.createUser();

await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);

await contentServicesPage.goToDocumentList();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('Create library directive', () => {
visibility: 'PUBLIC'
});

await loginPage.login(acsUser.email, acsUser.password);
await loginPage.login(acsUser.username, acsUser.password);
});

afterAll(async () => {
Expand Down

0 comments on commit 1c51b2a

Please sign in to comment.