remove unused directives (#1830)

* remove unused directives

* remove unused mock
This commit is contained in:
Denys Vuika 2020-11-27 15:28:49 +00:00 committed by GitHub
parent b96f6cece4
commit ffc4bd6e0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 162 deletions

View File

@ -1,31 +0,0 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Directive } from '@angular/core';
@Directive({
selector: '[acaCollapsedTemplate]'
})
export class CollapsedTemplateDirective {}

View File

@ -1,31 +0,0 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Directive } from '@angular/core';
@Directive({
selector: '[acaExpandedTemplate]'
})
export class ExpandedTemplateDirective {}

View File

@ -4,63 +4,27 @@
<app-create-menu [expanded]="mode === 'expanded'"></app-create-menu>
</div>
<div
*ngFor="let group of groups; trackBy: trackById"
class="section"
[ngClass]="'section--' + mode"
>
<div *ngFor="let group of groups; trackBy: trackById" class="section" [ngClass]="'section--' + mode">
<ng-container *ngSwitchCase="'expanded'">
<mat-list-item *ngFor="let item of group.items; trackBy: trackById">
<ng-container *ngIf="expandedTemplate">
<ng-template
[ngTemplateOutlet]="expandedTemplate"
[ngTemplateOutletContext]="{
$implicit: item,
state: 'expanded'
}"
>
</ng-template>
</ng-container>
<ng-container *ngIf="isLoggedIn(item.provider) && !item.component">
<app-expand-menu [item]="item"></app-expand-menu>
</ng-container>
<ng-container *ngIf="isLoggedIn(item.provider) && item.component">
<adf-dynamic-component
[data]="{ item: item, state: 'expanded' }"
[id]="item.component"
></adf-dynamic-component>
<adf-dynamic-component [data]="{ item: item, state: 'expanded' }" [id]="item.component"></adf-dynamic-component>
</ng-container>
</mat-list-item>
</ng-container>
<ng-container *ngSwitchCase="'collapsed'">
<div
class="list-item"
*ngFor="let item of group.items; trackBy: trackById"
>
<ng-container *ngIf="collapsedTemplate">
<ng-template
[ngTemplateOutlet]="collapsedTemplate"
[ngTemplateOutletContext]="{
$implicit: item,
state: 'collapsed'
}"
>
</ng-template>
</ng-container>
<div class="list-item" *ngFor="let item of group.items; trackBy: trackById">
<ng-container *ngIf="isLoggedIn(item.provider) && !item.component">
<app-button-menu [item]="item"></app-button-menu>
</ng-container>
<ng-container *ngIf="isLoggedIn(item.provider) && item.component">
<adf-dynamic-component
[data]="{ item: item, state: 'collapsed' }"
[id]="item.component"
>
</adf-dynamic-component>
<adf-dynamic-component [data]="{ item: item, state: 'collapsed' }" [id]="item.component"> </adf-dynamic-component>
</ng-container>
</div>
</ng-container>

View File

@ -23,9 +23,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { Component, ContentChild, Input, TemplateRef, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
import { CollapsedTemplateDirective } from './directives/collapsed-template.directive';
import { ExpandedTemplateDirective } from './directives/expanded-template.directive';
import { Component, Input, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
import { NavBarGroupRef } from '@alfresco/adf-extensions';
import { AuthenticationService } from '@alfresco/adf-core';
import { Store } from '@ngrx/store';
@ -45,16 +43,8 @@ export class SidenavComponent implements OnInit, OnDestroy {
@Input()
mode: 'collapsed' | 'expanded' = 'expanded';
@ContentChild(ExpandedTemplateDirective, { read: TemplateRef })
expandedTemplate;
@ContentChild(CollapsedTemplateDirective, {
read: TemplateRef
})
collapsedTemplate;
groups: Array<NavBarGroupRef> = [];
private onDestroy$: Subject<boolean> = new Subject<boolean>();
private onDestroy$ = new Subject<boolean>();
constructor(private store: Store<AppStore>, private extensions: AppExtensionService, private authService: AuthenticationService) {}

View File

@ -32,8 +32,6 @@ import { ExtensionsModule } from '@alfresco/adf-extensions';
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
import { ExpansionPanelDirective } from './directives/expansion-panel.directive';
import { MenuPanelDirective } from './directives/menu-panel.directive';
import { CollapsedTemplateDirective } from './directives/collapsed-template.directive';
import { ExpandedTemplateDirective } from './directives/expanded-template.directive';
import { SidenavComponent } from './sidenav.component';
import { ActiveLinkDirective } from './directives/active-link.directive';
import { ExpandMenuComponent } from './components/expand-menu.component';
@ -44,8 +42,6 @@ import { ActionDirective } from './directives/action.directive';
declarations: [
MenuPanelDirective,
ExpansionPanelDirective,
ExpandedTemplateDirective,
CollapsedTemplateDirective,
ActiveLinkDirective,
ActionDirective,
ExpandMenuComponent,
@ -55,8 +51,6 @@ import { ActionDirective } from './directives/action.directive';
exports: [
MenuPanelDirective,
ExpansionPanelDirective,
ExpandedTemplateDirective,
CollapsedTemplateDirective,
ActiveLinkDirective,
ActionDirective,
ExpandMenuComponent,

View File

@ -1,42 +0,0 @@
/*!
* @license
* Alfresco Example Content Application
*
* Copyright (C) 2005 - 2020 Alfresco Software Limited
*
* This file is part of the Alfresco Example Content Application.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { ExtensionRoute } from '@alfresco/aca-shared';
export const mockRoutesWithoutParentRoute: Array<ExtensionRoute> = [
{
path: 'extension-path',
component: null,
canActivate: ['fake-guard'],
canActivateChild: ['fake-guard']
}
];
export const mockRoutesWithParentRoute: Array<ExtensionRoute> = [
{
...mockRoutesWithoutParentRoute[0],
parentRoute: 'fake-path'
}
];