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
This commit is contained in:
Denys Vuika
2020-12-11 15:47:17 +00:00
committed by GitHub
parent b71e1530d1
commit 7a5350a06d
64 changed files with 482 additions and 744 deletions

View File

@@ -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
]
},
...
}
}
```

View File

@@ -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": {

View File

@@ -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
}
]
}
...,
]
```
![](../images/navigation-03.png)
@@ -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.