solved lint issues, added typedoc, fixed lgtm warnings

This commit is contained in:
lotte
2020-06-30 13:44:38 +02:00
parent c7994f9d90
commit 09665dfbe2
12 changed files with 39 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ import { HttpClient } from '@angular/common/http';
import { DefaultChangeAnalyzer } from '../default-change-analyzer.service';
import { Script } from '../../../process-page/scripts/script.model';
import { ProcessParameter } from '../../../process-page/processes/process-parameter.model';
import { find, map, switchMap, tap } from 'rxjs/operators';
import { find, map, switchMap } from 'rxjs/operators';
import { URLCombiner } from '../../url-combiner/url-combiner';
import { MultipartPostRequest, RestRequest } from '../request.models';
import { RequestService } from '../request.service';

View File

@@ -41,6 +41,9 @@ export class ProcessFormComponent implements OnInit {
*/
public files: File[] = [];
/**
* Message key for the header of the form
*/
@Input() public headerKey: string;
/**

View File

@@ -1,7 +1,6 @@
import { Component, EventEmitter, Input, OnInit, Output, Optional } from '@angular/core';
import { Component, EventEmitter, Input, Optional, Output } from '@angular/core';
import { ProcessParameter } from '../../../processes/process-parameter.model';
import { ScriptParameter } from '../../../scripts/script-parameter.model';
import { hasNoValue } from '../../../../shared/empty.util';
import { ControlContainer, NgForm } from '@angular/forms';
import { controlContainerFactory } from '../../process-form.component';

View File

@@ -1,4 +1,4 @@
import { Component, OnInit, Optional, Input } from '@angular/core';
import { Component, Input, Optional } from '@angular/core';
import { ValueInputComponent } from '../value-input.component';
import { ControlContainer, NgForm } from '@angular/forms';
import { controlContainerFactory } from '../../../process-form.component';
@@ -19,6 +19,10 @@ export class DateValueInputComponent extends ValueInputComponent<string> {
* The current value of the date string
*/
value: string;
/**
* Initial value of the field
*/
@Input() initialValue;
ngOnInit() {

View File

@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, OnChanges, OnInit, Optional, Output } from '@angular/core';
import { Component, EventEmitter, Input, Optional, Output } from '@angular/core';
import { ScriptParameterType } from '../../../scripts/script-parameter-type.model';
import { ScriptParameter } from '../../../scripts/script-parameter.model';
import { ControlContainer, NgForm } from '@angular/forms';
@@ -23,7 +23,9 @@ export class ParameterValueInputComponent {
*/
@Input() parameter: ScriptParameter;
/**
* Initial value for input
*/
@Input() initialValue: any;
/**
* Emits the value of the input when its updated

View File

@@ -19,12 +19,16 @@ export class StringValueInputComponent extends ValueInputComponent<string> {
* The current value of the string
*/
value: string;
/**
* Initial value of the field
*/
@Input() initialValue;
ngOnInit() {
this.value = this.initialValue;
}
setValue(value) {
this.value = value;
this.updateValue.emit(value)

View File

@@ -24,6 +24,10 @@ export class ProcessParametersComponent implements OnChanges {
* The currently selected script
*/
@Input() script: Script;
/**
* Initial parameters on load
*/
@Input() initialParams: ProcessParameter[];
/**
* Emits the parameter values when they're updated

View File

@@ -24,7 +24,13 @@ const SCRIPT_QUERY_PARAMETER = 'script';
deps: [[new Optional(), NgForm]] } ]
})
export class ScriptsSelectComponent implements OnInit, OnDestroy {
/**
* Emits the selected script when the selection changes
*/
@Output() select: EventEmitter<Script> = new EventEmitter<Script>();
/**
* All available scripts
*/
scripts$: Observable<Script[]>;
private _selectedScript: Script;
private routeSub: Subscription;

View File

@@ -18,13 +18,21 @@ import { Script } from '../scripts/script.model';
styleUrls: ['./new-process.component.scss'],
})
export class NewProcessComponent implements OnInit {
/**
* Emits preselected process if there is one
*/
fromExisting$?: Observable<Process>;
/**
* Emits preselected script if there is one
*/
script$?: Observable<Script>;
constructor(private route: ActivatedRoute, private processService: ProcessDataService, private linkService: LinkService) {
}
/**
* If there's an id parameter, use this the process with this identifier as presets for the form
*/
ngOnInit() {
const id = this.route.snapshot.queryParams.id;
if (id) {
@@ -37,4 +45,3 @@ export class NewProcessComponent implements OnInit {
}
}
}

View File

@@ -7,13 +7,10 @@ import { PROCESS } from './process.resource-type';
import { excludeFromEquals } from '../../core/utilities/equals.decorators';
import { ResourceType } from '../../core/shared/resource-type';
import { link, typedObject } from '../../core/cache/builders/build-decorators';
import { COLLECTION } from '../../core/shared/collection.resource-type';
import { Observable } from 'rxjs/internal/Observable';
import { RemoteData } from '../../core/data/remote-data';
import { Collection } from '../../core/shared/collection.model';
import { SCRIPT } from '../scripts/script.resource-type';
import { Script } from '../scripts/script.model';
import { PaginatedList } from '../../core/data/paginated-list';
/**
* Object representing a process

View File

@@ -1,4 +1,4 @@
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router';
import { ActivatedRouteSnapshot, Router } from '@angular/router';
import { hasValue } from '../empty.util';
import { URLCombiner } from '../../core/url-combiner/url-combiner';

View File

@@ -18,4 +18,3 @@ getTestBed().initTestEnvironment(
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);