From af7099f30c23f23689ec1a8153c3bc710f826fd4 Mon Sep 17 00:00:00 2001 From: Pal Kerecsenyi Date: Wed, 17 Jun 2026 16:17:41 +0200 Subject: [PATCH] feat(ep): redesign request page UI; remove record metadata fields --- .../record_details/CreatePublicRecordModal.js | 23 ++- .../components/record_details/EPApproval.js | 30 ++-- .../record_details/EPApprovalSubmitModal.js | 40 ----- .../requests/EPApprovalRequestDetails.js | 142 --------------- .../less/cds-rdm/ep_approval/ep-workflow.less | 37 ++-- site/cds_rdm/requests/ep_approval.py | 5 - .../invenio_requests/ep-approval/index.html | 169 ++++++++---------- 7 files changed, 133 insertions(+), 313 deletions(-) delete mode 100644 assets/js/components/requests/EPApprovalRequestDetails.js diff --git a/assets/js/components/record_details/CreatePublicRecordModal.js b/assets/js/components/record_details/CreatePublicRecordModal.js index f30aa797..74dddde5 100644 --- a/assets/js/components/record_details/CreatePublicRecordModal.js +++ b/assets/js/components/record_details/CreatePublicRecordModal.js @@ -6,7 +6,14 @@ import React, { Component } from "react"; import PropTypes from "prop-types"; -import { Button, Checkbox, Header, Icon, Message, Modal } from "semantic-ui-react"; +import { + Button, + Checkbox, + Header, + Icon, + Message, + Modal, +} from "semantic-ui-react"; import { http } from "react-invenio-forms"; import { i18next } from "@translations/invenio_rdm_records/i18next"; @@ -113,7 +120,9 @@ export class CreatePublicRecordModal extends Component { ) : publicRecord ? ( - {i18next.t("Public record created")} + + {i18next.t("Public record created")} + {i18next.t("The public record has been created successfully.")}{" "} this.setState({ agreedToTerms: checked })} + onChange={(_, { checked }) => + this.setState({ agreedToTerms: checked }) + } label={

{pubRn - ? i18next.t("EP-approved as {{rn}}", { rn: pubRn }) + ? i18next.t("EP-approved as ") : i18next.t("EP-approved record")} + + {pubRn && {pubRn}} + {canViewReviewedVersion && draftRecordId && ( <> {" · "} @@ -158,12 +164,12 @@ export class EPApprovalManageSection extends Component { target="_blank" rel="noreferrer" > - {i18next.t("Review history")} + {i18next.t("Original record")} )} - +

); } @@ -202,7 +208,7 @@ export class EPApprovalManageSection extends Component { // Timeline step states // Step 1 — Request for approval - const step1Completed = !!approvedReportNumber; + const step1Completed = !!openRequest && !isDeclined; const step1Active = !step1Completed && !isPending; // Step 2 — EP Board review @@ -300,11 +306,7 @@ export class EPApprovalManageSection extends Component { {step2Completed ? ( requestLink ? ( - + {i18next.t("Approved as {{rn}}", { rn: approvedReportNumber, })} @@ -348,7 +350,9 @@ export class EPApprovalManageSection extends Component {
- {i18next.t("Create final public version")} + {step3Completed + ? i18next.t("Final public version created") + : i18next.t("Create final public version")} {step3Completed ? ( diff --git a/assets/js/components/record_details/EPApprovalSubmitModal.js b/assets/js/components/record_details/EPApprovalSubmitModal.js index f18f1f3d..38c424c8 100644 --- a/assets/js/components/record_details/EPApprovalSubmitModal.js +++ b/assets/js/components/record_details/EPApprovalSubmitModal.js @@ -18,11 +18,6 @@ import { http } from "react-invenio-forms"; import { i18next } from "@translations/invenio_app_rdm/i18next"; const buildInitialForm = (record) => ({ - experiment: "", - submitted_by: "", - role: "", - publication_title: record?.metadata?.title || "", - latest_version_url: record?.links?.self_html || "", rapid_approval: false, cb_review_completed: false, cb_process_type: "", @@ -94,41 +89,6 @@ export class EPApprovalSubmitModal extends Component { {error && }
- - - - - <>{value ? i18next.t("Yes") : i18next.t("No")}; - -BoolCell.propTypes = { value: PropTypes.bool.isRequired }; - -const EPApprovalPayloadCard = ({ request }) => { - const payload = request.payload || {}; - const topicLinks = request.topic?.links || {}; - - return ( - - - {topicLinks.self_html && ( - - {i18next.t("Record")} - - - {topicLinks.self_html} - - - - )} - - {i18next.t("Experiment")} - {payload.experiment || "—"} - - - {i18next.t("Submitted by")} - {payload.submitted_by || "—"} - - - {i18next.t("Role")} - {payload.role || "—"} - - {payload.latest_version_url && ( - - {i18next.t("Latest version at")} - - - {payload.latest_version_url} - - - - )} - - {i18next.t("Rapid approval")} - - - - - - {i18next.t("CB review completed")} - - - {payload.cb_review_completed && payload.cb_process_type && ( - <> ({payload.cb_process_type}) - )} - - - - {i18next.t("Paper signed by whole collaboration")} - - - {!payload.paper_signed && payload.num_non_signers > 0 && ( - <> — {i18next.t("{{n}} non-signer(s)", { n: payload.num_non_signers })} - )} - - - {payload.controversy && ( - - {i18next.t("Controversy")} - {i18next.t("Yes")} - - )} - {payload.additional_communication && ( - - {i18next.t("Additional communication")} - - {payload.additional_communication} - - - )} - {payload.approved_report_number && ( - - {i18next.t("Approved report number")} - - {payload.approved_report_number} - - - )} - -
- ); -}; - -EPApprovalPayloadCard.propTypes = { - request: PropTypes.object.isRequired, -}; - -export const EPApprovalAwareRequestDetails = ({ - request, - userAvatar, - permissions, - config, -}) => { - const isEPApproval = request.type === "ep-approval"; - - return ( - - - {isEPApproval && } - - - - - - - ); -}; - -EPApprovalAwareRequestDetails.propTypes = { - request: PropTypes.object.isRequired, - userAvatar: PropTypes.string, - permissions: PropTypes.object.isRequired, - config: PropTypes.object.isRequired, -}; - -EPApprovalAwareRequestDetails.defaultProps = { - userAvatar: "", -}; diff --git a/assets/less/cds-rdm/ep_approval/ep-workflow.less b/assets/less/cds-rdm/ep_approval/ep-workflow.less index 5caeb911..f76bfc38 100644 --- a/assets/less/cds-rdm/ep_approval/ep-workflow.less +++ b/assets/less/cds-rdm/ep_approval/ep-workflow.less @@ -1,13 +1,15 @@ -.ep-step-group .step .content { - flex: 1; -} +.ep-step-group .step { + .content { + flex: 1; + } -.ep-step-group .step::after { - display: none !important; -} + &::after { + display: none !important; + } -.ep-step-group .step::before { - width: 30px; + &::before { + width: 30px; + } } .ep-action-step { @@ -16,8 +18,23 @@ align-items: center; width: 100%; column-gap: 5px; + + .description { + font-size: 1em !important; + } } -.ep-action-step .description { - font-size: 1em !important; +dl.ep-submission-details { + dt { + font-size: 0.9em; + color: @mutedTextColor; + margin-bottom: 2px; + } + + dd { + .ep-details-note { + // A little bit darker than @mutedTextColor to distinguish from the labels + color: #555; + } + } } diff --git a/site/cds_rdm/requests/ep_approval.py b/site/cds_rdm/requests/ep_approval.py index 7ec021a8..84752324 100644 --- a/site/cds_rdm/requests/ep_approval.py +++ b/site/cds_rdm/requests/ep_approval.py @@ -346,11 +346,6 @@ class EPApprovalRequest(RDMBaseRequest): # Populated on accept by the system. "approved_report_number": fields.Str(load_default=None), # Form fields. - "experiment": fields.Str(required=True), - "submitted_by": fields.Str(required=True), - "role": fields.Str(required=True), - "publication_title": fields.Str(required=True), - "latest_version_url": fields.Str(load_default=None), "rapid_approval": fields.Bool(load_default=False), "cb_review_completed": fields.Bool(load_default=False), "cb_process_type": fields.Str(load_default=None), # "standard" | "accelerated" diff --git a/templates/semantic-ui/invenio_requests/ep-approval/index.html b/templates/semantic-ui/invenio_requests/ep-approval/index.html index 3edf1596..61caead6 100644 --- a/templates/semantic-ui/invenio_requests/ep-approval/index.html +++ b/templates/semantic-ui/invenio_requests/ep-approval/index.html @@ -24,109 +24,80 @@ {% set p = invenio_request.get("payload", {}) %} {% if p %} -
-
- {{ _("Submission details") }} -
-
- {% if p.get("approved_report_number") %} -
- {{ _("Approved report number:") }} {{ p.approved_report_number }} +
+ {% if p.get("approved_report_number") %} +
+
{{ _("Approved report number") }}
+
+ {{ p.approved_report_number }}
- {% endif %} - -
-
- {% if p.get("experiment") %} -
- {{ _("Experiment") }} -
-
- {{ p.experiment }} -
- {% endif %} - - {% if p.get("submitted_by") %} -
- {{ _("Submitted by") }} -
-
- {{ p.submitted_by }} - - {% if p.get("role") %} - ({{ p.role }}) - {% endif %} -
- {% endif %} - - {% if p.get("publication_title") %} -
- {{ _("Publication title") }} -
-
- {{ p.publication_title }} -
- {% endif %} -
-
-
- {{ _("Rapid approval") }} -
-
- {{ _("Requested") if p.get("rapid_approval") else _("Not requested") }} -
- -
- {{ _("CB review completed") }} -
-
- {{ _("Yes") if p.get("cb_review_completed") else _("No") }} - {% if p.get("cb_review_completed") and p.get("cb_process_type") %} - ({{ p.cb_process_type }}) - {% endif %} -
- -
- {{ _("Paper signed by whole collaboration") }} -
-
- {{ _("Yes") if p.get("paper_signed") else _("No") }} - {% if not p.get("paper_signed") and p.get("num_non_signers") %} -
{{ p.num_non_signers }} {{ _("non-signer(s)") }} - {% endif %} -
- - {% if not p.get("paper_signed") %} -
- {{ _("Controversy") }} -
-
- {{ _("Yes") if p.get("controversy") else _("No") }} -
- {% endif %} -
- -
- {% if p.get("additional_communication") %} -
- {{ _("Additional communication") }} -
-
- {{ p.additional_communication }} -
+ {% endif %} + +
+
{{ _("Rapid approval") }}
+
+ {% if p.get("rapid_approval") %} + {{ _("Requested") }} + {% else %} + {{ _("Not requested") }} {% endif %} - - {% if p.get("latest_version_url") %} -
- - {{ _("View latest record version") }} - - -
+
+
+
+
{{ _("CB review completed") }} +
+ + {{ _("Yes") if p.get("cb_review_completed") else _("No") }} + + {% if p.get("cb_review_completed") and p.get("cb_process_type") %} + + ({{ p.cb_process_type }}) + + {% endif %} +
+
+
+
+ {{ _("Paper signed by whole collaboration") }} +
+
+ + {{ _("Yes") if p.get("paper_signed") else _("No") }} + + {% if not p.get("paper_signed") and p.get("num_non_signers") %} + + {{ p.num_non_signers }} {{ _("non-signer(s)") }} + {% endif %} - +
-
+
+
+ {{ _("Controversy") }} +
+
+ {% if p.get("controversy") %} + {{ _("Yes") }} + {% else %} + + {{ _("No") }} + + {% endif %} +
+
+
+ + {% if p.get("additional_communication") %} +
+
+ {{ _("Additional communication") }} +
+
+ {{ p.additional_communication }} +
+
+ {% endif %} + {% endif %} {%- endblock request_header %}