Skip to content

fix(ep): hide request link without read permission - #1062

Open
TahaKhan998 wants to merge 1 commit into
CERNDocumentServer:masterfrom
TahaKhan998:fix/issue-1027-ep-approval-request-link
Open

TahaKhan998 wants to merge 1 commit into
CERNDocumentServer:masterfrom
TahaKhan998:fix/issue-1027-ep-approval-request-link

Conversation

@TahaKhan998

@TahaKhan998 TahaKhan998 commented Nov 12, 2026 •

Copy link
Copy Markdown

closes #1027
record owners were seeing the ep approval request link even though they cant open the request (permission denied). step 3 also looked done for them after approval just because they cant create the public version.

now we only include the request link if the current user can actually read the request, and step 3 is only marked done when a public record exists.

Record not created yet:

image image

Record after being published:

Owner of the community's view:
image

Owner of the record's view:
image

Summary by CodeRabbit

  • New Features
    • Added a compact committee approval status view for eligible records, showing a published-record link or relevant request status and outcome details.
    • Added optional help information and descriptions to approval statuses.
  • Bug Fixes
    • Step 3 now reflects public-record availability, review completion, and whether record creation is available.
    • Request details and links are shown only to viewers with permission; others see status information only.

@zzacharo

Copy link
Copy Markdown
Contributor

@TahaKhan998 what about the steps where the user doesnt have access and there is no request created yet or it is still pending? what do we show?

@TahaKhan998

Copy link
Copy Markdown
Author

@TahaKhan998 what about the steps where the user doesnt have access and there is no request created yet or it is still pending? what do we show?

heres what it looks like for the different roles:

  1. no request yet - record owner
image
  1. no request yet - community owner
image
  1. pending - record owner
image
  1. pending - community owner
image

record owner still sees the steps, just no buttons/links. community owner gets the buttons. referee cant open the restricted record until they have access

@TahaKhan998
TahaKhan998 force-pushed the fix/issue-1027-ep-approval-request-link branch from c360978 to 4248fec Compare November 16, 2026 15:02
@TahaKhan998

Copy link
Copy Markdown
Author

updated what record owners, community curators and community members see (they all get the same status-only view, no actions):

  1. no request yet - nothing shown
image
  1. pending
image
  1. accepted
image
  1. published
image

community managers still get the full interactive 3-step.

the alternative mentioned was basically the same thing but keeping all steps visible together, with the ones not completed yet shown as disabled. went with the compact status-only version instead

@TahaKhan998
TahaKhan998 force-pushed the fix/issue-1027-ep-approval-request-link branch from 4248fec to 20b81d4 Compare November 30, 2026 10:49
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

An error occurred during the review process. Please try again later.

Walkthrough

The PR adds permission-aware request status data and status displays for community readers and non-submitters. It also updates the completion rules for committee approval step 3.

Changes: Committee approval status

Layer / File(s) Summary
Permission-aware request state
site/cds_rdm/requests/committee_approval_state.py, site/tests/test_committee_approval.py
When the current identity cannot read a request, the result contains only its status. The code builds status-only data from request and approval information, with tests for its status cases.
Status-only approval views
assets/js/components/record_details/CommitteeApproval.js, site/cds_rdm/templates/semantic-ui/cds_rdm/records/side_bar/committee_approval_status.html, invenio.cfg, assets/less/cds-rdm/committee_approval/committee-workflow.less
The PR adds status-only displays for eligible community readers and non-submitters. The displays can show a public-record link, report numbers, status text, an optional icon, tooltip, and description.
Step 3 completion state
assets/js/components/record_details/CommitteeApproval.js
Step 3 is complete only when a public record ID or approved public version exists. The step is disabled when review is incomplete or public-record creation is unavailable.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant ApprovalState as get_committee_approval_state
  participant StatusBuilder as _build_status_only
  participant StatusTemplate as Committee approval status template
  ApprovalState->>StatusBuilder: Build status-only data
  StatusBuilder-->>ApprovalState: Return status fields or None
  ApprovalState->>StatusTemplate: Provide approval state
  StatusTemplate->>StatusTemplate: Render link or status details
Loading

Suggested reviewers: palkerecsenyi, zzacharo

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

assets/js/components/record_details/CommitteeApproval.js

Parsing error: Cannot find module '@babel/preset-react'
Require stack:

  • /node_modules/.pnpm/@babel+core@7.29.7/node_modules/@babel/core/lib/config/files/plugins.js
  • /node_modules/.pnpm/@babel+core@7.29.7/node_modules/@babel/core/lib/config/files/index.js
  • /node_modules/.pnpm/@babel+core@7.29.7/node_modules/@babel/core/lib/index.js
  • /node_modules/.pnpm/@babel+eslint-parser@7.29.9_@babel+core@7.29.7_eslint@8.57.1/node_modules/@babel/eslint-parser/lib/worker/babel-core.cjs
  • /node_modules/.pnpm/@babel+eslint-parser@7.29.9_@babel+core@7.29.7_eslint@8.57.1/node_modules/@babel/eslint-parser/lib/worker/handle-message.cjs
  • /node_modules/.pnpm/@babel+eslint-parser@7.29.9_@babel+core@7.29.7_eslint@8.57.1/node_modules/@babel/eslint-parser/lib/client.cjs
  • /node_modules/.pnpm/@babel+eslint-parser@7.29.9_@babel+core@7.29.7_eslint@8.57.1/node_modules/@babel/eslint-parser/lib/index.cjs
  • /node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs

Make sure that all the Babel plugins and presets you are using
are defined as dependencies or devDependencies in your package.json
file. It's possible that the missing plugin is loaded by a preset
you are using that forgot to add the plugin to its dependencies: you
can workaround this problem by explicitly adding the missing package
to your top-level package.json.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@TahaKhan998

Copy link
Copy Markdown
Author

Records owner:

image image image image

Community managers:

image image image

@TahaKhan998

Copy link
Copy Markdown
Author

record owner:

image image image

-#}
{%- if not show_record_management_menu %}
{%- set ca = get_committee_approval_state(record_ui, record) %}
{%- if ca and ca.community_enrolled and not ca.can_submit and not ca.is_public_approved_record %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a duplication of logic and strings (like step_info) with CommitteeApprovalManageSection, which makes it error prone if we forget that we have to update it in 2 places.

was it decided that everybody should see this status, not just management?

What about having a new CommitteeApprovalSection which then has 2 components based on the access: CommitteeApprovalManageSection and CommitteeApprovalReadOnlySection (naming can be different)? and then the read-only part can be mounted for non-managers?

other option would be to extend get_committee_approval_state with these strings?

WDYT?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes after investigating, you're right. i went for the alternative solution you suggested because the status strings already belong on get_committee_approval_state (that helper is what feeds both the manage menu and the sidebar anyway). so now it builds status_only, and jinja + react just render that. same copy, no second place to update, no extra react mount.

and yeah, status for everyone was already decided: record owners/curators/members get the compact status-only view, managers keep the full workflow. no request yet = nothing shown.

@TahaKhan998
TahaKhan998 force-pushed the fix/issue-1027-ep-approval-request-link branch from 7c27ca1 to 25cdc0f Compare December 4, 2026 15:15

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EP Approval Request Workflow improvements

3 participants