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

@@ -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);
}
}

View File

@@ -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 }) {

View File

@@ -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;
}