Repository navigation
feat(#2990): mission completion-path ordering - #3001
Merged
Merged
Conversation
…CommunityToMission
…r sites
- packages/content/catalog-data.js: add pathOrder to columns, orderBy('pathOrder','name')
- srv/lib/build-catalog.js: orderBy('mission_ID','pathOrder','name') for cross-mission query
- srv/developer-service.js: orderBy('pathOrder','name') in getEventProgress and getAppSpaceProgress
- srv/lib/branch/mission-detail.js: append orderBy('pathOrder','name') to paths SELECT
- packages/content/catalog-mission-hierarchy.js: update JSDoc comment
- vitest.config.ts: add @tutorials/content alias to resolve worktree src in unit tests
- test/: add pathOrder-ordering assertions in catalog-data, build-catalog-mission-detail,
and app-space-segments-resolver (NULL pathOrder sorts first on SQLite per observed behavior)
…e sentinel)
Use tagged template literal .orderBy\`coalesce(pathOrder, 999999), name\` at all
five CompletionPaths render sites. Plain .orderBy('pathOrder','name') sorts NULLs
FIRST on SQLite but LAST on HANA — coalesce(pathOrder, 999999) forces NULL-last on
both engines. Tests updated to assert NULL-last ordering.
Fixes the { func: 'coalesce', args: [...] } object form which is not valid as a
fluent .orderBy() positional arg — the orders() function treats plain objects without
.ref as {field: sort} pairs, turning 'func' into a field reference lookup that fails.
The tagged template literal form goes through cds.parse._select and produces the
correct CQL func/args AST.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2990.
What
Lets Mission admins set the display order of a mission's Completion Paths, and makes every learner-facing surface honour that order. Mirrors the existing
CompletionPathItems.itemOrderpattern.Changes
CompletionPaths.pathOrder : Integer(db/schema.cds).app/admin-annotations.cds): editable "Order" column (first) +PresentationVariant.SortOrderon CompletionPaths.srv/admin-service.js):setPathOrderbefore-NEW/CREATE handler gap-numbers new paths (max(pathOrder)+10per mission), mirroringsetGroupItemOrder. Carried throughcopyMission(preserves source order) andpromoteCommunityToMission(seeds10).coalesce(pathOrder, 999999), nameso NULLs sort last identically on HANA and SQLite:packages/content/catalog-data.js(mission SSR)srv/lib/build-catalog.js(catalog,mission_IDfirst)srv/developer-service.js—getAppSpaceProgress(/app-space/ page) +getEventProgresssrv/lib/branch/mission-detail.js(branchingpaths[0])scripts/backfill-completion-path-order.cjs): one-shot, per-mission alphabetical-by-name gap-numbering of existing NULL rows;--dry-run/--commit/--verify-only; snapshot-before-write; idempotent. npm scriptbackfill-completion-path-order.Design decisions (confirmed with maintainer)
paths[0]) becomes the alphabetically-first path on deploy — accepted one-time shift.event-path-buckets.js) intentionally keep their completion-count sort — different surface, not changed.Tests
setPathOrdergap-numbering + explicit-preserve;copyMissioncarry; path ordering at app-space / catalog / mission-detail (each asserts NULL sorts last — would fail under a plain orderBy on SQLite); backfill A=10/B=20/C=30 + idempotency + base-extension. All green.test/hybrid/backfill-completion-path-order.test.js): runs at deploy (needs cf login + HANA).Deploy steps (required for the feature to take effect)
npm run deploy -- --env dev(NO--skip-build/-m— admin UI + content bundle are build-gated).npm run backfill-completion-path-order -- --commitagainst DEV HANA (then--verify-only-> exit 0).gh workflow run rebuild-content.yml -f mode=fullso mission SSR/catalog BLOBs bake the new order.ALLOW_HYBRID_WRITES=true npm run test:hybrid -- backfill-completion-path-order(cf login)./app-space/?eventId=....Notes
build:all.content.bundle.mjsis gitignored (regenerated at build) — not in the diff by design.