mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
[ACS-5627] migrate to standalone components (#3339)
* standalone preview component * remove deprecated routes * remove preview routes * standalone viewer * toggle favorite * edit offline * fix tests * toggle info drawer * toggle join library * toggle favorite library * view node * convert app toolbar module to standalone directives * convert sidenav module to standalone * convert search module to standalone * shared link view * shared files * reduce module files * files component * files component cleanup * cleanup directives module * favorite libraries * favorites component * recent files component * libraries component * cleanup * remove material module barrel * open in app component * cleanup modules * migrate toolbar module to standalone * split page layout module * remove incorrect import * remove incorrect import * rule list * folder rules module * folder rules module * backwards compatibility for ADW * reduce core module usage
This commit is contained in:
@@ -26,7 +26,6 @@ import { ButtonMenuComponent } from './button-menu.component';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { Router } from '@angular/router';
|
||||
import { AppSidenavModule } from '../sidenav.module';
|
||||
|
||||
describe('ButtonMenuComponent', () => {
|
||||
let component: ButtonMenuComponent;
|
||||
@@ -35,7 +34,7 @@ describe('ButtonMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule, AppSidenavModule]
|
||||
imports: [AppTestingModule, ButtonMenuComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(ButtonMenuComponent);
|
||||
|
@@ -25,8 +25,18 @@
|
||||
import { Component, Input, ViewEncapsulation, OnInit, ChangeDetectorRef } from '@angular/core';
|
||||
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||
import { NavBarLinkRef } from '@alfresco/adf-extensions';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { IconModule } from '@alfresco/adf-core';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { ActiveLinkDirective } from '../directives/active-link.directive';
|
||||
import { ActionDirective } from '../directives/action.directive';
|
||||
import { MenuPanelDirective } from '../directives/menu-panel.directive';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, IconModule, MatMenuModule, MatButtonModule, ActiveLinkDirective, ActionDirective, MenuPanelDirective],
|
||||
selector: 'app-button-menu',
|
||||
templateUrl: './button-menu.component.html',
|
||||
host: { class: 'app-button-menu' },
|
||||
|
@@ -20,7 +20,6 @@
|
||||
<mat-expansion-panel
|
||||
[expanded]="true"
|
||||
[acaExpansionPanel]="item"
|
||||
#acaExpansionPanel="acaExpansionPanel"
|
||||
[@.disabled]="true"
|
||||
>
|
||||
<mat-expansion-panel-header expandedHeight="48px" collapsedHeight="48px" role="group">
|
||||
|
@@ -26,7 +26,6 @@ import { ExpandMenuComponent } from './expand-menu.component';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { Router } from '@angular/router';
|
||||
import { AppSidenavModule } from '../sidenav.module';
|
||||
|
||||
describe('ExpandMenuComponent', () => {
|
||||
let component: ExpandMenuComponent;
|
||||
@@ -35,7 +34,7 @@ describe('ExpandMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule, AppSidenavModule]
|
||||
imports: [AppTestingModule, ExpandMenuComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(ExpandMenuComponent);
|
||||
|
@@ -24,8 +24,27 @@
|
||||
|
||||
import { Component, OnInit, Input, ViewEncapsulation, ChangeDetectorRef } from '@angular/core';
|
||||
import { NavBarLinkRef } from '@alfresco/adf-extensions';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { IconModule } from '@alfresco/adf-core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { ActiveLinkDirective } from '../directives/active-link.directive';
|
||||
import { ActionDirective } from '../directives/action.directive';
|
||||
import { MatExpansionModule } from '@angular/material/expansion';
|
||||
import { ExpansionPanelDirective } from '../directives/expansion-panel.directive';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
TranslateModule,
|
||||
IconModule,
|
||||
MatButtonModule,
|
||||
ActiveLinkDirective,
|
||||
ActionDirective,
|
||||
MatExpansionModule,
|
||||
ExpansionPanelDirective
|
||||
],
|
||||
selector: 'app-expand-menu',
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
templateUrl: './expand-menu.component.html',
|
||||
|
@@ -28,10 +28,15 @@ import { Observable, Subject } from 'rxjs';
|
||||
import { AppStore, getAppName, getLogoPath } from '@alfresco/aca-shared/store';
|
||||
import { AppConfigService } from '@alfresco/adf-core';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||
import { AppExtensionService, ToolbarActionComponent } from '@alfresco/aca-shared';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, RouterModule, ToolbarActionComponent],
|
||||
selector: 'app-sidenav-header',
|
||||
templateUrl: `./sidenav-header.component.html`,
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
|
@@ -28,6 +28,7 @@ import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '@alfresco/aca-shared/store';
|
||||
|
||||
@Directive({
|
||||
standalone: true,
|
||||
/* eslint-disable-next-line */
|
||||
selector: '[action]',
|
||||
exportAs: 'action'
|
||||
|
@@ -23,13 +23,16 @@
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { AppSidenavModule } from '../sidenav.module';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { Router, NavigationEnd } from '@angular/router';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ActiveLinkDirective } from './active-link.directive';
|
||||
import { ActionDirective } from './action.directive';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [ActiveLinkDirective, ActionDirective],
|
||||
selector: 'app-test-component',
|
||||
template: ` <span id="test-element" acaActiveLink="active-link-class" [action]="item"></span> `
|
||||
})
|
||||
@@ -56,8 +59,7 @@ describe('ActionDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule, AppSidenavModule],
|
||||
declarations: [TestComponent],
|
||||
imports: [AppTestingModule, ActiveLinkDirective, TestComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: Router,
|
||||
|
@@ -29,6 +29,7 @@ import { Subject } from 'rxjs';
|
||||
import { ActionDirective } from './action.directive';
|
||||
|
||||
@Directive({
|
||||
standalone: true,
|
||||
selector: '[acaActiveLink]',
|
||||
exportAs: 'acaActiveLink'
|
||||
})
|
||||
|
@@ -30,6 +30,7 @@ import { MatExpansionPanel } from '@angular/material/expansion';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
@Directive({
|
||||
standalone: true,
|
||||
selector: '[acaExpansionPanel]',
|
||||
exportAs: 'acaExpansionPanel'
|
||||
})
|
||||
|
@@ -29,6 +29,7 @@ import { Subject } from 'rxjs';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
@Directive({
|
||||
standalone: true,
|
||||
selector: '[acaMenuPanel]',
|
||||
exportAs: 'acaMenuPanel'
|
||||
})
|
||||
|
@@ -22,10 +22,6 @@
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
import { ExpansionPanelDirective } from './directives/expansion-panel.directive';
|
||||
import { MenuPanelDirective } from './directives/menu-panel.directive';
|
||||
import { SidenavComponent } from './sidenav.component';
|
||||
@@ -34,30 +30,16 @@ import { ExpandMenuComponent } from './components/expand-menu.component';
|
||||
import { ButtonMenuComponent } from './components/button-menu.component';
|
||||
import { ActionDirective } from './directives/action.directive';
|
||||
import { SidenavHeaderComponent } from './components/sidenav-header.component';
|
||||
import { SharedToolbarModule } from '@alfresco/aca-shared';
|
||||
import { UserMenuComponent } from './user-menu/user-menu.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [CoreModule.forChild(), ExtensionsModule.forChild(), RouterModule, SharedToolbarModule],
|
||||
declarations: [
|
||||
MenuPanelDirective,
|
||||
ExpansionPanelDirective,
|
||||
ActiveLinkDirective,
|
||||
ActionDirective,
|
||||
ExpandMenuComponent,
|
||||
ButtonMenuComponent,
|
||||
SidenavComponent,
|
||||
SidenavHeaderComponent,
|
||||
UserMenuComponent
|
||||
],
|
||||
exports: [
|
||||
MenuPanelDirective,
|
||||
ExpansionPanelDirective,
|
||||
ActiveLinkDirective,
|
||||
ActionDirective,
|
||||
ExpandMenuComponent,
|
||||
ButtonMenuComponent,
|
||||
SidenavComponent
|
||||
]
|
||||
})
|
||||
export class AppSidenavModule {}
|
||||
export const APP_SIDENAV_DIRECTIVES = [
|
||||
ButtonMenuComponent,
|
||||
ActiveLinkDirective,
|
||||
ActionDirective,
|
||||
MenuPanelDirective,
|
||||
ExpandMenuComponent,
|
||||
ExpansionPanelDirective,
|
||||
SidenavHeaderComponent,
|
||||
UserMenuComponent,
|
||||
SidenavComponent
|
||||
] as const;
|
@@ -36,8 +36,7 @@ describe('SidenavComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule],
|
||||
declarations: [SidenavComponent],
|
||||
imports: [AppTestingModule, SidenavComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: AppService,
|
||||
|
@@ -23,15 +23,21 @@
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core';
|
||||
import { NavBarGroupRef, NavBarLinkRef } from '@alfresco/adf-extensions';
|
||||
import { ExtensionsModule, NavBarGroupRef, NavBarLinkRef } from '@alfresco/adf-extensions';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore, getSideNavState } from '@alfresco/aca-shared/store';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil, distinctUntilChanged, debounceTime } from 'rxjs/operators';
|
||||
import { AppExtensionService, AppService } from '@alfresco/aca-shared';
|
||||
import { SidenavLayoutComponent } from '@alfresco/adf-core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { SidenavHeaderComponent } from './components/sidenav-header.component';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { ExpandMenuComponent } from './components/expand-menu.component';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [CommonModule, SidenavHeaderComponent, MatListModule, ExpandMenuComponent, ExtensionsModule],
|
||||
selector: 'app-sidenav',
|
||||
templateUrl: './sidenav.component.html',
|
||||
styleUrls: ['./sidenav.component.scss'],
|
||||
|
@@ -28,8 +28,6 @@ import { PeopleContentService } from '@alfresco/adf-content-services';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { UserMenuComponent } from './user-menu.component';
|
||||
import { of } from 'rxjs';
|
||||
import { SharedToolbarModule } from '@alfresco/aca-shared';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
|
||||
describe('UserMenuComponent', () => {
|
||||
let component: UserMenuComponent;
|
||||
@@ -108,8 +106,7 @@ describe('UserMenuComponent', () => {
|
||||
};
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule, SharedToolbarModule, MatMenuModule],
|
||||
declarations: [UserMenuComponent],
|
||||
imports: [AppTestingModule, UserMenuComponent],
|
||||
providers: [
|
||||
{ provide: AuthenticationService, useValue: authServiceStub },
|
||||
{ provide: PeopleContentService, useValue: peopleContentServiceStub },
|
||||
|
@@ -28,8 +28,15 @@ import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { ToolbarMenuItemComponent } from '@alfresco/aca-shared';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, MatButtonModule, MatMenuModule, ToolbarMenuItemComponent],
|
||||
selector: 'aca-user-menu',
|
||||
templateUrl: './user-menu.component.html',
|
||||
styleUrls: ['./user-menu.component.scss'],
|
||||
|
Reference in New Issue
Block a user