[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:
Denys Vuika
2023-05-29 10:28:26 +01:00
committed by GitHub
parent 40c4740b3a
commit 251b6a0ec7
52 changed files with 291 additions and 384 deletions

View File

@@ -22,19 +22,13 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { CustomNameColumnComponent } from './name-column/name-column.component';
import { LockedByModule } from '@alfresco/aca-shared';
import { ContentModule } from '@alfresco/adf-content-services';
import { MaterialModule } from '../../material.module';
import { CoreModule } from '@alfresco/adf-core';
import { LockedByComponent } from '@alfresco/aca-shared';
import { ThumbnailColumnComponent } from './thumbnail-column/thumbnail-column.component';
import { TagsColumnComponent } from './tags-column/tags-column.component';
@NgModule({
imports: [BrowserModule, CoreModule.forChild(), ContentModule.forChild(), MaterialModule, LockedByModule],
declarations: [CustomNameColumnComponent, ThumbnailColumnComponent, TagsColumnComponent],
exports: [CustomNameColumnComponent, ThumbnailColumnComponent, TagsColumnComponent]
imports: [LockedByComponent, ThumbnailColumnComponent, CustomNameColumnComponent, TagsColumnComponent]
})
export class DocumentListCustomComponentsModule {}

View File

@@ -23,7 +23,6 @@
*/
import { CustomNameColumnComponent } from './name-column.component';
import { DocumentListCustomComponentsModule } from '../document-list-custom-components.module';
import { Actions } from '@ngrx/effects';
import { StoreModule } from '@ngrx/store';
import { ComponentFixture, TestBed } from '@angular/core/testing';
@@ -39,7 +38,7 @@ describe('CustomNameColumnComponent', () => {
imports: [
TranslateModule.forRoot(),
CoreModule.forRoot(),
DocumentListCustomComponentsModule,
CustomNameColumnComponent,
StoreModule.forRoot({ app: () => {} }, { initialState: {} })
],
providers: [Actions]

View File

@@ -22,15 +22,19 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { NameColumnComponent, NodesApiService } from '@alfresco/adf-content-services';
import { ContentPipeModule, NameColumnComponent, NodesApiService } from '@alfresco/adf-content-services';
import { ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
import { Actions, ofType } from '@ngrx/effects';
import { Subject } from 'rxjs';
import { filter, takeUntil } from 'rxjs/operators';
import { NodeActionTypes } from '@alfresco/aca-shared/store';
import { isLocked } from '@alfresco/aca-shared';
import { LockedByComponent, isLocked } from '@alfresco/aca-shared';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
@Component({
standalone: true,
imports: [CommonModule, TranslateModule, LockedByComponent, ContentPipeModule],
selector: 'aca-custom-name-column',
templateUrl: './name-column.component.html',
styleUrls: ['./name-column.component.scss'],

View File

@@ -1,57 +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 { ComponentFixture, TestBed } from '@angular/core/testing';
import { TagsColumnComponent } from './tags-column.component';
import { ChangeDetectorRef } from '@angular/core';
describe('TagsColumnComponent', () => {
let fixture: ComponentFixture<TagsColumnComponent>;
let component: TagsColumnComponent;
let changeDetector: ChangeDetectorRef;
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TagsColumnComponent],
providers: [{ provide: ChangeDetectorRef, useValue: { detectChanges() {} } }]
});
changeDetector = TestBed.inject(ChangeDetectorRef);
fixture = TestBed.createComponent(TagsColumnComponent);
component = fixture.componentInstance;
component.context = { row: { id: '0' } };
});
it('should return nodeId from the row', () => {
const row: any = { id: 'test1' };
expect(component.getNodeId(row)).toBe('test1');
});
it('should force change detection on tags loading', () => {
spyOn(changeDetector, 'detectChanges');
component = new TagsColumnComponent(changeDetector);
component.onTagsLoaded();
expect(changeDetector.detectChanges).toHaveBeenCalled();
});
});

View File

@@ -22,10 +22,12 @@
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
*/
import { ShareDataRow } from '@alfresco/adf-content-services';
import { ShareDataRow, TagModule } from '@alfresco/adf-content-services';
import { ChangeDetectorRef, Component, Input, ViewEncapsulation } from '@angular/core';
@Component({
standalone: true,
imports: [TagModule],
selector: 'aca-tags-column',
template: `
<adf-tag-node-list [showDelete]="false" [limitTagsDisplayed]="true" [nodeId]="getNodeId(context.row)" (results)="onTagsLoaded()">

View File

@@ -24,8 +24,13 @@
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation, inject } from '@angular/core';
import { TranslationService } from '@alfresco/adf-core';
import { NgIf } from '@angular/common';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
@Component({
standalone: true,
imports: [NgIf, MatIconModule, MatTooltipModule],
selector: 'aca-custom-thumbnail-column',
templateUrl: './thumbnail-column.component.html',
encapsulation: ViewEncapsulation.None