Repository navigation
[FE] Guard the Competency Management route by taxonomy type (redirect non-Competency taxonomies) #707
Copy link
Copy link
Open
Description
Activity
- moved this to Needs additional details in Competency Criteria and Student Progress
on Jul 28, 2026 - changed the title
[-][Placeholder for FE] Error Page displayed when a taxonomy type is not competency[/-][+][Placeholder for FE] Guard the Competency Management route by taxonomy type (redirect non-Competency taxonomies)[/+]on Jul 29, 2026 - changed the title
[-][Placeholder for FE] Guard the Competency Management route by taxonomy type (redirect non-Competency taxonomies)[/-][+][FE] Guard the Competency Management route by taxonomy type (redirect non-Competency taxonomies)[/+]on Jul 29, 2026 - moved this from Needs additional details to Ready for Community Review in Competency Criteria and Student Progress
on Jul 31, 2026 - moved this from Ready for Community Review to Final Axim Review in Competency Criteria and Student Progress
on Aug 21, 2026 The discussion period for this ticket is now complete, and we appreciate all the feedback. We'll be moving forward with development based on the current ticket pending final Axim sign-off. That said, the conversation doesn't have to stop. If you still have feedback, please continue to add to this ticket. We'll review anything new and determine whether it fits within the current timeline or makes more sense as its own ticket for future work. Thanks again for helping make this better!
@jmakowski1123 This is ready for your review. Thank you!
2 remaining items
- added this to CBE and Skills Forward Roadmap - High Level and removed this from Learning Pathways
on Aug 26, 2026 - moved this to Todo in CBE and Skills Forward Roadmap - High Level
on Aug 26, 2026 Looks good.
- moved this from Final Axim Review to Todo in Competency Criteria and Student Progress
on Aug 31, 2026 - moved this from Todo to Next Sprint in Competency Criteria and Student Progress
on Aug 31, 2026 - moved this from Next Sprint to Todo in Competency Criteria and Student Progress
on Sep 4, 2026 - moved this from Todo to In Progress in Competency Criteria and Student Progress
on Sep 18, 2026 - moved this from In Progress to Unicon Code Review in Competency Criteria and Student Progress
on Sep 23, 2026 - moved this from Unicon Code Review to Community Code Review in Competency Criteria and Student Progress
on Sep 24, 2026 Environment: Master Sandbox, https://apps.master.openedx.io/authoring (frontend-app-authoring PR openedx/frontend-app-authoring#3264 deployed)
Test users:dmitryvarenikqa: global Stafftest670: no Staff or Org Staff role
Test type: UI testing in Studio (With the browser DevTools Network view used to check API responses and to simulate a slow or failing request)
Result: All scenarios passed. No bugs found.
Test data
- Competency taxonomy "QA706 Source Competency Taxonomy" (id 58), available to both test users.
- Tags taxonomies "QA706 Regression Tags" (id 61), "QA706 Tags From CM" (id 67), and "QA706 Pending List Cancel" (id 74).
- Competency taxonomy "QA706 Imported Framework" (id 59), which
test670cannot access. - A taxonomy id that does not exist (999999).
Route guard
Scenario Result A competency taxonomy opens the Competency Management page ( dmitryvarenikqa).Pass A competency taxonomy opens the Competency Management page for a user without roles ( test670). The "Import Competency Framework" button is not shown, as in #706.Pass A tags taxonomy redirects from /taxonomy/<id>/competenciesto its detail page/taxonomy/<id>(checked for 61, 67, and 74).Pass On a slow network, only a spinner is shown until the taxonomy loads. For a tags taxonomy, the Competency Management page never appears before the redirect. Pass A taxonomy that does not exist shows the same error as its detail page, without a redirect. Pass A taxonomy the user cannot access ( test670, id 59) shows the same error as its detail page, without a redirect.Pass After the redirect, the browser Back button returns to the previous page instead of /competencies, so there is no redirect loop.Pass Additionally tested
Scenario Result A competency taxonomy is redirected to its detail page when the user cannot tag it ( can_tag_object: false). Master Sandbox has no such taxonomy, so the API response was modified in the browser to setcan_tag_objecttofalse.Pass When the page is opened in a new empty tab and redirected, Back leaves the app and does not return to /competencies.Pass A tags taxonomy does not load the competency tree before the redirect. Pass A failed taxonomy request shows an error instead of a redirect. Pass A non-numeric id ( /taxonomy/abc/competencies) shows the same error as the detail page. An id with a leading zero (061) redirects to/taxonomy/61.Pass The taxonomy card link on the Taxonomies page has no trailing slash ( /taxonomy/61).Pass Regression
Scenario Result #663: "Apply Competencies" in the card, in the card menu, and in the detail page Actions menu opens the Competency Management page of a competency taxonomy. Pass #663: A tags taxonomy shows no "Apply Competencies" in its card or menu. Pass #706: The "Import Competency Framework" button is not shown for a tags taxonomy. Pass #706: Import with Taxonomy Type "Competency" opens the new taxonomy's Competency Management page. Pass #706: Import with Taxonomy Type "Tags" opens the new taxonomy's detail page directly. Pass
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsReady for UAT
Use Case
As a user who reaches the Competency Management page's URL for a taxonomy that is not a Competency type (a typed URL or a stale link), I want to be taken to where I can actually view that taxonomy instead of a competency page that doesn't apply to it, so that I'm not stranded on an irrelevant screen.
Acceptance Criteria
Frontend/QA-testable.
Description
Current state
#680 builds the Competency Management page at
/taxonomy/:taxonomyId/competencies, which is only meaningful for Competency-type taxonomies. Nothing prevents a user from reaching that route with a non-Competency taxonomy id, whether by a hand-typed URL or a stale bookmark. A taxonomy's type comes from the taxonomy-type field #616 surfaces on the frontend, backed by the backend type plumbing (#618/#630).The sibling taxonomy-detail page already establishes the pattern this guard extends.
TaxonomyDetailPage.jsxfetches withuseTaxonomyDetails(taxonomyId)and gates on its flags in a fixed order:if (!isFetched) return <Loading />;(line 35-37), thenif (isError || !taxonomy) return <ConnectionErrorAlert />;(line 39-41), then it renders.Loadingis the shared component atsrc/generic/Loading.tsx: a ParagonSpinnercentered in a full-viewport-height flex container, with a translated "Loading..." screen-reader label.Requested change
On entering the
/taxonomy/:taxonomyId/competenciesroute, resolve the taxonomy's type:/taxonomy/:taxonomyId).Loadingspinner, the same oneTaxonomyDetailPage.jsxshows for its own fetch. Do not flash the competency page before redirecting, and do not redirect before the type is known.No dedicated error page — this is a silent, immediate redirect.
Out of scope
Loadingcomponent or touseTaxonomyDetails.Technical Notes
Files to Modify
src/taxonomy/competency-management/CompetencyManagementPage.tsx(from #680)/taxonomy/:taxonomyId; unfetched →Loading; errored/inaccessible id → error state, not a redirect; no back-button loop.Implementation Notes
Resolve the taxonomy for
:taxonomyIdvia the existing taxonomy-detail query (useTaxonomyDetailsor equivalent) and read its type using #616's predicate.Reuse the gate ladder
TaxonomyDetailPage.jsxalready uses, in the same order, and insert the type check as a fourth rung:!isFetched→return <Loading />, importing the sharedLoadingfromsrc/generic/Loading.tsxexactly asTaxonomyDetailPage.jsx:13does. Do not write a new spinner, do not inline a ParagonSpinner, and do not reach forLoadingSpinner(the named export, which is the bare inline spinner for small in-page regions). The default export gives the full-page centered treatment this route needs, and reusing it keeps the competency route visually identical to the detail page during load, which matters because the guard's whole job is to be invisible when it passes.isError || !taxonomy→ the same error treatment the detail page gives that case, so a missing or forbidden id behaves consistently across both routes. Keep this rung ahead of the type check: an errored query has no type, and treating "no type" as "not a Competency" would silently redirect a broken fetch instead of reporting it.<Navigate to={/taxonomy/${taxonomyId}} replace />.replaceis required so the back button does not bounce into a redirect loop.Example Resolution Prompt
Prerequisite: #618 (with its sibling #630), the backend taxonomy-type plumbing that supplies the type this guard checks. The guard has nothing to read until the type is a real value on the taxonomy-detail response.
Can be built alongside #616. #616 surfaces that same type on the frontend
TaxonomyDataand shares #618 as its prerequisite, so it is not a blocker for this ticket, it is a peer. Both consume #618's field. Coordinate on the field name and the Competency predicate's name so the two land compatibly, rather than sequencing this behind #616. #680 provides the page and route this guard wraps. Related: #663 (the entry point, only surfaced for Competency taxonomies, so normal navigation will not reach here for a non-Competency taxonomy; this guard covers direct or stale URLs).