Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/jpluta-ACA-4730-Bottom-part-of-the…
Browse files Browse the repository at this point in the history
…-letters-are-cut-in-the-inputs
  • Loading branch information
jacekpluta authored Jan 25, 2024
2 parents c13db07 + 47fb269 commit ac1053b
Show file tree
Hide file tree
Showing 26 changed files with 354 additions and 44 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
fail-fast: false
matrix:
e2e-suites:
- name: "actions"
- name: "create-actions"
id: 1
- name: "folder-rules"
id: 2
Expand All @@ -169,6 +169,8 @@ jobs:
id: 9
- name: "copy-move-actions"
id: 10
- name: "library-actions"
id: 11
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"parserOptions": {
"project": [
"e2e/playwright/actions/tsconfig.e2e.json"
"e2e/playwright/create-actions/tsconfig.e2e.json"
],
"createDefaultProgram": true
},
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import EXCLUDED_JSON from './exclude.tests.json';
const config: PlaywrightTestConfig<CustomConfig> = {
...getGlobalConfig,

grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Actions'),
grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Create Actions'),
projects: [
{
name: 'Actions',
name: 'Create Actions',
testDir: './src/tests',
use: {
users: ['hruser']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "actions-e2e",
"name": "create-actions-e2e",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/playwright/actions/src",
"sourceRoot": "e2e/playwright/create-actions",
"projectType": "application",
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": ["npx playwright test --config=e2e/playwright/actions/playwright.config.ts"]
"commands": ["npx playwright test --config=e2e/playwright/create-actions/playwright.config.ts"]
},
"configurations": {
"production": {
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions e2e/playwright/library-actions/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "../../../.eslintrc.json",
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"e2e/playwright/library-actions/tsconfig.e2e.json"
],
"createDefaultProgram": true
},
"plugins": [
"rxjs",
"unicorn"
],
"rules": {
"@typescript-eslint/no-floating-promises": "off"
}
}
]
}
1 change: 1 addition & 0 deletions e2e/playwright/library-actions/exclude.tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
44 changes: 44 additions & 0 deletions e2e/playwright/library-actions/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*!
* 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 { PlaywrightTestConfig } from '@playwright/test';
import { CustomConfig, getGlobalConfig, getExcludedTestsRegExpArray } from '@alfresco/playwright-shared';
import EXCLUDED_JSON from './exclude.tests.json';

const config: PlaywrightTestConfig<CustomConfig> = {
...getGlobalConfig,

grepInvert: getExcludedTestsRegExpArray(EXCLUDED_JSON, 'Library Actions'),
projects: [
{
name: 'Library Actions',
testDir: './src/tests',
use: {
users: ['hruser']
}
}
]
};

export default config;
22 changes: 22 additions & 0 deletions e2e/playwright/library-actions/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "library-actions-e2e",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/playwright/library-actions/src",
"projectType": "application",
"targets": {
"e2e": {
"executor": "nx:run-commands",
"options": {
"commands": ["npx playwright test --config=e2e/playwright/library-actions/playwright.config.ts"]
},
"configurations": {
"production": {
"devServerTarget": "content-ce:serve:production"
}
}
},
"lint": {
"executor": "@angular-eslint/builder:lint"
}
}
}
File renamed without changes.
15 changes: 15 additions & 0 deletions e2e/playwright/library-actions/tsconfig.e2e.adf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../../tsconfig.adf.json",
"compilerOptions": {
"outDir": "../../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node"],
"skipLibCheck": true,
"paths": {
"@alfresco/playwright-shared": ["../../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}
15 changes: 15 additions & 0 deletions e2e/playwright/library-actions/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es2017",
"types": ["jasmine", "jasminewd2", "node", "@playwright/test"],
"skipLibCheck": true,
"paths": {
"@alfresco/playwright-shared": ["../../../projects/aca-playwright-shared/src/index.ts"]
}
},
"exclude": ["node_modules"]
}
5 changes: 2 additions & 3 deletions e2e/playwright/list-views/src/tests/permissions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ test.describe('Special permissions', () => {

test('[C213116] on Shared Files', async ({ sharedPage }) => {
await sharedPage.navigate();
expect(await sharedPage.dataTable.getRowsCount(), 'Incorrect number of items').toBe(2);
await expect(sharedPage.dataTable.getRowByName(sitePrivate)).toBeVisible();
await siteApiAdmin.deleteSiteMember(sitePrivate, username);
await sharedPage.reload();
expect(await sharedPage.dataTable.getRowsCount(), 'Incorrect number of items').toBe(0);
await expect(sharedPage.dataTable.getRowByName(sitePrivate)).toHaveCount(0);
});

test('[C290122] on Search Results', async ({ personalFiles, searchPage }) => {
Expand Down Expand Up @@ -187,7 +187,6 @@ test.describe('Special permissions', () => {

test(`[C213668] on Shared Files`, async ({ sharedPage }) => {
await sharedPage.navigate();
expect(await sharedPage.dataTable.getRowsCount(), 'Incorrect number of items').toBe(2);
expect(await sharedPage.dataTable.getItemLocationText(fileName)).toEqual('Unknown');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppTestingModule } from '../../testing/app-testing.module';
import { DetailsComponent } from './details.component';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, NavigationStart, Router } from '@angular/router';
import { BehaviorSubject, of, Subject } from 'rxjs';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { Store } from '@ngrx/store';
import { DefaultProjectorFn, MemoizedSelector, Store } from '@ngrx/store';
import { ContentApiService } from '@alfresco/aca-shared';
import { NavigateToFolder, SetSelectedNodesAction, STORE_INITIAL_APP_DATA } from '@alfresco/aca-shared/store';
import {
AppStore,
isInfoDrawerOpened,
NavigateToFolder,
NavigateToPreviousPage,
SetSelectedNodesAction,
STORE_INITIAL_APP_DATA
} from '@alfresco/aca-shared/store';
import { NodeEntry, PathElement } from '@alfresco/js-api';
import { RouterTestingModule } from '@angular/router/testing';
import { AuthenticationService, PageTitleService } from '@alfresco/adf-core';
Expand Down Expand Up @@ -100,6 +107,7 @@ describe('DetailsComponent', () => {
contentApiService = TestBed.inject(ContentApiService);
contentService = TestBed.inject(ContentService);
store = TestBed.inject(Store);
storeMock.dispatch.calls.reset();

node = {
entry: {
Expand Down Expand Up @@ -242,4 +250,45 @@ describe('DetailsComponent', () => {
component.setActiveTab('permissions');
expect(component.activeTab).not.toBe(2);
});

describe('infoDrawerOpened$ event', () => {
let infoDrawerOpened$: Subject<boolean>;

beforeEach(() => {
infoDrawerOpened$ = new Subject<boolean>();
spyOn(store, 'select').and.callFake((mapFn: MemoizedSelector<AppStore, boolean, DefaultProjectorFn<boolean>>) =>
mapFn === isInfoDrawerOpened ? infoDrawerOpened$ : mockStream
);
});

it('should dispatch store NavigateToPreviousPage by store if info drawer is closed', () => {
component.ngOnInit();

infoDrawerOpened$.next(false);
expect(storeMock.dispatch).toHaveBeenCalledWith(jasmine.any(NavigateToPreviousPage));
});

it('should not dispatch store NavigateToPreviousPage by store if info drawer is opened', () => {
component.ngOnInit();

infoDrawerOpened$.next(true);
expect(storeMock.dispatch).not.toHaveBeenCalledWith(jasmine.any(NavigateToPreviousPage));
});

it('should not dispatch store NavigateToPreviousPage by store if info drawer opening state is not changed', () => {
component.ngOnInit();

expect(storeMock.dispatch).not.toHaveBeenCalledWith(jasmine.any(NavigateToPreviousPage));
});

it('should not dispatch store NavigateToPreviousPage by store if info drawer is closed but there occurred NavigationStart event', () => {
Object.defineProperty(TestBed.inject(Router), 'events', {
value: of(new NavigationStart(1, ''))
});
component.ngOnInit();

infoDrawerOpened$.next(false);
expect(storeMock.dispatch).not.toHaveBeenCalledWith(jasmine.any(NavigateToPreviousPage));
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
*/

import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, NavigationStart } from '@angular/router';
import { ContentApiService, PageComponent, PageLayoutComponent, ToolbarComponent } from '@alfresco/aca-shared';
import { NavigateToFolder, NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
import { Subject } from 'rxjs';
import { merge, Subject } from 'rxjs';
import { BreadcrumbModule, ContentService, PermissionManagerModule } from '@alfresco/adf-content-services';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
Expand All @@ -37,7 +37,7 @@ import { MatButtonModule } from '@angular/material/button';
import { MetadataTabComponent } from '../info-drawer/metadata-tab/metadata-tab.component';
import { CommentsTabComponent } from '../info-drawer/comments-tab/comments-tab.component';
import { NodeEntry, PathElement } from '@alfresco/js-api';
import { takeUntil } from 'rxjs/operators';
import { first, takeUntil } from 'rxjs/operators';
import { ContentActionRef } from '@alfresco/adf-extensions';

@Component({
Expand Down Expand Up @@ -99,6 +99,20 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy
.subscribe((aspectActions) => {
this.aspectActions = aspectActions;
});
this.infoDrawerOpened$
.pipe(
first((opened) => !opened),
takeUntil(
merge(
this.onDestroy$,
this.router.events.pipe(
first((event) => event instanceof NavigationStart),
takeUntil(this.onDestroy$)
)
)
)
)
.subscribe(() => this.goBack());
}

setActiveTab(tabName: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<data-column id="app.search.size" key="content.sizeInBytes" type="fileSize" title="APP.DOCUMENT_LIST.COLUMNS.SIZE" class="adf-no-grow-cell adf-ellipsis-cell" [sortable]="false" *ngIf="!isSmallScreen" [draggable]="true"></data-column>
<data-column id="app.search.modifiedOn" key="modifiedAt" type="date" title="APP.DOCUMENT_LIST.COLUMNS.MODIFIED_ON" class="adf-no-grow-cell adf-ellipsis-cell" format="timeAgo" [sortable]="false" *ngIf="!isSmallScreen" [draggable]="true"></data-column>
<data-column id="app.search.modifiedBy" key="modifiedByUser.displayName" title="APP.DOCUMENT_LIST.COLUMNS.MODIFIED_BY" class="adf-no-grow-cell adf-ellipsis-cell" [sortable]="false" *ngIf="!isSmallScreen" [draggable]="true"></data-column>
<data-column id="app.search.tags" key="$tags" type="text" title="APP.DOCUMENT_LIST.COLUMNS.TAGS" class="adf-full-width adf-expand-cell-4" [sortable]="false" [draggable]="true">
<data-column id="app.search.tags" key="$tags" type="text" title="APP.DOCUMENT_LIST.COLUMNS.TAGS" class="adf-full-width adf-expand-cell-4" [sortable]="false" [draggable]="true" *ngIf="isTagsEnabled">
<ng-template let-context>
<aca-tags-column [context]="context"></aca-tags-column>
</ng-template>
Expand Down
Loading

0 comments on commit ac1053b

Please sign in to comment.