Forgot indent

This commit is contained in:
BVier 2020-01-13 11:28:30 +01:00
parent 0fa4b1d5df
commit a304d2d729
131 changed files with 1712 additions and 1700 deletions

View File

@ -16,7 +16,7 @@ module.exports = {
],
"rules": {
"arrow-parens": ["error", "as-needed"],
"@typescript-eslint/indent": ['off', 2],
"@typescript-eslint/indent": ['error', 2],
"max-len": ["off", { "code": 140, "ignorePattern": "import *" }], // smaller than 140?
"object-curly-newline": ["error", { "ImportDeclaration": "never" }],
"quote-props": ["error", "as-needed"],

View File

@ -128,7 +128,7 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
this.AccessItemsForm ? this.AccessItemsForm.value.workbasketKeyFilter : undefined,
this.sortModel,
true
)
)
.subscribe((accessItemsResource: AccessItemsWorkbasketResource) => {
this.setAccessItemsGroups(accessItemsResource ? accessItemsResource.accessItems : []);
this.requestInProgressService.setRequestInProgress(false);
@ -177,7 +177,7 @@ export class AccessItemsManagementComponent implements OnInit, OnDestroy {
)
);
}
);
);
}
private unSubscribe(subscription: Subscription): void {

View File

@ -44,9 +44,10 @@ describe('ClassificationDetailsComponent', () => {
let fixture: ComponentFixture<ClassificationDetailsComponent>;
const treeNodes: Array<TreeNodeModel> = new Array(new TreeNodeModel());
let classificationsService; let classificationCategoriesService;
let treeService; let
removeConfirmationService;
let classificationsService;
let classificationCategoriesService;
let treeService;
let removeConfirmationService;
beforeEach(done => {
const configure = (testBed: TestBed) => {

View File

@ -188,11 +188,11 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
try {
this.classification = (<ClassificationDefinition> await this.classificationsService.putClassification(
this.classification._links.self.href, this.classification
));
));
this.afterRequest();
this.alertService.triggerAlert(
new AlertModel(AlertType.SUCCESS, `Classification ${this.classification.key} was saved successfully`)
);
);
this.cloneClassification(this.classification);
} catch (error) {
this.generalModalService.triggerMessage(new MessageModal('There was error while saving your classification', error));
@ -279,7 +279,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
if (!this.classification || !this.classification.classificationId) {
this.generalModalService.triggerMessage(
new MessageModal('There is no classification selected', 'Please check if you are creating a classification')
);
);
return false;
}
this.requestInProgressService.setRequestInProgress(true);

View File

@ -43,8 +43,8 @@ describe('ClassificationListComponent', () => {
let fixture: ComponentFixture<ClassificationListComponent>;
const treeNodes: Array<TreeNodeModel> = new Array(new TreeNodeModel());
const classificationTypes: Array<string> = new Array<string>('type1', 'type2');
let classificationsService; let
classificationCategoriesService;
let classificationsService;
let classificationCategoriesService;
beforeEach(done => {
const configure = (testBed: TestBed) => {

View File

@ -45,7 +45,7 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
private categoryService: ClassificationCategoriesService,
private importExportService: ImportExportService,
private alertService: AlertService
) {
) {
}
ngOnInit() {

View File

@ -33,7 +33,7 @@ export class ImportExportComponent implements OnInit {
private alertService: AlertService,
public uploadservice: UploadService,
private importExportService: ImportExportService
) {
) {
}
ngOnInit() {

View File

@ -27,8 +27,11 @@ import { AccessItemsComponent } from './access-items.component';
describe('AccessItemsComponent', () => {
let component: AccessItemsComponent;
let fixture: ComponentFixture<AccessItemsComponent>;
let workbasketService; let debugElement; let alertService; let accessIdsService; let
formsValidatorService;
let workbasketService;
let debugElement;
let alertService;
let accessIdsService;
let formsValidatorService;
beforeEach(done => {
@ -55,7 +58,7 @@ formsValidatorService;
new WorkbasketAccessItems('id1', '1', 'accessID1', '', false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false),
new WorkbasketAccessItems('id2', '1', 'accessID2')
),
),
new Links({ href: 'someurl' })
)));
spyOn(workbasketService, 'updateWorkBasketAccessItem').and.returnValue(of(true)),
@ -103,7 +106,7 @@ formsValidatorService;
fixture.detectChanges();
expect(alertService.triggerAlert).toHaveBeenCalledWith(
new AlertModel(AlertType.SUCCESS, `Workbasket ${component.workbasket.key} Access items were saved successfully`)
);
);
});
fixture.detectChanges();
}));

View File

@ -89,7 +89,7 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
private customFieldsService: CustomFieldsService,
private formBuilder: FormBuilder,
private formsValidatorService: FormsValidatorService
) {
) {
}
ngOnChanges(changes: SimpleChanges): void {
@ -180,13 +180,13 @@ export class AccessItemsComponent implements OnChanges, OnDestroy {
this.requestInProgressService.setRequestInProgress(true);
this.workbasketService.updateWorkBasketAccessItem(
this.accessItemsResource._links.self.href, this.AccessItemsForm.value.accessItemsGroups
)
)
.subscribe(response => {
this.accessItemsClone = this.cloneAccessItems(this.AccessItemsForm.value.accessItemsGroups);
this.accessItemsResetClone = this.cloneAccessItems(this.AccessItemsForm.value.accessItemsGroups);
this.alertService.triggerAlert(new AlertModel(
AlertType.SUCCESS, `Workbasket ${this.workbasket.name} Access items were saved successfully`
));
));
this.requestInProgressService.setRequestInProgress(false);
}, error => {
this.generalModalService.triggerMessage(new MessageModal('There was error while saving your workbasket\'s access items', error));

View File

@ -50,15 +50,15 @@ describe('DistributionTargetsComponent', () => {
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' })),
new WorkbasketSummary('id2', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' })),
new WorkbasketSummary('id3', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
),
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
)));
spyOn(workbasketService, 'getWorkBasketsDistributionTargets').and.callFake(() => of(new WorkbasketDistributionTargetsResource(
new Array<WorkbasketSummary>(
new WorkbasketSummary('id2', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
),
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
)));
component.ngOnChanges({
active: new SimpleChange(undefined, 'distributionTargets', true)
});
@ -97,7 +97,7 @@ describe('DistributionTargetsComponent', () => {
filterBy: new FilterModel({
name: 'someName', owner: 'someOwner', description: 'someDescription', key: 'someKey'
}),
side: Side.LEFT
side: Side.LEFT
});
component.distributionTargetsLeft = new Array<WorkbasketSummary>(
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
@ -111,10 +111,10 @@ side: Side.LEFT
it('should reset distribution target and distribution target selected on reset', () => {
component.distributionTargetsLeft.push(
new WorkbasketSummary('id4', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
);
);
component.distributionTargetsRight.push(
new WorkbasketSummary('id5', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
);
);
expect(component.distributionTargetsLeft.length).toBe(3);
expect(component.distributionTargetsRight.length).toBe(2);
@ -132,9 +132,9 @@ side: Side.LEFT
new Array<WorkbasketSummary>(
new WorkbasketSummary('id2', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' })),
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '', false, new Links({ href: 'someurl' }))
),
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
)));
component.onSave();
fixture.detectChanges();
expect(component.distributionTargetsSelected.length).toBe(2);

View File

@ -74,7 +74,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
private generalModalService: GeneralModalService,
private requestInProgressService: RequestInProgressService,
private orientationService: OrientationService
) { }
) { }
ngOnChanges(changes: SimpleChanges): void {
if (!this.initialized && changes.active && changes.active.currentValue === 'distributionTargets') {
@ -116,7 +116,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
this.requestInProgressService.setRequestInProgress(true);
this.workbasketService.updateWorkBasketsDistributionTargets(
this.distributionTargetsSelectedResource._links.self.href, this.getSeletedIds()
).subscribe(response => {
).subscribe(response => {
this.requestInProgressService.setRequestInProgress(false);
this.distributionTargetsSelected = response.distributionTargets;
this.distributionTargetsSelectedClone = Object.assign([], this.distributionTargetsSelected);
@ -171,7 +171,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
}
this.distributionTargetsSubscription = this.workbasketService.getWorkBasketsDistributionTargets(
this.workbasket._links.distributionTargets.href
).subscribe(
).subscribe(
(distributionTargetsSelectedResource: WorkbasketDistributionTargetsResource) => {
this.distributionTargetsSelectedResource = distributionTargetsSelectedResource;
this.distributionTargetsSelected = distributionTargetsSelectedResource.distributionTargets;
@ -180,7 +180,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
this.calculateNumberItemsList();
this.getWorkbaskets();
}
);
);
this.savingDistributionTargetsSubscription = this.savingWorkbaskets.triggeredDistributionTargetsSaving()
.subscribe((savingInformation: SavingInformation) => {
@ -238,7 +238,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
}
this.onRequest(true);
}
);
);
}
private setBadge() {

View File

@ -37,8 +37,12 @@ const routes: Routes = [
describe('WorkbasketInformationComponent', () => {
let component: WorkbasketInformationComponent;
let fixture: ComponentFixture<WorkbasketInformationComponent>;
let debugElement; let workbasketService; let alertService; let savingWorkbasketService; let requestInProgressService; let
formsValidatorService;
let debugElement;
let workbasketService;
let alertService;
let savingWorkbasketService;
let requestInProgressService;
let formsValidatorService;
beforeEach(done => {
const configure = (testBed: TestBed) => {
@ -145,7 +149,7 @@ formsValidatorService;
new Workbasket('someNewId', 'created', 'keyModified', 'domain', ICONTYPES.TOPIC, 'modified', 'name', 'description',
'owner', 'custom1', 'custom2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2',
'orgLevel3', 'orgLevel4', new Links({ href: 'someUrl' }))
));
));
fixture.detectChanges();
spyOn(formsValidatorService, 'validateFormAccess').and.returnValue(Promise.resolve(true));
component.onSubmit();
@ -169,7 +173,7 @@ formsValidatorService;
new Workbasket('someNewId', 'created', 'keyModified', 'domain', ICONTYPES.TOPIC, 'modified', 'name', 'description',
'owner', 'custom1', 'custom2', 'custom3', 'custom4', 'orgLevel1', 'orgLevel2',
'orgLevel3', 'orgLevel4', new Links({ href: 'someUrl' }, { href: 'someUrl' }, { href: 'someUrl' }))
));
));
spyOn(savingWorkbasketService, 'triggerDistributionTargetSaving');
spyOn(savingWorkbasketService, 'triggerAccessItemsSaving');

View File

@ -32,7 +32,7 @@ import { FormsValidatorService } from 'app/shared/services/forms/forms-validator
styleUrls: ['./workbasket-information.component.scss']
})
export class WorkbasketInformationComponent
implements OnInit, OnChanges, OnDestroy {
implements OnInit, OnChanges, OnDestroy {
@Input()
workbasket: Workbasket;

View File

@ -80,17 +80,17 @@ describe('WorkbasketDetailsComponent', () => {
new Array<WorkbasketSummary>(
new WorkbasketSummary('id1', '', '', '', '', '', '', '', '', '', '', '',
false, new Links({ href: 'someurl' }))
),
),
new LinksWorkbasketSummary({ href: 'someurl' })
)));
)));
spyOn(workbasketService, 'getWorkBasket').and.callFake(() => of(workbasket));
spyOn(workbasketService, 'getWorkBasketAccessItems').and.callFake(() => of(new WorkbasketAccessItemsResource(
new Array<WorkbasketAccessItems>(), new Links({ href: 'url' })
)));
)));
spyOn(workbasketService, 'getWorkBasketsDistributionTargets').and.callFake(() => of(new WorkbasketSummaryResource(
new Array<WorkbasketSummary>(), new LinksWorkbasketSummary({ href: 'url' })
)));
)));
done();
});
});

View File

@ -116,7 +116,7 @@ export class WorkbasketDetailsComponent implements OnInit, OnDestroy {
}, err => {
this.generalModalService.triggerMessage(
new MessageModal('An error occurred while fetching the workbasket', err)
);
);
});
}
}

View File

@ -35,8 +35,9 @@ export class DummyDetailComponent {
describe('WorkbasketListToolbarComponent', () => {
let component: WorkbasketListToolbarComponent;
let fixture: ComponentFixture<WorkbasketListToolbarComponent>;
let debugElement; let workbasketService; let
router;
let debugElement;
let workbasketService;
let router;
const routes: Routes = [
{ path: ':id', component: DummyDetailComponent, outlet: 'detail' }
@ -67,7 +68,7 @@ router;
component = fixture.componentInstance;
component.workbaskets = new Array<WorkbasketSummary>(
new WorkbasketSummary('1', 'key1', 'NAME1', 'description 1', 'owner 1')
);
);
component.workbaskets[0].markedForDeletion = false;
component.workbaskets[0]._links = new Links({ href: 'selfLink' });

View File

@ -34,7 +34,7 @@ export class WorkbasketListToolbarComponent implements OnInit {
private workbasketService: WorkbasketService,
private route: ActivatedRoute,
private router: Router
) {
) {
}
ngOnInit() {

View File

@ -49,7 +49,7 @@ const workbasketSummaryResource: WorkbasketSummaryResource = new WorkbasketSumma
new Array<WorkbasketSummary>(
new WorkbasketSummary('1', 'key1', 'NAME1', 'description 1', 'owner 1', '', '', 'PERSONAL', '', '', '', ''),
new WorkbasketSummary('2', 'key2', 'NAME2', 'description 2', 'owner 2', '', '', 'GROUP', '', '', '', '')
),
),
new LinksWorkbasketSummary({ href: 'url' })
);
@ -164,10 +164,10 @@ describe('WorkbasketListComponent', () => {
it('should have performRequest with forced = true after performFilter is triggered', (() => {
const filter = new FilterModel({
name: 'someName',
owner: 'someOwner',
description: 'someDescription',
owner: 'someOwner',
description: 'someDescription',
key: 'someKey',
type: 'PERSONAL'
type: 'PERSONAL'
});
component.performFilter(filter);

View File

@ -47,7 +47,7 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
private route: ActivatedRoute,
private orientationService: OrientationService,
private importExportService: ImportExportService
) {
) {
}
ngOnInit() {
@ -96,7 +96,7 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
refreshWorkbasketList() {
this.cards = this.orientationService.calculateNumberItemsList(
window.innerHeight, 72, 170 + this.toolbarElement.nativeElement.offsetHeight, false
);
);
this.performRequest();
}
@ -108,7 +108,7 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
true, this.sort.sortBy, this.sort.sortDirection, '',
this.filterBy.filterParams.name, this.filterBy.filterParams.description, '', this.filterBy.filterParams.owner,
this.filterBy.filterParams.type, '', this.filterBy.filterParams.key, ''
)
)
.subscribe(resultList => {
this.workbasketsResource = resultList;
this.workbaskets = resultList.workbaskets;

View File

@ -9,8 +9,9 @@ import { AppComponent } from './app.component';
import { NavBarComponent } from './components/nav-bar/nav-bar.component';
describe('AppComponent', () => {
let app; let fixture; let
debugElement;
let app;
let fixture;
let debugElement;
const routes: Routes = [
{ path: 'classifications', component: AppComponent }

View File

@ -46,7 +46,7 @@ export class AppComponent implements OnInit, OnDestroy {
private selectedRouteService: SelectedRouteService,
private formsValidatorService: FormsValidatorService,
public uploadService: UploadService
) {
) {
}
ngOnInit() {

View File

@ -30,7 +30,7 @@ export const configureTests = (configure: (testBed: TestBed) => void) => {
testBed.initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
);
}
configure(testBed);

View File

@ -20,8 +20,8 @@ import { NavBarComponent } from './nav-bar.component';
describe('NavBarComponent', () => {
let component: NavBarComponent;
let fixture: ComponentFixture<NavBarComponent>;
let debugElement; let
navBar;
let debugElement;
let navBar;
const routes: Routes = [
{ path: 'classifications', component: NavBarComponent }

View File

@ -50,7 +50,7 @@ export class NavBarComponent implements OnInit, OnDestroy {
private domainService: DomainService,
private taskanaEngineService: TaskanaEngineService,
private window: WindowRefService
) { }
) { }
ngOnInit() {
this.selectedRouteSubscription = this.selectedRouteService.getSelectedRoute().subscribe((value: string) => {

View File

@ -16,7 +16,7 @@ export class DomainGuard implements CanActivate {
catchError(() => {
this.generalModalService.triggerMessage(new MessageModal(
'There was an error, please contact with your administrator', 'There was an error getting Domains'
));
));
return of(false);
})
);

View File

@ -14,12 +14,12 @@ export class HistoryGuard implements CanActivate {
private taskanaEngineService: TaskanaEngineService,
public router: Router,
public generalModalService: GeneralModalService
) { }
) { }
canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): Observable<boolean> | Promise<boolean> | boolean {
): Observable<boolean> | Promise<boolean> | boolean {
return this.taskanaEngineService.isHistoryProviderEnabled().pipe(
map(value => {
if (value) {
@ -30,7 +30,7 @@ export class HistoryGuard implements CanActivate {
catchError(() => {
this.generalModalService.triggerMessage(new MessageModal(
'There was an error, please contact with your administrator', 'There was an error getting history provider'
));
));
return of(this.navigateToWorkplace());
})
);

View File

@ -73,7 +73,7 @@ export class TaskQueryService {
custom4: string,
created: string,
allPages: boolean = false
): string {
): string {
const parameters = new QueryParametersModel();
parameters.SORTBY = orderBy;
parameters.SORTDIRECTION = sortDirection;

View File

@ -33,7 +33,7 @@ export class TaskQueryComponent implements OnInit {
private orientationService: OrientationService,
private generalModalService: GeneralModalService,
private requestInProgressService: RequestInProgressService
) { }
) { }
ngOnInit() {
this.orientationSubscription = this.orientationService.getOrientation().subscribe((orientation: Orientation) => {
@ -182,7 +182,7 @@ export class TaskQueryComponent implements OnInit {
this.orderBy.sortDirection,
new TaskHistoryEventData(this.taskQueryForm.value),
false
).subscribe(taskQueryResource => {
).subscribe(taskQueryResource => {
this.requestInProgressService.setRequestInProgress(false);
if (!taskQueryResource.taskHistoryEvents) {
this.taskQuery = null;

View File

@ -4,6 +4,6 @@ export class AccessIdDefinition {
constructor(
public accessId?: string,
public name?: string
) {
) {
}
}

View File

@ -3,6 +3,6 @@ export class CustomField {
constructor(
public visible: boolean,
public field: string
) {
) {
}
}

View File

@ -4,5 +4,5 @@ export class UserInfoModel {
public userId: string = '',
public groupIds: Array<string> = [],
public roles: Array<string> = []
) { }
) { }
}

View File

@ -5,6 +5,6 @@ export class WorkbasketDistributionTargetsResource {
constructor(
public distributionTargets: Array<WorkbasketSummary> = [],
public _links: Links = null
) {
) {
}
}

View File

@ -5,5 +5,5 @@ export class WorkbasketResource {
constructor(
public workbaskets: Array<Workbasket> = [],
public _links: Links = new Links()
) { }
) { }
}

View File

@ -19,6 +19,6 @@ export class WorkbasketSummary {
public markedForDeletion: boolean = false,
public _links?: Links,
public page?: Page
) {
) {
}
}

View File

@ -43,6 +43,6 @@ export class Workbasket {
public orgLevel3?: string,
public orgLevel4?: string,
public _links: Links = new Links()
) {
) {
}
}

View File

@ -27,7 +27,7 @@ export class ClassificationTasksComponent implements OnInit {
constructor(
private restConnectorService: RestConnectorService,
private requestInProgressService: RequestInProgressService
) {
) {
}
async ngOnInit() {

View File

@ -17,7 +17,7 @@ export class TasksComponent implements OnInit {
constructor(
private restConnectorService: RestConnectorService,
private requestInProgressService: RequestInProgressService
) {
) {
}
async ngOnInit() {

View File

@ -31,7 +31,7 @@ export class MonitorWorkbasketDueDateComponent implements OnInit {
constructor(
private restConnectorService: RestConnectorService,
private requestInProgressService: RequestInProgressService
) {
) {
}

View File

@ -32,7 +32,7 @@ export class MonitorWorkbasketPlannedDateComponent implements OnInit {
constructor(
private restConnectorService: RestConnectorService,
private requestInProgressService: RequestInProgressService
) {
) {
}
async ngOnInit() {

View File

@ -61,9 +61,9 @@ export class CustomFieldsService {
value = this.mergeKeys(value, fallbackObject);
return value;
}
}
private mergeKeys(defaultObject: Object, newObject: Object) {
private mergeKeys(defaultObject: Object, newObject: Object) {
const value = new Object();
for (const item of Object.keys(defaultObject)) {

View File

@ -22,7 +22,7 @@ export class DomainService {
private router: Router,
private requestInProgressService: RequestInProgressService,
private selectedRouteService: SelectedRouteService
) {
) {
this.selectedRouteService.getSelectedRoute().subscribe((value: string) => {
if (value.indexOf('workbaskets') === 0) {
this.hasMasterDomain = false;

View File

@ -17,8 +17,8 @@ describe('StartupService', () => {
taskanaLogoutUrl: someLogoutUrl
};
let httpMock; let
service;
let httpMock;
let service;
beforeEach(() => {
TestBed.configureTestingModule({

View File

@ -16,7 +16,7 @@ export class StartupService {
private taskanaEngineService: TaskanaEngineService,
private injector: Injector,
private window: WindowRefService
) {
) {
}
public get router(): Router {

View File

@ -21,7 +21,7 @@ export class TaskanaEngineService {
data => {
this.currentUserInfo = data;
}
)).toPromise();
)).toPromise();
}
hasRole(roles2Find: Array<string>): boolean {

View File

@ -11,7 +11,7 @@ export const expandDown = trigger('toggleDown', [
style({ opacity: 1, height: '*' }),
style({ opacity: 0.5, height: '50px' }),
style({ opacity: 0, height: '0px' })])))
]);
]);
export const expandRight = trigger('toggleRight', [
transition('void => *', animate('300ms ease-in', keyframes([

View File

@ -24,10 +24,10 @@ describe('FilterComponent', () => {
component = fixture.componentInstance;
component.filterParams = {
name: 'someName',
owner: 'someOwner',
description: 'someDescription',
owner: 'someOwner',
description: 'someDescription',
key: 'someKey',
type: 'PERSONAL'
type: 'PERSONAL'
};
debugElement = fixture.debugElement.nativeElement;
fixture.detectChanges();
@ -60,10 +60,10 @@ type: 'PERSONAL'
it('should be able to clear all fields after pressing clear button', () => {
component.filterParams = {
name: 'someName',
owner: 'someOwner',
description: 'someDescription',
owner: 'someOwner',
description: 'someDescription',
key: 'someKey',
type: 'PERSONAL'
type: 'PERSONAL'
};
fixture.detectChanges();
debugElement.querySelector('[title="Clear"]').click();

View File

@ -26,8 +26,10 @@ export class DummyDetailComponent {
}
describe('MasterAndDetailComponent ', () => {
let component; let fixture; let debugElement; let
router;
let component;
let fixture;
let debugElement;
let router;
const routes: Routes = [
{

View File

@ -16,7 +16,7 @@ export class AccessIdsService {
private accessItemsRef: Observable<AccessItemsWorkbasketResource> = new Observable();
constructor(
private httpClient: HttpClient
) { }
) { }
getAccessItemsInformation(token: string, searchInGroups = false): Observable<Array<AccessIdDefinition>> {
if (!token || token.length < 3) {
@ -34,7 +34,7 @@ export class AccessIdsService {
workbasketKeyLike?: string,
sortModel: SortingModel = new SortingModel('workbasket-key'),
forceRequest: boolean = false
): Observable<AccessItemsWorkbasketResource> {
): Observable<AccessItemsWorkbasketResource> {
if (this.accessItemsRef && !forceRequest) {
return this.accessItemsRef;
}
@ -44,8 +44,8 @@ export class AccessIdsService {
this.accessIdsParameters(sortModel,
accessIds,
accessIdLike, workbasketKeyLike)
)}`
));
)}`
));
}
removeAccessItemsPermissions(accessId: string) {
@ -58,7 +58,7 @@ export class AccessIdsService {
accessIds: Array<AccessIdDefinition>,
accessIdLike?: string,
workbasketKeyLike?: string
): QueryParametersModel {
): QueryParametersModel {
const parameters = new QueryParametersModel();
parameters.SORTBY = sortModel.sortBy;
parameters.SORTDIRECTION = sortModel.sortDirection;

View File

@ -27,7 +27,7 @@ export class ClassificationCategoriesService {
constructor(
private httpClient: HttpClient,
private customFieldsService: CustomFieldsService
) { }
) { }
getCategories(type?: string): Observable<Array<string>> {
if (!this.dataObsCategories$.observers.length || type !== this.type) {
@ -52,7 +52,7 @@ export class ClassificationCategoriesService {
private getCustomCategoriesObject(categories: Array<string>): Object {
return this.customFieldsService.getCustomObject(
this.getDefaultCategoryMap(categories), 'classifications.categories'
);
);
}
private getDefaultCategoryMap(categoryList: Array<string>): Object {

View File

@ -26,7 +26,7 @@ export class ClassificationsService {
private httpClient: HttpClient,
private classificationCategoriesService: ClassificationCategoriesService,
private domainService: DomainService
) {
) {
}
private static classificationParameters(domain: string): QueryParametersModel {
@ -45,7 +45,7 @@ export class ClassificationsService {
return this.domainService.getSelectedDomain().pipe(
mergeMap(domain => this.getClassificationObservable(this.httpClient.get<ClassificationResource>(
`${this.url}${TaskanaQueryParameters.getQueryParameters(ClassificationsService.classificationParameters(domain))}`
))),
))),
tap(() => {
this.domainService.domainChangedComplete();
})
@ -58,7 +58,7 @@ export class ClassificationsService {
this.lastDomain = domain;
this.classificationResourcePromise = this.httpClient.get<ClassificationResource>(
`${this.url}${TaskanaQueryParameters.getQueryParameters(ClassificationsService.classificationParameters(domain))}`
).toPromise();
).toPromise();
}
return this.classificationResourcePromise;
}

View File

@ -12,7 +12,7 @@ export class FormsValidatorService {
constructor(
private alertService: AlertService,
private accessIdsService: AccessIdsService
) {
) {
}
public async validateFormInformation(form: NgForm, toogleValidationMap: Map<any, boolean>): Promise<any> {

View File

@ -14,7 +14,7 @@ export class HttpClientInterceptor implements HttpInterceptor {
constructor(
private generalModalService: GeneralModalService,
private requestInProgressService: RequestInProgressService
) {
) {
}
@ -28,13 +28,13 @@ export class HttpClientInterceptor implements HttpInterceptor {
if (error instanceof HttpErrorResponse && (error.status === 401 || error.status === 403)) {
this.generalModalService.triggerMessage(
new MessageModal('You have no access to this resource ', error)
);
);
} else if (error instanceof HttpErrorResponse && (error.status === 404) && error.url.indexOf('environment-information.json')) {
// ignore this error message
} else {
this.generalModalService.triggerMessage(
new MessageModal('There was error, please contact with your administrator ', error)
);
);
}
}));
}

View File

@ -51,7 +51,7 @@ export class WorkbasketService {
`${environment.taskanaRestUrl}/v1/workbaskets/${TaskanaQueryParameters
.getQueryParameters(this.workbasketParameters(sortBy, order, name, nameLike, descLike, owner, ownerLike,
type, key, keyLike, requiredPermission, allPages, domain))}`
)
)
.pipe(tap((workbaskets => workbaskets)))), tap(() => {
this.domainService.domainChangedComplete();
}));
@ -170,7 +170,7 @@ export class WorkbasketService {
requiredPermission?: string,
allPages?: boolean,
domain?: string
): QueryParametersModel {
): QueryParametersModel {
const parameters = new QueryParametersModel();
parameters.SORTBY = sortBy;
parameters.SORTDIRECTION = order;

View File

@ -67,7 +67,7 @@ export class SpinnerComponent implements OnDestroy {
this.generalModalService.triggerMessage(
new MessageModal('There was an error with your request, please make sure you have internet connection',
'Request time execeed')
);
);
this.cancelTimeout();
this.isRunning = false;
}, this.maxRequestTimeout);

View File

@ -71,7 +71,7 @@ export class TaskanaTreeComponent implements OnInit, AfterViewChecked, OnDestroy
private categoryService: ClassificationCategoriesService,
private elementRef: ElementRef,
private classificationsService: ClassificationsService
) {
) {
}
ngOnInit() {

View File

@ -55,7 +55,7 @@ export class TaskService {
objRefTypeLike,
objRefValueLike,
allPages
))}`;
))}`;
return this.httpClient.get<TaskResource>(url);
}
@ -109,7 +109,7 @@ export class TaskService {
objRefTypeLike: string,
objRefValueLike: string,
allPages: boolean = false
): QueryParametersModel {
): QueryParametersModel {
const parameters = new QueryParametersModel();
parameters.WORKBASKET_ID = basketId;
parameters.SORTBY = sortBy;

View File

@ -76,7 +76,7 @@ export class TaskComponent implements OnInit, OnDestroy {
this.requestInProgress = false;
this.task = task;
}
);
);
this.navigateBack();
}
@ -89,7 +89,7 @@ export class TaskComponent implements OnInit, OnDestroy {
this.taskService.publishUpdatedTask(task);
this.navigateBack();
}
);
);
}
navigateBack() {

View File

@ -51,7 +51,7 @@ xdescribe('GeneralComponent', () => {
1, 'service', new Links({ href: 'someurl' })),
new Classification('id2', '2', 'category', 'type', 'domain_a', 'classification2', 'parentId2',
1, 'service', new Links({ href: 'someurl' }))
),
),
new Links({ href: 'someurl' })
));
done();

View File

@ -40,7 +40,7 @@ export class TaskdetailsGeneralFieldsComponent implements OnInit, OnChanges {
private customFieldsService: CustomFieldsService,
private formsValidatorService: FormsValidatorService,
private domainService: DomainService
) {
) {
}
ngOnInit() {

View File

@ -87,7 +87,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
}, err => {
this.generalModalService.triggerMessage(
new MessageModal('An error occurred while fetching the task', err)
);
);
});
}
}
@ -117,7 +117,7 @@ export class TaskdetailsComponent implements OnInit, OnDestroy {
}, err => {
this.generalModalService.triggerMessage(
new MessageModal('An error occurred while deleting the task ', err)
);
);
});
}

View File

@ -55,7 +55,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
private workplaceService: WorkplaceService,
private alertService: AlertService,
private orientationService: OrientationService
) {
) {
this.taskChangeSubscription = this.taskService.taskChangedStream.subscribe(task => {
this.getTasks();
this.selectedId = task ? task.taskId : '';
@ -88,7 +88,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
this.selectedId = '';
}
}
);
);
this.orientationSubscription = this.orientationService.getOrientation().subscribe((orientation: Orientation) => {
this.refreshWorkbasketList();
});