Skip to content

Commit

Permalink
[ADF-5183] Upgrade to Angular 10 (#1506)
Browse files Browse the repository at this point in the history
* upgrade preparation fixes

* remove fdescribe

* update browserlist config

* ng8

* ngrx 8

* ng9

* ngrx 9

* remove entryComponents

* unit tests

* ng 10

* latest ADF

* fix unit tests

* fix lint

* update deps and travis

* code fixes

* upgrade webdriver

* cleanup libs

* fix test

* update test

* Use browserTarget as target for lite-serve

* Use the update webdriver with CI condition

* Use version console.log('load', path

* Fix path sh

* Try to use remote env

* Add the . to export variabled

* Use hardcoded chrome version

* Remove the run remote

* Avoid to use the escape

* Skip flaky e2e and raise issue ACA-3615

* SKip failing e2e

* Skip flaky e2e and raise issue ACA-3615

* Fix close app toolbar menu and preconditions + tests of  mark-favorite.test.ts  Personal Files section

* Fix mark-favorite tests

* Fix ext-header test

* Fix new-menu tests

* Fix lint

* no message

* Fix viewer tests

Co-authored-by: maurizio vitale <[email protected]>
Co-authored-by: Cristina Jalba <[email protected]>
  • Loading branch information
3 people authored Jul 9, 2020
1 parent 4ac1b8d commit 2854c17
Show file tree
Hide file tree
Showing 139 changed files with 14,860 additions and 10,995 deletions.
17 changes: 17 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major version
last 2 iOS major versions
Firefox ESR
not IE 9-11 # For IE 9-11 support, remove 'not'.
17 changes: 8 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
dist: trusty
dist: bionic
sudo: required
services:
- docker
- xvfb
addons:
chrome: stable
language: node_js
Expand All @@ -21,8 +22,6 @@ branches:
before_install:
- sudo /etc/init.d/postgresql stop
- npm install -g npm@latest
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
- . ./scripts/ci/job_hooks/before_install.sh

Expand Down Expand Up @@ -74,37 +73,37 @@ jobs:
- stage: e2e
name: Test Suite appNavigation&search
before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a"
- ./start.sh
script: ng run app-e2e:e2elite --suite "authentication,listViews,navigation,application,pagination,search"
after_script: ./start.sh -d
- name: Test Suite actionsAvailable
before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a"
- ./start.sh
script: ng run app-e2e:e2elite --suite "actionsAvailable"
after_script: ./start.sh -d
- name: Test Suite addRemoveContent
before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a"
- ./start.sh
script: ng run app-e2e:e2elite --suite "addRemoveContent"
after_script: ./start.sh -d
- name: Test Suite manageContent
before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a"
- ./start.sh
script: ng run app-e2e:e2elite --suite "manageContent"
after_script: ./start.sh -d
- name: Test Suite sharingContent&markFavorite
before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a"
- ./start.sh
script: ng run app-e2e:e2elite --suite "sharingContent"
after_script: ./start.sh -d
- name: Test Suite viewContent&metadata&extensions
before_script:
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app" "-a"
- ./start.sh
script: ng run app-e2e:e2elite --suite "viewer,infoDrawer,extensions"
after_script: ./start.sh -d
Expand Down
32 changes: 26 additions & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist/app",
"index": "src/index.html",
"main": "src/main.ts",
Expand Down Expand Up @@ -85,8 +86,7 @@
"node_modules/pdfjs-dist/build/pdf.js",
"node_modules/pdfjs-dist/web/pdf_viewer.js",
"node_modules/moment/min/moment.min.js"
],
"es5BrowserSupport": true
]
},
"configurations": {
"production": {
Expand Down Expand Up @@ -117,10 +117,20 @@
"name": "vendor",
"maximumWarning": "10mb",
"maximumError": "15mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
},
"e2e": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand Down Expand Up @@ -160,7 +170,7 @@
"builder": "@angular-custom-builders/lite-serve:dist-serve",
"options": {
"publicHost": "http://localhost:4200",
"outputPath": "dist/app"
"browserTarget": "app:build"
}
},
"extract-i18n": {
Expand Down Expand Up @@ -285,7 +295,12 @@
"tsConfig": "projects/adf-office-services-ext/tsconfig.lib.json",
"project": "projects/adf-office-services-ext/ng-package.json"
}
},
, "configurations": {
"production": {
"tsConfig": "projects/adf-office-services-ext/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand Down Expand Up @@ -320,7 +335,12 @@
"tsConfig": "projects/aca-shared/tsconfig.lib.json",
"project": "projects/aca-shared/ng-package.json"
}
},
, "configurations": {
"production": {
"tsConfig": "projects/aca-shared/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand Down Expand Up @@ -354,7 +374,7 @@
"schematics": {
"@schematics/angular:component": {
"prefix": "aca",
"styleext": "scss"
"style": "scss"
},
"@schematics/angular:directive": {
"prefix": "aca"
Expand Down
1 change: 0 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"polyfill",
"polyfills",
"jsonp",
"hammerjs",
"pdfjs",
"xpath",
"tooltip",
Expand Down
1 change: 0 additions & 1 deletion docs/extending/custom-extension-loaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import { EXTENSION_DATA_LOADERS } from '@alfresco/aca-shared';
@NgModule({
imports: [...],
declarations: [...],
entryComponents: [...],
providers: [
...
{
Expand Down
12 changes: 0 additions & 12 deletions docs/extending/redistributable-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ Angular CLI automatically configures Typescript path mappings for the project, s

### Register dynamic components

Update `my-extension.module.ts` and put all the content you plan to use at runtime dynamically to the `entryComponents` section of the module.

```typescript
@NgModule({
imports: [],
declarations: [MyExtensionComponent],
exports: [MyExtensionComponent],
entryComponents: [MyExtensionComponent]
})
export class MyExtensionModule {}
```

Now we need to register `MyExtensionComponent` as an extension component.
Update the code as in the next example:

Expand Down
6 changes: 1 addition & 5 deletions docs/extending/registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import { ExtensionsModule, ExtensionService } from '@alfresco/adf-extensions';

@NgModule({
imports: [ ExtensionsModule ]
declarations: [ MyComponent1, MyLayout ],
entryComponents: [ MyComponent1, MyLayout ]
declarations: [ MyComponent1, MyLayout ]
})
export class MyExtensionModule {

Expand All @@ -42,8 +41,5 @@ export class MyExtensionModule {
}
```

**Note:** According to Angular rules, all components that are created dynamically at runtime
need to be registered within the `entryComponents` section of the NgModule.

The Registration API is not limited to the custom content only.
You can replace any existing entries by replacing the values from your module.
18 changes: 0 additions & 18 deletions docs/extending/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,6 @@ Please read more details on Dialog components here: [Dialog Overview](https://ma
ng g component dialogs/my-extension-dialog --module=app
```

According to Angular rules, the component needs to also be registered within the `entryComponents` section of the module.

Update the `src/app/app.module.ts` file according to the example below:

```ts
@NgModule({
imports: [...],
declarations: [
...,
MyExtensionDialogComponent
],
entryComponents: [
...,
MyExtensionDialogComponent
]
})
```

Update `my-extension-dialog.component.ts`:

```ts
Expand Down
2 changes: 0 additions & 2 deletions docs/getting-started/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,4 @@ Navigation items or group of navigation items can be conditional render based on

For more informations about rules checkout [Rules](../extending/rules.md) section.

Note that components must be declared as entryComponents under the app module.

For more information about the content of a custom page see [Document List Layout](/features/document-list-layout) section.
12 changes: 0 additions & 12 deletions docs/ja/extending/redistributable-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ Angular CLI は、プロジェクトの Typescript パスマッピングを自

### 動的コンポーネントを登録する

`my-extension.module.ts` を更新し、実行時に動的に使用する予定のすべてのコンテンツをモジュールの `entryComponents` セクションに配置します。

```typescript
@NgModule({
imports: [],
declarations: [MyExtensionComponent],
exports: [MyExtensionComponent],
entryComponents: [MyExtensionComponent]
})
export class MyExtensionModule {}
```

ここで、`MyExtensionComponent` を拡張コンポーネントとして登録する必要があります。
次の例のようにコードを更新します:

Expand Down
6 changes: 1 addition & 5 deletions docs/ja/extending/registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import { ExtensionsModule, ExtensionService } from '@alfresco/adf-extensions';

@NgModule({
imports: [ ExtensionsModule ]
declarations: [ MyComponent1, MyLayout ],
entryComponents: [ MyComponent1, MyLayout ]
declarations: [ MyComponent1, MyLayout ]
})
export class MyExtensionModule {

Expand All @@ -43,8 +42,5 @@ export class MyExtensionModule {
}
```

**注:** Angular のルールによれば、実行時に動的に作成されるすべてのコンポーネントは、
NgModule の `entryComponents` セクション内に登録する必要があります。

Registration API は、カスタムコンテンツのみに限定されません。
モジュールの値を置き換えることにより、既存のエントリを置き換えることができます。
18 changes: 0 additions & 18 deletions docs/ja/extending/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,6 @@ node: 10
ng g component dialogs/my-extension-dialog --module=app
```

Angular ルールに従って、コンポーネントはモジュールの `entryComponents` セクション内にも登録する必要があります。

以下の例に従って `src/app/app.module.ts` ファイルを更新します:

```ts
@NgModule({
imports: [...],
declarations: [
...,
MyExtensionDialogComponent
],
entryComponents: [
...,
MyExtensionDialogComponent
]
})
```

`my-extension-dialog.component.ts` を更新します:

```ts
Expand Down
2 changes: 0 additions & 2 deletions docs/ja/getting-started/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,4 @@ export class CustomPage {
]
```

コンポーネントは app モジュールの下で entryComponents として宣言する必要があることに注意してください。

カスタムページのコンテンツの詳細については、[ドキュメントリストのレイアウト](/ja/features/document-list-layout) セクションを参照してください。
6 changes: 0 additions & 6 deletions docs/ja/tutorials/dialog-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ nav: ja
ng g component dialogs/my-extension-dialog --module=app
```

Angular ルールに従って、コンポーネントはモジュールの `entryComponents` セクション内にも登録する必要があります。

以下の例に従って `src/app/app.module.ts` ファイルを更新します:

```ts
Expand All @@ -25,10 +23,6 @@ Angular ルールに従って、コンポーネントはモジュールの `entr
declarations: [
...,
MyExtensionDialogComponent
],
entryComponents: [
...,
MyExtensionDialogComponent
]
})
```
Expand Down
18 changes: 0 additions & 18 deletions docs/tutorials/dialog-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,6 @@ Please read more details on Dialog components here: [Dialog Overview](https://ma
ng g component dialogs/my-extension-dialog --module=app
```

According to Angular rules, the component needs to also be registered within the `entryComponents` section of the module.

Update the `src/app/app.module.ts` file according to the example below:

```ts
@NgModule({
imports: [...],
declarations: [
...,
MyExtensionDialogComponent
],
entryComponents: [
...,
MyExtensionDialogComponent
]
})
```

Update `my-extension-dialog.component.ts`:

```ts
Expand Down
10 changes: 1 addition & 9 deletions e2e/suites/actions-available/files-folders/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/

import { BrowsingPage, SearchResultsPage, Utils } from '@alfresco/aca-testing-shared';
import { BrowsingPage, SearchResultsPage } from '@alfresco/aca-testing-shared';
import * as testData from './test-data';
import * as testUtil from '../test-util';

Expand All @@ -39,14 +39,6 @@ export function viewerTests(parentName?: string) {
await page.clickPersonalFiles();
});

beforeEach(async () => {
await Utils.pressEscape();
});

afterEach(async () => {
await page.closeOpenDialogs();
});

describe('file opened from Personal Files', () => {

beforeAll(async () => {
Expand Down
1 change: 0 additions & 1 deletion e2e/suites/actions-available/test-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export async function checkViewerActions(item: string, expectedToolbarPrimary: s
const actualMoreActions = await viewerToolbar.menu.getMenuItems();
expect(actualMoreActions).toEqual(expectedToolbarMore);

await toolbar.closeMoreMenu();
await Utils.pressEscape();
}

Expand Down
Loading

0 comments on commit 2854c17

Please sign in to comment.