TSK-998: Simple linting changes

This commit is contained in:
BVier 2020-01-14 10:36:58 +01:00 committed by Benjamin Eckstein
parent 4bcf7300b7
commit d9311f56a1
56 changed files with 83 additions and 190 deletions

View File

@ -31,31 +31,14 @@ module.exports = {
"import/no-unresolved": "off", "import/no-unresolved": "off",
"import/prefer-default-export": "off", "import/prefer-default-export": "off",
"max-classes-per-file": "off", "max-classes-per-file": "off",
"no-useless-escape": "off",
"@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-expressions": "off",
// all following rules MUST be removed (mostly autofix) // all following rules MUST be removed (mostly autofix)
"linebreak-style": ["off", "unix"], // own PR "linebreak-style": ["off", "unix"], // own PR
"no-restricted-syntax": "off", "no-restricted-syntax": "off",
"consistent-return": "off",
"no-return-assign": "off",
"prefer-destructuring": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-useless-constructor": "off",
"@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/camelcase": "off", "@typescript-eslint/camelcase": "off",
"no-multi-assign": "off",
"no-new-object": "off",
"no-plusplus": "off", "no-plusplus": "off",
"array-callback-return": "off",
"no-mixed-operators": "off",
"no-multi-str": "off",
"no-nested-ternary": "off",
"no-sequences": "off",
"no-tabs": "off",
"no-self-assign": "off",
"global-require": "off",
"no-prototype-builtins": "off", "no-prototype-builtins": "off",
} }
}; };

View File

@ -53,7 +53,7 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
setAccessItemsGroups(accessItems: Array<AccessItemWorkbasket>) { setAccessItemsGroups(accessItems: Array<AccessItemWorkbasket>) {
const AccessItemsFormGroups = accessItems.map(accessItem => this.formBuilder.group(accessItem)); const AccessItemsFormGroups = accessItems.map(accessItem => this.formBuilder.group(accessItem));
AccessItemsFormGroups.map(accessItemGroup => { AccessItemsFormGroups.forEach(accessItemGroup => {
accessItemGroup.controls.accessId.setValidators(Validators.required); accessItemGroup.controls.accessId.setValidators(Validators.required);
for (const key of Object.keys(accessItemGroup.controls)) { for (const key of Object.keys(accessItemGroup.controls)) {
accessItemGroup.controls[key].disable(); accessItemGroup.controls[key].disable();

View File

@ -1,4 +1,3 @@
// tslint:enable:max-line-length
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@ -71,5 +70,3 @@ const DECLARATIONS = [
}) })
export class AdministrationModule { export class AdministrationModule {
} }
// tslint:enable:max-line-length

View File

@ -13,9 +13,7 @@ import { ClassificationDefinition } from 'app/models/classification-definition';
import { LinksClassification } from 'app/models/links-classfication'; import { LinksClassification } from 'app/models/links-classfication';
import { Pair } from 'app/models/pair'; import { Pair } from 'app/models/pair';
// tslint:disable:max-line-length
import { ClassificationCategoriesService } from 'app/shared/services/classifications/classification-categories.service'; import { ClassificationCategoriesService } from 'app/shared/services/classifications/classification-categories.service';
// tslint:enable:max-line-length
import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-detail.service'; import { MasterAndDetailService } from 'app/services/masterAndDetail/master-and-detail.service';
import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service'; import { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.service';
import { ClassificationsService } from 'app/shared/services/classifications/classifications.service'; import { ClassificationsService } from 'app/shared/services/classifications/classifications.service';

View File

@ -18,9 +18,7 @@ import { AlertService } from 'app/services/alert/alert.service';
import { TreeService } from 'app/services/tree/tree.service'; import { TreeService } from 'app/services/tree/tree.service';
import { RemoveConfirmationService } from 'app/services/remove-confirmation/remove-confirmation.service'; import { RemoveConfirmationService } from 'app/services/remove-confirmation/remove-confirmation.service';
// tslint:disable:max-line-length
import { ClassificationCategoriesService } from 'app/shared/services/classifications/classification-categories.service'; import { ClassificationCategoriesService } from 'app/shared/services/classifications/classification-categories.service';
// tslint:enable:max-line-length
import { DomainService } from 'app/services/domain/domain.service'; import { DomainService } from 'app/services/domain/domain.service';
import { Pair } from 'app/models/pair'; import { Pair } from 'app/models/pair';
import { NgForm } from '@angular/forms'; import { NgForm } from '@angular/forms';
@ -112,7 +110,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.fillClassificationInformation(this.classification ? this.classification : new ClassificationDefinition()); this.fillClassificationInformation(this.classification ? this.classification : new ClassificationDefinition());
} }
if (!this.classification || this.classification.classificationId !== id && id) { if (!this.classification || (this.classification.classificationId !== id && id)) {
this.selectClassification(id); this.selectClassification(id);
} }
}); });
@ -128,7 +126,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
// TSK-891 fix: The property is already set and is crucial value // TSK-891 fix: The property is already set and is crucial value
// Wrapped with an if to set a default if not already set. // Wrapped with an if to set a default if not already set.
if (!this.classification.category) { if (!this.classification.category) {
this.classification.category = categories[0]; [this.classification.category] = categories;
} }
} }
}); });
@ -224,18 +222,17 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
} }
private async selectClassification(id: string) { private async selectClassification(id: string) {
if (this.classificationIsAlreadySelected()) { if (!this.classificationIsAlreadySelected()) {
return true; this.requestInProgress = true;
const classification = await this.classificationsService.getClassification(id);
this.fillClassificationInformation(classification);
this.classificationsService.selectClassification(classification);
this.requestInProgress = false;
} }
this.requestInProgress = true;
const classification = await this.classificationsService.getClassification(id);
this.fillClassificationInformation(classification);
this.classificationsService.selectClassification(classification);
this.requestInProgress = false;
} }
private classificationIsAlreadySelected(): boolean { private classificationIsAlreadySelected(): boolean {
if (this.action === ACTION.CREATE && this.classification) { return true; } return this.action === ACTION.CREATE && !!this.classification;
} }
private fillClassificationInformation(classificationSelected: ClassificationDefinition) { private fillClassificationInformation(classificationSelected: ClassificationDefinition) {
@ -280,7 +277,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.generalModalService.triggerMessage( this.generalModalService.triggerMessage(
new MessageModal('There is no classification selected', 'Please check if you are creating a classification') new MessageModal('There is no classification selected', 'Please check if you are creating a classification')
); );
return false; return;
} }
this.requestInProgressService.setRequestInProgress(true); this.requestInProgressService.setRequestInProgress(true);
this.treeService.setRemovedNodeId(this.classification.classificationId); this.treeService.setRemovedNodeId(this.classification.classificationId);

View File

@ -38,7 +38,7 @@ export class ImportExportComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.domainService.getDomains().subscribe( this.domainService.getDomains().subscribe(
data => this.domains = data data => { this.domains = data; }
); );
} }
@ -54,23 +54,24 @@ export class ImportExportComponent implements OnInit {
const file = this.selectedFileInput.nativeElement.files[0]; const file = this.selectedFileInput.nativeElement.files[0];
const formdata = new FormData(); const formdata = new FormData();
const ajax = new XMLHttpRequest(); const ajax = new XMLHttpRequest();
if (!this.checkFormatFile(file)) { return false; } if (this.checkFormatFile(file)) {
formdata.append('file', file); formdata.append('file', file);
ajax.upload.addEventListener('progress', this.progressHandler.bind(this), false); ajax.upload.addEventListener('progress', this.progressHandler.bind(this), false);
ajax.addEventListener('load', this.resetProgress.bind(this), false); ajax.addEventListener('load', this.resetProgress.bind(this), false);
ajax.addEventListener('error', this.onFailedResponse.bind(this, ajax), false); ajax.addEventListener('error', this.onFailedResponse.bind(this, ajax), false);
ajax.onreadystatechange = this.onReadyStateChangeHandler.bind(this, ajax); ajax.onreadystatechange = this.onReadyStateChangeHandler.bind(this, ajax);
if (this.currentSelection === TaskanaType.WORKBASKETS) { if (this.currentSelection === TaskanaType.WORKBASKETS) {
ajax.open('POST', `${environment.taskanaRestUrl}/v1/workbasket-definitions`); ajax.open('POST', `${environment.taskanaRestUrl}/v1/workbasket-definitions`);
} else { } else {
ajax.open('POST', `${environment.taskanaRestUrl}/v1/classification-definitions`); ajax.open('POST', `${environment.taskanaRestUrl}/v1/classification-definitions`);
}
if (!environment.production) {
ajax.setRequestHeader('Authorization', 'Basic YWRtaW46YWRtaW4=');
}
ajax.send(formdata);
this.uploadservice.isInUse = true;
this.uploadservice.setCurrentProgressValue(1);
} }
if (!environment.production) {
ajax.setRequestHeader('Authorization', 'Basic YWRtaW46YWRtaW4=');
}
ajax.send(formdata);
this.uploadservice.isInUse = true;
this.uploadservice.setCurrentProgressValue(1);
} }
progressHandler(event) { progressHandler(event) {
@ -79,7 +80,7 @@ export class ImportExportComponent implements OnInit {
} }
private checkFormatFile(file): boolean { private checkFormatFile(file): boolean {
const ending = file.name.match(/\.([^\.]+)$/)[1]; const ending = file.name.match(/\.([^.]+)$/)[1];
let check = false; let check = false;
switch (ending) { switch (ending) {
case 'json': case 'json':
@ -120,8 +121,8 @@ export class ImportExportComponent implements OnInit {
} }
private onFailedResponse(event) { private onFailedResponse(event) {
this.errorHandler('Upload failed', 'The upload didn\'t proceed sucessfully. \ this.errorHandler('Upload failed', 'The upload didn\'t proceed sucessfully. \n'
\n Probably the uploaded file exceeded the maximum file size of 10 MB'); + 'Probably the uploaded file exceeded the maximum file size of 10 MB');
} }
private errorHandler(title = 'Import was not successful', message) { private errorHandler(title = 'Import was not successful', message) {

View File

@ -23,16 +23,17 @@ export class IconTypeComponent implements OnInit {
return new Map([['PERSONAL', 'Personal'], ['GROUP', 'Group'], ['CLEARANCE', 'Clearance'], ['TOPIC', 'Topic']]); return new Map([['PERSONAL', 'Personal'], ['GROUP', 'Group'], ['CLEARANCE', 'Clearance'], ['TOPIC', 'Topic']]);
} }
constructor() { }
ngOnInit() { ngOnInit() {
} }
getIconPath(type: string) { getIconPath(type: string) {
return type === 'PERSONAL' ? 'user.svg' switch (type) {
: type === 'GROUP' ? 'users.svg' case 'PERSONAL': return 'user.svg';
: type === 'TOPIC' ? 'topic.svg' case 'GROUP': return 'users.svg';
: type === 'CLEARANCE' ? 'clearance.svg' : 'asterisk.svg'; case 'TOPIC': return 'topic.svg';
case 'CLEARANCE': return 'clearance.svg';
default: return 'asterisk.svg';
}
} }
} }

View File

@ -5,8 +5,6 @@ import { Subject, Observable } from 'rxjs';
export class ImportExportService { export class ImportExportService {
public importingFinished = new Subject<boolean>(); public importingFinished = new Subject<boolean>();
constructor() { }
setImportingFinished(value: boolean) { setImportingFinished(value: boolean) {
this.importingFinished.next(value); this.importingFinished.next(value);
} }

View File

@ -13,8 +13,6 @@ export class SavingWorkbasketService {
public distributionTargetsSavingInformation = new Subject<SavingInformation>(); public distributionTargetsSavingInformation = new Subject<SavingInformation>();
public accessItemsSavingInformation = new Subject<SavingInformation>(); public accessItemsSavingInformation = new Subject<SavingInformation>();
constructor() { }
triggerDistributionTargetSaving(distributionTargetInformation: SavingInformation) { triggerDistributionTargetSaving(distributionTargetInformation: SavingInformation) {
this.distributionTargetsSavingInformation.next(distributionTargetInformation); this.distributionTargetsSavingInformation.next(distributionTargetInformation);
} }

View File

@ -61,8 +61,8 @@ describe('AccessItemsComponent', () => {
), ),
new Links({ href: 'someurl' }) new Links({ href: 'someurl' })
))); )));
spyOn(workbasketService, 'updateWorkBasketAccessItem').and.returnValue(of(true)), spyOn(workbasketService, 'updateWorkBasketAccessItem').and.returnValue(of(true));
spyOn(alertService, 'triggerAlert').and.returnValue(of(true)), spyOn(alertService, 'triggerAlert').and.returnValue(of(true));
debugElement = fixture.debugElement.nativeElement; debugElement = fixture.debugElement.nativeElement;
accessIdsService = TestBed.get(AccessIdsService); accessIdsService = TestBed.get(AccessIdsService);
spyOn(accessIdsService, 'getAccessItemsInformation').and.returnValue(of(new Array<string>( spyOn(accessIdsService, 'getAccessItemsInformation').and.returnValue(of(new Array<string>(

View File

@ -69,7 +69,7 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
setAccessItemsGroups(accessItems: Array<WorkbasketAccessItems>) { setAccessItemsGroups(accessItems: Array<WorkbasketAccessItems>) {
const AccessItemsFormGroups = accessItems.map(accessItem => this.formBuilder.group(accessItem)); const AccessItemsFormGroups = accessItems.map(accessItem => this.formBuilder.group(accessItem));
AccessItemsFormGroups.map(accessItemGroup => { AccessItemsFormGroups.forEach(accessItemGroup => {
accessItemGroup.controls.accessId.setValidators(Validators.required); accessItemGroup.controls.accessId.setValidators(Validators.required);
}); });
const AccessItemsFormArray = this.formBuilder.array(AccessItemsFormGroups); const AccessItemsFormArray = this.formBuilder.array(AccessItemsFormGroups);

View File

@ -147,7 +147,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
this.onRequest(false, dualListFilter.side); this.onRequest(false, dualListFilter.side);
this.workbasketFilterSubscription = this.workbasketService.getWorkBasketsSummary(true, '', '', '', this.workbasketFilterSubscription = this.workbasketService.getWorkBasketsSummary(true, '', '', '',
dualListFilter.filterBy.filterParams.name, dualListFilter.filterBy.filterParams.description, '', dualListFilter.filterBy.filterParams.name, dualListFilter.filterBy.filterParams.description, '',
dualListFilter.filterBy.filterParams.owner, dualListFilter.filterBy.filterParams.type, '', dualListFilter.filterBy.filterParams.owner, dualListFilter.filterBy.filterParams.type, '',
dualListFilter.filterBy.filterParams.key, '', true).subscribe(resultList => { dualListFilter.filterBy.filterParams.key, '', true).subscribe(resultList => {
(dualListFilter.side === Side.RIGHT) (dualListFilter.side === Side.RIGHT)
? this.distributionTargetsRight = (resultList.workbaskets) ? this.distributionTargetsRight = (resultList.workbaskets)

View File

@ -186,7 +186,7 @@ implements OnInit, OnChanges, OnDestroy {
this.beforeRequest(); this.beforeRequest();
if (!this.workbasket.workbasketId) { if (!this.workbasket.workbasketId) {
this.postNewWorkbasket(); this.postNewWorkbasket();
return true; return;
} }
this.workbasketSubscription = this.workbasketService this.workbasketSubscription = this.workbasketService

View File

@ -134,15 +134,15 @@ describe('WorkbasketListComponent', () => {
}); });
// it('should have two workbasketsummary rows created with the second one selected.', fakeAsync(() => { // it('should have two workbasketsummary rows created with the second one selected.', fakeAsync(() => {
// tick(0); // tick(0);
// fixture.detectChanges(); // fixture.detectChanges();
// fixture.whenStable().then(() => { // fixture.whenStable().then(() => {
// expect(debugElement.querySelectorAll('#wb-list-container > li').length).toBe(3); // expect(debugElement.querySelectorAll('#wb-list-container > li').length).toBe(3);
// expect(debugElement.querySelectorAll('#wb-list-container > li')[1].getAttribute('class')) // expect(debugElement.querySelectorAll('#wb-list-container > li')[1].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted'); // .toBe('list-group-item ng-star-inserted');
// expect(debugElement.querySelectorAll('#wb-list-container > li')[2].getAttribute('class')) // expect(debugElement.querySelectorAll('#wb-list-container > li')[2].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted active'); // .toBe('list-group-item ng-star-inserted active');
// }) // })
// //
// })); // }));

View File

@ -1,4 +1,3 @@
// tslint:disable:max-line-length
/** /**
* Modules * Modules
*/ */
@ -113,5 +112,3 @@ export function startupServiceFactory(startupService: StartupService): () => Pro
}) })
export class AppModule { export class AppModule {
} }
// tslint:enable:max-line-length

View File

@ -134,13 +134,12 @@ export class TaskQueryComponent implements OnInit {
} }
changeOrderBy(key: string) { changeOrderBy(key: string) {
if (!this.filterFieldsToAllowQuerying(key)) { if (this.filterFieldsToAllowQuerying(key)) {
return null; if (this.orderBy.sortBy === key) {
this.orderBy.sortDirection = this.toggleSortDirection(this.orderBy.sortDirection);
}
this.orderBy.sortBy = key;
} }
if (this.orderBy.sortBy === key) {
this.orderBy.sortDirection = this.toggleSortDirection(this.orderBy.sortDirection);
}
this.orderBy.sortBy = key;
} }
openDetails(key: string, val: string) { openDetails(key: string, val: string) {
@ -184,13 +183,8 @@ export class TaskQueryComponent implements OnInit {
false false
).subscribe(taskQueryResource => { ).subscribe(taskQueryResource => {
this.requestInProgressService.setRequestInProgress(false); this.requestInProgressService.setRequestInProgress(false);
if (!taskQueryResource.taskHistoryEvents) { this.taskQueryResource = taskQueryResource.taskHistoryEvents ? taskQueryResource : null;
this.taskQuery = null; this.taskQuery = taskQueryResource.taskHistoryEvents ? taskQueryResource.taskHistoryEvents : null;
this.taskQueryResource = null;
return null;
}
this.taskQueryResource = taskQueryResource;
this.taskQuery = taskQueryResource.taskHistoryEvents;
}); });
} }
@ -206,8 +200,8 @@ export class TaskQueryComponent implements OnInit {
const unusedHeight = 300; const unusedHeight = 300;
const totalHeight = window.innerHeight; const totalHeight = window.innerHeight;
const cards = Math.round((totalHeight - (unusedHeight)) / rowHeight); const cards = Math.round((totalHeight - (unusedHeight)) / rowHeight);
TaskanaQueryParameters.page ? TaskanaQueryParameters.page = TaskanaQueryParameters.page : TaskanaQueryParameters.page = 1; TaskanaQueryParameters.page = TaskanaQueryParameters.page ? TaskanaQueryParameters.page : 1;
cards > 0 ? TaskanaQueryParameters.pageSize = cards : TaskanaQueryParameters.pageSize = 1; TaskanaQueryParameters.pageSize = cards > 0 ? cards : 1;
} }
updateDate($event: string) { updateDate($event: string) {

View File

@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-useless-constructor */
import { WorkbasketAccessItems } from './workbasket-access-items'; import { WorkbasketAccessItems } from './workbasket-access-items';
import { Workbasket } from './workbasket'; import { Workbasket } from './workbasket';

View File

@ -12,9 +12,6 @@ export class ReportComponent implements OnInit {
@Input() @Input()
reportData: ReportData; reportData: ReportData;
constructor() {
}
ngOnInit(): void { ngOnInit(): void {
} }

View File

@ -40,7 +40,7 @@ export class RestConnectorService {
getChartData(source: ReportData): Array<ChartData> { getChartData(source: ReportData): Array<ChartData> {
return source.rows.map(row => { return source.rows.map(row => {
const rowData = new ChartData(); const rowData = new ChartData();
rowData.label = row.desc[0]; [rowData.label] = row.desc;
rowData.data = row.cells; rowData.data = row.cells;
return rowData; return rowData;
}); });

View File

@ -14,9 +14,6 @@ export class MonitorWorkbasketQuerySwitcherComponent implements OnInit {
monitorQueryPlannedDateType = MonitorQueryType.PlannedDate; monitorQueryPlannedDateType = MonitorQueryType.PlannedDate;
monitorQueryDueDateType = MonitorQueryType.DueDate; monitorQueryDueDateType = MonitorQueryType.DueDate;
constructor() {
}
ngOnInit() { ngOnInit() {
this.selectedChartType = MonitorQueryType.DueDate; this.selectedChartType = MonitorQueryType.DueDate;
this.queryChanged.emit(MonitorQueryType.DueDate); this.queryChanged.emit(MonitorQueryType.DueDate);

View File

@ -12,9 +12,6 @@ export class MonitorWorkbasketsComponent implements OnInit {
showMonitorQueryPlannedDate: Boolean; showMonitorQueryPlannedDate: Boolean;
showMonitorQueryDueDate: Boolean; showMonitorQueryDueDate: Boolean;
constructor() {
}
ngOnInit() { ngOnInit() {
} }

View File

@ -6,8 +6,6 @@ import { AlertModel } from 'app/models/alert';
export class AlertService { export class AlertService {
public alertTriggered = new Subject<AlertModel>(); public alertTriggered = new Subject<AlertModel>();
constructor() { }
triggerAlert(alert: AlertModel) { triggerAlert(alert: AlertModel) {
this.alertTriggered.next(alert); this.alertTriggered.next(alert);
} }

View File

@ -2,6 +2,8 @@ import { TestBed, inject } from '@angular/core/testing';
import { CustomFieldsService } from './custom-fields.service'; import { CustomFieldsService } from './custom-fields.service';
const json = require('./taskana-customization-test.json');
describe('CustomFieldsService', () => { describe('CustomFieldsService', () => {
beforeEach(() => { beforeEach(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
@ -21,7 +23,6 @@ describe('CustomFieldsService', () => {
})); }));
it('should take default icon path in merge', inject([CustomFieldsService], (service: CustomFieldsService) => { it('should take default icon path in merge', inject([CustomFieldsService], (service: CustomFieldsService) => {
const json = require('./taskana-customization-test.json');
service.initCustomFields('EN', json); service.initCustomFields('EN', json);
const categoriesDefault = json.EN.classifications.categories; const categoriesDefault = json.EN.classifications.categories;
const categoriesData = { const categoriesData = {
@ -36,7 +37,6 @@ describe('CustomFieldsService', () => {
})); }));
it('should take merge icon path', inject([CustomFieldsService], (service: CustomFieldsService) => { it('should take merge icon path', inject([CustomFieldsService], (service: CustomFieldsService) => {
const json = require('./taskana-customization-test.json');
service.initCustomFields('EN', json); service.initCustomFields('EN', json);
const categoriesData = { DEFAULT: 'assets/icons/categories/default.svg' }; const categoriesData = { DEFAULT: 'assets/icons/categories/default.svg' };
const result = { const result = {

View File

@ -4,7 +4,6 @@ import { CustomField } from '../../models/customField';
@Injectable() @Injectable()
export class CustomFieldsService { export class CustomFieldsService {
private customizedFields: any = {}; private customizedFields: any = {};
constructor() { }
initCustomFields(language: string = 'EN', jsonFile: any) { initCustomFields(language: string = 'EN', jsonFile: any) {
this.customizedFields = jsonFile[language]; this.customizedFields = jsonFile[language];
@ -64,7 +63,7 @@ export class CustomFieldsService {
} }
private mergeKeys(defaultObject: Object, newObject: Object) { private mergeKeys(defaultObject: Object, newObject: Object) {
const value = new Object(); const value = {};
for (const item of Object.keys(defaultObject)) { for (const item of Object.keys(defaultObject)) {
if (!value[item]) { if (!value[item]) {

View File

@ -6,9 +6,6 @@ export class DomainServiceMock {
private domainSelectedValue; private domainSelectedValue;
private domainSelected = new BehaviorSubject<string>('DOMAIN_A'); private domainSelected = new BehaviorSubject<string>('DOMAIN_A');
constructor() {
}
// GET // GET
getDomains(): Observable<string[]> { getDomains(): Observable<string[]> {
return of<string[]>([]); return of<string[]>([]);

View File

@ -110,5 +110,6 @@ export class DomainService {
} if (this.router.url.indexOf('classifications') !== -1) { } if (this.router.url.indexOf('classifications') !== -1) {
return 'taskana/administration/classifications'; return 'taskana/administration/classifications';
} }
return '';
} }
} }

View File

@ -6,8 +6,6 @@ import { MessageModal } from 'app/models/message-modal';
export class GeneralModalService { export class GeneralModalService {
private messageTriggered = new Subject<MessageModal>(); private messageTriggered = new Subject<MessageModal>();
constructor() { }
triggerMessage(message: MessageModal) { triggerMessage(message: MessageModal) {
this.messageTriggered.next(message); this.messageTriggered.next(message);
} }

View File

@ -5,9 +5,6 @@ import { Observable, BehaviorSubject } from 'rxjs';
export class MasterAndDetailService { export class MasterAndDetailService {
public showDetail = new BehaviorSubject<boolean>(false); public showDetail = new BehaviorSubject<boolean>(false);
constructor() { }
setShowDetail(newValue: boolean) { setShowDetail(newValue: boolean) {
this.showDetail.next(newValue); this.showDetail.next(newValue);
} }

View File

@ -9,8 +9,6 @@ export class OrientationService {
private currentOrientation; private currentOrientation;
public orientation = new BehaviorSubject<Orientation>(this.currentOrientation); public orientation = new BehaviorSubject<Orientation>(this.currentOrientation);
constructor() { }
onResize() { onResize() {
const orientation = this.detectOrientation(); const orientation = this.detectOrientation();
if (orientation !== this.currentOrientation) { if (orientation !== this.currentOrientation) {
@ -36,7 +34,7 @@ export class OrientationService {
calculateNumberItemsList(heightContainer: number, cardHeight: number, unusedHeight: number, doubleList = false): number { calculateNumberItemsList(heightContainer: number, cardHeight: number, unusedHeight: number, doubleList = false): number {
let cards = Math.round((heightContainer - unusedHeight) / cardHeight); let cards = Math.round((heightContainer - unusedHeight) / cardHeight);
if (doubleList && window.innerWidth < 992) { cards = Math.floor(cards / 2); } if (doubleList && window.innerWidth < 992) { cards = Math.floor(cards / 2); }
cards > 0 ? TaskanaQueryParameters.pageSize = cards : TaskanaQueryParameters.pageSize = 1; TaskanaQueryParameters.pageSize = cards > 0 ? cards : 1;
return cards; return cards;
} }

View File

@ -6,8 +6,6 @@ export class RemoveConfirmationService {
private removeConfirmationCallbackSubject = new Subject<{ callback: Function, message: string }>(); private removeConfirmationCallbackSubject = new Subject<{ callback: Function, message: string }>();
private removeConfirmationCallback: Function; private removeConfirmationCallback: Function;
constructor() { }
setRemoveConfirmation(callback: Function, message: string) { setRemoveConfirmation(callback: Function, message: string) {
this.removeConfirmationCallback = callback; this.removeConfirmationCallback = callback;
this.removeConfirmationCallbackSubject.next({ callback, message }); this.removeConfirmationCallbackSubject.next({ callback, message });

View File

@ -5,8 +5,6 @@ import { Subject, Observable } from 'rxjs';
export class RequestInProgressService { export class RequestInProgressService {
public requestInProgressTriggered = new Subject<boolean>(); public requestInProgressTriggered = new Subject<boolean>();
constructor() { }
setRequestInProgress(value: boolean) { setRequestInProgress(value: boolean) {
setTimeout(() => this.requestInProgressTriggered.next(value), 0); setTimeout(() => this.requestInProgressTriggered.next(value), 0);
} }

View File

@ -38,10 +38,6 @@ export class TaskanaEngineServiceMock {
} }
private findRole(roles2Find: Array<string>) { private findRole(roles2Find: Array<string>) {
return this.currentUserInfo.roles.find(role => roles2Find.some(roleLookingFor => { return this.currentUserInfo.roles.find(role => roles2Find.some(roleLookingFor => role === roleLookingFor));
if (role === roleLookingFor) {
return true;
}
}));
} }
} }

View File

@ -48,10 +48,6 @@ export class TaskanaEngineService {
} }
private findRole(roles2Find: Array<string>) { private findRole(roles2Find: Array<string>) {
return this.currentUserInfo.roles.find(role => roles2Find.some(roleLookingFor => { return this.currentUserInfo.roles.find(role => roles2Find.some(roleLookingFor => role === roleLookingFor));
if (role === roleLookingFor) {
return true;
}
}));
} }
} }

View File

@ -4,7 +4,6 @@ import { Injectable } from '@angular/core';
export class TitlesService { export class TitlesService {
titles = new Map<number, string>(); titles = new Map<number, string>();
customizedTitles: any = {}; customizedTitles: any = {};
constructor() { }
initTitles(language: string = 'EN', jsonFile: any) { initTitles(language: string = 'EN', jsonFile: any) {
this.titles = jsonFile[language]; this.titles = jsonFile[language];

View File

@ -5,8 +5,6 @@ import { Subject } from 'rxjs';
export class TreeService { export class TreeService {
public removedNodeId = new Subject<string>(); public removedNodeId = new Subject<string>();
constructor() { }
setRemovedNodeId(value: string) { setRemovedNodeId(value: string) {
this.removedNodeId.next(value); this.removedNodeId.next(value);
} }

View File

@ -18,8 +18,6 @@ export class ClassificationTypesSelectorComponent implements OnInit {
@Output() @Output()
classificationTypeChanged = new EventEmitter<string>(); classificationTypeChanged = new EventEmitter<string>();
constructor() { }
ngOnInit() { ngOnInit() {
} }

View File

@ -12,9 +12,6 @@ export class DropdownComponent implements OnInit {
@Input() list: Array<any>; @Input() list: Array<any>;
@Output() performClassification = new EventEmitter<any>(); @Output() performClassification = new EventEmitter<any>();
constructor() {
}
ngOnInit(): void { ngOnInit(): void {
} }

View File

@ -17,8 +17,6 @@ export class FieldErrorDisplayComponent implements OnInit {
@Input() @Input()
validationTrigger: boolean; validationTrigger: boolean;
constructor() { }
ngOnInit() { ngOnInit() {
} }
} }

View File

@ -20,8 +20,6 @@ export class GeneralMessageModalComponent implements OnChanges {
@ViewChild('generalModal', { static: true }) @ViewChild('generalModal', { static: true })
private modal; private modal;
constructor() { }
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
if (this.message) { if (this.message) {
$(this.modal.nativeElement).modal('toggle'); $(this.modal.nativeElement).modal('toggle');

View File

@ -52,9 +52,6 @@ export class NumberPickerComponent implements OnInit, ControlValueAccessor {
this.onTouchedCallback = fn; this.onTouchedCallback = fn;
} }
constructor() {
}
ngOnInit() { ngOnInit() {
} }

View File

@ -33,8 +33,6 @@ export class PaginationComponent implements OnChanges {
pageSelected = 1; pageSelected = 1;
maxPagesAvailable = 8; maxPagesAvailable = 8;
constructor() {}
ngOnChanges(changes: SimpleChanges): void { ngOnChanges(changes: SimpleChanges): void {
if (changes.page && changes.page.currentValue) { if (changes.page && changes.page.currentValue) {
this.pageSelected = changes.page.currentValue.number; this.pageSelected = changes.page.currentValue.number;
@ -44,7 +42,8 @@ export class PaginationComponent implements OnChanges {
changeToPage(page) { changeToPage(page) {
if (page < 1) { if (page < 1) {
page = this.pageSelected = 1; this.pageSelected = 1;
page = this.pageSelected;
} }
if (page > this.page.totalPages) { if (page > this.page.totalPages) {
page = this.page.totalPages; page = this.page.totalPages;

View File

@ -11,7 +11,7 @@ export class SelectWorkBasketPipe implements PipeTransform {
for (let index = originArray.length - 1; index >= 0; index--) { for (let index = originArray.length - 1; index >= 0; index--) {
if ((arg1 && !selectionArray.some(elementToRemove => originArray[index].workbasketId === elementToRemove.workbasketId)) if ((arg1 && !selectionArray.some(elementToRemove => originArray[index].workbasketId === elementToRemove.workbasketId))
|| !arg1 && selectionArray.some(elementToRemove => originArray[index].workbasketId === elementToRemove.workbasketId)) { || (!arg1 && selectionArray.some(elementToRemove => originArray[index].workbasketId === elementToRemove.workbasketId))) {
originArray.splice(index, 1); originArray.splice(index, 1);
} }
} }

View File

@ -16,8 +16,6 @@ export class ProgressBarComponent implements OnInit, OnChanges {
inProgress = false; inProgress = false;
constructor() { }
ngOnInit() { ngOnInit() {
} }

View File

@ -39,13 +39,14 @@ export class AccessIdsService {
return this.accessItemsRef; return this.accessItemsRef;
} }
return this.accessItemsRef = this.httpClient.get<AccessItemsWorkbasketResource>(encodeURI( this.accessItemsRef = this.httpClient.get<AccessItemsWorkbasketResource>(encodeURI(
`${environment.taskanaRestUrl}/v1/workbasket-access-items/${TaskanaQueryParameters.getQueryParameters( `${environment.taskanaRestUrl}/v1/workbasket-access-items/${TaskanaQueryParameters.getQueryParameters(
this.accessIdsParameters(sortModel, this.accessIdsParameters(sortModel,
accessIds, accessIds,
accessIdLike, workbasketKeyLike) accessIdLike, workbasketKeyLike)
)}` )}`
)); ));
return this.accessItemsRef;
} }
removeAccessItemsPermissions(accessId: string) { removeAccessItemsPermissions(accessId: string) {

View File

@ -14,7 +14,7 @@ export class ClassificationCategoriesService {
private urlCategories = `${this.mainUrl}/v1/classification-categories`; private urlCategories = `${this.mainUrl}/v1/classification-categories`;
private param = '/?type='; private param = '/?type=';
private dataObsCategories$ = new ReplaySubject<Array<string>>(1); private dataObsCategories$ = new ReplaySubject<Array<string>>(1);
private categoriesObject = new Object(); private categoriesObject = {};
private missingIcon = 'assets/icons/categories/missing-icon.svg'; private missingIcon = 'assets/icons/categories/missing-icon.svg';
private type = 'UNKNOW'; private type = 'UNKNOW';
@ -56,7 +56,7 @@ export class ClassificationCategoriesService {
} }
private getDefaultCategoryMap(categoryList: Array<string>): Object { private getDefaultCategoryMap(categoryList: Array<string>): Object {
const defaultCategoryMap = new Object(); const defaultCategoryMap = {};
categoryList.forEach(element => { categoryList.forEach(element => {
defaultCategoryMap[element] = `assets/icons/categories/${element.toLowerCase()}.svg`; defaultCategoryMap[element] = `assets/icons/categories/${element.toLowerCase()}.svg`;
}); });

View File

@ -18,7 +18,7 @@ export class FormsValidatorService {
public async validateFormInformation(form: NgForm, toogleValidationMap: Map<any, boolean>): Promise<any> { public async validateFormInformation(form: NgForm, toogleValidationMap: Map<any, boolean>): Promise<any> {
let validSync = true; let validSync = true;
if (!form) { if (!form) {
return; return false;
} }
const forFieldsPromise = new Promise((resolve, reject) => { const forFieldsPromise = new Promise((resolve, reject) => {
for (const control in form.form.controls) { for (const control in form.form.controls) {

View File

@ -8,8 +8,6 @@ export class UploadService {
private currentProgressValue = new Subject<number>(); private currentProgressValue = new Subject<number>();
public isInUse = false; public isInUse = false;
constructor() { }
setCurrentProgressValue(value: number) { setCurrentProgressValue(value: number) {
this.currentProgressValue.next(value); this.currentProgressValue.next(value);
} }

View File

@ -15,9 +15,6 @@ export class SortComponent implements OnInit {
sort: SortingModel = new SortingModel(); sort: SortingModel = new SortingModel();
constructor() {
}
ngOnInit() { ngOnInit() {
this.sort.sortBy = this.defaultSortBy; this.sort.sortBy = this.defaultSortBy;
} }

View File

@ -13,7 +13,6 @@ import { LinksClassification } from '../../models/links-classfication';
import { ClassificationCategoriesService } from '../services/classifications/classification-categories.service'; import { ClassificationCategoriesService } from '../services/classifications/classification-categories.service';
import { ClassificationsService } from '../services/classifications/classifications.service'; import { ClassificationsService } from '../services/classifications/classifications.service';
// tslint:disable:component-selector
@Component({ @Component({
selector: 'tree-root', selector: 'tree-root',
template: '' template: ''
@ -28,8 +27,6 @@ class TreeVendorComponent {
}; };
} }
// tslint:enable:component-selector
describe('TaskanaTreeComponent', () => { describe('TaskanaTreeComponent', () => {
let component: TaskanaTreeComponent; let component: TaskanaTreeComponent;
let fixture: ComponentFixture<TaskanaTreeComponent>; let fixture: ComponentFixture<TaskanaTreeComponent>;

View File

@ -124,7 +124,7 @@ export class TypeAheadComponent implements OnInit, ControlValueAccessor {
} }
setTyping(value) { setTyping(value) {
if (this.disable) { return true; } if (this.disable) { return; }
if (value) { if (value) {
setTimeout(() => { setTimeout(() => {
this.inputTypeAhead.nativeElement.focus(); this.inputTypeAhead.nativeElement.focus();

View File

@ -15,17 +15,15 @@ export class CodeComponent implements OnInit {
@HostListener('window:keyup', ['$event']) @HostListener('window:keyup', ['$event'])
keyEvent(event: KeyboardEvent) { keyEvent(event: KeyboardEvent) {
if (this.bufferKeys === '') { if (this.bufferKeys === '') {
setTimeout(() => this.bufferKeys = '', 5000); setTimeout(() => { this.bufferKeys = ''; }, 5000);
} }
this.bufferKeys += event.code; this.bufferKeys += event.code;
if (this.code === this.bufferKeys) { if (this.code === this.bufferKeys) {
this.showCode = true; this.showCode = true;
setTimeout(() => this.showCode = false, 5000); setTimeout(() => { this.showCode = false; }, 5000);
} }
} }
constructor() { }
ngOnInit() { ngOnInit() {
} }
} }

View File

@ -6,9 +6,6 @@ import { environment } from 'environments/environment';
@Injectable() @Injectable()
export class CustomHttpClientInterceptor implements HttpInterceptor { export class CustomHttpClientInterceptor implements HttpInterceptor {
constructor() {
}
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
if (!environment.production) { if (!environment.production) {
req = req.clone({ headers: req.headers.set('Authorization', 'Basic YWRtaW46YWRtaW4=') }); req = req.clone({ headers: req.headers.set('Authorization', 'Basic YWRtaW46YWRtaW4=') });

View File

@ -11,10 +11,6 @@ export class TaskdetailsAttributeComponent implements OnInit {
@Input() attributes: CustomAttribute[] = []; @Input() attributes: CustomAttribute[] = [];
@Output() attributesChange: EventEmitter<CustomAttribute[]> = new EventEmitter<CustomAttribute[]>(); @Output() attributesChange: EventEmitter<CustomAttribute[]> = new EventEmitter<CustomAttribute[]>();
constructor() {
}
ngOnInit() { ngOnInit() {
} }

View File

@ -9,9 +9,6 @@ export class TaskdetailsCustomFieldsComponent implements OnInit {
@Input() task: Task; @Input() task: Task;
@Output() taskChange: EventEmitter<Task> = new EventEmitter<Task>(); @Output() taskChange: EventEmitter<Task> = new EventEmitter<Task>();
constructor() {
}
ngOnInit() { ngOnInit() {
} }
} }

View File

@ -10,8 +10,6 @@ export class GeneralFieldsExtensionComponent implements OnInit {
@Input() task: Task; @Input() task: Task;
@Output() taskChange: EventEmitter<Task> = new EventEmitter<Task>(); @Output() taskChange: EventEmitter<Task> = new EventEmitter<Task>();
constructor() { }
ngOnInit() { ngOnInit() {
} }
} }

View File

@ -18,7 +18,6 @@ export class DummyDetailComponent {
} }
@Component({ @Component({
// tslint:disable-next-line: component-selector
selector: 'svg-icon', selector: 'svg-icon',
template: '<p>Mock Icon Component</p>' template: '<p>Mock Icon Component</p>'
}) })