From 59c16d02c3784fbb873155606fd0ff77fd833f7c Mon Sep 17 00:00:00 2001 From: Neil Dewhurst Date: Wed, 21 Aug 2024 19:33:05 +0100 Subject: [PATCH 1/5] add betaUntil as version label --- preview-src/docs-roles.adoc | 6 ++++++ src/js/data/rolesData.json | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/preview-src/docs-roles.adoc b/preview-src/docs-roles.adoc index 59e6c2c7..2ed22629 100644 --- a/preview-src/docs-roles.adoc +++ b/preview-src/docs-roles.adoc @@ -13,6 +13,12 @@ Flags sections as Not Available on Aura, Aura DB Enterprise, Enterprise Edition, -- +[role=betaUntil-5.12] +== Beta until + +Lorem ipsum. + + [role="label--new-5.17 label--enterprise-edition"] == Relationship property type constraints diff --git a/src/js/data/rolesData.json b/src/js/data/rolesData.json index 1fd9ac78..d95cc8aa 100644 --- a/src/js/data/rolesData.json +++ b/src/js/data/rolesData.json @@ -140,6 +140,12 @@ "labelCategory": "version", "displayText": "Beta" }, + "betaUntil":{ + "description": "The feature or function was in beta until the version specified", + "labelCategory": "version", + "displayText": "Beta", + "versionText": "until" + }, "deprecated":{ "labelCategory": "version", "displayText": "Deprecated" From 88bcfbc2b4f2b7f77202065463c35bad88092189 Mon Sep 17 00:00:00 2001 From: Neil Dewhurst Date: Thu, 22 Aug 2024 11:53:55 +0100 Subject: [PATCH 2/5] add beta-until label --- preview-src/docs-roles.adoc | 2 +- src/css/labels.css | 3 ++- src/js/60-docs-roles.js | 4 ++-- src/js/data/rolesData.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/preview-src/docs-roles.adoc b/preview-src/docs-roles.adoc index 2ed22629..7c71c2c8 100644 --- a/preview-src/docs-roles.adoc +++ b/preview-src/docs-roles.adoc @@ -13,7 +13,7 @@ Flags sections as Not Available on Aura, Aura DB Enterprise, Enterprise Edition, -- -[role=betaUntil-5.12] +[role=label--new-5.11 label--beta-until-5.12] == Beta until Lorem ipsum. diff --git a/src/css/labels.css b/src/css/labels.css index c7e925da..572840d7 100644 --- a/src/css/labels.css +++ b/src/css/labels.css @@ -167,7 +167,8 @@ span.label--yes { } span.label--alpha, -span.label--beta { +span.label--beta, +span.label--betaUntil { background: var(--alpha-beta-background-color); color: var(--alpha-beta-color); } diff --git a/src/js/60-docs-roles.js b/src/js/60-docs-roles.js index 19527fbc..d9a79761 100644 --- a/src/js/60-docs-roles.js +++ b/src/js/60-docs-roles.js @@ -27,7 +27,7 @@ document.addEventListener('DOMContentLoaded', function () { // label could be eg aura-db-enterprise - we use the full label // label could be eg new-5.20 - we use 'new' for the label and add the version as text - label = (rolesData[label] && rolesData[label].category !== 'version') ? label : labelParts[0] + label = (rolesData[label] && rolesData[label].labelCategory !== 'version') ? label : labelParts.slice(0,-1).join('-') // ignore labels that are not defined in rolesData if (!rolesData[label]) { @@ -47,7 +47,7 @@ document.addEventListener('DOMContentLoaded', function () { // get version number for version labels if ((rolesData[label].labelCategory === 'version' || rolesData[label].versionText) && labelParts[1]) { - labelDetails.data.version = labelParts[1] + labelDetails.data.version = labelParts.pop() const joinText = rolesData[label].versionText ? rolesData[label].versionText : 'in' labelDetails.text = [labelDetails.text, joinText, labelDetails.data.version].join(' ') } diff --git a/src/js/data/rolesData.json b/src/js/data/rolesData.json index d95cc8aa..54b6df2d 100644 --- a/src/js/data/rolesData.json +++ b/src/js/data/rolesData.json @@ -140,7 +140,7 @@ "labelCategory": "version", "displayText": "Beta" }, - "betaUntil":{ + "beta-until":{ "description": "The feature or function was in beta until the version specified", "labelCategory": "version", "displayText": "Beta", From 2da41fe8baa21087ffdba7fcd7d2df47fc4d1477 Mon Sep 17 00:00:00 2001 From: Neil Dewhurst Date: Thu, 22 Aug 2024 11:54:40 +0100 Subject: [PATCH 3/5] lint --- src/js/60-docs-roles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/60-docs-roles.js b/src/js/60-docs-roles.js index d9a79761..4e9b3c92 100644 --- a/src/js/60-docs-roles.js +++ b/src/js/60-docs-roles.js @@ -27,7 +27,7 @@ document.addEventListener('DOMContentLoaded', function () { // label could be eg aura-db-enterprise - we use the full label // label could be eg new-5.20 - we use 'new' for the label and add the version as text - label = (rolesData[label] && rolesData[label].labelCategory !== 'version') ? label : labelParts.slice(0,-1).join('-') + label = (rolesData[label] && rolesData[label].labelCategory !== 'version') ? label : labelParts.slice(0, -1).join('-') // ignore labels that are not defined in rolesData if (!rolesData[label]) { From 434225a0c977f4a0f3accfa7dbec124ddc3dff79 Mon Sep 17 00:00:00 2001 From: Neil Dewhurst Date: Thu, 22 Aug 2024 14:11:20 +0100 Subject: [PATCH 4/5] beta-until css --- src/css/labels.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/css/labels.css b/src/css/labels.css index 572840d7..5383edae 100644 --- a/src/css/labels.css +++ b/src/css/labels.css @@ -168,7 +168,7 @@ span.label--yes { span.label--alpha, span.label--beta, -span.label--betaUntil { +span.label--beta-until { background: var(--alpha-beta-background-color); color: var(--alpha-beta-color); } From 56a21a9c7fa6019b374f32b38c090bb2cb25628c Mon Sep 17 00:00:00 2001 From: Neil Dewhurst Date: Thu, 22 Aug 2024 14:14:05 +0100 Subject: [PATCH 5/5] Fix version selector bugs (#255) Recent updates in the version selector, and previous changes that were specific to the cheat sheet, meant the version of the cheat that is being displayed was excluded from the version selector. This PR fixes that and a bug in the code for defining the default product to display. --- src/js/50-cheat-sheet-toggle.js | 8 +++++++- src/partials/nav-selectors.hbs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/js/50-cheat-sheet-toggle.js b/src/js/50-cheat-sheet-toggle.js index ff0af990..eb72a47c 100644 --- a/src/js/50-cheat-sheet-toggle.js +++ b/src/js/50-cheat-sheet-toggle.js @@ -26,8 +26,14 @@ const prodMatrix = { // get the default product from optionMap const defaultProdArray = optionMap.find((prod) => prod.default === 'true') -const defaultProd = defaultProdArray ? defaultProdArray.value : optionMap[0].value +// display for 'all' products unless a differnt value is specified via attributes in source +let defaultProd +if (defaultProdArray && optionMap) { + defaultProd = defaultProdArray ? defaultProdArray.value : optionMap[0].value +} else { + defaultProd = 'all' +} const defaultClasses = ['exampleblock', 'sect2', 'sect1'] document.addEventListener('DOMContentLoaded', function () { diff --git a/src/partials/nav-selectors.hbs b/src/partials/nav-selectors.hbs index 65c9e705..a63a6301 100644 --- a/src/partials/nav-selectors.hbs +++ b/src/partials/nav-selectors.hbs @@ -17,7 +17,7 @@