Skip to content

Commit f320109

Browse files
Merge branch 'dspace-cris-2024_02_x' into ux-plus-cris-2024_02_x
2 parents d03b697 + 21b5577 commit f320109

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

src/app/process-page/form/process-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export class ProcessFormComponent implements OnInit {
136136
* @param processParameter The parameter value to check
137137
*/
138138
private checkValue(processParameter: ProcessParameter): string {
139-
if (typeof processParameter.value === 'object') {
139+
if (processParameter?.value != null && typeof processParameter.value === 'object') {
140140
this.files = [...this.files, processParameter.value];
141141
return processParameter.value.name;
142142
}

src/app/process-page/form/process-parameters/process-parameters.component.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
EventEmitter,
88
Input,
99
OnChanges,
10-
OnInit,
1110
Optional,
1211
Output,
1312
SimpleChanges,
@@ -40,7 +39,7 @@ import { ParameterSelectComponent } from './parameter-select/parameter-select.co
4039
standalone: true,
4140
imports: [NgIf, NgFor, ParameterSelectComponent, TranslateModule],
4241
})
43-
export class ProcessParametersComponent implements OnChanges, OnInit {
42+
export class ProcessParametersComponent implements OnChanges {
4443
/**
4544
* The currently selected script
4645
*/
@@ -60,12 +59,6 @@ export class ProcessParametersComponent implements OnChanges, OnInit {
6059
*/
6160
parameterValues: ProcessParameter[];
6261

63-
ngOnInit(): void {
64-
if (hasValue(this.initialParams)) {
65-
this.parameterValues = this.initialParams;
66-
}
67-
}
68-
6962
/**
7063
* Makes sure the parameters are reset when the script changes
7164
* @param changes
@@ -82,7 +75,8 @@ export class ProcessParametersComponent implements OnChanges, OnInit {
8275
*/
8376
initParameters() {
8477
if (hasValue(this.initialParams)) {
85-
this.parameterValues = this.initialParams;
78+
this.parameterValues = [...this.initialParams];
79+
this.addParameter();
8680
} else {
8781
this.parameterValues = [];
8882
this.initializeParameter();

0 commit comments

Comments
 (0)