Skip to content

fix: always show all CRE links on CRE pages without collapsing (#901)#909

Merged
Pa04rth merged 1 commit into
OWASP:mainfrom
shreeshtripurwarcomp23-coder:fix/901-always-expand-cre-links
May 30, 2026
Merged

fix: always show all CRE links on CRE pages without collapsing (#901)#909
Pa04rth merged 1 commit into
OWASP:mainfrom
shreeshtripurwarcomp23-coder:fix/901-always-expand-cre-links

Conversation

@shreeshtripurwarcomp23-coder
Copy link
Copy Markdown
Contributor

Fixes #901

Problem

On a CRE page, lists of linked CREs were being collapsed after 5 items,
requiring users to click "Show more" to see the rest. This happened because
the collapse logic in CommonRequirementEnumeration.tsx did not distinguish
between CRE links and links to external standards.

Fix

Added a check in CommonRequirementEnumeration.tsx: if all links in a group
are CREs, show all of them without collapsing and hide the "Show more" button.
Links to external standards still collapse as before.

This matches the logic already present in DocumentNode.tsx (allLinksAreCres).

Changes

  • application/frontend/src/pages/CommonRequirementEnumeration/CommonRequirementEnumeration.tsx
    • Import DOCUMENT_TYPES from ../../const
    • Compute allLinksAreCres before rendering each link group
    • Use visibleResults (full list when CREs, sliced otherwise) instead of inline slice
    • Guard the "Show more" button with !allLinksAreCres

@Pa04rth
Copy link
Copy Markdown
Collaborator

Pa04rth commented May 24, 2026

@shreeshtripurwarcomp23-coder Add the screenshot/screen recording of the result

@shreeshtripurwarcomp23-coder
Copy link
Copy Markdown
Contributor Author

@Pa04rth
Thank you for the feedback, @Pa04rth !
Please find the screenshot attached showing the fix working locally.

The issue was in CommonRequirementEnumeration.tsx — the collapse logic (slicing the list after 5 items and showing a "Show more" button) was being applied to all link types including CREs, with no distinction between CRE links and links to external standards.

The fix adds an allLinksAreCres check that mirrors the same pattern already correctly implemented in DocumentNode.tsx. When all links in a group are of type CRE, the full list is shown without slicing and the "Show more" button is hidden. Links to external standards continue to collapse as before.

Changes are limited to a single file: CommonRequirementEnumeration.tsx

  • Added DOCUMENT_TYPES import from ../../const
  • Compute allLinksAreCres before rendering each link group
  • Use visibleResults (full list for CREs, sliced for others) instead of inline slice
  • Guard the "Show more" button with !allLinksAreCres
OWASP SCREENSHOT

@Pa04rth
Copy link
Copy Markdown
Collaborator

Pa04rth commented May 26, 2026

@shreeshtripurwarcomp23-coder Approved

@shreeshtripurwarcomp23-coder
Copy link
Copy Markdown
Contributor Author

@Pa04rth
I've force pushed a signed/verified commit, could you please approve the workflows to run?

@shreeshtripurwarcomp23-coder shreeshtripurwarcomp23-coder force-pushed the fix/901-always-expand-cre-links branch from 864c77b to b4e139f Compare May 26, 2026 05:27
@Pa04rth Pa04rth merged commit e93ce92 into OWASP:main May 30, 2026
3 checks passed
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.

Do not collapse CREs

2 participants