mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
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:
@@ -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": [
|
||||
{
|
||||
|
Reference in New Issue
Block a user