Skip to content

Commit bdb4700

Browse files
UFAL/Show openaire input field every time the EU funding type is selected (#897)
* Show openaire input field every time the EU type is selected
1 parent 76e5772 commit bdb4700

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/app/shared/form/builder/ds-dynamic-form-ui/models/ds-dynamic-complex.model.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ export class DynamicComplexModel extends DynamicConcatModel {
109109
// remove undefined values
110110
values = values.filter(v => v);
111111

112-
// if funding type is `EU`
113-
let isEUFund = false;
114112
values.forEach((val, index) => {
115113
if (val.value) {
116114
// do not set value if it bigger than allowed length
@@ -123,13 +121,8 @@ export class DynamicComplexModel extends DynamicConcatModel {
123121
if (this.name === SPONSOR_METADATA_NAME) {
124122
// if funding type is `EU`
125123
if (index === FUNDING_TYPE_INDEX && DEFAULT_EU_FUNDING_TYPES.includes(val.value)) {
126-
isEUFund = true;
127-
}
128-
// if funding type is `EU` and input field is `openaire_id` -> show `openaire_id` readonly input field
129-
if (index === EU_IDENTIFIER_INDEX && isEUFund && val.value.includes(EU_PROJECT_PREFIX)) {
124+
// Show EU identifier input field
130125
(this.get(EU_IDENTIFIER_INDEX) as DsDynamicInputModel).hidden = false;
131-
} else {
132-
(this.get(EU_IDENTIFIER_INDEX) as DsDynamicInputModel).hidden = true;
133126
}
134127
}
135128
} else if (hasValue((this.get(index) as DsDynamicInputModel))) {

0 commit comments

Comments
 (0)