From 7a5350a06daa5c4424898a26d2ca5f3b0976bc7f Mon Sep 17 00:00:00 2001 From: Denys Vuika <denys.vuika@alfresco.com> Date: Fri, 11 Dec 2020 15:47:17 +0000 Subject: [PATCH] reduce duplication and code improvements (#1707) * reduce code duplication * reduce duplication, fix license headers * simplify code * typings fixes * update tests * minor fixes * markdown fixes * revert changes --- .editorconfig | 3 - cspell.json | 1 - docs/extending/application-features.md | 67 +++++----- docs/extending/custom-extension-loaders.md | 10 +- docs/extending/extension-format.md | 6 +- docs/extending/redistributable-libraries.md | 8 +- docs/extending/registration.md | 2 +- docs/extending/routes.md | 24 ++-- docs/extending/tutorials.md | 66 ++++------ docs/features/file-viewer.md | 42 +++---- docs/getting-started/configuration.md | 17 +-- docs/getting-started/internationalization.md | 11 +- docs/getting-started/navigation.md | 116 ++++++++---------- docs/images/Browserstack-logo.svg | 90 -------------- docs/index.html | 12 +- docs/ja/extending/application-features.md | 67 +++++----- docs/ja/extending/extension-format.md | 6 +- .../ja/extending/redistributable-libraries.md | 6 - docs/ja/extending/registration.md | 2 +- docs/ja/extending/tutorials.md | 14 +-- docs/ja/getting-started/configuration.md | 17 +-- .../getting-started/internationalization.md | 11 +- docs/ja/getting-started/navigation.md | 75 +++++------ docs/ja/images/Browserstack-logo.svg | 90 -------------- docs/ja/tutorials/dialog-actions.md | 16 +-- docs/tutorials/dialog-actions.md | 12 +- .../actions/create/create-folder.test.ts | 58 +++------ e2e/suites/navigation/breadcrumb.test.ts | 26 ++-- .../src/lib/settings.component.ts | 2 +- projects/aca-shared/rules/src/app.rules.ts | 11 +- .../toolbar-button.component.ts | 5 +- .../toolbar-menu-item.component.ts | 5 +- .../toolbar-menu/toolbar-menu.component.ts | 4 - .../src/lib/services/app.extension.service.ts | 2 +- .../store/src/effects/router.effects.ts | 6 +- .../info-drawer-metadata-content.ts | 5 +- .../src/components/menu/menu.ts | 12 -- .../src/lib/aos-extension.service.ts | 4 +- scripts/clireader/base-param.ts | 27 +++- scripts/clireader/boolean-param.ts | 27 +++- scripts/clireader/checkbox-param.ts | 27 +++- scripts/clireader/cli-reader.ts | 27 +++- scripts/clireader/input-param.ts | 27 +++- scripts/clireader/list-param.ts | 27 +++- scripts/clireader/params.ts | 27 +++- scripts/npm/lite-serve.ts | 6 +- .../toggle-shared/toggle-shared.component.ts | 2 +- .../context-menu-item.component.ts | 5 +- .../context-menu/context-menu.component.html | 34 +---- .../favorite-libraries.component.ts | 4 +- .../favorites/favorites.component.ts | 3 +- src/app/components/files/files.component.ts | 2 +- .../libraries/libraries.component.ts | 3 +- .../recent-files/recent-files.component.ts | 3 +- .../search-libraries-results.component.ts | 3 +- .../shared-files/shared-files.component.ts | 3 +- .../components/expand-menu.component.spec.ts | 16 ++- .../components/expand-menu.component.ts | 4 +- .../components/sidenav/sidenav.component.scss | 1 - .../sidenav/sidenav.component.theme.scss | 3 +- .../components/trashcan/trashcan.component.ts | 4 +- .../services/content-management.service.ts | 6 +- src/app/services/node-actions.service.spec.ts | 2 +- src/proxy.conf.js | 2 +- 64 files changed, 482 insertions(+), 744 deletions(-) delete mode 100644 docs/images/Browserstack-logo.svg delete mode 100644 docs/ja/images/Browserstack-logo.svg diff --git a/.editorconfig b/.editorconfig index 3a5764abc..6e87a003d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,6 +11,3 @@ trim_trailing_whitespace = true [*.md] max_line_length = off trim_trailing_whitespace = false - -[*.yml] -indent_size = 2 diff --git a/cspell.json b/cspell.json index d8b19aad8..5bfa6a141 100644 --- a/cspell.json +++ b/cspell.json @@ -8,7 +8,6 @@ "Redistributable", "fullscreen", "LGPL", - "Browserstack", "mincount", "QNAME", "PNAME", diff --git a/docs/extending/application-features.md b/docs/extending/application-features.md index c32edd784..d14173740 100644 --- a/docs/extending/application-features.md +++ b/docs/extending/application-features.md @@ -657,40 +657,39 @@ This external plugin disables the initial `exif:exif` aspect already defined in Here is the initial setting from `app.extension.json`: ```json -... - "content-metadata-presets": [ - { - "id": "app.content.metadata.custom", - "custom": [ - { - "id": "app.content.metadata.customGroup", - "title": "APP.CONTENT_METADATA.EXIF_GROUP_TITLE", - "items": [ - { - "id": "app.content.metadata.exifAspect", - "aspect": "exif:exif", - "properties": [ - "exif:pixelXDimension", - "exif:pixelYDimension", - "exif:dateTimeOriginal", - "exif:exposureTime", - "exif:fNumber", - "exif:flash", - "exif:focalLength", - "exif:isoSpeedRatings", - "exif:orientation", - "exif:manufacturer", - "exif:model", - "exif:software" - ] - } - ] - } - ] - } - ] -... - +{ + "content-metadata-presets": [ + { + "id": "app.content.metadata.custom", + "custom": [ + { + "id": "app.content.metadata.customGroup", + "title": "APP.CONTENT_METADATA.EXIF_GROUP_TITLE", + "items": [ + { + "id": "app.content.metadata.exifAspect", + "aspect": "exif:exif", + "properties": [ + "exif:pixelXDimension", + "exif:pixelYDimension", + "exif:dateTimeOriginal", + "exif:exposureTime", + "exif:fNumber", + "exif:flash", + "exif:focalLength", + "exif:isoSpeedRatings", + "exif:orientation", + "exif:manufacturer", + "exif:model", + "exif:software" + ] + } + ] + } + ] + } + ] +} ``` **Tip:** In order to allow the content-metadata presets to be extended, the settings from `app.config.json` must be copied to the `app.extensions.json` file and its ids must be added to all the items. diff --git a/docs/extending/custom-extension-loaders.md b/docs/extending/custom-extension-loaders.md index 66fd5098d..841e323c5 100644 --- a/docs/extending/custom-extension-loaders.md +++ b/docs/extending/custom-extension-loaders.md @@ -52,19 +52,15 @@ This registering can be done, using Angular's multi-provider capabilities: import { EXTENSION_DATA_LOADERS } from '@alfresco/aca-shared'; @NgModule({ - imports: [...], - declarations: [...], providers: [ - ... { provide: EXTENSION_DATA_LOADERS, multi: true, useValue: myExtensionLoader - }, - ... - ], + } + ] }) -export class MyExtensionModule { +export class MyExtensionModule {} ``` 1. `MyExtensionModule` is the extension's entry module, which needs to be imported by the extensions.module.ts. diff --git a/docs/extending/extension-format.md b/docs/extending/extension-format.md index cff675e2f..877c8e7d5 100644 --- a/docs/extending/extension-format.md +++ b/docs/extending/extension-format.md @@ -296,13 +296,11 @@ exposed by the application with a custom one coming with the plugin. "create": [ { "id": "app.create.folder", - "disabled": true, - ... + "disabled": true }, { "id": "plugin1.create.folder", - "title": "Create Folder", - ... + "title": "Create Folder" } ] } diff --git a/docs/extending/redistributable-libraries.md b/docs/extending/redistributable-libraries.md index 6c484076f..76699f376 100644 --- a/docs/extending/redistributable-libraries.md +++ b/docs/extending/redistributable-libraries.md @@ -103,8 +103,6 @@ Update the root `package.json` file and append the following entry to the `scrip ```json { "scripts": { - ..., - "build:my-extension": "ng build my-extension && cpr projects/my-extension/assets dist/my-extension/assets --deleteFirst" } @@ -113,7 +111,7 @@ Update the root `package.json` file and append the following entry to the `scrip You can now use that script to build the library and copy assets to the output folder. -**Tip:** It is good practice to provide installation instructions for your library in the `README.md` file. +**Tip:** It is good practice providing installation instructions for your library in the `README.md` file. Be sure to mention that developers should have a build rule to copy your plugin definition file to the `assets/plugins` folder of the main application. ## Publishing library to NPM @@ -174,13 +172,10 @@ Use the following rule if you are installing an extension from NPM: In the main application, edit the `src/app/extensions.module.ts` file and append the module declaration as in the next example: ```typescript -... import { MyExtensionModule } from 'my-extension'; @NgModule({ - ... imports: [ - ..., MyExtensionModule ] }) @@ -194,7 +189,6 @@ Finally, update the `src/assets/app.extensions.json` file and add a reference to ```json { "$references": [ - ..., "my-extension.json" ] } diff --git a/docs/extending/registration.md b/docs/extending/registration.md index 6ef891bb8..bdaf773ff 100644 --- a/docs/extending/registration.md +++ b/docs/extending/registration.md @@ -17,7 +17,7 @@ and use the following snippet to register custom content: import { ExtensionsModule, ExtensionService } from '@alfresco/adf-extensions'; @NgModule({ - imports: [ ExtensionsModule ] + imports: [ ExtensionsModule ], declarations: [ MyComponent1, MyLayout ] }) export class MyExtensionModule { diff --git a/docs/extending/routes.md b/docs/extending/routes.md index f5bdb1a21..8f5125187 100644 --- a/docs/extending/routes.md +++ b/docs/extending/routes.md @@ -91,16 +91,18 @@ Extensions may register a routes that are children of some existing application Imagine the situation when application has the following route structure: ```ts -{ - path: 'files, - component: FilesComponent, - children: [ - { - path: 'bin', - component: BinComponent, - }, - ], -} +export const APP_ROUTES: Routes = [ + { + path: 'files', + component: FilesComponent, + children: [ + { + path: 'bin', + component: BinComponent, + }, + ], + } +] ``` Within the extension, you can declare a route like: @@ -113,7 +115,7 @@ Within the extension, you can declare a route like: "parentRoute": "files", "path": "my-path", "layout": "app.layout.main", - "component": "your.component.id", + "component": "your.component.id" } ] } diff --git a/docs/extending/tutorials.md b/docs/extending/tutorials.md index b034f21c8..2280faa8b 100644 --- a/docs/extending/tutorials.md +++ b/docs/extending/tutorials.md @@ -192,15 +192,11 @@ import { ShowMydDialogAction, SHOW_MY_DIALOG } from '../actions/app.actions'; @Injectable() export class AppEffects { - constructor(...) {} - @Effect({ dispatch: false }) showMyDialog$ = this.actions$.pipe( ofType<ShowMydDialogAction>(SHOW_MY_DIALOG), map(() => {}) ); - - // ... } ``` @@ -216,10 +212,7 @@ import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my @Injectable() export class AppEffects { - constructor( - ..., - private dialog: MatDialog - ) {} + constructor(private dialog: MatDialog) {} @Effect({ dispatch: false }) showMyDialog$ = this.actions$.pipe( @@ -228,9 +221,6 @@ export class AppEffects { this.dialog.open(MyExtensionDialogComponent) }) ); - - ... - } ``` @@ -240,8 +230,6 @@ Update the `src/assets/app.extensions.json` file, and insert a new entry to the ```json { - ..., - "features": { "toolbar": [ { @@ -280,35 +268,35 @@ We need to add the custom route with our entry component and its child route for ```json { - ... - "routes": [{ - "id": "start-process", - "path": "start-process", - "parentRoute": "", - "layout": "app.layout.main", - // The component we register to be our entry point for this particular route - "component": "myplugin.components.start-process", - "children": [ + "routes": [ + { + "id": "start-process", + "path": "start-process", + "parentRoute": "", + "layout": "app.layout.main", + // The component we register to be our entry point for this particular route + "component": "myplugin.components.start-process", + "children": [ { - "id": "start-process-preview", - // It can be accessed on the "/start-process(viewer:preview/nodeId)" route - "path": "preview/:nodeId", - "component": "app.components.preview", - "data": { - // Using history.back() when closing the preview - "navigateBackAsClose": true, - // Disabling complex action and buttons for the preview - "simplestMode": true - }, - // We would like to target that named router outlet which is used for the viewer overlay - "outlet": "viewer" + "id": "start-process-preview", + // It can be accessed on the "/start-process(viewer:preview/nodeId)" route + "path": "preview/:nodeId", + "component": "app.components.preview", + "data": { + // Using history.back() when closing the preview + "navigateBackAsClose": true, + // Disabling complex action and buttons for the preview + "simplestMode": true + }, + // We would like to target that named router outlet which is used for the viewer overlay + "outlet": "viewer" } - ] - }] - ... + ] + } + ] +} ``` - ##### Dispatching the right action within our component to open the file preview ```ts @@ -316,8 +304,6 @@ import { PluginPreviewAction } from '@alfresco/aca-shared/store'; @Component({...}) export class StartProcessComponent { - ... - onFilePreview({ nodeId }) { this.store.dispatch(new PluginPreviewAction('start-process-cloud', nodeId)); } diff --git a/docs/features/file-viewer.md b/docs/features/file-viewer.md index 7497eea6f..45d641391 100644 --- a/docs/features/file-viewer.md +++ b/docs/features/file-viewer.md @@ -75,27 +75,27 @@ export interface ViewNodeExtras { ```typescript // app.routes.ts -... -{ - path: 'custom-path', - children: [ - { - path: '', - component: CustomComponent - }, - { - path: 'view/:nodeId', - outlet: 'viewer', - children: [ - { - path: '', - loadChildren: './components/viewer/viewer.module#AppViewerModule' - } - ] - } - ] -} -... +export const APP_ROUTES: Routes = [ + { + path: 'custom-path', + children: [ + { + path: '', + component: CustomComponent + }, + { + path: 'view/:nodeId', + outlet: 'viewer', + children: [ + { + path: '', + loadChildren: './components/viewer/viewer.module#AppViewerModule' + } + ] + } + ] + } +] ``` ```typescript diff --git a/docs/getting-started/configuration.md b/docs/getting-started/configuration.md index 36f1b36a8..8742336a1 100644 --- a/docs/getting-started/configuration.md +++ b/docs/getting-started/configuration.md @@ -20,8 +20,7 @@ The example below demonstrates the most common dynamic format for a development ```json { - "ecmHost": "http://{hostname}{:port}", - ... + "ecmHost": "http://{hostname}{:port}" } ``` @@ -40,8 +39,7 @@ Alternatively, you can provide a static address for the ACS server if necessary: ```json { - "ecmHost": "http://localhost:4200", - ... + "ecmHost": "http://localhost:4200" } ``` @@ -65,7 +63,6 @@ The following block allows you to change the name of the application. ```json { - ..., "application": { "name": "Alfresco Example Content Application" } @@ -111,7 +108,7 @@ You can change the header background image by specifying the path to the corresp ```json { "application": { - "headerImagePath": "assets/images/mastHead-bg-shapesPattern.svg", + "headerImagePath": "assets/images/mastHead-bg-shapesPattern.svg" } } ``` @@ -124,7 +121,6 @@ By default, the application ships with the following rules already predefined: ```json { - ..., "files": { "excluded": [ ".DS_Store", @@ -132,8 +128,7 @@ By default, the application ships with the following rules already predefined: "thumbs.db", ".git" ] - }, - ... + } } ``` @@ -145,15 +140,13 @@ You can change the default settings of the pagination that gets applied to all t ```json { - ..., "pagination": { "supportedPageSizes": [ 25, 50, 100 ] - }, - ... + } } ``` diff --git a/docs/getting-started/internationalization.md b/docs/getting-started/internationalization.md index 348ff80d3..ca0898c40 100644 --- a/docs/getting-started/internationalization.md +++ b/docs/getting-started/internationalization.md @@ -35,7 +35,6 @@ To change the default language set edit the `app.config.json` file and add or re ```json { - ..., "languages": [ { "key": "de", @@ -48,8 +47,7 @@ To change the default language set edit the `app.config.json` file and add or re { "key": "es", "label": "Spanish" - }, - ... + } ] } ``` @@ -75,11 +73,9 @@ You can copy the content over to your newly created file and replace the English "CREATE_FOLDER": "Ordner erstellen", "UPLOAD_FILE": "Datei hochladen", "UPLOAD_FOLDER": "Ordner hochladen" - }, - ... + } } - }, - ... + } } ``` @@ -109,7 +105,6 @@ Modify the `/src/assets/i18n/en.json` file and append the "CORE" section like in ```json { "APP": { - ... }, "CORE": { "FOLDER_DIALOG": { diff --git a/docs/getting-started/navigation.md b/docs/getting-started/navigation.md index b510a685a..8934321ba 100644 --- a/docs/getting-started/navigation.md +++ b/docs/getting-started/navigation.md @@ -22,12 +22,8 @@ Navigation configuration supports array and object like schema. Defining an obje ```json { "navigation": { - "main": [ - ... - ], - "secondary": [ - ... - ] + "main": [], + "secondary": [] } } ``` @@ -37,9 +33,8 @@ Navigation configuration supports array and object like schema. Defining an obje ```json { "navigation": [ - { ... }, - { ... }, - ... + { }, + { } ] } ``` @@ -61,17 +56,17 @@ Navigation configuration supports array and object like schema. Defining an obje To change the `title` and `label` of navigation links edit the values under `BROWSE` entry found at `/src/assets/i18n/en.json` ```json -"APP" : { - ... - "BROWSE": { - "PERSONAL": { - "TITLE": "Personal Files", - "SIDENAV_LINK": { - "LABEL": "Personal Files", - "TOOLTIP": "View your Personal Files" +{ + "APP": { + "BROWSE": { + "PERSONAL": { + "TITLE": "Personal Files", + "SIDENAV_LINK": { + "LABEL": "Personal Files", + "TOOLTIP": "View your Personal Files" + } } - }, - ... + } } } ``` @@ -100,17 +95,12 @@ export class CustomPage { Register the component in ```app.module.ts``` ```javascript +import { CustomPage } from './components/custom-page/custom-page.component'; - ... - import { CustomPage } from './components/custom-page/custom-page.component'; - - @NgModule({ - ... - declarations: [ - ..., - CustomPage - ], - ... +@NgModule({ + declarations: [ + CustomPage + ] }) ``` @@ -119,7 +109,6 @@ In the `app.config.json` define a link entry which will point to the custom page ```json { - ..., "navigation": [ "main": [ ... ], "secondary": [ ... ], @@ -135,14 +124,12 @@ In the `app.config.json` define a link entry which will point to the custom page ] ] } - ``` This can also be declared using ngrx store action: ```json { - ..., "navigation": [ "main": [ ... ], "secondary": [ ... ], @@ -159,29 +146,25 @@ This can also be declared using ngrx store action: ] ] } - ``` Map the `/custom-route` in `app.routes.ts` as a child of `LayoutComponent` definition. ```js +import { CustomPage } from './components/custom-page/custom-page.component.ts'; - import { CustomPage } from './components/custom-page/custom-page.component.ts'; - - ... +export const APP_ROUTES: Routes = [ { path: '', component: LayoutComponent, children: [ - ..., { path: 'custom-route', component: CustomPage } ] } - ..., - +] ```  @@ -191,49 +174,48 @@ Map the `/custom-route` in `app.routes.ts` as a child of `LayoutComponent` defin Navigation definition also supports custom components to be dynamically render. The schema for this is as follows: ```json -"navbar": [ - { +{ + "navbar": [ + { "id": "app.navbar.primary", "items": [ - ... - - { - "id": "custom-component", - "component": "custom-menu-item" - } - - ... + { + "id": "custom-component", + "component": "custom-menu-item" + } ] - } -] + } + ] +} ``` Navigation items or group of navigation items can be conditional render based on defined rules. ```json -"navbar": [ - { - "id": "custom-group-1", - "rules": { - "visible": "rule-reference-id" +{ + "navbar": [ + { + "id": "custom-group-1", + "rules": { + "visible": "rule-reference-id" + }, + "items": [] }, - "items": [ ... ] - }, - { - "id": "custom-group-2", - "items": [ + { + "id": "custom-group-2", + "items": [ { "id": "itemId", "rules": { "visible": "rule-reference-id" - }, - ... + } } - ] - } -] + ] + } + ] +} ``` -For more informations about rules checkout [Rules](../extending/rules.md) section. +For more information about rules checkout [Rules](../extending/rules.md) section. For more information about the content of a custom page see [Document List Layout](/features/document-list-layout) section. diff --git a/docs/images/Browserstack-logo.svg b/docs/images/Browserstack-logo.svg deleted file mode 100644 index 195f64d2f..000000000 --- a/docs/images/Browserstack-logo.svg +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> -<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" - viewBox="0 0 490.1 105.6" style="enable-background:new 0 0 490.1 105.6;" xml:space="preserve"> -<style type="text/css"> - .st0{fill:#F4B960;} - .st1{fill:#E66F32;} - .st2{fill:#E43C41;} - .st3{fill:#BDD041;} - .st4{fill:#6DB54C;} - .st5{fill:#AEDAE6;} - .st6{fill:#56B8DE;} - .st7{fill:#00B1D5;} - .st8{fill:url(#SVGID_1_);} - .st9{fill:#221F1F;} - .st10{fill:#FFFFFF;} - .st11{fill:#000111;} -</style> -<title>Browserstack-logo-white</title> -<circle class="st0" cx="52.8" cy="52.8" r="52.8"/> -<circle class="st1" cx="47.5" cy="47.5" r="47.5"/> -<circle class="st2" cx="53.8" cy="41.1" r="41.1"/> -<circle class="st3" cx="57.1" cy="44.4" r="37.8"/> -<circle class="st4" cx="54.3" cy="47.2" r="35.1"/> -<circle class="st5" cx="48.8" cy="41.7" r="29.5"/> -<circle class="st6" cx="53.6" cy="36.8" r="24.7"/> -<circle class="st7" cx="56.6" cy="39.9" r="21.7"/> -<radialGradient id="SVGID_1_" cx="53.45" cy="63.02" r="18.57" gradientTransform="matrix(1 0 0 -1 0 106)" gradientUnits="userSpaceOnUse"> - <stop offset="0" style="stop-color:#797979"/> - <stop offset="1" style="stop-color:#4C4C4C"/> -</radialGradient> -<circle class="st8" cx="53.5" cy="43" r="18.6"/> -<circle class="st9" cx="53.5" cy="43" r="18.6"/> -<ellipse transform="matrix(0.4094 -0.9123 0.9123 0.4094 2.8913 76.9251)" class="st10" cx="60.9" cy="36.2" rx="5.7" ry="3.7"/> -<path class="st11" d="M122.5,32.6c0-0.3,0.3-0.6,0.6-0.6c0,0,0,0,0.1,0h16.6c9.5,0,13.9,4.4,13.9,11c0.2,3.7-1.8,7.2-5.2,8.8v0.1 - c3.7,1.5,6.1,5.2,6,9.3c0,8.2-5.6,12.2-15.4,12.2h-16c-0.3,0-0.6-0.2-0.7-0.5c0,0,0,0,0-0.1L122.5,32.6L122.5,32.6z M139.6,49.1 - c3.9,0,6.4-2.2,6.4-5.4s-2.4-5.5-6.4-5.5h-8.9c-0.2,0-0.4,0.1-0.4,0.3c0,0,0,0,0,0.1v10.2c0,0.2,0.1,0.3,0.3,0.4c0,0,0,0,0.1,0 - H139.6L139.6,49.1z M130.6,66.9h9.3c4.3,0,6.8-2.3,6.8-5.8s-2.4-5.7-6.7-5.7h-9.3c-0.2,0-0.4,0.1-0.4,0.3c0,0,0,0,0,0.1v10.7 - C130.3,66.8,130.4,66.9,130.6,66.9C130.6,66.9,130.6,66.9,130.6,66.9L130.6,66.9z"/> -<path class="st11" d="M159.9,73.3c-0.3,0-0.6-0.2-0.7-0.5c0,0,0,0,0-0.1V44.6c0-0.3,0.3-0.6,0.6-0.6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.4c0,0,0,0,0.1,0h12.4c0.2,0,0.4-0.1,0.4-0.3c0,0,0,0,0-0.1 - C310.8,54.5,310.6,53.6,310.4,52.8L310.4,52.8z"/> -<path class="st11" d="M323.6,73.3c-0.3,0-0.6-0.2-0.7-0.5c0,0,0,0,0-0.1V44.6c0-0.3,0.3-0.6,0.6-0.6c0,0,0,0,0.1,0h6 - c0.3,0,0.6,0.2,0.7,0.5c0,0,0,0,0,0.1v2.5h0.1c1.5-2.2,4.2-3.8,8.2-3.8c2.4,0,4.8,0.8,6.6,2.4c0.3,0.3,0.4,0.5,0.1,0.8l-3.5,4.1 - c-0.2,0.3-0.6,0.4-0.9,0.2c0,0,0,0-0.1,0c-1.4-0.9-3-1.4-4.7-1.4c-4.1,0-6,2.7-6,7.4v15.9c0,0.3-0.3,0.6-0.6,0.6c0,0,0,0-0.1,0 - H323.6L323.6,73.3z"/> -<path class="st11" d="M346.5,68.5c-0.3-0.2-0.4-0.6-0.2-0.9c0,0,0,0,0,0l4.1-4.4c0.2-0.3,0.6-0.3,0.9-0.1c0,0,0,0,0,0 - c3.5,2.7,7.7,4.2,12.1,4.4c5.3,0,8.4-2.5,8.4-6c0-3-2-4.9-8.1-5.7l-2.4-0.3c-8.6-1.1-13.5-4.9-13.5-11.8c0-7.5,5.9-12.4,15.1-12.4 - c5.1-0.1,10.1,1.4,14.5,4.2c0.3,0.1,0.4,0.4,0.2,0.7c0,0.1-0.1,0.1-0.1,0.2l-3.1,4.5c-0.2,0.3-0.6,0.4-0.9,0.2 - c-3.2-2.1-6.9-3.2-10.7-3.2c-4.5,0-7,2.3-7,5.5c0,2.9,2.2,4.8,8.2,5.6l2.4,0.3c8.6,1.1,13.3,4.9,13.3,12c0,7.3-5.7,12.8-16.8,12.8 - C356.3,73.9,350,71.5,346.5,68.5z"/> -<path class="st11" d="M393.3,73.8c-6.4,0-8.8-2.9-8.8-8.6V49.8c0-0.2-0.1-0.3-0.3-0.4c0,0,0,0-0.1,0H382c-0.3,0-0.6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433.1,65.8c-0.7-2.3-1.1-4.8-1-7.2c-0.1-2.4,0.3-4.9,1-7.2c1.8-5.2,6.7-8.1,13.1-8.1c4.2-0.2,8.2,1.5,11,4.6 - c0.2,0.2,0.2,0.6,0,0.8c0,0,0,0-0.1,0.1l-4.1,3.3c-0.3,0.2-0.7,0.2-0.9-0.1c0,0,0,0,0-0.1c-1.5-1.7-3.6-2.6-5.9-2.5 - c-2.8,0-5,1.3-5.9,3.8c-0.5,1.8-0.8,3.6-0.7,5.4c-0.1,1.8,0.1,3.7,0.7,5.5c0.9,2.5,3.1,3.8,5.9,3.8c2.2,0.1,4.4-0.9,5.9-2.6 - c0.2-0.3,0.6-0.3,0.9-0.1c0,0,0,0,0,0l4.1,3.3c0.3,0.2,0.3,0.5,0.1,0.8c0,0,0,0-0.1,0.1c-2.9,3-6.9,4.6-11,4.5 - C439.8,73.9,435,71.1,433.1,65.8z"/> -<path class="st11" d="M482.8,73.3c-0.4,0-0.8-0.2-1-0.6l-8-12.3l-4.3,4.6v7.7c0,0.3-0.3,0.6-0.6,0.6c0,0,0,0-0.1,0h-6 - c-0.3,0-0.6-0.2-0.7-0.5c0,0,0,0,0-0.1V32.6c0-0.3,0.3-0.6,0.6-0.6c0,0,0,0,0.1,0h6c0.3,0,0.6,0.2,0.7,0.5c0,0,0,0,0,0.1v23.8 - l10.8-11.8c0.3-0.4,0.8-0.6,1.2-0.6h6.7c0.2,0,0.4,0.1,0.4,0.3c0,0.1,0,0.3-0.1,0.3l-10.1,10.7L490,72.7c0.1,0.2,0.1,0.4,0,0.5 - c-0.1,0.1-0.2,0.1-0.3,0.1H482.8L482.8,73.3z"/> -</svg> diff --git a/docs/index.html b/docs/index.html index 7e9a280eb..6a444ef8d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,10 +3,7 @@ <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> - <meta - name="viewport" - content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" - /> + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" /> <title>Alfresco Content App</title> <link rel="stylesheet" href="https://unpkg.com/docute@3/dist/docute.css" /> <link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96" /> @@ -16,20 +13,19 @@ <script src="https://unpkg.com/docute@3/dist/docute.js"></script> <script src="https://unpkg.com/prismjs/components/prism-typescript.js"></script> <script> - var langs = [ + const langs = [ { title: 'English', path: '/' }, { title: '日本語', path: '/ja/', matchPath: /^\/ja[\/$]/ } ]; docute.init({ url: '.', - toc: $route => { + toc: ($route) => { const isJapaneseLang = $route.path.split('/')[1] === 'ja'; const wasJapaneseLang = $route.from.path.split('/')[1] === 'ja'; if (wasJapaneseLang !== isJapaneseLang) { - const isFirstPageLoad = - $route.from.path === '/' && $route.from.meta.name !== 'home'; + const isFirstPageLoad = $route.from.path === '/' && $route.from.meta.name !== 'home'; if (!isFirstPageLoad) { document.location.reload(); } diff --git a/docs/ja/extending/application-features.md b/docs/ja/extending/application-features.md index 3cc8d5528..9c3a3b4e4 100644 --- a/docs/ja/extending/application-features.md +++ b/docs/ja/extending/application-features.md @@ -649,40 +649,39 @@ export interface ViewerRules { `app.extension.json` の初期設定は次のとおりです: ```json -... - "content-metadata-presets": [ - { - "id": "app.content.metadata.custom", - "custom": [ - { - "id": "app.content.metadata.customGroup", - "title": "APP.CONTENT_METADATA.EXIF_GROUP_TITLE", - "items": [ - { - "id": "app.content.metadata.exifAspect", - "aspect": "exif:exif", - "properties": [ - "exif:pixelXDimension", - "exif:pixelYDimension", - "exif:dateTimeOriginal", - "exif:exposureTime", - "exif:fNumber", - "exif:flash", - "exif:focalLength", - "exif:isoSpeedRatings", - "exif:orientation", - "exif:manufacturer", - "exif:model", - "exif:software" - ] - } - ] - } - ] - } - ] -... - +{ + "content-metadata-presets": [ + { + "id": "app.content.metadata.custom", + "custom": [ + { + "id": "app.content.metadata.customGroup", + "title": "APP.CONTENT_METADATA.EXIF_GROUP_TITLE", + "items": [ + { + "id": "app.content.metadata.exifAspect", + "aspect": "exif:exif", + "properties": [ + "exif:pixelXDimension", + "exif:pixelYDimension", + "exif:dateTimeOriginal", + "exif:exposureTime", + "exif:fNumber", + "exif:flash", + "exif:focalLength", + "exif:isoSpeedRatings", + "exif:orientation", + "exif:manufacturer", + "exif:model", + "exif:software" + ] + } + ] + } + ] + } + ] +} ``` **Tip:** content-metadata プリセットを拡張できるようにするには、 `app.config.json` の設定を `app.extensions.json` ファイルにコピーし、その ID をすべてのアイテムに追加する必要があります。 diff --git a/docs/ja/extending/extension-format.md b/docs/ja/extending/extension-format.md index 5a8b26756..356dd0816 100644 --- a/docs/ja/extending/extension-format.md +++ b/docs/ja/extending/extension-format.md @@ -297,13 +297,11 @@ JSON 構造およびネストのレベルに制限はありません。 "create": [ { "id": "app.create.folder", - "disabled": true, - ... + "disabled": true }, { "id": "plugin1.create.folder", - "title": "Create Folder", - ... + "title": "Create Folder" } ] } diff --git a/docs/ja/extending/redistributable-libraries.md b/docs/ja/extending/redistributable-libraries.md index 216614bdb..150d76872 100644 --- a/docs/ja/extending/redistributable-libraries.md +++ b/docs/ja/extending/redistributable-libraries.md @@ -101,8 +101,6 @@ JSON 定義で `my-extension.main.component` 識別子を使用できるよう ```json { "scripts": { - ..., - "build:my-extension": "ng build my-extension && cpr projects/my-extension/assets dist/my-extension/assets --deleteFirst" } @@ -172,13 +170,10 @@ NPM から拡張機能をインストールする場合は、次のルールを メインアプリケーションで、`src/app/extensions.module.ts` ファイルを編集し、次の例のようにモジュール宣言を追加します: ```typescript -... import { MyExtensionModule } from 'my-extension'; @NgModule({ - ... imports: [ - ..., MyExtensionModule ] }) @@ -192,7 +187,6 @@ export class AppExtensionsModule {} ```json { "$references": [ - ..., "my-extension.json" ] } diff --git a/docs/ja/extending/registration.md b/docs/ja/extending/registration.md index 01dcd8b48..b5210146f 100644 --- a/docs/ja/extending/registration.md +++ b/docs/ja/extending/registration.md @@ -18,7 +18,7 @@ nav: ja import { ExtensionsModule, ExtensionService } from '@alfresco/adf-extensions'; @NgModule({ - imports: [ ExtensionsModule ] + imports: [ ExtensionsModule ], declarations: [ MyComponent1, MyLayout ] }) export class MyExtensionModule { diff --git a/docs/ja/extending/tutorials.md b/docs/ja/extending/tutorials.md index 6ed78f830..809dc3969 100644 --- a/docs/ja/extending/tutorials.md +++ b/docs/ja/extending/tutorials.md @@ -193,15 +193,11 @@ import { ShowMydDialogAction, SHOW_MY_DIALOG } from '../actions/app.actions'; @Injectable() export class AppEffects { - constructor(...) {} - @Effect({ dispatch: false }) showMyDialog$ = this.actions$.pipe( ofType<ShowMydDialogAction>(SHOW_MY_DIALOG), map(() => {}) ); - - // ... } ``` @@ -217,10 +213,7 @@ import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my @Injectable() export class AppEffects { - constructor( - ..., - private dialog: MatDialog - ) {} + constructor(private dialog: MatDialog) {} @Effect({ dispatch: false }) showMyDialog$ = this.actions$.pipe( @@ -229,9 +222,6 @@ export class AppEffects { this.dialog.open(MyExtensionDialogComponent) }) ); - - ... - } ``` @@ -241,8 +231,6 @@ export class AppEffects { ```json { - ..., - "features": { "toolbar": [ { diff --git a/docs/ja/getting-started/configuration.md b/docs/ja/getting-started/configuration.md index 5b8a27910..ae55e00e7 100644 --- a/docs/ja/getting-started/configuration.md +++ b/docs/ja/getting-started/configuration.md @@ -21,8 +21,7 @@ Content Application が起動したら、Alfresco Content Services サーバの ```json { - "ecmHost": "http://{hostname}{:port}", - ... + "ecmHost": "http://{hostname}{:port}" } ``` @@ -41,8 +40,7 @@ ACS リポジトリの `localhost:4200/alfresco` のプロキシサーバです ```json { - "ecmHost": "http://localhost:4200", - ... + "ecmHost": "http://localhost:4200" } ``` @@ -66,7 +64,6 @@ ACS リポジトリの `localhost:4200/alfresco` のプロキシサーバです ```json { - ..., "application": { "name": "Alfresco Example Content Application" } @@ -86,7 +83,6 @@ Alfresco コンテンツアプリケーションの左上隅に表示される ```json { - ..., "application": { "logo": "/assets/images/alfresco-logo-white.svg" } @@ -99,7 +95,6 @@ Alfresco コンテンツアプリケーションの左上隅に表示される ```json { - ..., "headerColor": "#ffffff" } ``` @@ -112,7 +107,6 @@ Alfresco コンテンツアプリケーションの左上隅に表示される ```json { - ..., "files": { "excluded": [ ".DS_Store", @@ -120,8 +114,7 @@ Alfresco コンテンツアプリケーションの左上隅に表示される "thumbs.db", ".git" ] - }, - ... + } } ``` @@ -133,15 +126,13 @@ Alfresco コンテンツアプリケーションの左上隅に表示される ```json { - ..., "pagination": { "supportedPageSizes": [ 25, 50, 100 ] - }, - ... + } } ``` diff --git a/docs/ja/getting-started/internationalization.md b/docs/ja/getting-started/internationalization.md index 27c6907f7..25eae3644 100644 --- a/docs/ja/getting-started/internationalization.md +++ b/docs/ja/getting-started/internationalization.md @@ -36,7 +36,6 @@ nav: ja ```json { - ..., "languages": [ { "key": "de", @@ -49,8 +48,7 @@ nav: ja { "key": "es", "label": "スペイン語" - }, - ... + } ] } ``` @@ -76,11 +74,9 @@ nav: ja "CREATE_FOLDER": "Ordner erstellen", "UPLOAD_FILE": "Datei hochladen", "UPLOAD_FOLDER": "Ordner hochladen" - }, - ... + } } - }, - ... + } } ``` @@ -110,7 +106,6 @@ ADF リソースの翻訳を提供することもできます。 ```json { "APP": { - ... }, "CORE": { "FOLDER_DIALOG": { diff --git a/docs/ja/getting-started/navigation.md b/docs/ja/getting-started/navigation.md index 4a6a93c23..e8c32362c 100644 --- a/docs/ja/getting-started/navigation.md +++ b/docs/ja/getting-started/navigation.md @@ -38,9 +38,8 @@ nav: ja ```json { "navigation": [ - { ... }, - { ... }, - ... + {}, + {} ] } ``` @@ -62,17 +61,17 @@ nav: ja ナビゲーションリンクの `title` と `label` を変更するには、`/src/assets/i18n/en.json` にある `BROWSE` エントリの下の値を編集します ```json -"APP" : { - ... - "BROWSE": { - "PERSONAL": { - "TITLE": "Personal Files", - "SIDENAV_LINK": { - "LABEL": "Personal Files", - "TOOLTIP": "View your Personal Files" +{ + "APP": { + "BROWSE": { + "PERSONAL": { + "TITLE": "Personal Files", + "SIDENAV_LINK": { + "LABEL": "Personal Files", + "TOOLTIP": "View your Personal Files" + } } - }, - ... + } } } ``` @@ -101,29 +100,22 @@ export class CustomPage { コンポーネントを ```app.module.ts``` に登録します ```javascript +import { CustomPage } from './components/custom-page/custom-page.component'; - ... - import { CustomPage } from './components/custom-page/custom-page.component'; - - @NgModule({ - ... - declarations: [ - ..., - CustomPage - ], - ... +@NgModule({ + declarations: [ + CustomPage + ] }) - ``` `app.config.json` で、カスタムページを指すリンクエントリを定義します ```json { - ..., "navigation": [ - "main": [ ... ], - "secondary": [ ... ], + "main": [ ], + "secondary": [ ], "custom": [ { "icon": "work", @@ -167,21 +159,20 @@ export class CustomPage { ```js - import { CustomPage } from './components/custom-page/custom-page.component.ts'; +import { CustomPage } from './components/custom-page/custom-page.component.ts'; - ... +export const APP_ROUTES: Routes = [ { path: '', component: LayoutComponent, children: [ - ..., { path: 'custom-route', component: CustomPage } ] } - ..., +] ``` @@ -192,21 +183,19 @@ export class CustomPage { ナビゲーション定義は、動的にレンダリングされるカスタムコンポーネントもサポートします。このスキーマは次のとおりです: ```json -"navbar": [ - { +{ + "navbar": [ + { "id": "app.navbar.primary", "items": [ - ... - - { - "id": "custom-component", - "component": "custom-menu-item" - } - - ... + { + "id": "custom-component", + "component": "custom-menu-item" + } ] - } -] + } + ] +} ``` カスタムページのコンテンツの詳細については、[ドキュメントリストのレイアウト](/ja/features/document-list-layout) セクションを参照してください。 diff --git a/docs/ja/images/Browserstack-logo.svg b/docs/ja/images/Browserstack-logo.svg deleted file mode 100644 index 195f64d2f..000000000 --- a/docs/ja/images/Browserstack-logo.svg +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> -<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" - viewBox="0 0 490.1 105.6" style="enable-background:new 0 0 490.1 105.6;" xml:space="preserve"> -<style type="text/css"> - .st0{fill:#F4B960;} - .st1{fill:#E66F32;} - .st2{fill:#E43C41;} - .st3{fill:#BDD041;} - .st4{fill:#6DB54C;} - .st5{fill:#AEDAE6;} - .st6{fill:#56B8DE;} - .st7{fill:#00B1D5;} - .st8{fill:url(#SVGID_1_);} - .st9{fill:#221F1F;} - .st10{fill:#FFFFFF;} - .st11{fill:#000111;} -</style> -<title>Browserstack-logo-white</title> -<circle class="st0" cx="52.8" cy="52.8" r="52.8"/> -<circle class="st1" cx="47.5" cy="47.5" r="47.5"/> -<circle class="st2" cx="53.8" cy="41.1" r="41.1"/> -<circle class="st3" cx="57.1" cy="44.4" r="37.8"/> -<circle class="st4" cx="54.3" cy="47.2" r="35.1"/> -<circle class="st5" cx="48.8" cy="41.7" r="29.5"/> -<circle class="st6" cx="53.6" cy="36.8" r="24.7"/> -<circle class="st7" cx="56.6" cy="39.9" r="21.7"/> -<radialGradient id="SVGID_1_" cx="53.45" cy="63.02" r="18.57" gradientTransform="matrix(1 0 0 -1 0 106)" gradientUnits="userSpaceOnUse"> - <stop offset="0" style="stop-color:#797979"/> - <stop offset="1" style="stop-color:#4C4C4C"/> -</radialGradient> -<circle class="st8" cx="53.5" cy="43" r="18.6"/> -<circle class="st9" cx="53.5" cy="43" r="18.6"/> -<ellipse transform="matrix(0.4094 -0.9123 0.9123 0.4094 2.8913 76.9251)" class="st10" cx="60.9" cy="36.2" rx="5.7" ry="3.7"/> -<path class="st11" d="M122.5,32.6c0-0.3,0.3-0.6,0.6-0.6c0,0,0,0,0.1,0h16.6c9.5,0,13.9,4.4,13.9,11c0.2,3.7-1.8,7.2-5.2,8.8v0.1 - c3.7,1.5,6.1,5.2,6,9.3c0,8.2-5.6,12.2-15.4,12.2h-16c-0.3,0-0.6-0.2-0.7-0.5c0,0,0,0,0-0.1L122.5,32.6L122.5,32.6z M139.6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,6,3.8C198.6,68,201,66.5,201.9,64L201.9,64z"/> -<path class="st11" d="M241.9,73.3c-0.4,0-0.7-0.3-0.8-0.6L235,53.9h-0.1l-6.2,18.7c-0.1,0.4-0.4,0.6-0.8,0.6h-5.4 - c-0.4,0-0.7-0.3-0.8-0.6l-10-28.1c-0.1-0.2,0-0.5,0.2-0.6c0.1,0,0.2-0.1,0.3,0h6.3c0.4,0,0.8,0.2,0.9,0.6l6.1,19.3h0.1l6-19.3 - c0.1-0.4,0.5-0.6,0.9-0.6h4.7c0.4,0,0.7,0.2,0.9,0.6l6.4,19.3h0.1l5.8-19.3c0.1-0.4,0.5-0.7,0.9-0.6h6.3c0.2-0.1,0.5,0.1,0.5,0.3 - c0,0.1,0,0.2,0,0.3l-10,28.1c-0.1,0.4-0.4,0.6-0.8,0.6L241.9,73.3L241.9,73.3z"/> -<path class="st11" d="M259.3,69.3c-0.2-0.2-0.3-0.6-0.1-0.8c0,0,0,0,0.1-0.1l3.7-3.6c0.3-0.2,0.7-0.2,0.9,0c2.6,2.1,5.9,3.3,9.3,3.3 - c3.9,0,5.9-1.5,5.9-3.5c0-1.8-1.1-2.9-5.2-3.2l-3.4-0.3c-6.4-0.6-9.7-3.6-9.7-8.6c0-5.7,4.4-9.2,12.3-9.2c4.2-0.1,8.4,1.2,11.9,3.6 - c0.3,0.2,0.3,0.5,0.2,0.8c0,0,0,0,0,0.1l-3.2,3.6c-0.2,0.3-0.6,0.3-0.9,0.1c-2.5-1.5-5.4-2.4-8.3-2.4c-3.1,0-4.8,1.3-4.8,3 - s1.1,2.7,5.2,3.1l3.4,0.3c6.6,0.6,9.8,3.8,9.8,8.6c0,5.8-4.6,9.9-13.3,9.9C268,74,263.2,72.4,259.3,69.3z"/> -<path class="st11" d="M291.2,65.8c-0.8-2.3-1.2-4.7-1.1-7.2c-0.1-2.5,0.3-4.9,1-7.2c1.8-5.1,6.6-8.1,12.9-8.1c6.5,0,11.2,3.1,13,8.1 - c0.7,2.1,1,4.1,1,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1,0h6c0.3,0,0.6,0.2,0.7,0.5c0,0,0,0,0,0.1v23.8 - l10.8-11.8c0.3-0.4,0.8-0.6,1.2-0.6h6.7c0.2,0,0.4,0.1,0.4,0.3c0,0.1,0,0.3-0.1,0.3l-10.1,10.7L490,72.7c0.1,0.2,0.1,0.4,0,0.5 - c-0.1,0.1-0.2,0.1-0.3,0.1H482.8L482.8,73.3z"/> -</svg> diff --git a/docs/ja/tutorials/dialog-actions.md b/docs/ja/tutorials/dialog-actions.md index b380b07f8..6afea5b60 100644 --- a/docs/ja/tutorials/dialog-actions.md +++ b/docs/ja/tutorials/dialog-actions.md @@ -19,9 +19,7 @@ ng g component dialogs/my-extension-dialog --module=app ```ts @NgModule({ - imports: [...], declarations: [ - ..., MyExtensionDialogComponent ] }) @@ -80,15 +78,11 @@ import { ShowMydDialogAction, SHOW_MY_DIALOG } from '../actions/app.actions'; @Injectable() export class AppEffects { - constructor(...) {} - @Effect({ dispatch: false }) showMyDialog$ = this.actions$.pipe( ofType<ShowMydDialogAction>(SHOW_MY_DIALOG), map(() => {}) ); - - // ... } ``` @@ -104,10 +98,7 @@ import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my @Injectable() export class AppEffects { - constructor( - ..., - private dialog: MatDialog - ) {} + constructor(private dialog: MatDialog) {} @Effect({ dispatch: false }) showMyDialog$ = this.actions$.pipe( @@ -116,9 +107,6 @@ export class AppEffects { this.dialog.open(MyExtensionDialogComponent) }) ); - - ... - } ``` @@ -128,8 +116,6 @@ export class AppEffects { ```json { - ..., - "features": { "toolbar": [ { diff --git a/docs/tutorials/dialog-actions.md b/docs/tutorials/dialog-actions.md index 256c2c7ed..c28854dc2 100644 --- a/docs/tutorials/dialog-actions.md +++ b/docs/tutorials/dialog-actions.md @@ -67,15 +67,11 @@ import { ShowMydDialogAction, SHOW_MY_DIALOG } from '../actions/app.actions'; @Injectable() export class AppEffects { - constructor(...) {} - @Effect({ dispatch: false }) showMyDialog$ = this.actions$.pipe( ofType<ShowMydDialogAction>(SHOW_MY_DIALOG), map(() => {}) ); - - // ... } ``` @@ -91,10 +87,7 @@ import { MyExtensionDialogComponent } from '../../dialogs/my-extension-dialog/my @Injectable() export class AppEffects { - constructor( - ..., - private dialog: MatDialog - ) {} + constructor(private dialog: MatDialog) {} @Effect({ dispatch: false }) showMyDialog$ = this.actions$.pipe( @@ -103,9 +96,6 @@ export class AppEffects { this.dialog.open(MyExtensionDialogComponent) }) ); - - ... - } ``` diff --git a/e2e/suites/actions/create/create-folder.test.ts b/e2e/suites/actions/create/create-folder.test.ts index b9313e852..c726b4328 100755 --- a/e2e/suites/actions/create/create-folder.test.ts +++ b/e2e/suites/actions/create/create-folder.test.ts @@ -61,6 +61,12 @@ describe('Create folder', () => { const { dataTable } = page; const adminApiActions = new AdminActions(); + async function openCreateFolderDialog(name: string) { + await page.dataTable.doubleClickOnRowByName(name); + await page.sidenav.openCreateFolderDialog(); + await createDialog.waitForDialogToOpen(); + } + beforeAll(async (done) => { await adminApiActions.createUser({ username }); @@ -93,9 +99,7 @@ describe('Create folder', () => { }); it('[C216341] creates new folder with name', async () => { - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); await createDialog.enterName(folderName1); await BrowserActions.click(createDialog.createButton); await createDialog.waitForDialogToClose(); @@ -105,9 +109,7 @@ describe('Create folder', () => { }); it('[C216340] creates new folder with name and description', async (done) => { - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); await createDialog.enterName(folderName2); await createDialog.enterDescription(folderDescription); await BrowserActions.click(createDialog.createButton); @@ -121,9 +123,7 @@ describe('Create folder', () => { }); it('[C216345] dialog UI elements', async () => { - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); expect(await createDialog.getTitle()).toMatch('Create new folder'); expect(await createDialog.nameInput.isDisplayed()).toBe(true, 'Name input is not displayed'); @@ -133,9 +133,7 @@ describe('Create folder', () => { }); it('[C216346] with empty folder name', async () => { - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); await clearTextWithBackspace(createDialog.nameInput); expect(await createDialog.isCreateButtonEnabled()).toBe(false, 'Create button is enabled'); @@ -143,9 +141,7 @@ describe('Create folder', () => { }); it('[C216348] with folder name ending with a dot "."', async () => { - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); await createDialog.enterName('folder-name.'); expect(await createDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled'); @@ -155,9 +151,7 @@ describe('Create folder', () => { it('[C216347] with folder name containing special characters', async () => { const namesWithSpecialChars = ['a*a', 'a"a', 'a<a', 'a>a', `a\\a`, 'a/a', 'a?a', 'a:a', 'a|a']; - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); for (const name of namesWithSpecialChars) { await createDialog.enterName(name); @@ -167,9 +161,7 @@ describe('Create folder', () => { }); it('[C280406] with folder name containing only spaces', async () => { - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); await createDialog.enterName(' '); expect(await createDialog.isCreateButtonEnabled()).toBe(false, 'Create button is not disabled'); @@ -177,9 +169,7 @@ describe('Create folder', () => { }); it('[C216349] cancel folder creation', async () => { - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); await createDialog.enterName('test'); await createDialog.enterDescription('test description'); await createDialog.clickCancel(); @@ -188,9 +178,7 @@ describe('Create folder', () => { }); it('[C216350] duplicate folder name', async () => { - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); await createDialog.enterName(duplicateFolderName); await BrowserActions.click(createDialog.createButton); @@ -199,9 +187,7 @@ describe('Create folder', () => { }); it('[C216351] trim ending spaces from folder name', async () => { - await page.dataTable.doubleClickOnRowByName(parent); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(parent); await createDialog.enterName(nameWithSpaces); await BrowserActions.click(createDialog.createButton); await createDialog.waitForDialogToClose(); @@ -225,9 +211,7 @@ describe('Create folder', () => { }); it('[C280394] creates new folder with name and description', async () => { - await page.dataTable.doubleClickOnRowByName(siteName); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(siteName); await createDialog.enterName(folderSite); await createDialog.enterDescription(folderDescription); await BrowserActions.click(createDialog.createButton); @@ -240,9 +224,7 @@ describe('Create folder', () => { }); it('[C280403] cancel folder creation', async () => { - await page.dataTable.doubleClickOnRowByName(siteName); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(siteName); await createDialog.enterName('test'); await createDialog.enterDescription('test description'); await createDialog.clickCancel(); @@ -251,9 +233,7 @@ describe('Create folder', () => { }); it('[C280404] duplicate folder name', async () => { - await page.dataTable.doubleClickOnRowByName(siteName); - await page.sidenav.openCreateFolderDialog(); - await createDialog.waitForDialogToOpen(); + await openCreateFolderDialog(siteName); await createDialog.enterName(duplicateFolderSite); await BrowserActions.click(createDialog.createButton); diff --git a/e2e/suites/navigation/breadcrumb.test.ts b/e2e/suites/navigation/breadcrumb.test.ts index eaf83d3ed..2920481de 100755 --- a/e2e/suites/navigation/breadcrumb.test.ts +++ b/e2e/suites/navigation/breadcrumb.test.ts @@ -88,46 +88,44 @@ describe('Breadcrumb', () => { done(); }); + async function verifyBreadcrumb(expectedCount: number, expectedText: string) { + expect(await breadcrumb.items.count()).toEqual(expectedCount, 'Breadcrumb has incorrect number of items'); + expect(await breadcrumb.currentItem.getText()).toBe(expectedText); + } + it('[C260964] Personal Files breadcrumb main node', async () => { await page.clickPersonalFiles(); - expect(await breadcrumb.items.count()).toEqual(1, 'Breadcrumb has incorrect number of items'); - expect(await breadcrumb.currentItem.getText()).toBe('Personal Files'); + await verifyBreadcrumb(1, 'Personal Files'); }); it('[C260966] My Libraries breadcrumb main node', async () => { await page.goToMyLibrariesAndWait(); - expect(await breadcrumb.items.count()).toEqual(1, 'Breadcrumb has incorrect number of items'); - expect(await breadcrumb.currentItem.getText()).toBe('My Libraries'); + await verifyBreadcrumb(1, 'My Libraries'); }); it('[C289891] Favorite Libraries breadcrumb main node', async () => { await page.goToFavoriteLibrariesAndWait(); - expect(await breadcrumb.items.count()).toEqual(1, 'Breadcrumb has incorrect number of items'); - expect(await breadcrumb.currentItem.getText()).toBe('Favorite Libraries'); + await verifyBreadcrumb(1, 'Favorite Libraries'); }); it('[C260971] Recent Files breadcrumb main node', async () => { await page.clickRecentFiles(); - expect(await breadcrumb.items.count()).toEqual(1, 'Breadcrumb has incorrect number of items'); - expect(await breadcrumb.currentItem.getText()).toBe('Recent Files'); + await verifyBreadcrumb(1, 'Recent Files'); }); it('[C260972] Shared Files breadcrumb main node', async () => { await page.clickSharedFiles(); - expect(await breadcrumb.items.count()).toEqual(1, 'Breadcrumb has incorrect number of items'); - expect(await breadcrumb.currentItem.getText()).toBe('Shared Files'); + await verifyBreadcrumb(1, 'Shared Files'); }); it('[C260973] Favorites breadcrumb main node', async () => { await page.clickFavorites(); - expect(await breadcrumb.items.count()).toEqual(1, 'Breadcrumb has incorrect number of items'); - expect(await breadcrumb.currentItem.getText()).toBe('Favorites'); + await verifyBreadcrumb(1, 'Favorites'); }); it('[C260974] Trash breadcrumb main node', async () => { await page.clickTrash(); - expect(await breadcrumb.items.count()).toEqual(1, 'Breadcrumb has incorrect number of items'); - expect(await breadcrumb.currentItem.getText()).toBe('Trash'); + await verifyBreadcrumb(1, 'Trash'); }); it('[C260965] Personal Files breadcrumb for a folder hierarchy', async () => { diff --git a/projects/aca-settings/src/lib/settings.component.ts b/projects/aca-settings/src/lib/settings.component.ts index fcacc415c..09f92d600 100644 --- a/projects/aca-settings/src/lib/settings.component.ts +++ b/projects/aca-settings/src/lib/settings.component.ts @@ -125,7 +125,7 @@ export class SettingsComponent implements OnInit { if (result) { return result === 'true'; } else { - return param.value ? true : false; + return !!param.value; } } diff --git a/projects/aca-shared/rules/src/app.rules.ts b/projects/aca-shared/rules/src/app.rules.ts index dfbff769e..f8f8aa89b 100644 --- a/projects/aca-shared/rules/src/app.rules.ts +++ b/projects/aca-shared/rules/src/app.rules.ts @@ -212,8 +212,7 @@ export function canDownloadSelection(context: RuleContext): boolean { * JSON ref: `app.selection.folder` */ export function hasFolderSelected(context: RuleContext): boolean { - const folder = context.selection.folder; - return folder ? true : false; + return !!context.selection.folder; } /** @@ -221,8 +220,7 @@ export function hasFolderSelected(context: RuleContext): boolean { * JSON ref: `app.selection.library` */ export function hasLibrarySelected(context: RuleContext): boolean { - const library = context.selection.library; - return library ? true : false; + return !!context.selection.library; } /** @@ -256,10 +254,7 @@ export function hasNoLibraryRole(context: RuleContext): boolean { * JSON ref: `app.selection.file` */ export function hasFileSelected(context: RuleContext): boolean { - if (context && context.selection && context.selection.file) { - return true; - } - return false; + return !!(context && context.selection && context.selection.file); } /** diff --git a/projects/aca-shared/src/lib/components/tool-bar/toolbar-button/toolbar-button.component.ts b/projects/aca-shared/src/lib/components/tool-bar/toolbar-button/toolbar-button.component.ts index a665a70a8..b24471561 100644 --- a/projects/aca-shared/src/lib/components/tool-bar/toolbar-button/toolbar-button.component.ts +++ b/projects/aca-shared/src/lib/components/tool-bar/toolbar-button/toolbar-button.component.ts @@ -57,9 +57,6 @@ export class ToolbarButtonComponent { } private hasClickAction(actionRef: ContentActionRef): boolean { - if (actionRef && actionRef.actions && actionRef.actions.click) { - return true; - } - return false; + return !!(actionRef && actionRef.actions && actionRef.actions.click); } } diff --git a/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.ts b/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.ts index ef8e4bc73..cb14dc9c8 100644 --- a/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.ts +++ b/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.ts @@ -53,10 +53,7 @@ export class ToolbarMenuItemComponent { } private hasClickAction(actionRef: ContentActionRef): boolean { - if (actionRef && actionRef.actions && actionRef.actions.click) { - return true; - } - return false; + return !!(actionRef && actionRef.actions && actionRef.actions.click); } trackById(_: number, obj: { id: string }) { diff --git a/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.ts b/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.ts index 142cee9d7..5bd23a401 100644 --- a/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.ts +++ b/projects/aca-shared/src/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.ts @@ -47,10 +47,6 @@ export class ToolbarMenuComponent { this.matTrigger.closeMenu(); } - get hasChildren(): boolean { - return this.actionRef && this.actionRef.children && this.actionRef.children.length > 0; - } - trackById(_: number, obj: { id: string }) { return obj.id; } diff --git a/projects/aca-shared/src/lib/services/app.extension.service.ts b/projects/aca-shared/src/lib/services/app.extension.service.ts index da59a7768..d5a6df27e 100644 --- a/projects/aca-shared/src/lib/services/app.extension.service.ts +++ b/projects/aca-shared/src/lib/services/app.extension.service.ts @@ -466,7 +466,7 @@ export class AppExtensionService implements RuleContext { // todo: move to ADF/RuleService isRuleDefined(ruleId: string): boolean { - return ruleId && this.getEvaluator(ruleId) ? true : false; + return !!(ruleId && this.getEvaluator(ruleId)); } // todo: move to ADF/RuleService diff --git a/projects/aca-shared/store/src/effects/router.effects.ts b/projects/aca-shared/store/src/effects/router.effects.ts index f654626d8..46b4d05c6 100644 --- a/projects/aca-shared/store/src/effects/router.effects.ts +++ b/projects/aca-shared/store/src/effects/router.effects.ts @@ -126,10 +126,6 @@ export class RouterEffects { } private isLibraryContent(path: PathInfoEntity): boolean { - if (path && path.elements.length >= 2 && path.elements[1].name === 'Sites') { - return true; - } - - return false; + return path && path.elements.length >= 2 && path.elements[1].name === 'Sites'; } } diff --git a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts index cc4187b38..025afc402 100755 --- a/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts +++ b/projects/aca-testing-shared/src/components/info-drawer/info-drawer-metadata-content.ts @@ -62,10 +62,7 @@ export class ContentMetadata extends Component { .filter(async (elem) => elem.isDisplayed()) .map(async (elem) => { if (await elem.isElementPresent(by.css('.mat-checkbox'))) { - if (await elem.isElementPresent(by.css('.mat-checkbox-checked'))) { - return true; - } - return false; + return !!(await elem.isElementPresent(by.css('.mat-checkbox-checked'))); } return this.getElementValue(elem); diff --git a/projects/aca-testing-shared/src/components/menu/menu.ts b/projects/aca-testing-shared/src/components/menu/menu.ts index bd9acfbdd..47fde56f2 100755 --- a/projects/aca-testing-shared/src/components/menu/menu.ts +++ b/projects/aca-testing-shared/src/components/menu/menu.ts @@ -30,7 +30,6 @@ import { Utils, isPresentAndEnabled, waitForPresence, waitForStaleness } from '. export class Menu extends Component { items = this.allByCss('.mat-menu-item'); - backdrop = this.byCss('.cdk-overlay-backdrop', browser); uploadFilesInput = this.byId('app-upload-files', browser); submenus = browser.element.all(by.css('app-context-menu-item .mat-menu-item')); @@ -45,26 +44,15 @@ export class Menu extends Component { cancelEditingAction = this.byCss(`.mat-menu-item[title='Cancel Editing']`); cancelJoinAction = this.byCssText('.mat-menu-item', 'Cancel Join'); copyAction = this.byCssText('.mat-menu-item', 'Copy'); - deleteAction = this.byCssText('.mat-menu-item', 'Delete'); downloadAction = this.byCssText('.mat-menu-item', 'Download'); editFolderAction = this.byCss(`.mat-menu-item[id$='editFolder']`); editOfflineAction = this.byCss(`.mat-menu-item[title='Edit Offline']`); - favoriteAction = this.byCss(`.mat-menu-item[id$='favorite.add']`); - removeFavoriteAction = this.byCss(`.mat-menu-item[id$='favorite.remove']`); - toggleFavoriteAction = this.byCssText('.mat-menu-item', 'Favorite'); - toggleRemoveFavoriteAction = this.byCssText('.mat-menu-item', 'Remove Favorite'); joinAction = this.byCssText('.mat-menu-item', 'Join'); leaveAction = this.byCssText('.mat-menu-item', 'Leave'); managePermissionsAction = this.byCssText('.mat-menu-item', 'Permissions'); - manageVersionsAction = this.byCssText('.mat-menu-item', 'Manage Versions'); - uploadNewVersionAction = this.byCssText('.mat-menu-item', 'Upload New Version'); - moveAction = this.byCssText('.mat-menu-item', 'Move'); - permanentDeleteAction = this.byCssText('.mat-menu-item', 'Permanently Delete'); restoreAction = this.byCssText('.mat-menu-item', 'Restore'); shareAction = this.byCssText('.mat-menu-item', 'Share'); shareEditAction = this.byCssText('.mat-menu-item', 'Shared Link Settings'); - viewAction = this.byCssText('.mat-menu-item', 'View'); - viewDetailsAction = this.byCssText('.mat-menu-item', 'View Details'); constructor(ancestor?: string) { super('.mat-menu-panel', ancestor); diff --git a/projects/adf-office-services-ext/src/lib/aos-extension.service.ts b/projects/adf-office-services-ext/src/lib/aos-extension.service.ts index e2a71b366..ad6596380 100644 --- a/projects/adf-office-services-ext/src/lib/aos-extension.service.ts +++ b/projects/adf-office-services-ext/src/lib/aos-extension.service.ts @@ -65,11 +65,11 @@ export class AosEditOnlineService { } private isWindows(): boolean { - return this.getUserAgent().indexOf('win') !== -1 ? true : false; + return this.getUserAgent().indexOf('win') !== -1; } private isMacOs(): boolean { - return this.getUserAgent().indexOf('mac') !== -1 ? true : false; + return this.getUserAgent().indexOf('mac') !== -1; } private onAlreadyLockedNotification(nodeId: string, lockOwner: string) { diff --git a/scripts/clireader/base-param.ts b/scripts/clireader/base-param.ts index 0d96b3667..76db9aa99 100644 --- a/scripts/clireader/base-param.ts +++ b/scripts/clireader/base-param.ts @@ -1,9 +1,26 @@ -/* - * Copyright 2005-2019 Alfresco Software, Ltd. All rights reserved. +/*! + * @license + * Alfresco Example Content Application * - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * + * 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 + * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ import { ParamType } from './params'; diff --git a/scripts/clireader/boolean-param.ts b/scripts/clireader/boolean-param.ts index 09866ff40..530044e58 100644 --- a/scripts/clireader/boolean-param.ts +++ b/scripts/clireader/boolean-param.ts @@ -1,9 +1,26 @@ -/* - * Copyright 2005-2019 Alfresco Software, Ltd. All rights reserved. +/*! + * @license + * Alfresco Example Content Application * - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * + * 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 + * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ import { ParamType } from './params'; diff --git a/scripts/clireader/checkbox-param.ts b/scripts/clireader/checkbox-param.ts index 2b1321a37..146facdbf 100644 --- a/scripts/clireader/checkbox-param.ts +++ b/scripts/clireader/checkbox-param.ts @@ -1,9 +1,26 @@ -/* - * Copyright 2005-2019 Alfresco Software, Ltd. All rights reserved. +/*! + * @license + * Alfresco Example Content Application * - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * + * 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 + * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ import { ParamType } from './params'; diff --git a/scripts/clireader/cli-reader.ts b/scripts/clireader/cli-reader.ts index df3c6a91c..707db31b2 100644 --- a/scripts/clireader/cli-reader.ts +++ b/scripts/clireader/cli-reader.ts @@ -1,9 +1,26 @@ -/* - * Copyright 2005-2019 Alfresco Software, Ltd. All rights reserved. +/*! + * @license + * Alfresco Example Content Application * - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * + * 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 + * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ import commander, { program } from 'commander'; diff --git a/scripts/clireader/input-param.ts b/scripts/clireader/input-param.ts index 1f1e4459d..1ac7bbd82 100644 --- a/scripts/clireader/input-param.ts +++ b/scripts/clireader/input-param.ts @@ -1,9 +1,26 @@ -/* - * Copyright 2005-2019 Alfresco Software, Ltd. All rights reserved. +/*! + * @license + * Alfresco Example Content Application * - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * + * 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 + * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ import { ParamType } from './params'; diff --git a/scripts/clireader/list-param.ts b/scripts/clireader/list-param.ts index a3b114e8d..1969224a5 100644 --- a/scripts/clireader/list-param.ts +++ b/scripts/clireader/list-param.ts @@ -1,9 +1,26 @@ -/* - * Copyright 2005-2019 Alfresco Software, Ltd. All rights reserved. +/*! + * @license + * Alfresco Example Content Application * - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * + * 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 + * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ import { ParamType } from './params'; diff --git a/scripts/clireader/params.ts b/scripts/clireader/params.ts index 2e192bc2a..42505c640 100644 --- a/scripts/clireader/params.ts +++ b/scripts/clireader/params.ts @@ -1,9 +1,26 @@ -/* - * Copyright 2005-2019 Alfresco Software, Ltd. All rights reserved. +/*! + * @license + * Alfresco Example Content Application * - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. + * Copyright (C) 2005 - 2020 Alfresco Software Limited + * + * 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 + * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ export enum ParamType { diff --git a/scripts/npm/lite-serve.ts b/scripts/npm/lite-serve.ts index 42b6cbd15..878db39a5 100755 --- a/scripts/npm/lite-serve.ts +++ b/scripts/npm/lite-serve.ts @@ -57,7 +57,7 @@ export default class LiteServeRunner { run() { const readerGenerator = this.cliReader.getReader(this.inputParams, this.cliArgs); - const program: Object = readerGenerator.next().value; + readerGenerator.next(); const builtApps = this.getAppList().filter((app) => !app.disabled); if (!builtApps.length) { @@ -65,7 +65,7 @@ export default class LiteServeRunner { process.exit(0); } - const inputInquirer = <Promise<Object>>readerGenerator.next().value; + const inputInquirer = readerGenerator.next().value as Promise<Object>; return inputInquirer.then(this.appConfigReplace.bind(this)).then(this.spawnLiteServer.bind(this)).catch(logger.error.bind(logger)); } @@ -92,7 +92,7 @@ export default class LiteServeRunner { logger.error(data.toString()); reject(); }); - replace.on('exit', (code) => { + replace.on('exit', () => { spinner.succeed(); logger.verbose(green(`Rewrite ${appPath} succeeded!`)); resolvePromise(inputParams); diff --git a/src/app/components/common/toggle-shared/toggle-shared.component.ts b/src/app/components/common/toggle-shared/toggle-shared.component.ts index 1a865f52f..ad8f3938a 100644 --- a/src/app/components/common/toggle-shared/toggle-shared.component.ts +++ b/src/app/components/common/toggle-shared/toggle-shared.component.ts @@ -34,7 +34,7 @@ import { AppStore, ShareNodeAction, getAppSelection } from '@alfresco/aca-shared templateUrl: './toggle-shared.component.html' }) export class ToggleSharedComponent implements OnInit { - @Input() data: any; + @Input() data: { iconButton?: string }; selection$: Observable<SelectionState>; diff --git a/src/app/components/context-menu/context-menu-item.component.ts b/src/app/components/context-menu/context-menu-item.component.ts index 00156eb34..bafeb5aa9 100644 --- a/src/app/components/context-menu/context-menu-item.component.ts +++ b/src/app/components/context-menu/context-menu-item.component.ts @@ -46,10 +46,7 @@ export class ContextMenuItemComponent { } private hasClickAction(actionRef: ContentActionRef): boolean { - if (actionRef && actionRef.actions && actionRef.actions.click) { - return true; - } - return false; + return !!(actionRef && actionRef.actions && actionRef.actions.click); } trackById(_: number, obj: { id: string }) { diff --git a/src/app/components/context-menu/context-menu.component.html b/src/app/components/context-menu/context-menu.component.html index 351ecd91c..c51117c1c 100644 --- a/src/app/components/context-menu/context-menu.component.html +++ b/src/app/components/context-menu/context-menu.component.html @@ -1,27 +1,10 @@ <div [dir]="direction"> - <div - style="visibility: hidden" - [matMenuTriggerFor]="rootMenu" - #rootTriggerEl - ></div> + <div style="visibility: hidden" [matMenuTriggerFor]="rootMenu"></div> - <mat-menu - #rootMenu="matMenu" - class="aca-context-menu" - hasBackdrop="false" - acaContextMenuOutsideEvent - (clickOutside)="onClickOutsideEvent()" - > - <ng-container - *ngFor="let entry of actions; trackBy: trackById" - [ngSwitch]="entry.type" - > + <mat-menu #rootMenu="matMenu" class="aca-context-menu" hasBackdrop="false" acaContextMenuOutsideEvent (clickOutside)="onClickOutsideEvent()"> + <ng-container *ngFor="let entry of actions; trackBy: trackById" [ngSwitch]="entry.type"> <ng-container *ngSwitchDefault> - <button - mat-menu-item - [id]="entry.id" - (click)="runAction(entry.actions.click)" - > + <button mat-menu-item [id]="entry.id" (click)="runAction(entry.actions.click)"> <adf-icon [value]="entry.icon"></adf-icon> <span>{{ entry.title | translate }}</span> </button> @@ -38,19 +21,14 @@ </button> <mat-menu #childMenu="matMenu"> - <ng-container - *ngFor="let child of entry.children; trackBy: trackById" - > + <ng-container *ngFor="let child of entry.children; trackBy: trackById"> <app-context-menu-item [actionRef]="child"></app-context-menu-item> </ng-container> </mat-menu> </ng-container> <ng-container *ngSwitchCase="'custom'"> - <adf-dynamic-component - [data]="entry.data" - [id]="entry.component" - ></adf-dynamic-component> + <adf-dynamic-component [data]="entry.data" [id]="entry.component"></adf-dynamic-component> </ng-container> </ng-container> </mat-menu> diff --git a/src/app/components/favorite-libraries/favorite-libraries.component.ts b/src/app/components/favorite-libraries/favorite-libraries.component.ts index 94841e830..bea4cddd3 100644 --- a/src/app/components/favorite-libraries/favorite-libraries.component.ts +++ b/src/app/components/favorite-libraries/favorite-libraries.component.ts @@ -32,6 +32,8 @@ import { AppExtensionService, ContentApiService } from '@alfresco/aca-shared'; import { NavigateLibraryAction } from '@alfresco/aca-shared/store'; import { PageComponent } from '../page.component'; import { UserPreferencesService } from '@alfresco/adf-core'; +import { DocumentListPresetRef } from '@alfresco/adf-extensions'; + @Component({ templateUrl: './favorite-libraries.component.html' }) @@ -44,7 +46,7 @@ export class FavoriteLibrariesComponent extends PageComponent implements OnInit isLoading = false; list: FavoritePaging; isSmallScreen = false; - columns: any[] = []; + columns: DocumentListPresetRef[] = []; constructor( content: ContentManagementService, diff --git a/src/app/components/favorites/favorites.component.ts b/src/app/components/favorites/favorites.component.ts index 9ccb173a4..ed150f5d7 100644 --- a/src/app/components/favorites/favorites.component.ts +++ b/src/app/components/favorites/favorites.component.ts @@ -34,6 +34,7 @@ import { Store } from '@ngrx/store'; import { debounceTime, map } from 'rxjs/operators'; import { ContentManagementService } from '../../services/content-management.service'; import { PageComponent } from '../page.component'; +import { DocumentListPresetRef } from '@alfresco/adf-extensions'; @Component({ templateUrl: './favorites.component.html' @@ -41,7 +42,7 @@ import { PageComponent } from '../page.component'; export class FavoritesComponent extends PageComponent implements OnInit { isSmallScreen = false; - columns: any[] = []; + columns: DocumentListPresetRef[] = []; constructor( private router: Router, diff --git a/src/app/components/files/files.component.ts b/src/app/components/files/files.component.ts index 9b3ef7b32..5ddde5491 100644 --- a/src/app/components/files/files.component.ts +++ b/src/app/components/files/files.component.ts @@ -307,7 +307,7 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy { navigateToFilter(activeFilters: FilterSearch[]) { const objectFromMap = {}; activeFilters.forEach((filter: FilterSearch) => { - let paramValue = null; + let paramValue; if (filter.value && filter.value.from && filter.value.to) { paramValue = `${filter.value.from}||${filter.value.to}`; } else { diff --git a/src/app/components/libraries/libraries.component.ts b/src/app/components/libraries/libraries.component.ts index 7e8d7b779..1d9451867 100644 --- a/src/app/components/libraries/libraries.component.ts +++ b/src/app/components/libraries/libraries.component.ts @@ -31,6 +31,7 @@ import { Store } from '@ngrx/store'; import { ContentManagementService } from '../../services/content-management.service'; import { PageComponent } from '../page.component'; import { AppExtensionService } from '@alfresco/aca-shared'; +import { DocumentListPresetRef } from '@alfresco/adf-extensions'; @Component({ templateUrl: './libraries.component.html' @@ -38,7 +39,7 @@ import { AppExtensionService } from '@alfresco/aca-shared'; export class LibrariesComponent extends PageComponent implements OnInit { isSmallScreen = false; - columns: any[] = []; + columns: DocumentListPresetRef[] = []; constructor( content: ContentManagementService, diff --git a/src/app/components/recent-files/recent-files.component.ts b/src/app/components/recent-files/recent-files.component.ts index 0438ba4e3..5ff7677ad 100644 --- a/src/app/components/recent-files/recent-files.component.ts +++ b/src/app/components/recent-files/recent-files.component.ts @@ -34,6 +34,7 @@ import { UploadService } from '@alfresco/adf-core'; import { debounceTime } from 'rxjs/operators'; import { Router } from '@angular/router'; import { AppExtensionService } from '@alfresco/aca-shared'; +import { DocumentListPresetRef } from '@alfresco/adf-extensions'; @Component({ templateUrl: './recent-files.component.html' @@ -41,7 +42,7 @@ import { AppExtensionService } from '@alfresco/aca-shared'; export class RecentFilesComponent extends PageComponent implements OnInit { isSmallScreen = false; - columns: any[] = []; + columns: DocumentListPresetRef[] = []; constructor( store: Store<AppStore>, diff --git a/src/app/components/search/search-libraries-results/search-libraries-results.component.ts b/src/app/components/search/search-libraries-results/search-libraries-results.component.ts index a615bdf35..dab952d3e 100644 --- a/src/app/components/search/search-libraries-results/search-libraries-results.component.ts +++ b/src/app/components/search/search-libraries-results/search-libraries-results.component.ts @@ -33,6 +33,7 @@ import { ContentManagementService } from '../../../services/content-management.s import { PageComponent } from '../../page.component'; import { SearchLibrariesQueryBuilderService } from './search-libraries-query-builder.service'; import { AppExtensionService } from '@alfresco/aca-shared'; +import { DocumentListPresetRef } from '@alfresco/adf-extensions'; @Component({ selector: 'aca-search-results', @@ -46,7 +47,7 @@ export class SearchLibrariesResultsComponent extends PageComponent implements On data: NodePaging; totalResults = 0; isLoading = false; - columns: any[] = []; + columns: DocumentListPresetRef[] = []; constructor( private breakpointObserver: BreakpointObserver, diff --git a/src/app/components/shared-files/shared-files.component.ts b/src/app/components/shared-files/shared-files.component.ts index 89cae80a9..dfc8fcdd9 100644 --- a/src/app/components/shared-files/shared-files.component.ts +++ b/src/app/components/shared-files/shared-files.component.ts @@ -33,6 +33,7 @@ import { UploadService } from '@alfresco/adf-core'; import { Router } from '@angular/router'; import { MinimalNodeEntity } from '@alfresco/js-api'; import { AppExtensionService } from '@alfresco/aca-shared'; +import { DocumentListPresetRef } from '@alfresco/adf-extensions'; @Component({ templateUrl: './shared-files.component.html' @@ -40,7 +41,7 @@ import { AppExtensionService } from '@alfresco/aca-shared'; export class SharedFilesComponent extends PageComponent implements OnInit { isSmallScreen = false; - columns: any[] = []; + columns: DocumentListPresetRef[] = []; constructor( store: Store<any>, diff --git a/src/app/components/sidenav/components/expand-menu.component.spec.ts b/src/app/components/sidenav/components/expand-menu.component.spec.ts index 2ef90ead2..8d1d8bbe6 100644 --- a/src/app/components/sidenav/components/expand-menu.component.spec.ts +++ b/src/app/components/sidenav/components/expand-menu.component.spec.ts @@ -56,7 +56,10 @@ describe('ExpandMenuComponent', () => { it('should render action item', () => { component.item = { id: 'test-action-button', - url: 'dummy' + url: 'dummy', + title: null, + icon: null, + route: null }; fixture.detectChanges(); @@ -68,16 +71,23 @@ describe('ExpandMenuComponent', () => { it('should render action item with children', () => { component.item = { id: 'test-action-button', + icon: null, + title: null, + route: null, children: [ { id: 'child-1', title: 'child-1', - url: 'dummy' + url: 'dummy', + icon: null, + route: null }, { id: 'child-2', title: 'child-2', - url: 'dummy' + url: 'dummy', + icon: null, + route: null } ] }; diff --git a/src/app/components/sidenav/components/expand-menu.component.ts b/src/app/components/sidenav/components/expand-menu.component.ts index 3c3c482a5..ddc0d1651 100644 --- a/src/app/components/sidenav/components/expand-menu.component.ts +++ b/src/app/components/sidenav/components/expand-menu.component.ts @@ -24,6 +24,7 @@ */ import { Component, OnInit, Input, ViewEncapsulation, ChangeDetectorRef } from '@angular/core'; +import { NavBarLinkRef } from '@alfresco/adf-extensions'; @Component({ selector: 'app-expand-menu', @@ -32,7 +33,8 @@ import { Component, OnInit, Input, ViewEncapsulation, ChangeDetectorRef } from ' host: { class: 'app-expand-menu' } }) export class ExpandMenuComponent implements OnInit { - @Input() item; + @Input() + item: NavBarLinkRef; constructor(private cd: ChangeDetectorRef) {} diff --git a/src/app/components/sidenav/sidenav.component.scss b/src/app/components/sidenav/sidenav.component.scss index 2d03e8d2a..760941a2e 100644 --- a/src/app/components/sidenav/sidenav.component.scss +++ b/src/app/components/sidenav/sidenav.component.scss @@ -71,7 +71,6 @@ display: flex; align-items: center; text-decoration: none; - text-decoration: none; height: 24px; width: 100%; user-select: none; diff --git a/src/app/components/sidenav/sidenav.component.theme.scss b/src/app/components/sidenav/sidenav.component.theme.scss index f25367bd9..ae22a0819 100644 --- a/src/app/components/sidenav/sidenav.component.theme.scss +++ b/src/app/components/sidenav/sidenav.component.theme.scss @@ -35,8 +35,7 @@ box-shadow: none !important; } - .mat-expansion-panel:not(.mat-expanded) - .mat-expansion-panel-header:not([aria-disabled='true']):hover { + .mat-expansion-panel:not(.mat-expanded) .mat-expansion-panel-header:not([aria-disabled='true']):hover { background: none !important; } diff --git a/src/app/components/trashcan/trashcan.component.ts b/src/app/components/trashcan/trashcan.component.ts index ec09495ad..d97416a49 100644 --- a/src/app/components/trashcan/trashcan.component.ts +++ b/src/app/components/trashcan/trashcan.component.ts @@ -24,7 +24,7 @@ */ import { AppStore, getUserProfile } from '@alfresco/aca-shared/store'; -import { ProfileState } from '@alfresco/adf-extensions'; +import { DocumentListPresetRef, ProfileState } from '@alfresco/adf-extensions'; import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { Component, OnInit } from '@angular/core'; import { Store } from '@ngrx/store'; @@ -40,7 +40,7 @@ export class TrashcanComponent extends PageComponent implements OnInit { isSmallScreen = false; user$: Observable<ProfileState>; - columns: any[] = []; + columns: DocumentListPresetRef[] = []; constructor( content: ContentManagementService, diff --git a/src/app/services/content-management.service.ts b/src/app/services/content-management.service.ts index e6a35720b..b4a7cc2fa 100644 --- a/src/app/services/content-management.service.ts +++ b/src/app/services/content-management.service.ts @@ -820,11 +820,7 @@ export class ContentManagementService { } private isLibraryContent(path: PathInfoEntity): boolean { - if (path && path.elements.length >= 2 && path.elements[1].name === 'Sites') { - return true; - } - - return false; + return path && path.elements.length >= 2 && path.elements[1].name === 'Sites'; } private getRestoreMessage(status: DeleteStatus): SnackbarAction { diff --git a/src/app/services/node-actions.service.spec.ts b/src/app/services/node-actions.service.spec.ts index 4e8900b08..9974c6c43 100644 --- a/src/app/services/node-actions.service.spec.ts +++ b/src/app/services/node-actions.service.spec.ts @@ -408,7 +408,7 @@ describe('NodeActionsService', () => { spyOn(service, 'getContentNodeSelection').and.callThrough(); spyOn(service, 'getEntryParentId').and.returnValue('parent-id'); - let dialogData: any; + let dialogData = null; spyOn(dialog, 'open').and.callFake((_contentNodeSelectorComponent: any, data: any) => { dialogData = data; return { componentInstance: {} } as MatDialogRef<any>; diff --git a/src/proxy.conf.js b/src/proxy.conf.js index 4ae5c706a..af01974d1 100644 --- a/src/proxy.conf.js +++ b/src/proxy.conf.js @@ -8,7 +8,7 @@ module.exports = { secure: false, changeOrigin: true, // workaround for REPO-2260 - onProxyRes: function(proxyRes, req, res) { + onProxyRes: function (proxyRes) { const header = proxyRes.headers['www-authenticate']; if (header && header.startsWith('Basic')) { proxyRes.headers['www-authenticate'] = 'x' + header;