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

@@ -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 をすべてのアイテムに追加する必要があります。

View File

@@ -297,13 +297,11 @@ JSON 構造およびネストのレベルに制限はありません。
"create": [
{
"id": "app.create.folder",
"disabled": true,
...
"disabled": true
},
{
"id": "plugin1.create.folder",
"title": "Create Folder",
...
"title": "Create Folder"
}
]
}

View File

@@ -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"
]
}

View File

@@ -18,7 +18,7 @@ nav: ja
import { ExtensionsModule, ExtensionService } from '@alfresco/adf-extensions';
@NgModule({
imports: [ ExtensionsModule ]
imports: [ ExtensionsModule ],
declarations: [ MyComponent1, MyLayout ]
})
export class MyExtensionModule {

View File

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