From 1443f982117d43bc9b8372cb93c67c5ab398c9b0 Mon Sep 17 00:00:00 2001 From: Tom Morrell Date: Wed, 4 Sep 2024 16:19:12 -0700 Subject: [PATCH] Deposit form customization --- .../invenio_app_rdm/deposit/RDMDepositForm.js | 277 +++++++++--------- 1 file changed, 135 insertions(+), 142 deletions(-) diff --git a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js index aa0eab5cd..2e80ce732 100644 --- a/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js +++ b/invenio_app_rdm/theme/assets/semantic-ui/js/invenio_app_rdm/deposit/RDMDepositForm.js @@ -143,41 +143,6 @@ export class RDMDepositForm extends Component { - - - {this.noFiles && record.is_published && ( -
- {i18next.t("The record has no files.")} -
- )} - - - -
-
- - - - + + + + @@ -290,6 +273,7 @@ export class RDMDepositForm extends Component { > @@ -340,8 +324,47 @@ export class RDMDepositForm extends Component { noFiles={this.noFiles} hideCommunitySelection={this.hide_community_selection} /> + + + + + + + + + + + {!_isEmpty(customFieldsUI) && ( + + import(`@templates/custom_fields/${widget}.js`), + (widget) => + import(`@js/invenio_rdm_records/src/deposit/customFields`), + (widget) => import(`react-invenio-forms`), + ]} + fieldPathPrefix="custom_fields" + /> + + )} + - - - - - - lang !== null - )} // needed because dumped empty record from backend gives [null] - serializeSuggestions={(suggestions) => - suggestions.map((item) => ({ - text: item.title_l10n, - value: item.id, - key: item.id, - })) - } - /> - - + lang !== null + )} // needed because dumped empty record from backend gives [null] + serializeSuggestions={(suggestions) => + suggestions.map((item) => ({ + text: item.title_l10n, + value: item.id, + key: item.id, + })) + } + /> + @@ -535,25 +528,24 @@ export class RDMDepositForm extends Component { + + - @@ -561,64 +553,65 @@ export class RDMDepositForm extends Component { - + + {this.noFiles && record.is_published && ( +
+ {i18next.t("The record has no files.")} +
+ )} - +
- {!_isEmpty(customFieldsUI) && ( - - import(`@templates/custom_fields/${widget}.js`), - (widget) => - import(`@js/invenio_rdm_records/src/deposit/customFields`), - (widget) => import(`react-invenio-forms`), - ]} - fieldPathPrefix="custom_fields" - /> - - )} +