Minor code and style fixes (#5398)

* type fixes

* import fixes

* fix typos

* fix warning for private props that init in ctor only

* typing fixes

* typing fixes

* style cleanup

* fix test template
This commit is contained in:
Denys Vuika 2020-02-09 22:03:32 +00:00 committed by GitHub
parent 3459c98bd0
commit a0926a38d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
74 changed files with 171 additions and 71 deletions

View File

@ -328,7 +328,7 @@
[allowRightSidebar]="allowRightSidebar" [allowRightSidebar]="allowRightSidebar"
[allowLeftSidebar]="allowLeftSidebar" [allowLeftSidebar]="allowLeftSidebar"
[urlFile]="urlFile" [urlFile]="urlFile"
(showViewerChange)="onViewerVisibilityChanged($event)" (showViewerChange)="onViewerVisibilityChanged()"
[sidebarLeftTemplate]="sidebarLeftTemplate" [sidebarLeftTemplate]="sidebarLeftTemplate"
[sidebarRightTemplate]="sidebarRightTemplate"> [sidebarRightTemplate]="sidebarRightTemplate">

View File

@ -56,6 +56,5 @@ div.app-search-results-container {
.example-search-input { .example-search-input {
width: 100px; width: 100px;
border: 1 solid; border: 1px solid black;
border-color: black;
} }

View File

@ -316,10 +316,10 @@ async function main(args: ConfigArgs) {
}); });
if (result.isValid) { if (result.isValid) {
logger.error('The envirorment is up and running'); logger.error('The environment is up and running');
await deployMissingApps(); await deployMissingApps();
} else { } else {
logger.error('The envirorment is not up'); logger.error('The environment is not up');
process.exit(1); process.exit(1);
} }

View File

@ -17,8 +17,7 @@
} }
.mat-checkbox-inner-container { .mat-checkbox-inner-container {
margin: auto 0; margin: auto 8px auto 0;
margin-right: 8px;
} }
} }

View File

@ -20,6 +20,7 @@ import { TagService } from './services/tag.service';
import { PaginationModel } from '@alfresco/adf-core'; import { PaginationModel } from '@alfresco/adf-core';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
import { TagEntry } from '@alfresco/js-api';
/** /**
* This component provide a list of all the tag inside the ECM * This component provide a list of all the tag inside the ECM
@ -39,7 +40,7 @@ export class TagListComponent implements OnInit, OnDestroy {
/** /**
* Array of tags that are displayed * Array of tags that are displayed
*/ */
tagsEntries: any = []; tagsEntries: TagEntry[] = [];
/** /**
* Number of items per iteration * Number of items per iteration
@ -86,7 +87,7 @@ export class TagListComponent implements OnInit, OnDestroy {
} }
refreshTag(opts?: any) { refreshTag(opts?: any) {
this.tagService.getAllTheTags(opts).subscribe((tags: any) => { this.tagService.getAllTheTags(opts).subscribe((tags) => {
this.tagsEntries = this.tagsEntries.concat(tags.list.entries); this.tagsEntries = this.tagsEntries.concat(tags.list.entries);
this.pagination = tags.list.pagination; this.pagination = tags.list.pagination;
this.result.emit(this.tagsEntries); this.result.emit(this.tagsEntries);

View File

@ -17,7 +17,7 @@
import { Component, EventEmitter, Input, OnChanges, Output, ViewEncapsulation, OnDestroy, OnInit } from '@angular/core'; import { Component, EventEmitter, Input, OnChanges, Output, ViewEncapsulation, OnDestroy, OnInit } from '@angular/core';
import { TagService } from './services/tag.service'; import { TagService } from './services/tag.service';
import { TagPaging } from '@alfresco/js-api'; import { TagEntry } from '@alfresco/js-api';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators'; import { takeUntil } from 'rxjs/operators';
@ -41,7 +41,7 @@ export class TagNodeListComponent implements OnChanges, OnDestroy, OnInit {
@Input() @Input()
showDelete = true; showDelete = true;
tagsEntries: any; tagsEntries: TagEntry[];
/** Emitted when a tag is selected. */ /** Emitted when a tag is selected. */
@Output() @Output()
@ -73,7 +73,7 @@ export class TagNodeListComponent implements OnChanges, OnDestroy, OnInit {
refreshTag() { refreshTag() {
if (this.nodeId) { if (this.nodeId) {
this.tagService.getTagsByNodeId(this.nodeId).subscribe((tagPaging: TagPaging) => { this.tagService.getTagsByNodeId(this.nodeId).subscribe((tagPaging) => {
this.tagsEntries = tagPaging.list.entries; this.tagsEntries = tagPaging.list.entries;
this.results.emit(this.tagsEntries); this.results.emit(this.tagsEntries);
}); });

View File

@ -27,7 +27,7 @@ adf-version-manager {
.adf-new-version-uploader-container { .adf-new-version-uploader-container {
padding: 16px 0; padding: 16px 0;
width: 100%; width: 100%;
height: 0%; height: 0;
float: left; float: left;
position: relative; position: relative;

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-card-view-array-item-theme($theme) { @mixin adf-card-view-array-item-theme($theme) {
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-card-view-textitem-theme($theme) { @mixin adf-card-view-textitem-theme($theme) {
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);
$outline: 1px solid mat-color($alfresco-ecm-blue, A200) !default; $outline: 1px solid mat-color($alfresco-ecm-blue, A200) !default;

View File

@ -1,3 +1,4 @@
@import '~@angular/material/theming';
@mixin adf-card-view-theme($theme) { @mixin adf-card-view-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-clipboard-theme($theme) { @mixin adf-clipboard-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$config: mat-typography-config(); $config: mat-typography-config();

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-task-list-comment-list-theme($theme) { @mixin adf-task-list-comment-list-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$primaryColor: mat-color($primary, 100); $primaryColor: mat-color($primary, 100);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-task-list-comment-theme($theme) { @mixin adf-task-list-comment-theme($theme) {
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);
$header-border: 1px solid mat-color($foreground, divider); $header-border: 1px solid mat-color($foreground, divider);
@ -16,9 +18,8 @@
} }
.adf-comments-input-container { .adf-comments-input-container {
padding: 0 15px;
width: calc(100% - 30px); width: calc(100% - 30px);
padding-top: 8px; padding: 8px 15px 0;
border-bottom: $header-border; border-bottom: $header-border;
textarea { textarea {

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-datatable-theme($theme) { @mixin adf-datatable-theme($theme) {
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);
$background: map-get($theme, background); $background: map-get($theme, background);

View File

@ -23,7 +23,8 @@ import { CoreModule } from '../core.module';
import { TestBed } from '@angular/core/testing'; import { TestBed } from '@angular/core/testing';
@Component({ @Component({
selector: 'adf-text-subject' selector: 'adf-text-subject',
template: ''
}) })
class TestComponent implements NodeAllowableOperationSubject { class TestComponent implements NodeAllowableOperationSubject {
disabled: boolean = false; disabled: boolean = false;

View File

@ -34,7 +34,7 @@ export class RestoreMessageModel {
selector: '[adf-restore]' selector: '[adf-restore]'
}) })
export class NodeRestoreDirective { export class NodeRestoreDirective {
private restoreProcessStatus; private readonly restoreProcessStatus;
/** Array of deleted nodes to restore. */ /** Array of deleted nodes to restore. */
@Input('adf-restore') @Input('adf-restore')

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-form-renderer-theme($theme) { @mixin adf-form-renderer-theme($theme) {
$config: mat-typography-config(); $config: mat-typography-config();

View File

@ -1,3 +1,4 @@
@import '~@angular/material/theming';
@mixin adf-form-container-widget-theme($theme) { @mixin adf-form-container-widget-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);

View File

@ -21,7 +21,7 @@ import { FormOutcomeModel } from './form-outcome.model';
export class FormOutcomeEvent { export class FormOutcomeEvent {
private _outcome: FormOutcomeModel; private readonly _outcome: FormOutcomeModel;
private _defaultPrevented: boolean = false; private _defaultPrevented: boolean = false;
get outcome(): FormOutcomeModel { get outcome(): FormOutcomeModel {

View File

@ -30,7 +30,7 @@ export abstract class FormWidgetModel {
readonly form: any; readonly form: any;
readonly json: any; readonly json: any;
constructor(form: FormModel, json: any) { protected constructor(form: FormModel, json: any) {
this.form = form; this.form = form;
this.json = json; this.json = json;

View File

@ -38,7 +38,7 @@ export class DynamicTableModel extends FormWidgetModel {
rows: DynamicTableRow[] = []; rows: DynamicTableRow[] = [];
private _selectedRow: DynamicTableRow; private _selectedRow: DynamicTableRow;
private _validators: CellValidator[] = []; private readonly _validators: CellValidator[] = [];
get selectedRow(): DynamicTableRow { get selectedRow(): DynamicTableRow {
return this._selectedRow; return this._selectedRow;

View File

@ -1,3 +1,4 @@
@import '~@angular/material/theming';
@import '../form'; @import '../form';
@mixin adf-dynamic-table-theme($theme) { @mixin adf-dynamic-table-theme($theme) {
@ -62,9 +63,7 @@
&:focus { &:focus {
outline-offset: -1px; outline-offset: -1px;
outline-width: 1px; outline: rgb(68, 138, 255) solid 1px;
outline-color: rgb(68, 138, 255);
outline-style: solid;
} }
} }
} }

View File

@ -7,10 +7,7 @@
} }
.row-editor__invalid .row-editor__validation-summary { .row-editor__invalid .row-editor__validation-summary {
padding-left: 16px; padding: 8px 16px;
padding-right: 16px;
padding-top: 8px;
padding-bottom: 8px;
color: #d50000; color: #d50000;
visibility: visible; visibility: visible;
} }

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-form-theme($theme) { @mixin adf-form-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$accent: map-get($theme, accent); $accent: map-get($theme, accent);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-hyperlink-widget-theme($theme) { @mixin adf-hyperlink-widget-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);

View File

@ -46,6 +46,7 @@ import { TypeaheadWidgetComponent } from './typeahead/typeahead.widget';
import { UploadWidgetComponent } from './upload/upload.widget'; import { UploadWidgetComponent } from './upload/upload.widget';
import { DateTimeWidgetComponent } from './date-time/date-time.widget'; import { DateTimeWidgetComponent } from './date-time/date-time.widget';
import { JsonWidgetComponent } from './json/json.widget'; import { JsonWidgetComponent } from './json/json.widget';
import { UploadFolderWidgetComponent } from './upload-folder/upload-folder.widget';
// core // core
export * from './widget.component'; export * from './widget.component';
@ -76,6 +77,7 @@ export * from './error/error.component';
export * from './document/document.widget'; export * from './document/document.widget';
export * from './date-time/date-time.widget'; export * from './date-time/date-time.widget';
export * from './json/json.widget'; export * from './json/json.widget';
export * from './upload-folder/upload-folder.widget';
// editors (dynamic table) // editors (dynamic table)
export * from './dynamic-table/dynamic-table.widget.model'; export * from './dynamic-table/dynamic-table.widget.model';
@ -117,7 +119,8 @@ export const WIDGET_DIRECTIVES: any[] = [
DateTimeWidgetComponent, DateTimeWidgetComponent,
DateTimeEditorComponent, DateTimeEditorComponent,
JsonWidgetComponent, JsonWidgetComponent,
AmountEditorComponent AmountEditorComponent,
UploadFolderWidgetComponent
]; ];
export const MASK_DIRECTIVE: any[] = [ export const MASK_DIRECTIVE: any[] = [

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-form-people-widget-theme($theme) { @mixin adf-form-people-widget-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$background: map-get($theme, background); $background: map-get($theme, background);

View File

@ -147,7 +147,7 @@ export class UploadFolderWidgetComponent extends WidgetComponent implements OnIn
file.contentBlob = blob; file.contentBlob = blob;
this.formService.formContentClicked.next(file); this.formService.formContentClicked.next(file);
}, },
(error) => { () => {
this.logService.error('Unable to send event for file ' + file.name); this.logService.error('Unable to send event for file ' + file.name);
} }
); );

View File

@ -37,10 +37,14 @@ import { WidgetComponent } from './components/widgets/widget.component';
import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimepicker/core'; import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimepicker/core';
import { FormRendererComponent } from './components/form-renderer.component'; import { FormRendererComponent } from './components/form-renderer.component';
import { EditJsonDialogModule } from '../dialogs/edit-json/edit-json.dialog.module'; import { EditJsonDialogModule } from '../dialogs/edit-json/edit-json.dialog.module';
import { A11yModule } from '@angular/cdk/a11y';
import { FlexLayoutModule } from '@angular/flex-layout';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
A11yModule,
FlexLayoutModule,
DataTableModule, DataTableModule,
HttpClientModule, HttpClientModule,
MaterialModule, MaterialModule,

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-info-drawer-theme($theme) { @mixin adf-info-drawer-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$background: map-get($theme, background); $background: map-get($theme, background);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-header-layout-theme($theme) { @mixin adf-header-layout-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$accent: map-get($theme, accent); $accent: map-get($theme, accent);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-layout-container-theme($theme) { @mixin adf-layout-container-theme($theme) {
$background: map-get($theme, background); $background: map-get($theme, background);
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-sidebar-action-menu-theme($theme) { @mixin adf-sidebar-action-menu-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-login-dialog-panel-theme($theme) { @mixin adf-login-dialog-panel-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$accent: map-get($theme, accent); $accent: map-get($theme, accent);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-login-dialog-theme($theme) { @mixin adf-login-dialog-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$accent: map-get($theme, accent); $accent: map-get($theme, accent);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-login-theme($theme) { @mixin adf-login-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$accent: map-get($theme, accent); $accent: map-get($theme, accent);

View File

@ -120,7 +120,7 @@ export class LoginComponent implements OnInit, OnDestroy {
isError: boolean = false; isError: boolean = false;
errorMsg: string; errorMsg: string;
actualLoginStep: any = LoginSteps.Landing; actualLoginStep: any = LoginSteps.Landing;
LoginSteps: any = LoginSteps; LoginSteps = LoginSteps;
rememberMe: boolean = true; rememberMe: boolean = true;
formError: { [id: string]: string }; formError: { [id: string]: string };
minLength: number = 2; minLength: number = 2;

View File

@ -17,7 +17,7 @@
export class LoginSubmitEvent { export class LoginSubmitEvent {
private _values: any; private readonly _values: any;
private _defaultPrevented: boolean = false; private _defaultPrevented: boolean = false;
get values(): any { get values(): any {

View File

@ -15,11 +15,13 @@
* limitations under the License. * limitations under the License.
*/ */
import { Person } from '@alfresco/js-api';
export class CommentModel { export class CommentModel {
id: number; id: number;
message: string; message: string;
created: Date; created: Date;
createdBy: any; createdBy: Person;
isSelected: boolean; isSelected: boolean;
constructor(obj?: any) { constructor(obj?: any) {

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-pagination-theme($theme) { @mixin adf-pagination-theme($theme) {
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);

View File

@ -19,6 +19,7 @@ import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
import { UserProcessModel } from '../models/user-process.model'; import { UserProcessModel } from '../models/user-process.model';
import { EcmUserModel } from '../models/ecm-user.model'; import { EcmUserModel } from '../models/ecm-user.model';
import { IdentityUserModel } from '../models/identity-user.model';
@Pipe({ @Pipe({
name: 'usernameInitials' name: 'usernameInitials'
@ -28,7 +29,7 @@ export class InitialUsernamePipe implements PipeTransform {
constructor(private sanitized: DomSanitizer) { constructor(private sanitized: DomSanitizer) {
} }
transform(user: UserProcessModel | EcmUserModel, className: string = '', delimiter: string = ''): SafeHtml { transform(user: UserProcessModel | EcmUserModel | IdentityUserModel, className: string = '', delimiter: string = ''): SafeHtml {
let safeHtml: SafeHtml = ''; let safeHtml: SafeHtml = '';
if (user) { if (user) {
const initialResult = this.getInitialUserName(user.firstName, user.lastName, delimiter); const initialResult = this.getInitialUserName(user.firstName, user.lastName, delimiter);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-search-text-input-theme($theme) { @mixin adf-search-text-input-theme($theme) {
$background: map-get($theme, background); $background: map-get($theme, background);
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);

View File

@ -21,6 +21,7 @@ import { CommentModel } from '../models/comment.model';
import { AlfrescoApiService } from '../services/alfresco-api.service'; import { AlfrescoApiService } from '../services/alfresco-api.service';
import { LogService } from '../services/log.service'; import { LogService } from '../services/log.service';
import { map, catchError } from 'rxjs/operators'; import { map, catchError } from 'rxjs/operators';
import { CommentEntry } from '@alfresco/js-api';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -40,7 +41,7 @@ export class CommentContentService {
addNodeComment(nodeId: string, message: string): Observable<CommentModel> { addNodeComment(nodeId: string, message: string): Observable<CommentModel> {
return from(this.apiService.getInstance().core.commentsApi.addComment(nodeId, {content: message})) return from(this.apiService.getInstance().core.commentsApi.addComment(nodeId, {content: message}))
.pipe( .pipe(
map((response: any) => { map((response: CommentEntry) => {
return new CommentModel({ return new CommentModel({
id: response.entry.id, id: response.entry.id,
message: response.entry.content, message: response.entry.content,
@ -60,7 +61,7 @@ export class CommentContentService {
getNodeComments(nodeId: string): Observable<CommentModel[]> { getNodeComments(nodeId: string): Observable<CommentModel[]> {
return from(this.apiService.getInstance().core.commentsApi.getComments(nodeId)) return from(this.apiService.getInstance().core.commentsApi.getComments(nodeId))
.pipe( .pipe(
map((response: any) => { map((response) => {
const comments: CommentModel[] = []; const comments: CommentModel[] = [];
response.list.entries.forEach((comment: any) => { response.list.entries.forEach((comment: any) => {
comments.push(new CommentModel({ comments.push(new CommentModel({

View File

@ -41,7 +41,7 @@ export class CommentProcessService {
addTaskComment(taskId: string, message: string): Observable<CommentModel> { addTaskComment(taskId: string, message: string): Observable<CommentModel> {
return from(this.apiService.getInstance().activiti.taskApi.addTaskComment({ message: message }, taskId)) return from(this.apiService.getInstance().activiti.taskApi.addTaskComment({ message: message }, taskId))
.pipe( .pipe(
map((response: CommentModel) => { map((response) => {
return new CommentModel({ return new CommentModel({
id: response.id, id: response.id,
message: response.message, message: response.message,
@ -61,9 +61,9 @@ export class CommentProcessService {
getTaskComments(taskId: string): Observable<CommentModel[]> { getTaskComments(taskId: string): Observable<CommentModel[]> {
return from(this.apiService.getInstance().activiti.taskApi.getTaskComments(taskId)) return from(this.apiService.getInstance().activiti.taskApi.getTaskComments(taskId))
.pipe( .pipe(
map((response: any) => { map((response) => {
const comments: CommentModel[] = []; const comments: CommentModel[] = [];
response.data.forEach((comment: CommentModel) => { response.data.forEach((comment) => {
const user = new UserProcessModel(comment.createdBy); const user = new UserProcessModel(comment.createdBy);
comments.push(new CommentModel({ comments.push(new CommentModel({
id: comment.id, id: comment.id,
@ -86,9 +86,9 @@ export class CommentProcessService {
getProcessInstanceComments(processInstanceId: string): Observable<CommentModel[]> { getProcessInstanceComments(processInstanceId: string): Observable<CommentModel[]> {
return from(this.apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId)) return from(this.apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId))
.pipe( .pipe(
map((response: any) => { map((response) => {
const comments: CommentModel[] = []; const comments: CommentModel[] = [];
response.data.forEach((comment: CommentModel) => { response.data.forEach((comment) => {
const user = new UserProcessModel(comment.createdBy); const user = new UserProcessModel(comment.createdBy);
comments.push(new CommentModel({ comments.push(new CommentModel({
id: comment.id, id: comment.id,
@ -113,7 +113,7 @@ export class CommentProcessService {
return from( return from(
this.apiService.getInstance().activiti.commentsApi.addProcessInstanceComment({ message: message }, processInstanceId) this.apiService.getInstance().activiti.commentsApi.addProcessInstanceComment({ message: message }, processInstanceId)
).pipe( ).pipe(
map((response: CommentModel) => { map((response) => {
return new CommentModel({ return new CommentModel({
id: response.id, id: response.id,
message: response.message, message: response.message,

View File

@ -21,7 +21,7 @@ import { Injectable } from '@angular/core';
providedIn: 'root' providedIn: 'root'
}) })
export class DownloadService { export class DownloadService {
private saveData: Function; private readonly saveData: Function;
constructor() { constructor() {
this.saveData = (function() { this.saveData = (function() {

View File

@ -23,7 +23,7 @@ import { Injectable } from '@angular/core';
export class StorageService { export class StorageService {
private memoryStore: { [key: string]: any } = {}; private memoryStore: { [key: string]: any } = {};
private useLocalStorage: boolean = false; private readonly useLocalStorage: boolean = false;
private _prefix: string = ''; private _prefix: string = '';
get prefix() { get prefix() {

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-default-class-theme($theme) { @mixin adf-default-class-theme($theme) {
.adf-hide-small { .adf-hide-small {

View File

@ -1,3 +1,4 @@
@import '~@angular/material/theming';
@import 'variables'; @import 'variables';
@mixin adf-no-select { @mixin adf-no-select {

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-colors-theme($theme) { @mixin adf-colors-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-snackbar-theme($theme) { @mixin adf-snackbar-theme($theme) {
$warn: map-get($theme, warn); $warn: map-get($theme, warn);
$accent: map-get($theme, accent); $accent: map-get($theme, accent);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-empty-content-theme($theme) { @mixin adf-empty-content-theme($theme) {
$config: mat-typography-config(); $config: mat-typography-config();

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-error-content-theme($theme) { @mixin adf-error-content-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-toolbar-theme($theme) { @mixin adf-toolbar-theme($theme) {
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);
$adf-toolbar-height: 48px !default; $adf-toolbar-height: 48px !default;

View File

@ -16,6 +16,7 @@
*/ */
import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core'; import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
import { ThemePalette } from '@angular/material/core';
@Component({ @Component({
selector: 'adf-toolbar', selector: 'adf-toolbar',
@ -33,6 +34,6 @@ export class ToolbarComponent {
/** Toolbar color. Can be changed to empty value (default), `primary`, `accent` or `warn`. */ /** Toolbar color. Can be changed to empty value (default), `primary`, `accent` or `warn`. */
@Input() @Input()
color: string; color: ThemePalette;
} }

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-userinfo-theme($theme) { @mixin adf-userinfo-theme($theme) {
$primary: map-get($theme, primary); $primary: map-get($theme, primary);
$accent: map-get($theme, accent); $accent: map-get($theme, accent);

View File

@ -24,7 +24,7 @@ import { BpmUserService } from '../../services/bpm-user.service';
import { EcmUserService } from '../../services/ecm-user.service'; import { EcmUserService } from '../../services/ecm-user.service';
import { IdentityUserService } from '../../services/identity-user.service'; import { IdentityUserService } from '../../services/identity-user.service';
import { of, Observable } from 'rxjs'; import { of, Observable } from 'rxjs';
import { MatMenuTrigger } from '@angular/material'; import { MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material';
@Component({ @Component({
selector: 'adf-userinfo', selector: 'adf-userinfo',
@ -46,11 +46,11 @@ export class UserInfoComponent implements OnInit {
/** Custom choice for opening the menu at the bottom. Can be `before` or `after`. */ /** Custom choice for opening the menu at the bottom. Can be `before` or `after`. */
@Input() @Input()
menuPositionX: string = 'after'; menuPositionX: MenuPositionX = 'after';
/** Custom choice for opening the menu at the bottom. Can be `above` or `below`. */ /** Custom choice for opening the menu at the bottom. Can be `above` or `below`. */
@Input() @Input()
menuPositionY: string = 'below'; menuPositionY: MenuPositionY = 'below';
/** Shows/hides the username next to the user info button. */ /** Shows/hides the username next to the user info button. */
@Input() @Input()

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-image-viewer-theme($theme) { @mixin adf-image-viewer-theme($theme) {
$background: map-get($theme, background); $background: map-get($theme, background);
$viewer-image-outline: 1px solid mat-color($alfresco-ecm-blue, A200) !default; $viewer-image-outline: 1px solid mat-color($alfresco-ecm-blue, A200) !default;

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
.adf-fill-remaining-space { .adf-fill-remaining-space {
flex: 1 1 auto; flex: 1 1 auto;
} }

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-pdf-thumbnails-theme($theme) { @mixin adf-pdf-thumbnails-theme($theme) {
$background: map-get($theme, background); $background: map-get($theme, background);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-pdf-viewer-theme($theme) { @mixin adf-pdf-viewer-theme($theme) {
$background: map-get($theme, background); $background: map-get($theme, background);
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);
@ -47,12 +49,12 @@
&__container { &__container {
display: flex; display: flex;
height: 100%; height: 100%;
} }
&__content { &__content {
flex: 1 1 auto; flex: 1 1 auto;
position: relative; position: relative;
} }
.adf-loader-item { .adf-loader-item {

View File

@ -399,11 +399,11 @@
position: absolute; position: absolute;
white-space: pre; white-space: pre;
cursor: text; cursor: text;
-webkit-transform-origin: 0% 0%; -webkit-transform-origin: 0 0;
-moz-transform-origin: 0% 0%; -moz-transform-origin: 0 0;
-o-transform-origin: 0% 0%; -o-transform-origin: 0 0;
-ms-transform-origin: 0% 0%; -ms-transform-origin: 0 0;
transform-origin: 0% 0%; transform-origin: 0 0;
} }
.adf-highlight { .adf-highlight {

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-text-viewer-theme($theme) { @mixin adf-text-viewer-theme($theme) {
$background: map-get($theme, background); $background: map-get($theme, background);

View File

@ -1,3 +1,5 @@
@import '~@angular/material/theming';
@mixin adf-viewer-theme($theme) { @mixin adf-viewer-theme($theme) {
$background: map-get($theme, background); $background: map-get($theme, background);
$foreground: map-get($theme, foreground); $foreground: map-get($theme, foreground);

View File

@ -0,0 +1,24 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface DiagramElementOptions {
stroke?: string;
fillColors?: string;
fillOpacity?: string;
strokeWidth?: number;
radius?: number;
}

View File

@ -34,7 +34,8 @@ import {
FormFieldValidator, FormFieldValidator,
FormValues, FormValues,
FormModel, FormModel,
AppConfigService AppConfigService,
ContentLinkModel
} from '@alfresco/adf-core'; } from '@alfresco/adf-core';
import { FormCloudService } from '../services/form-cloud.service'; import { FormCloudService } from '../services/form-cloud.service';
import { TaskVariableCloud } from '../models/task-variable-cloud.model'; import { TaskVariableCloud } from '../models/task-variable-cloud.model';
@ -101,7 +102,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
/** Emitted when form content is clicked. */ /** Emitted when form content is clicked. */
@Output() @Output()
formContentClicked = new EventEmitter<string>(); formContentClicked = new EventEmitter<ContentLinkModel>();
protected subscriptions: Subscription[] = []; protected subscriptions: Subscription[] = [];
nodeId: string; nodeId: string;
@ -119,7 +120,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
this.formService.formContentClicked this.formService.formContentClicked
.pipe(takeUntil(this.onDestroy$)) .pipe(takeUntil(this.onDestroy$))
.subscribe((content: any) => { .subscribe((content) => {
this.formContentClicked.emit(content); this.formContentClicked.emit(content);
}); });
this.formRenderingService.setComponentTypeResolver('upload', () => AttachFileCloudWidgetComponent, true); this.formRenderingService.setComponentTypeResolver('upload', () => AttachFileCloudWidgetComponent, true);

View File

@ -88,7 +88,7 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent
this.onFileChanged(event); this.onFileChanged(event);
} }
onRemoveAttachFile(file: File | RelatedContentRepresentation) { onRemoveAttachFile(file: File | RelatedContentRepresentation | Node) {
this.removeFile(file); this.removeFile(file);
} }

View File

@ -28,7 +28,7 @@
} }
&-menu-list { &-menu-list {
padding-top: 0px!important; padding-top: 0 !important;
} }
} }
} }

View File

@ -25,6 +25,7 @@ import { fakeGlobalTask, fakeCustomSchema } from '../mock/fakeTaskResponseMock';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module'; import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
import { TaskListCloudModule } from '../task-list-cloud.module'; import { TaskListCloudModule } from '../task-list-cloud.module';
import { Person } from '@alfresco/js-api';
@Component({ @Component({
template: ` template: `
@ -34,7 +35,7 @@ import { TaskListCloudModule } from '../task-list-cloud.module';
<data-column key="created" title="ADF_CLOUD_TASK_LIST.PROPERTIES.CREATED" class="adf-hidden"></data-column> <data-column key="created" title="ADF_CLOUD_TASK_LIST.PROPERTIES.CREATED" class="adf-hidden"></data-column>
<data-column key="startedBy" title="ADF_CLOUD_TASK_LIST.PROPERTIES.CREATED" class="adf-desktop-only dw-dt-col-3 adf-ellipsis-cell"> <data-column key="startedBy" title="ADF_CLOUD_TASK_LIST.PROPERTIES.CREATED" class="adf-desktop-only dw-dt-col-3 adf-ellipsis-cell">
<ng-template let-entry="$implicit"> <ng-template let-entry="$implicit">
<div>{{getFullName(entry.row.obj.startedBy)}}</div> <div>{{getFullName(entry.row?.obj?.startedBy)}}</div>
</ng-template> </ng-template>
</data-column> </data-column>
</data-columns> </data-columns>
@ -43,7 +44,11 @@ import { TaskListCloudModule } from '../task-list-cloud.module';
class CustomTaskListComponent { class CustomTaskListComponent {
@ViewChild(TaskListCloudComponent) @ViewChild(TaskListCloudComponent)
taskList: TaskListCloudComponent; taskList: TaskListCloudComponent;
}
getFullName(person: Person): string {
return `${person.firstName} ${person.lastName}`;
}
}
@Component({ @Component({
template: ` template: `
<adf-tasklist> <adf-tasklist>

View File

@ -1,5 +1,5 @@
.adf-create-attachment { .adf-create-attachment {
display: inline-block; display: inline-block;
line-height: 0px; line-height: 0;
vertical-align: middle; vertical-align: middle;
} }

View File

@ -11,10 +11,7 @@
} }
.adf-fix-element-user-list { .adf-fix-element-user-list {
padding-top: 0; padding: 0;
padding-right: 0;
padding-bottom: 0;
padding-left: 0;
} }
.adf-search-text-header { .adf-search-text-header {

View File

@ -43,9 +43,8 @@
} }
.adf-comments-input-container { .adf-comments-input-container {
padding: 0 15px;
width: calc(100% - 30px); width: calc(100% - 30px);
padding-top: 8px; padding: 8px 15px 0;
border-bottom: $header-border; border-bottom: $header-border;
} }

View File

@ -25,7 +25,7 @@
} }
&-menu-list { &-menu-list {
padding-top: 0px!important; padding-top: 0 !important;
} }
} }
} }

View File

@ -28,7 +28,7 @@
} }
&-menu-list { &-menu-list {
padding-top: 0px!important; padding-top: 0 !important;
} }
} }
} }

View File

@ -542,7 +542,7 @@ describe('TaskListComponent', () => {
<data-column key="created" title="ADF_TASK_LIST.PROPERTIES.CREATED" class="hidden"></data-column> <data-column key="created" title="ADF_TASK_LIST.PROPERTIES.CREATED" class="hidden"></data-column>
<data-column key="startedBy" title="ADF_TASK_LIST.PROPERTIES.CREATED" class="desktop-only dw-dt-col-3 ellipsis-cell"> <data-column key="startedBy" title="ADF_TASK_LIST.PROPERTIES.CREATED" class="desktop-only dw-dt-col-3 ellipsis-cell">
<ng-template let-entry="$implicit"> <ng-template let-entry="$implicit">
<div>{{entry.row.obj.startedBy | fullName}}</div> <div>{{entry.row?.obj?.startedBy | fullName}}</div>
</ng-template> </ng-template>
</data-column> </data-column>
</data-columns> </data-columns>