mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
remove unused directives (#1830)
* remove unused directives * remove unused mock
This commit is contained in:
parent
b96f6cece4
commit
ffc4bd6e0f
@ -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 {}
|
|
@ -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 {}
|
|
@ -4,63 +4,27 @@
|
|||||||
<app-create-menu [expanded]="mode === 'expanded'"></app-create-menu>
|
<app-create-menu [expanded]="mode === 'expanded'"></app-create-menu>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div *ngFor="let group of groups; trackBy: trackById" class="section" [ngClass]="'section--' + mode">
|
||||||
*ngFor="let group of groups; trackBy: trackById"
|
|
||||||
class="section"
|
|
||||||
[ngClass]="'section--' + mode"
|
|
||||||
>
|
|
||||||
<ng-container *ngSwitchCase="'expanded'">
|
<ng-container *ngSwitchCase="'expanded'">
|
||||||
<mat-list-item *ngFor="let item of group.items; trackBy: trackById">
|
<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">
|
<ng-container *ngIf="isLoggedIn(item.provider) && !item.component">
|
||||||
<app-expand-menu [item]="item"></app-expand-menu>
|
<app-expand-menu [item]="item"></app-expand-menu>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="isLoggedIn(item.provider) && item.component">
|
<ng-container *ngIf="isLoggedIn(item.provider) && item.component">
|
||||||
<adf-dynamic-component
|
<adf-dynamic-component [data]="{ item: item, state: 'expanded' }" [id]="item.component"></adf-dynamic-component>
|
||||||
[data]="{ item: item, state: 'expanded' }"
|
|
||||||
[id]="item.component"
|
|
||||||
></adf-dynamic-component>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngSwitchCase="'collapsed'">
|
<ng-container *ngSwitchCase="'collapsed'">
|
||||||
<div
|
<div class="list-item" *ngFor="let item of group.items; trackBy: trackById">
|
||||||
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>
|
|
||||||
|
|
||||||
<ng-container *ngIf="isLoggedIn(item.provider) && !item.component">
|
<ng-container *ngIf="isLoggedIn(item.provider) && !item.component">
|
||||||
<app-button-menu [item]="item"></app-button-menu>
|
<app-button-menu [item]="item"></app-button-menu>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="isLoggedIn(item.provider) && item.component">
|
<ng-container *ngIf="isLoggedIn(item.provider) && item.component">
|
||||||
<adf-dynamic-component
|
<adf-dynamic-component [data]="{ item: item, state: 'collapsed' }" [id]="item.component"> </adf-dynamic-component>
|
||||||
[data]="{ item: item, state: 'collapsed' }"
|
|
||||||
[id]="item.component"
|
|
||||||
>
|
|
||||||
</adf-dynamic-component>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -23,9 +23,7 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, ContentChild, Input, TemplateRef, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
|
import { Component, Input, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
|
||||||
import { CollapsedTemplateDirective } from './directives/collapsed-template.directive';
|
|
||||||
import { ExpandedTemplateDirective } from './directives/expanded-template.directive';
|
|
||||||
import { NavBarGroupRef } from '@alfresco/adf-extensions';
|
import { NavBarGroupRef } from '@alfresco/adf-extensions';
|
||||||
import { AuthenticationService } from '@alfresco/adf-core';
|
import { AuthenticationService } from '@alfresco/adf-core';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
@ -45,16 +43,8 @@ export class SidenavComponent implements OnInit, OnDestroy {
|
|||||||
@Input()
|
@Input()
|
||||||
mode: 'collapsed' | 'expanded' = 'expanded';
|
mode: 'collapsed' | 'expanded' = 'expanded';
|
||||||
|
|
||||||
@ContentChild(ExpandedTemplateDirective, { read: TemplateRef })
|
|
||||||
expandedTemplate;
|
|
||||||
|
|
||||||
@ContentChild(CollapsedTemplateDirective, {
|
|
||||||
read: TemplateRef
|
|
||||||
})
|
|
||||||
collapsedTemplate;
|
|
||||||
|
|
||||||
groups: Array<NavBarGroupRef> = [];
|
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) {}
|
constructor(private store: Store<AppStore>, private extensions: AppExtensionService, private authService: AuthenticationService) {}
|
||||||
|
|
||||||
|
@ -32,8 +32,6 @@ import { ExtensionsModule } from '@alfresco/adf-extensions';
|
|||||||
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
|
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
|
||||||
import { ExpansionPanelDirective } from './directives/expansion-panel.directive';
|
import { ExpansionPanelDirective } from './directives/expansion-panel.directive';
|
||||||
import { MenuPanelDirective } from './directives/menu-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 { SidenavComponent } from './sidenav.component';
|
||||||
import { ActiveLinkDirective } from './directives/active-link.directive';
|
import { ActiveLinkDirective } from './directives/active-link.directive';
|
||||||
import { ExpandMenuComponent } from './components/expand-menu.component';
|
import { ExpandMenuComponent } from './components/expand-menu.component';
|
||||||
@ -44,8 +42,6 @@ import { ActionDirective } from './directives/action.directive';
|
|||||||
declarations: [
|
declarations: [
|
||||||
MenuPanelDirective,
|
MenuPanelDirective,
|
||||||
ExpansionPanelDirective,
|
ExpansionPanelDirective,
|
||||||
ExpandedTemplateDirective,
|
|
||||||
CollapsedTemplateDirective,
|
|
||||||
ActiveLinkDirective,
|
ActiveLinkDirective,
|
||||||
ActionDirective,
|
ActionDirective,
|
||||||
ExpandMenuComponent,
|
ExpandMenuComponent,
|
||||||
@ -55,8 +51,6 @@ import { ActionDirective } from './directives/action.directive';
|
|||||||
exports: [
|
exports: [
|
||||||
MenuPanelDirective,
|
MenuPanelDirective,
|
||||||
ExpansionPanelDirective,
|
ExpansionPanelDirective,
|
||||||
ExpandedTemplateDirective,
|
|
||||||
CollapsedTemplateDirective,
|
|
||||||
ActiveLinkDirective,
|
ActiveLinkDirective,
|
||||||
ActionDirective,
|
ActionDirective,
|
||||||
ExpandMenuComponent,
|
ExpandMenuComponent,
|
||||||
|
@ -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'
|
|
||||||
}
|
|
||||||
];
|
|
Loading…
x
Reference in New Issue
Block a user