diff --git a/preview-src/docs-roles.adoc b/preview-src/docs-roles.adoc index 7c71c2c8..24805c71 100644 --- a/preview-src/docs-roles.adoc +++ b/preview-src/docs-roles.adoc @@ -5,6 +5,7 @@ :page-banner-text: Lorem ipsum dolor sit est. :page-banner-link: https://neo4j.com/docs :page-banner-link-text: Link text +:page-product: Neo4j // :page-labels: fabric enterprise-edition alpha test [abstract] @@ -13,6 +14,48 @@ Flags sections as Not Available on Aura, Aura DB Enterprise, Enterprise Edition, -- +[role=label--beta-until-bolt-1.0 label--removed-2.0] +== Adding a product name to versioned labels + + +[role=label--beta-until-1.0 label--dynamic-5.22 label--dynamic] +[[messages-ack-failure]] +=== Request message `ACK_FAILURE` + +The request message `ACK_FAILURE` signals to the server that the client has acknowledged a previous failure and should return to a `READY` state. + +The request message `ACK_FAILURE` is only valid in version *1* and *2* and the request message `RESET` should be used in its place in version *3+*. + +*Signature:* `0E` + +*Fields:* No fields. + +*Detail messages*: + +No detail messages should be returned. + +*Valid summary messages:* + +** `SUCCESS` +** `FAILURE` + +The server must be in a `FAILED` state to be able to successfully process an `ACK_FAILURE` request. +For any other states, receipt of an `ACK_FAILURE` request will be considered a protocol violation and will lead to connection closure. + +==== Examples +.Synopsis +[source, bolt] +---- +ACK_FAILURE +---- + +.Example +[source, bolt] +---- +ACK_FAILURE +---- + + [role=label--new-5.11 label--beta-until-5.12] == Beta until diff --git a/src/js/60-docs-roles.js b/src/js/60-docs-roles.js index dc5eab26..88519ecb 100644 --- a/src/js/60-docs-roles.js +++ b/src/js/60-docs-roles.js @@ -15,6 +15,8 @@ function checkWrapped () { } document.addEventListener('DOMContentLoaded', function () { + const contentDataset = document.querySelector('article.doc').dataset + var camelCased = function (str) { return str.split(/-|\./) .map((text) => text.substr(0, 1).toUpperCase() + text.substr(1)) @@ -34,32 +36,53 @@ document.addEventListener('DOMContentLoaded', function () { // so if the role is a single word, we use the role as is - ie deprecated // if it is longer we test to see if it is a 'versionable' roke - ie deprecated-5.20 - // if it is a versionable role, and a veresion is specified, we remove the version and use the remaining text as the label class - if (labelParts.length > 1) { - label = (rolesData[label] && rolesData[label].labelCategory !== 'version') ? label : labelParts.slice(0, -1).join('-') + // if it is a versionable role, and a version is specified, we remove the version and use the remaining text as the label class + // if (labelParts.length > 1) { + // label = (rolesData[label] && rolesData[label].labelCategory !== 'version') ? label : labelParts.slice(0, -1).join('-') + // } + + let dataLabel, dataProduct, dataVersion + const dataExtras = [] + + // what about roles like new-bolt-5.20 if we want to use a product name in the label? + while (!dataLabel && labelParts.length > 0) { + const labelCandidate = labelParts.join('-') + if (rolesData[labelCandidate]) { + dataLabel = labelCandidate + } else { + dataExtras.push(labelParts.pop()) + } } // ignore labels that are not defined in rolesData - if (!rolesData[label]) { + if (!dataLabel) { return } + if (dataExtras.length > 0) { + dataVersion = dataExtras.shift() + } + + if (dataExtras.length > 0) { + dataProduct = camelCased(dataExtras.join(' ')) + } + var labelDetails = { - class: label, - role: label, - text: rolesData[label].displayText || '', + class: dataLabel, + role: dataLabel, + text: rolesData[dataLabel].displayText || '', + joinText: dataVersion ? rolesData[dataLabel].joinText || 'in' : '', data: { - labelCategory: rolesData[label].labelCategory || '', - product: rolesData[label].product || '', - function: rolesData[label].function || '', + labelCategory: rolesData[dataLabel].labelCategory || '', + product: dataVersion ? dataProduct || rolesData[dataLabel].product || contentDataset.product || '' : '', + version: dataVersion || '', + function: rolesData[dataLabel].function || '', }, } - // get version number for version labels - if ((rolesData[label].labelCategory === 'version' || rolesData[label].versionText) && 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(' ') + // update label text for versioned labels + if ((rolesData[dataLabel].labelCategory === 'version' || (rolesData[dataLabel].joinText && dataVersion))) { + labelDetails.text = [labelDetails.text, labelDetails.joinText, labelDetails.data.product, labelDetails.data.version].join(' ') } return labelDetails diff --git a/src/js/data/rolesData.json b/src/js/data/rolesData.json index 54b6df2d..6afe1fc5 100644 --- a/src/js/data/rolesData.json +++ b/src/js/data/rolesData.json @@ -130,7 +130,7 @@ "dynamic":{ "labelCategory": "function", "displayText": "Dynamic", - "versionText": "since" + "joinText": "since" }, "alpha":{ "labelCategory": "version", @@ -144,7 +144,7 @@ "description": "The feature or function was in beta until the version specified", "labelCategory": "version", "displayText": "Beta", - "versionText": "until" + "joinText": "until" }, "deprecated":{ "labelCategory": "version", diff --git a/src/partials/article.hbs b/src/partials/article.hbs index 63847c47..485e3249 100644 --- a/src/partials/article.hbs +++ b/src/partials/article.hbs @@ -1,5 +1,5 @@
-
+
{{#if (eq page.layout '404')}}

{{{or page.title 'Page Not Found'}}}