[ACA-2704] move Locked By to aca-shared library (#1322)

* move component to aca-shared

* use aca-shared import

* update e2e

* fix selector prefix

* remove

* move node utils to aca-shared

* update reference

* fix lint

* fix linting
This commit is contained in:
Cilibiu Bogdan
2020-01-28 09:00:48 +02:00
committed by Denys Vuika
parent 4c7a95c7e6
commit 5102f7d64d
11 changed files with 58 additions and 13 deletions

View File

@@ -26,7 +26,7 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { CustomNameColumnComponent } from './name-column/name-column.component';
import { LockByComponent } from './locked-by/locked-by.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';
@@ -36,10 +36,11 @@ import { CoreModule } from '@alfresco/adf-core';
BrowserModule,
CoreModule.forChild(),
ContentModule.forChild(),
MaterialModule
MaterialModule,
LockedByModule
],
declarations: [CustomNameColumnComponent, LockByComponent],
exports: [CustomNameColumnComponent, LockByComponent],
entryComponents: [CustomNameColumnComponent, LockByComponent]
declarations: [CustomNameColumnComponent],
exports: [CustomNameColumnComponent],
entryComponents: [CustomNameColumnComponent]
})
export class DocumentListCustomComponentsModule {}

View File

@@ -1,11 +0,0 @@
.aca-locked-by {
.locked_by--icon {
font-size: 14px;
width: 14px;
height: 14px;
}
.locked_by--name {
font-size: 12px;
}
}

View File

@@ -1,69 +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 {
Component,
Input,
OnInit,
ChangeDetectionStrategy,
ViewEncapsulation
} from '@angular/core';
import { NodeEntry } from '@alfresco/js-api';
@Component({
selector: 'aca-locked-by',
template: `
<mat-icon class="locked_by--icon">lock</mat-icon>
<span class="locked_by--name">{{ writeLockedBy() }}</span>
`,
styleUrls: ['./locked-by.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
host: {
class: 'aca-locked-by'
}
})
export class LockByComponent implements OnInit {
@Input()
context: any;
node: NodeEntry;
constructor() {}
ngOnInit() {
this.node = this.context.row.node;
}
writeLockedBy() {
return (
this.node &&
this.node.entry.properties &&
this.node.entry.properties['cm:lockOwner'] &&
this.node.entry.properties['cm:lockOwner'].displayName
);
}
}

View File

@@ -37,7 +37,7 @@ 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 '../../../utils/node.utils';
import { isLocked } from '@alfresco/aca-shared';
@Component({
selector: 'aca-custom-name-column',