Merge branch 'master' into monolith-gs-restructure
commit
f75719e025
|
@ -5,13 +5,13 @@
|
||||||
* release notes pages.
|
* release notes pages.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Use jQuery filter to get an array of all the *release* h2 elements
|
// Get all h2 elements that are not checkpoint-releases
|
||||||
const releases = $('h2').filter(
|
const releases = Array.from(document.querySelectorAll('h2')).filter(
|
||||||
(_i, el) => !el.id.match(/checkpoint-releases/)
|
el => !el.id.match(/checkpoint-releases/)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Extract data about each release from the array of releases
|
// Extract data about each release from the array of releases
|
||||||
releaseData = releases.map((_i, el) => ({
|
const releaseData = releases.map(el => ({
|
||||||
name: el.textContent,
|
name: el.textContent,
|
||||||
id: el.id,
|
id: el.id,
|
||||||
class: el.getAttribute('class'),
|
class: el.getAttribute('class'),
|
||||||
|
@ -19,8 +19,8 @@ releaseData = releases.map((_i, el) => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Use release data to generate a list item for each release
|
// Use release data to generate a list item for each release
|
||||||
getReleaseItem = (releaseData) => {
|
function getReleaseItem(releaseData) {
|
||||||
var li = document.createElement("li");
|
const li = document.createElement("li");
|
||||||
if (releaseData.class !== null) {
|
if (releaseData.class !== null) {
|
||||||
li.className = releaseData.class;
|
li.className = releaseData.class;
|
||||||
}
|
}
|
||||||
|
@ -29,9 +29,10 @@ getReleaseItem = (releaseData) => {
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use jQuery each to build the release table of contents
|
// Build the release table of contents
|
||||||
releaseData.each((_i, release) => {
|
const releaseTocUl = document.querySelector('#release-toc ul');
|
||||||
$('#release-toc ul')[0].appendChild(getReleaseItem(release));
|
releaseData.forEach(release => {
|
||||||
|
releaseTocUl.appendChild(getReleaseItem(release));
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -39,20 +40,30 @@ releaseData.each((_i, release) => {
|
||||||
* number specified in the `show` attribute of `ul.release-list`.
|
* number specified in the `show` attribute of `ul.release-list`.
|
||||||
* Once all the release items are visible, the "Show More" button is hidden.
|
* Once all the release items are visible, the "Show More" button is hidden.
|
||||||
*/
|
*/
|
||||||
$('#release-toc .show-more').click(function () {
|
const showMoreBtn = document.querySelector('#release-toc .show-more');
|
||||||
const itemHeight = 1.885; // Item height in rem
|
if (showMoreBtn) {
|
||||||
const releaseNum = releaseData.length;
|
showMoreBtn.addEventListener('click', function () {
|
||||||
const maxHeight = releaseNum * itemHeight;
|
const itemHeight = 1.885; // Item height in rem
|
||||||
const releaseIncrement = Number($('#release-list')[0].getAttribute('show'));
|
const releaseNum = releaseData.length;
|
||||||
const currentHeight = Number(
|
const maxHeight = releaseNum * itemHeight;
|
||||||
$('#release-list')[0].style.height.match(/\d+\.?\d+/)[0]
|
const releaseList = document.getElementById('release-list');
|
||||||
);
|
const releaseIncrement = Number(releaseList.getAttribute('show'));
|
||||||
const potentialHeight = currentHeight + releaseIncrement * itemHeight;
|
const currentHeightMatch = releaseList.style.height.match(/\d+\.?\d+/);
|
||||||
const newHeight = potentialHeight > maxHeight ? maxHeight : potentialHeight;
|
const currentHeight = currentHeightMatch
|
||||||
|
? Number(currentHeightMatch[0])
|
||||||
|
: 0;
|
||||||
|
const potentialHeight = currentHeight + releaseIncrement * itemHeight;
|
||||||
|
const newHeight = potentialHeight > maxHeight ? maxHeight : potentialHeight;
|
||||||
|
|
||||||
$('#release-list')[0].style.height = `${newHeight}rem`;
|
releaseList.style.height = `${newHeight}rem`;
|
||||||
|
|
||||||
if (newHeight >= maxHeight) {
|
if (newHeight >= maxHeight) {
|
||||||
$('#release-toc .show-more').fadeOut(100);
|
// Simple fade out
|
||||||
}
|
showMoreBtn.style.transition = 'opacity 0.1s';
|
||||||
});
|
showMoreBtn.style.opacity = 0;
|
||||||
|
setTimeout(() => {
|
||||||
|
showMoreBtn.style.display = 'none';
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
@ -66,8 +66,8 @@ us-docker.pkg.dev/influxdb2-artifacts/clustered/influxdb:PACKAGE_VERSION
|
||||||
|
|
||||||
### Identify the version to upgrade to
|
### Identify the version to upgrade to
|
||||||
|
|
||||||
All available InfluxDB Clustered package versions are provided at
|
All available InfluxDB Clustered package versions are provided in the
|
||||||
[oci.influxdata.com](https://oci.influxdata.com).
|
[InfluxDB Clustered release notes](/influxdb3/clustered/reference/release-notes/clustered/).
|
||||||
Find the package version you want to upgrade to and copy the version number.
|
Find the package version you want to upgrade to and copy the version number.
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ Find the package version you want to upgrade to and copy the version number.
|
||||||
Some InfluxDB Clustered releases are _checkpoint releases_ that introduce a
|
Some InfluxDB Clustered releases are _checkpoint releases_ that introduce a
|
||||||
breaking change to an InfluxDB component.
|
breaking change to an InfluxDB component.
|
||||||
Checkpoint releases are only made when absolutely necessary and are clearly
|
Checkpoint releases are only made when absolutely necessary and are clearly
|
||||||
identified at [oci.influxdata.com](https://oci.influxdata.com).
|
identified in the [InfluxDB Clustered release notes](/influxdb3/clustered/reference/release-notes/clustered/).
|
||||||
|
|
||||||
**When upgrading, always upgrade to each checkpoint release first, before proceeding
|
**When upgrading, always upgrade to each checkpoint release first, before proceeding
|
||||||
to newer versions.**
|
to newer versions.**
|
||||||
|
|
Loading…
Reference in New Issue