Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .deploy/mta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ID: tutorials-ims
# Bump this on each release you deploy — it's the version shown by `cf mtas`
# and in the mtar filename (tutorials-ims_<version>.mtar). Deploy is manual:
# `cd .deploy && mbt build && cf deploy mta_archives/tutorials-ims_<version>.mtar -e ../deploy/<env>.mtaext -f`.
version: 1.44.4
version: 1.45.0

# Top-level parameters (overridable per-env via deploy/<env>.mtaext).
parameters:
Expand Down
27 changes: 22 additions & 5 deletions packages/content/content-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,15 @@ export function createContentHandlers({ namespace = 'com.sap.developers.ims', ap
allTutRows.filter(t => slugSet.has(t.slug) && t.status === 'INACTIVE').map(t => t.slug)
);

// Public-feed exclusion set: slugs whose Tutorials row is ROLE_GATED. Used to
// drop gated tutorials from the public feed WITHOUT dropping content slugs that
// simply have no Tutorials row yet (e.g. published-but-not-yet-indexed, or the
// metadata-light fallback path). Pre-#3168 the fallback required no Tutorials
// join at all; requiring tutMap[r.slug] here regressed those slugs to invisible.
const gatedSlugs = new Set(
allTutRows.filter(t => slugSet.has(t.slug) && t.visibility === 'ROLE_GATED').map(t => t.slug)
);

const tutMap = Object.fromEntries(tutRows.map(t => [t.slug, t]));
const tutIds = tutRows.map(t => t.ID).filter(Boolean);
const tutIdSet = new Set(tutIds);
Expand Down Expand Up @@ -1862,11 +1871,19 @@ export function createContentHandlers({ namespace = 'com.sap.developers.ims', ap

// Build result: iterate contentRows so order mirrors publish order.
const tutorials = contentRows
.filter(r =>
r.slug !== '__nav__' && r.slug !== '__404__' &&
r.slug !== '__shell__' && !inactiveSlugs.has(r.slug) &&
tutMap[r.slug] // only slugs that passed the visibility filter
)
.filter(r => {
if (r.slug === '__nav__' || r.slug === '__404__' || r.slug === '__shell__') return false;
if (inactiveSlugs.has(r.slug)) return false;
if (isGatedFilter) {
// Gated feed: only slugs with a ROLE_GATED Tutorials row (tutMap holds
// exactly those for this filter).
return Boolean(tutMap[r.slug]);
}
// Public feed: keep every content slug EXCEPT those whose Tutorials row is
// ROLE_GATED. Slugs with no Tutorials row fall through as public (metadata
// defaults below) — restores the pre-#3168 fallback behavior.
return !gatedSlugs.has(r.slug);
})
.map(r => {
const meta = tutMap[r.slug];
return {
Expand Down
Loading