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/prefer-default-export": "off",
"max-classes-per-file": "off",
"no-useless-escape": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-expressions": "off",
// all following rules MUST be removed (mostly autofix)
"linebreak-style": ["off", "unix"], // own PR
"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/camelcase": "off",
"no-multi-assign": "off",
"no-new-object": "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",
}
};

View File

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

View File

@ -1,4 +1,3 @@
// tslint:enable:max-line-length
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@ -71,5 +70,3 @@ const DECLARATIONS = [
})
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 { Pair } from 'app/models/pair';
// tslint:disable:max-line-length
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 { RequestInProgressService } from 'app/services/requestInProgress/request-in-progress.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 { RemoveConfirmationService } from 'app/services/remove-confirmation/remove-confirmation.service';
// tslint:disable:max-line-length
import { ClassificationCategoriesService } from 'app/shared/services/classifications/classification-categories.service';
// tslint:enable:max-line-length
import { DomainService } from 'app/services/domain/domain.service';
import { Pair } from 'app/models/pair';
import { NgForm } from '@angular/forms';
@ -112,7 +110,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
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);
}
});
@ -128,7 +126,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
// TSK-891 fix: The property is already set and is crucial value
// Wrapped with an if to set a default if not already set.
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) {
if (this.classificationIsAlreadySelected()) {
return true;
if (!this.classificationIsAlreadySelected()) {
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 {
if (this.action === ACTION.CREATE && this.classification) { return true; }
return this.action === ACTION.CREATE && !!this.classification;
}
private fillClassificationInformation(classificationSelected: ClassificationDefinition) {
@ -280,7 +277,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
this.generalModalService.triggerMessage(
new MessageModal('There is no classification selected', 'Please check if you are creating a classification')
);
return false;
return;
}
this.requestInProgressService.setRequestInProgress(true);
this.treeService.setRemovedNodeId(this.classification.classificationId);

View File

@ -38,7 +38,7 @@ export class ImportExportComponent implements OnInit {
ngOnInit() {
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 formdata = new FormData();
const ajax = new XMLHttpRequest();
if (!this.checkFormatFile(file)) { return false; }
formdata.append('file', file);
ajax.upload.addEventListener('progress', this.progressHandler.bind(this), false);
ajax.addEventListener('load', this.resetProgress.bind(this), false);
ajax.addEventListener('error', this.onFailedResponse.bind(this, ajax), false);
ajax.onreadystatechange = this.onReadyStateChangeHandler.bind(this, ajax);
if (this.currentSelection === TaskanaType.WORKBASKETS) {
ajax.open('POST', `${environment.taskanaRestUrl}/v1/workbasket-definitions`);
} else {
ajax.open('POST', `${environment.taskanaRestUrl}/v1/classification-definitions`);
if (this.checkFormatFile(file)) {
formdata.append('file', file);
ajax.upload.addEventListener('progress', this.progressHandler.bind(this), false);
ajax.addEventListener('load', this.resetProgress.bind(this), false);
ajax.addEventListener('error', this.onFailedResponse.bind(this, ajax), false);
ajax.onreadystatechange = this.onReadyStateChangeHandler.bind(this, ajax);
if (this.currentSelection === TaskanaType.WORKBASKETS) {
ajax.open('POST', `${environment.taskanaRestUrl}/v1/workbasket-definitions`);
} else {
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) {
@ -79,7 +80,7 @@ export class ImportExportComponent implements OnInit {
}
private checkFormatFile(file): boolean {
const ending = file.name.match(/\.([^\.]+)$/)[1];
const ending = file.name.match(/\.([^.]+)$/)[1];
let check = false;
switch (ending) {
case 'json':
@ -120,8 +121,8 @@ export class ImportExportComponent implements OnInit {
}
private onFailedResponse(event) {
this.errorHandler('Upload failed', 'The upload didn\'t proceed sucessfully. \
\n Probably the uploaded file exceeded the maximum file size of 10 MB');
this.errorHandler('Upload failed', 'The upload didn\'t proceed sucessfully. \n'
+ 'Probably the uploaded file exceeded the maximum file size of 10 MB');
}
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']]);
}
constructor() { }
ngOnInit() {
}
getIconPath(type: string) {
return type === 'PERSONAL' ? 'user.svg'
: type === 'GROUP' ? 'users.svg'
: type === 'TOPIC' ? 'topic.svg'
: type === 'CLEARANCE' ? 'clearance.svg' : 'asterisk.svg';
switch (type) {
case 'PERSONAL': return 'user.svg';
case 'GROUP': return 'users.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 {
public importingFinished = new Subject<boolean>();
constructor() { }
setImportingFinished(value: boolean) {
this.importingFinished.next(value);
}

View File

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

View File

@ -61,8 +61,8 @@ describe('AccessItemsComponent', () => {
),
new Links({ href: 'someurl' })
)));
spyOn(workbasketService, 'updateWorkBasketAccessItem').and.returnValue(of(true)),
spyOn(alertService, 'triggerAlert').and.returnValue(of(true)),
spyOn(workbasketService, 'updateWorkBasketAccessItem').and.returnValue(of(true));
spyOn(alertService, 'triggerAlert').and.returnValue(of(true));
debugElement = fixture.debugElement.nativeElement;
accessIdsService = TestBed.get(AccessIdsService);
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>) {
const AccessItemsFormGroups = accessItems.map(accessItem => this.formBuilder.group(accessItem));
AccessItemsFormGroups.map(accessItemGroup => {
AccessItemsFormGroups.forEach(accessItemGroup => {
accessItemGroup.controls.accessId.setValidators(Validators.required);
});
const AccessItemsFormArray = this.formBuilder.array(AccessItemsFormGroups);

View File

@ -147,7 +147,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
this.onRequest(false, dualListFilter.side);
this.workbasketFilterSubscription = this.workbasketService.getWorkBasketsSummary(true, '', '', '',
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.side === Side.RIGHT)
? this.distributionTargetsRight = (resultList.workbaskets)

View File

@ -186,7 +186,7 @@ implements OnInit, OnChanges, OnDestroy {
this.beforeRequest();
if (!this.workbasket.workbasketId) {
this.postNewWorkbasket();
return true;
return;
}
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(() => {
// tick(0);
// fixture.detectChanges();
// fixture.whenStable().then(() => {
// expect(debugElement.querySelectorAll('#wb-list-container > li').length).toBe(3);
// expect(debugElement.querySelectorAll('#wb-list-container > li')[1].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted');
// expect(debugElement.querySelectorAll('#wb-list-container > li')[2].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted active');
// })
// tick(0);
// fixture.detectChanges();
// fixture.whenStable().then(() => {
// expect(debugElement.querySelectorAll('#wb-list-container > li').length).toBe(3);
// expect(debugElement.querySelectorAll('#wb-list-container > li')[1].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted');
// expect(debugElement.querySelectorAll('#wb-list-container > li')[2].getAttribute('class'))
// .toBe('list-group-item ng-star-inserted active');
// })
//
// }));

View File

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

View File

@ -134,13 +134,12 @@ export class TaskQueryComponent implements OnInit {
}
changeOrderBy(key: string) {
if (!this.filterFieldsToAllowQuerying(key)) {
return null;
if (this.filterFieldsToAllowQuerying(key)) {
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) {
@ -184,13 +183,8 @@ export class TaskQueryComponent implements OnInit {
false
).subscribe(taskQueryResource => {
this.requestInProgressService.setRequestInProgress(false);
if (!taskQueryResource.taskHistoryEvents) {
this.taskQuery = null;
this.taskQueryResource = null;
return null;
}
this.taskQueryResource = taskQueryResource;
this.taskQuery = taskQueryResource.taskHistoryEvents;
this.taskQueryResource = taskQueryResource.taskHistoryEvents ? taskQueryResource : null;
this.taskQuery = taskQueryResource.taskHistoryEvents ? taskQueryResource.taskHistoryEvents : null;
});
}
@ -206,8 +200,8 @@ export class TaskQueryComponent implements OnInit {
const unusedHeight = 300;
const totalHeight = window.innerHeight;
const cards = Math.round((totalHeight - (unusedHeight)) / rowHeight);
TaskanaQueryParameters.page ? TaskanaQueryParameters.page = TaskanaQueryParameters.page : TaskanaQueryParameters.page = 1;
cards > 0 ? TaskanaQueryParameters.pageSize = cards : TaskanaQueryParameters.pageSize = 1;
TaskanaQueryParameters.page = TaskanaQueryParameters.page ? TaskanaQueryParameters.page : 1;
TaskanaQueryParameters.pageSize = cards > 0 ? cards : 1;
}
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 { Workbasket } from './workbasket';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,8 +9,6 @@ export class OrientationService {
private currentOrientation;
public orientation = new BehaviorSubject<Orientation>(this.currentOrientation);
constructor() { }
onResize() {
const orientation = this.detectOrientation();
if (orientation !== this.currentOrientation) {
@ -36,7 +34,7 @@ export class OrientationService {
calculateNumberItemsList(heightContainer: number, cardHeight: number, unusedHeight: number, doubleList = false): number {
let cards = Math.round((heightContainer - unusedHeight) / cardHeight);
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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -39,13 +39,14 @@ export class AccessIdsService {
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(
this.accessIdsParameters(sortModel,
accessIds,
accessIdLike, workbasketKeyLike)
)}`
));
return this.accessItemsRef;
}
removeAccessItemsPermissions(accessId: string) {

View File

@ -14,7 +14,7 @@ export class ClassificationCategoriesService {
private urlCategories = `${this.mainUrl}/v1/classification-categories`;
private param = '/?type=';
private dataObsCategories$ = new ReplaySubject<Array<string>>(1);
private categoriesObject = new Object();
private categoriesObject = {};
private missingIcon = 'assets/icons/categories/missing-icon.svg';
private type = 'UNKNOW';
@ -56,7 +56,7 @@ export class ClassificationCategoriesService {
}
private getDefaultCategoryMap(categoryList: Array<string>): Object {
const defaultCategoryMap = new Object();
const defaultCategoryMap = {};
categoryList.forEach(element => {
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> {
let validSync = true;
if (!form) {
return;
return false;
}
const forFieldsPromise = new Promise((resolve, reject) => {
for (const control in form.form.controls) {

View File

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

View File

@ -15,9 +15,6 @@ export class SortComponent implements OnInit {
sort: SortingModel = new SortingModel();
constructor() {
}
ngOnInit() {
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 { ClassificationsService } from '../services/classifications/classifications.service';
// tslint:disable:component-selector
@Component({
selector: 'tree-root',
template: ''
@ -28,8 +27,6 @@ class TreeVendorComponent {
};
}
// tslint:enable:component-selector
describe('TaskanaTreeComponent', () => {
let component: TaskanaTreeComponent;
let fixture: ComponentFixture<TaskanaTreeComponent>;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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