Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add beta-until label #254

Merged
merged 5 commits into from
Aug 22, 2024
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
6 changes: 6 additions & 0 deletions preview-src/docs-roles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Flags sections as Not Available on Aura, Aura DB Enterprise, Enterprise Edition,
--


[role=label--new-5.11 label--beta-until-5.12]
== Beta until

Lorem ipsum.


[role="label--new-5.17 label--enterprise-edition"]
== Relationship property type constraints

Expand Down
3 changes: 2 additions & 1 deletion src/css/labels.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ span.label--yes {
}

span.label--alpha,
span.label--beta {
span.label--beta,
span.label--beta-until {
background: var(--alpha-beta-background-color);
color: var(--alpha-beta-color);
}
Expand Down
8 changes: 7 additions & 1 deletion src/js/50-cheat-sheet-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions src/js/60-docs-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand All @@ -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(' ')
}
Expand Down
6 changes: 6 additions & 0 deletions src/js/data/rolesData.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@
"labelCategory": "version",
"displayText": "Beta"
},
"beta-until":{
"description": "The feature or function was in beta until the version specified",
"labelCategory": "version",
"displayText": "Beta",
"versionText": "until"
},
"deprecated":{
"labelCategory": "version",
"displayText": "Deprecated"
Expand Down
2 changes: 1 addition & 1 deletion src/partials/nav-selectors.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<select data-current="{{@root.page.version}}" class="version-selector dropdown-styles">
{{#each page.versions}}
{{#unless (or this.prerelease (and (eq this.version @root.page.version) (eq @root.page.attributes.theme 'cheat-sheet') ))}}
{{#unless this.prerelease}}
<option
data-version="{{this.displayVersion}}"
value="{{{relativize this.url}}}"
Expand Down