mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACS-5308] cleanup content common module and move to standalone components (#3234)
* language picker * location link * logout component * logout: fix tests * toggle shared component * user info component * cleanup common module * migrate generic error to standalone * thumbnail column component * name column component * tags column component * locked by component * cleanup module dependencies * comments tab component * info drawer and details * cleanup infodrawer module * remove useless test * reduce useless imports * info drawer module * context menu component
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||
import { ContextMenuItemComponent } from './context-menu-item.component';
|
||||
import { ContextMenuModule } from './context-menu.module';
|
||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||
import { ContextMenuComponent } from './context-menu.component';
|
||||
|
||||
describe('ContextMenuComponent', () => {
|
||||
let fixture: ComponentFixture<ContextMenuItemComponent>;
|
||||
@@ -36,8 +36,7 @@ describe('ContextMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppTestingModule, ContextMenuModule],
|
||||
providers: [AppExtensionService]
|
||||
imports: [AppTestingModule, ContextMenuComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(ContextMenuItemComponent);
|
||||
|
@@ -23,10 +23,17 @@
|
||||
*/
|
||||
|
||||
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
import { ContentActionRef, ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { IconModule } from '@alfresco/adf-core';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, MatMenuModule, IconModule, MatDividerModule, ExtensionsModule],
|
||||
selector: 'app-context-menu-item',
|
||||
templateUrl: './context-menu-item.component.html',
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
|
@@ -27,6 +27,7 @@ import { fromEvent, Subscription } from 'rxjs';
|
||||
import { filter } from 'rxjs/operators';
|
||||
|
||||
@Directive({
|
||||
standalone: true,
|
||||
selector: '[acaContextMenuOutsideEvent]'
|
||||
})
|
||||
export class OutsideEventDirective implements OnInit, OnDestroy {
|
||||
|
@@ -25,7 +25,6 @@
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { AppTestingModule } from '../../testing/app-testing.module';
|
||||
import { ContextMenuComponent } from './context-menu.component';
|
||||
import { ContextMenuModule } from './context-menu.module';
|
||||
import { ContextMenuOverlayRef } from './context-menu-overlay';
|
||||
import { ContentActionType } from '@alfresco/adf-extensions';
|
||||
|
||||
@@ -50,7 +49,7 @@ describe('ContextMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContextMenuModule, AppTestingModule],
|
||||
imports: [ContextMenuComponent, AppTestingModule],
|
||||
providers: [
|
||||
{
|
||||
provide: ContextMenuOverlayRef,
|
||||
|
@@ -23,16 +23,33 @@
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation, OnInit, OnDestroy, HostListener, ViewChild, AfterViewInit, Inject } from '@angular/core';
|
||||
import { MatMenuTrigger } from '@angular/material/menu';
|
||||
import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
import { ContentActionRef, ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
import { ContextMenuOverlayRef } from './context-menu-overlay';
|
||||
import { CONTEXT_MENU_DIRECTION } from './direction.token';
|
||||
import { Direction } from '@angular/cdk/bidi';
|
||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatDividerModule } from '@angular/material/divider';
|
||||
import { IconModule } from '@alfresco/adf-core';
|
||||
import { ContextMenuItemComponent } from './context-menu-item.component';
|
||||
import { OutsideEventDirective } from './context-menu-outside-event.directive';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
TranslateModule,
|
||||
MatMenuModule,
|
||||
MatDividerModule,
|
||||
IconModule,
|
||||
ContextMenuItemComponent,
|
||||
ExtensionsModule,
|
||||
OutsideEventDirective
|
||||
],
|
||||
selector: 'aca-context-menu',
|
||||
templateUrl: './context-menu.component.html',
|
||||
host: {
|
||||
|
@@ -1,54 +0,0 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* 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
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { CoreExtensionsModule } from '../../extensions/core.extensions.module';
|
||||
import { AppCommonModule } from '../common/common.module';
|
||||
import { ContextMenuItemComponent } from './context-menu-item.component';
|
||||
import { OutsideEventDirective } from './context-menu-outside-event.directive';
|
||||
import { ContextMenuComponent } from './context-menu.component';
|
||||
import { ContextActionsModule } from '@alfresco/aca-shared';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
MatMenuModule,
|
||||
MatListModule,
|
||||
MatIconModule,
|
||||
MatButtonModule,
|
||||
CoreExtensionsModule.forChild(),
|
||||
CoreModule.forChild(),
|
||||
AppCommonModule,
|
||||
ExtensionsModule,
|
||||
ContextActionsModule
|
||||
],
|
||||
declarations: [ContextMenuComponent, ContextMenuItemComponent, OutsideEventDirective],
|
||||
exports: [OutsideEventDirective, ContextMenuComponent, ContextMenuItemComponent, ContextActionsModule]
|
||||
})
|
||||
export class ContextMenuModule {}
|
@@ -29,27 +29,29 @@ import { Store } from '@ngrx/store';
|
||||
import { of } from 'rxjs';
|
||||
import { CoreModule, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { ContextMenuService } from './context-menu.service';
|
||||
import { ContextMenuModule } from './context-menu.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { ContextMenuComponent } from './context-menu.component';
|
||||
import { ContextmenuOverlayConfig } from './interfaces';
|
||||
|
||||
describe('ContextMenuService', () => {
|
||||
let contextMenuService;
|
||||
let overlay;
|
||||
let injector;
|
||||
let userPreferencesService;
|
||||
const overlayConfig = {
|
||||
let contextMenuService: ContextMenuService;
|
||||
let overlay: Overlay;
|
||||
let injector: Injector;
|
||||
let userPreferencesService: UserPreferencesService;
|
||||
|
||||
const overlayConfig: ContextmenuOverlayConfig = {
|
||||
hasBackdrop: false,
|
||||
backdropClass: '',
|
||||
panelClass: 'test-panel',
|
||||
source: {
|
||||
x: 1,
|
||||
y: 1
|
||||
}
|
||||
} as any
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContextMenuModule],
|
||||
imports: [TranslateModule.forRoot(), CoreModule.forRoot(), ContextMenuComponent],
|
||||
providers: [Overlay, { provide: Store, useValue: { select: () => of() } }, UserPreferencesService]
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user