From 99140b3ac93042bf27a3435f10c2c05d5b363adf Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 10 Nov 2020 17:03:19 +0000 Subject: [PATCH] [ADF-5252] Disable settings and about pages by default (#1750) * move Settings readme to the plugin itself * disable settings, update readme * about plugin readme * disable about module --- docs/extending/README.md | 1 - docs/extending/extending.md | 1 - docs/extending/settings.md | 45 ------- projects/aca-about/README.md | 68 ++++++++--- projects/aca-settings/README.md | 110 +++++++++++++++--- .../assets}/aca-settings-custom-group.png | Bin src/app/extensions.module.ts | 4 +- src/assets/app.extensions.json | 4 +- src/assets/plugins/app.about.json | 46 -------- src/assets/plugins/app.settings.json | 46 -------- 10 files changed, 154 insertions(+), 171 deletions(-) delete mode 100644 docs/extending/extending.md delete mode 100644 docs/extending/settings.md rename {docs/images => projects/aca-settings/assets}/aca-settings-custom-group.png (100%) delete mode 100644 src/assets/plugins/app.about.json delete mode 100644 src/assets/plugins/app.settings.json diff --git a/docs/extending/README.md b/docs/extending/README.md index 27c1a0e00..c8bfb6298 100644 --- a/docs/extending/README.md +++ b/docs/extending/README.md @@ -16,7 +16,6 @@ Learn how to extend the features of the Alfresco Content Application. - [Actions](/extending/actions) - [Application actions](/extending/application-actions) - [Rules](/extending/rules) -- [Settings](/extending/settings) - [Application features](/extending/application-features) - [Custom icons](/extending/icons) - [Registration](/extending/registration) diff --git a/docs/extending/extending.md b/docs/extending/extending.md deleted file mode 100644 index 8b1378917..000000000 --- a/docs/extending/extending.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/extending/settings.md b/docs/extending/settings.md deleted file mode 100644 index 581714336..000000000 --- a/docs/extending/settings.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -Title: Settings ---- - -# Settings - -The application settings can be accessed via the `/settings` route. - -You can project custom configuration groups via the `settings` section: - -```json -{ - "settings": [ - { - "id": "extensions.ps.settings", - "name": "Extensions: Process Services", - "parameters": [ - { - "name": "Enable Process Services Extensions", - "key": "processServices", - "type": "boolean", - "value": false - } - ] - } - ] -} -``` - -At runtime, you are going to get an extra group called "Extensions: Process Services" -with a custom boolean setting "Enable Process Services Extensions". - -![Custom settings group](../images/aca-settings-custom-group.png) - -## Parameters - -Each setting parameter object supports the following properties: - -| Property | Description | -| -------- | ----------------------------------------------- | -| id | (optional) Unique identifier | -| name | Public name, can be translation key | -| key | The key to use when saving to the storage | -| type | The type of the value (boolean / string) | -| value | (optional) Default value to use for the setting | diff --git a/projects/aca-about/README.md b/projects/aca-about/README.md index 687f377cd..31236fd6a 100644 --- a/projects/aca-about/README.md +++ b/projects/aca-about/README.md @@ -1,24 +1,66 @@ -# AcaAbout +# About Plugin for Alfresco Content App -This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.14. +Provides the "About" page for ACA and ACA-based apps. -## Code scaffolding +## Installing -Run `ng generate component component-name --project aca-about` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project aca-about`. -> Note: Don't forget to add `--project aca-about` or else it will be added to the default project in your `angular.json` file. +Import the module into the application: -## Build +```ts +// src/app/extensions.module.ts -Run `ng build aca-about` to build the project. The build artifacts will be stored in the `dist/` directory. +import { AcaAboutModule } from '@alfresco/aca-about'; -## Publishing +@NgModule({ + imports: [ + // other modules + AcaAboutModule + ] +}) +export class AcaAboutModule {} +``` -After building your library with `ng build aca-about`, go to the dist folder `cd dist/aca-about` and run `npm publish`. +Update the `app.extensions.json` extension configuration to enable extra routes and components: -## Running unit tests +```json +{ + "actions": [ + { + "id": "app.actions.about", + "type": "NAVIGATE_URL", + "payload": "/about" + } + ], -Run `ng test aca-about` to execute the unit tests via [Karma](https://karma-runner.github.io). + "routes": [ + { + "id": "app.about", + "path": "about", + "layout": "app.layout.main", + "component": "app.about.component" + } + ], -## Further help + "features": { + "header": [ + { + "id": "app.header.more", + "children": [ + { + "id": "app.header.about", + "order": 100, + "title": "APP.BROWSE.ABOUT.TITLE", + "description": "APP.BROWSE.ABOUT.TITLE", + "icon": "info", + "actions": { + "click": "app.actions.about" + } + } + ] + } + ] + } +} +``` -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). +Compile and distribute/run the application. diff --git a/projects/aca-settings/README.md b/projects/aca-settings/README.md index cf41b7ea3..6812d95bb 100644 --- a/projects/aca-settings/README.md +++ b/projects/aca-settings/README.md @@ -1,24 +1,108 @@ -# AcaSettings +--- +Title: Settings +--- -This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.14. +# Settings -## Code scaffolding +The application settings can be accessed via the `/settings` route. -Run `ng generate component component-name --project aca-settings` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project aca-settings`. -> Note: Don't forget to add `--project aca-settings` or else it will be added to the default project in your `angular.json` file. +You can project custom configuration groups via the `settings` section: -## Build +```json +{ + "settings": [ + { + "id": "extensions.ps.settings", + "name": "Extensions: Process Services", + "parameters": [ + { + "name": "Enable Process Services Extensions", + "key": "processServices", + "type": "boolean", + "value": false + } + ] + } + ] +} +``` -Run `ng build aca-settings` to build the project. The build artifacts will be stored in the `dist/` directory. +At runtime, you are going to get an extra group called "Extensions: Process Services" +with a custom boolean setting "Enable Process Services Extensions". -## Publishing +![Custom settings group](assets/aca-settings-custom-group.png) -After building your library with `ng build aca-settings`, go to the dist folder `cd dist/aca-settings` and run `npm publish`. +## Parameters -## Running unit tests +Each setting parameter object supports the following properties: -Run `ng test aca-settings` to execute the unit tests via [Karma](https://karma-runner.github.io). +| Property | Description | +| -------- | ----------------------------------------------- | +| id | (optional) Unique identifier | +| name | Public name, can be translation key | +| key | The key to use when saving to the storage | +| type | The type of the value (boolean / string) | +| value | (optional) Default value to use for the setting | -## Further help +# Installing -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). +Import the module into the application: + +```ts +// src/app/extensions.module.ts + +import { AcaSettingsModule } from '@alfresco/aca-settings'; + +@NgModule({ + imports: [ + // other modules + AcaSettingsModule + ] +}) +export class AppExtensionsModule {} +``` + +Update the `app.extensions.json` extension configuration to enable extra routes and components: + +```json +{ + "actions": [ + { + "id": "app.actions.settings", + "type": "NAVIGATE_URL", + "payload": "/settings" + } + ], + + "routes": [ + { + "id": "app.settings", + "path": "settings", + "layout": "blank", + "component": "app.settings.component" + } + ], + + "features": { + "header": [ + { + "id": "app.header.more", + "children": [ + { + "id": "app.header.settings", + "order": 110, + "title": "APP.SETTINGS.TITLE", + "description": "APP.SETTINGS.TITLE", + "icon": "info", + "actions": { + "click": "app.actions.settings" + } + } + ] + } + ] + } +} +``` + +Compile and distribute/run the application. diff --git a/docs/images/aca-settings-custom-group.png b/projects/aca-settings/assets/aca-settings-custom-group.png similarity index 100% rename from docs/images/aca-settings-custom-group.png rename to projects/aca-settings/assets/aca-settings-custom-group.png diff --git a/src/app/extensions.module.ts b/src/app/extensions.module.ts index c60c5eed1..4a46719a7 100644 --- a/src/app/extensions.module.ts +++ b/src/app/extensions.module.ts @@ -25,13 +25,11 @@ import { NgModule } from '@angular/core'; import { AosExtensionModule } from '@alfresco/adf-office-services-ext'; -import { AcaAboutModule } from '@alfresco/aca-about'; -import { AcaSettingsModule } from '@alfresco/aca-settings'; // Main entry point for external extensions only. // For any application-specific code use CoreExtensionsModule instead. @NgModule({ - imports: [AosExtensionModule, AcaAboutModule, AcaSettingsModule] + imports: [AosExtensionModule] }) export class AppExtensionsModule {} diff --git a/src/assets/app.extensions.json b/src/assets/app.extensions.json index 2f9977b78..a7c0d3722 100644 --- a/src/assets/app.extensions.json +++ b/src/assets/app.extensions.json @@ -8,9 +8,7 @@ "$runtime": "1.7.0", "$description": "Core application extensions and features", "$references": [ - "aos.plugin.json", - "app.about.json", - "app.settings.json" + "aos.plugin.json" ], "rules": [ diff --git a/src/assets/plugins/app.about.json b/src/assets/plugins/app.about.json deleted file mode 100644 index 4ab714dc6..000000000 --- a/src/assets/plugins/app.about.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "../../../extension.schema.json", - "$id": "app.about", - "$name": "app.about", - "$version": "1.0.0", - "$vendor": "Alfresco Software, Ltd.", - "$license": "LGPL-3.0", - "$description": "Application About Screen", - - "actions": [ - { - "id": "app.actions.about", - "type": "NAVIGATE_URL", - "payload": "/about" - } - ], - - "routes": [ - { - "id": "app.about", - "path": "about", - "layout": "app.layout.main", - "component": "app.about.component" - } - ], - - "features": { - "header": [ - { - "id": "app.header.more", - "children": [ - { - "id": "app.header.about", - "order": 100, - "title": "APP.BROWSE.ABOUT.TITLE", - "description": "APP.BROWSE.ABOUT.TITLE", - "icon": "info", - "actions": { - "click": "app.actions.about" - } - } - ] - } - ] - } -} diff --git a/src/assets/plugins/app.settings.json b/src/assets/plugins/app.settings.json deleted file mode 100644 index 2b3f5c46b..000000000 --- a/src/assets/plugins/app.settings.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "../../../extension.schema.json", - "$id": "app.settings", - "$name": "app.settings", - "$version": "1.0.0", - "$vendor": "Alfresco Software, Ltd.", - "$license": "LGPL-3.0", - "$description": "Application Settings Screen", - - "actions": [ - { - "id": "app.actions.settings", - "type": "NAVIGATE_URL", - "payload": "/settings" - } - ], - - "routes": [ - { - "id": "app.settings", - "path": "settings", - "layout": "blank", - "component": "app.settings.component" - } - ], - - "features": { - "header": [ - { - "id": "app.header.more", - "children": [ - { - "id": "app.header.settings", - "order": 110, - "title": "APP.SETTINGS.TITLE", - "description": "APP.SETTINGS.TITLE", - "icon": "info", - "actions": { - "click": "app.actions.settings" - } - } - ] - } - ] - } -}