[ACA-1347] Setup code linting and production builds with CI (#339)

This commit is contained in:
Denys Vuika
2018-04-30 11:51:27 +01:00
committed by GitHub
parent 46a5339214
commit 25c5738160
33 changed files with 176 additions and 78 deletions

View File

@@ -45,7 +45,7 @@ import { DocumentListService } from '@alfresco/adf-content-services';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
@Component({
template: '<div [app-copy-node]="selection"></div>'
template: '<div [acaCopyNode]="selection"></div>'
})
class TestComponent {
selection;

View File

@@ -32,11 +32,12 @@ import { NodeActionsService } from '../services/node-actions.service';
import { ContentManagementService } from '../services/content-management.service';
@Directive({
selector: '[app-copy-node]'
selector: '[acaCopyNode]'
})
export class NodeCopyDirective {
@Input('app-copy-node')
// tslint:disable-next-line:no-input-rename
@Input('acaCopyNode')
selection: MinimalNodeEntity[];
@HostListener('click')

View File

@@ -36,7 +36,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@Component({
template: '<div [app-delete-node]="selection"></div>'
template: '<div [acaDeleteNode]="selection"></div>'
})
class TestComponent {
selection;

View File

@@ -32,13 +32,14 @@ import { Observable } from 'rxjs/Rx';
import { ContentManagementService } from '../services/content-management.service';
@Directive({
selector: '[app-delete-node]'
selector: '[acaDeleteNode]'
})
export class NodeDeleteDirective {
static RESTORE_MESSAGE_DURATION: number = 3000;
static DELETE_MESSAGE_DURATION: number = 10000;
static RESTORE_MESSAGE_DURATION = 3000;
static DELETE_MESSAGE_DURATION = 10000;
@Input('app-delete-node')
// tslint:disable-next-line:no-input-rename
@Input('acaDeleteNode')
selection: MinimalNodeEntity[];
@HostListener('click')

View File

@@ -23,13 +23,13 @@ import { DownloadZipDialogComponent } from '@alfresco/adf-content-services';
/** @deprecated workaround for the ADF 2.3.0 regression. */
@Directive({
selector: '[appNodeDownload]'
selector: '[acaNodeDownload]'
})
export class NodeDownloadDirective {
/** Nodes to download. */
// tslint:disable-next-line:no-input-rename
@Input('appNodeDownload')
@Input('acaNodeDownload')
nodes: MinimalNodeEntity[];
@HostListener('click')

View File

@@ -29,7 +29,7 @@ import { AlfrescoApiService, CoreModule } from '@alfresco/adf-core';
import { NodeInfoDirective } from './node-info.directive';
@Component({
template: '<div [app-node-info]="selection"></div>'
template: '<div [acaNodeInfo]="selection"></div>'
})
class TestComponent {
selection;

View File

@@ -28,12 +28,13 @@ import { AlfrescoApiService } from '@alfresco/adf-core';
import { MinimalNodeEntity, MinimalNodeEntryEntity } from 'alfresco-js-api';
@Directive({
selector: '[app-node-info]',
selector: '[acaNodeInfo]',
exportAs: 'nodeInfo'
})
export class NodeInfoDirective implements OnInit {
@Input('app-node-info') selection: MinimalNodeEntity[];
// tslint:disable-next-line:no-input-rename
@Input('acaNodeInfo') selection: MinimalNodeEntity[];
@Output() changed: EventEmitter<null|MinimalNodeEntryEntity> = new EventEmitter<null|MinimalNodeEntryEntity>();
@Output() error: EventEmitter<null> = new EventEmitter<null>();

View File

@@ -36,7 +36,7 @@ import { NodeMoveDirective } from './node-move.directive';
import { ContentManagementService } from '../services/content-management.service';
@Component({
template: '<div [app-move-node]="selection"></div>'
template: '<div [acaMoveNode]="selection"></div>'
})
class TestComponent {
selection;

View File

@@ -33,11 +33,12 @@ import { NodeActionsService } from '../services/node-actions.service';
import { Observable } from 'rxjs/Rx';
@Directive({
selector: '[app-move-node]'
selector: '[acaMoveNode]'
})
export class NodeMoveDirective {
@Input('app-move-node')
// tslint:disable-next-line:no-input-rename
@Input('acaMoveNode')
selection: MinimalNodeEntity[];
@HostListener('click')
@@ -86,7 +87,7 @@ export class NodeMoveDirective {
// in case of success
if (info.toLowerCase().indexOf('succes') !== -1) {
let i18nMessageString = 'APP.MESSAGES.INFO.NODE_MOVE.';
const i18nMessageString = 'APP.MESSAGES.INFO.NODE_MOVE.';
let i18MessageSuffix = '';
if (succeeded) {

View File

@@ -83,7 +83,7 @@ describe('NodePermanentDeleteDirective', () => {
spyOn(dialog, 'open').and.returnValue({
afterClosed() {
return Observable.of(true)
return Observable.of(true);
}
});
});

View File

@@ -36,7 +36,7 @@ import { NodeRestoreDirective } from './node-restore.directive';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@Component({
template: `<div [app-restore-node]="selection"></div>`
template: `<div [acaRestoreNode]="selection"></div>`
})
class TestComponent {
selection = [];

View File

@@ -31,12 +31,13 @@ import { TranslationService, AlfrescoApiService, NotificationService } from '@al
import { MinimalNodeEntity, PathInfoEntity, DeletedNodesPaging } from 'alfresco-js-api';
@Directive({
selector: '[app-restore-node]'
selector: '[acaRestoreNode]'
})
export class NodeRestoreDirective {
private restoreProcessStatus;
@Input('app-restore-node')
// tslint:disable-next-line:no-input-rename
@Input('acaRestoreNode')
selection: MinimalNodeEntity[];
@HostListener('click')

View File

@@ -28,12 +28,12 @@ import { AlfrescoApiService } from '@alfresco/adf-core';
import { MinimalNodeEntity } from 'alfresco-js-api';
@Directive({
selector: '[appUnshareNode]'
selector: '[acaUnshareNode]'
})
export class NodeUnshareDirective {
// tslint:disable-next-line:no-input-rename
@Input('appUnshareNode')
@Input('acaUnshareNode')
selection: MinimalNodeEntity[];
constructor(

View File

@@ -32,11 +32,12 @@ import { VersionManagerDialogAdapterComponent } from '../../components/versions-
import { MatDialog } from '@angular/material';
@Directive({
selector: '[app-node-versions]'
selector: '[acaNodeVersions]'
})
export class NodeVersionsDirective {
@Input('app-node-versions')
// tslint:disable-next-line:no-input-rename
@Input('acaNodeVersions')
selection: MinimalNodeEntity[];
@Output()

View File

@@ -68,21 +68,21 @@
<button
mat-menu-item
[app-copy-node]="documentList.selection">
[acaCopyNode]="documentList.selection">
<mat-icon color="primary">content_copy</mat-icon>
<span>{{ 'APP.ACTIONS.COPY' | translate }}</span>
</button>
<button
mat-menu-item
[app-move-node]="documentList.selection">
[acaMoveNode]="documentList.selection">
<mat-icon color="primary">library_books</mat-icon>
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
</button>
<button
mat-menu-item
[app-delete-node]="documentList.selection">
[acaDeleteNode]="documentList.selection">
<mat-icon color="primary">delete</mat-icon>
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>
</button>
@@ -90,7 +90,7 @@
<button
mat-menu-item
*ngIf="isFileSelected(documentList.selection)"
[app-node-versions]="documentList.selection">
[acaNodeVersions]="documentList.selection">
<mat-icon color="primary">history</mat-icon>
<span>{{ 'APP.ACTIONS.VERSIONS' | translate }}</span>
</button>
@@ -180,7 +180,7 @@
<div class="inner-layout__side-panel"
*ngIf="infoDrawerOpened"
[app-node-info]="documentList.selection"
[acaNodeInfo]="documentList.selection"
(changed)="toggleSidebar($event)"
#infoInstance=nodeInfo>

View File

@@ -70,7 +70,7 @@
<button
mat-menu-item
[app-copy-node]="documentList.selection">
[acaCopyNode]="documentList.selection">
<mat-icon color="primary">content_copy</mat-icon>
<span>{{ 'APP.ACTIONS.COPY' | translate }}</span>
</button>
@@ -78,7 +78,7 @@
<button
mat-menu-item
*ngIf="canMove(documentList.selection)"
[app-move-node]="documentList.selection">
[acaMoveNode]="documentList.selection">
<mat-icon color="primary">library_books</mat-icon>
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
</button>
@@ -86,7 +86,7 @@
<button
mat-menu-item
*ngIf="canDelete(documentList.selection)"
[app-delete-node]="documentList.selection">
[acaDeleteNode]="documentList.selection">
<mat-icon color="primary">delete</mat-icon>
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>
</button>
@@ -94,7 +94,7 @@
<button
mat-menu-item
*ngIf="canManageVersions(documentList.selection)"
[app-node-versions]="documentList.selection">
[acaNodeVersions]="documentList.selection">
<mat-icon color="primary">history</mat-icon>
<span>{{ 'APP.ACTIONS.VERSIONS' | translate }}</span>
</button>
@@ -183,7 +183,7 @@
<div class="inner-layout__side-panel"
*ngIf="infoDrawerOpened"
[app-node-info]="documentList.selection"
[acaNodeInfo]="documentList.selection"
(changed)="toggleSidebar($event)"
#infoInstance=nodeInfo>

View File

@@ -48,7 +48,7 @@
<button
mat-menu-item
[app-copy-node]="selectedEntities">
[acaCopyNode]="selectedEntities">
<mat-icon color="primary">content_copy</mat-icon>
<span>{{ 'APP.ACTIONS.COPY' | translate }}</span>
</button>
@@ -56,7 +56,7 @@
<button
mat-menu-item
*ngIf="permission.check(node, ['delete'])"
[app-move-node]="selectedEntities">
[acaMoveNode]="selectedEntities">
<mat-icon color="primary">library_books</mat-icon>
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
</button>
@@ -72,7 +72,7 @@
<button
mat-menu-item
*ngIf="permission.check(node, ['update'])"
[app-node-versions]="selectedEntities">
[acaNodeVersions]="selectedEntities">
<mat-icon color="primary">history</mat-icon>
<span>{{ 'APP.ACTIONS.VERSIONS' | translate }}</span>
</button>

View File

@@ -58,7 +58,7 @@
<button
mat-menu-item
[app-copy-node]="documentList.selection">
[acaCopyNode]="documentList.selection">
<mat-icon color="primary">content_copy</mat-icon>
<span>{{ 'APP.ACTIONS.COPY' | translate }}</span>
</button>
@@ -66,7 +66,7 @@
<button
mat-menu-item
*ngIf="canMove(documentList.selection)"
[app-move-node]="documentList.selection">
[acaMoveNode]="documentList.selection">
<mat-icon color="primary">library_books</mat-icon>
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
</button>
@@ -74,7 +74,7 @@
<button
mat-menu-item
*ngIf="canDelete(documentList.selection)"
[app-delete-node]="documentList.selection">
[acaDeleteNode]="documentList.selection">
<mat-icon color="primary">delete</mat-icon>
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>
</button>
@@ -82,7 +82,7 @@
<button
mat-menu-item
*ngIf="canManageVersions(documentList.selection)"
[app-node-versions]="documentList.selection">
[acaNodeVersions]="documentList.selection">
<mat-icon color="primary">history</mat-icon>
<span>{{ 'APP.ACTIONS.VERSIONS' | translate }}</span>
</button>
@@ -168,7 +168,7 @@
<div class="inner-layout__side-panel"
*ngIf="infoDrawerOpened"
[app-node-info]="documentList.selection"
[acaNodeInfo]="documentList.selection"
(changed)="toggleSidebar($event)"
#infoInstance=nodeInfo>

View File

@@ -18,7 +18,7 @@
mat-icon-button
*ngIf="hasSelection(documentList.selection)"
title="{{ 'APP.ACTIONS.DOWNLOAD' | translate }}"
[appNodeDownload]="documentList.selection">
[acaNodeDownload]="documentList.selection">
<mat-icon>get_app</mat-icon>
</button>
@@ -57,7 +57,7 @@
<button
mat-menu-item
[app-copy-node]="documentList.selection">
[acaCopyNode]="documentList.selection">
<mat-icon color="primary">content_copy</mat-icon>
<span>{{ 'APP.ACTIONS.COPY' | translate }}</span>
</button>
@@ -65,7 +65,7 @@
<button
mat-menu-item
*ngIf="permission.check(documentList.selection, ['delete'], { target: 'allowableOperationsOnTarget' })"
[app-move-node]="documentList.selection">
[acaMoveNode]="documentList.selection">
<mat-icon color="primary">library_books</mat-icon>
<span>{{ 'APP.ACTIONS.MOVE' | translate }}</span>
</button>
@@ -73,7 +73,7 @@
<button
mat-menu-item
*ngIf="permission.check(documentList.selection, ['delete'])"
[appUnshareNode]="documentList.selection"
[acaUnshareNode]="documentList.selection"
(links-unshared)="refresh()">
<mat-icon color="primary">stop_screen_share</mat-icon>
<span>{{ 'APP.ACTIONS.UNSHARE' | translate }}</span>
@@ -82,7 +82,7 @@
<button
mat-menu-item
*ngIf="permission.check(documentList.selection, ['delete'], { target: 'allowableOperationsOnTarget' })"
[app-delete-node]="documentList.selection">
[acaDeleteNode]="documentList.selection">
<mat-icon color="primary">delete</mat-icon>
<span>{{ 'APP.ACTIONS.DELETE' | translate }}</span>
</button>
@@ -90,7 +90,7 @@
<button
mat-menu-item
*ngIf="permission.check(documentList.selection[0], ['update'], { target: 'allowableOperationsOnTarget' })"
[app-node-versions]="documentList.selection">
[acaNodeVersions]="documentList.selection">
<mat-icon color="primary">history</mat-icon>
<span>{{ 'APP.ACTIONS.VERSIONS' | translate }}</span>
</button>
@@ -185,7 +185,7 @@
<div class="inner-layout__side-panel"
*ngIf="infoDrawerOpened"
[app-node-info]="documentList.selection"
[acaNodeInfo]="documentList.selection"
(changed)="toggleSidebar($event)"
#infoInstance=nodeInfo>

View File

@@ -33,7 +33,7 @@ import {
NodesApiService, AlfrescoApiService, ContentService,
UserPreferencesService, LogService, AppConfigService,
StorageService, CookieService, ThumbnailService, AuthenticationService,
TimeAgoPipe, NodeNameTooltipPipe, NodeFavoriteDirective,DataTableComponent
TimeAgoPipe, NodeNameTooltipPipe, NodeFavoriteDirective, DataTableComponent
} from '@alfresco/adf-core';
import { DocumentListComponent, CustomResourcesService } from '@alfresco/adf-content-services';
import { TranslateModule } from '@ngx-translate/core';

View File

@@ -18,7 +18,7 @@
color="primary"
mat-icon-button
(selection-node-restored)="refresh()"
[app-restore-node]="documentList.selection"
[acaRestoreNode]="documentList.selection"
*ngIf="documentList.selection.length"
title="{{ 'APP.ACTIONS.RESTORE' | translate }}">
<mat-icon>restore</mat-icon>