Skip to content

Commit

Permalink
DOC-611 Hide Enterprise license metadata in Cloud contexts (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeSCahill authored Oct 18, 2024
1 parent 8086544 commit c37f7c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions macros/rp-connect-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ module.exports.register = function (registry, context) {
});

/**
* Registers a block macro to generate a dropdown for component types and display metadata about the selected component.
* Registers a block macro to display metadata about the selected component.
*
* This macro creates a dropdown to select different types of a connector component, such as Input, Output, or Processor.
* It also provides links to the corresponding Cloud or Self-Managed documentation for the selected component type, and displays information on whether the connector requires an enterprise license.
Expand Down Expand Up @@ -697,11 +697,13 @@ module.exports.register = function (registry, context) {
sortedTypes.unshift(currentType);
}
// Check if the component requires an Enterprise license (based on support level)
const requiresEnterprise = componentRows.some(row => row.is_licensed.toLowerCase() === 'yes');
let enterpriseLicenseInfo = '';
if (requiresEnterprise) {
enterpriseLicenseInfo = `
<p><strong>License</strong>: This component requires an <a href="https://redpanda.com/compare-platform-editions" target="_blank">Enterprise license</a>. To upgrade, contact <a href="https://redpanda.com/try-redpanda?section=enterprise-trial" target="_blank" rel="noopener">Redpanda sales</a>.</p>`;
if (component !== 'Cloud') {
const requiresEnterprise = componentRows.some(row => row.is_licensed.toLowerCase() === 'yes');
if (requiresEnterprise) {
enterpriseLicenseInfo = `
<p><strong>License</strong>: This component requires an <a href="https://redpanda.com/compare-platform-editions" target="_blank">Enterprise license</a>. To upgrade, contact <a href="https://redpanda.com/try-redpanda?section=enterprise-trial" target="_blank" rel="noopener">Redpanda sales</a>.</p>`;
}
}
const isCloudSupported = componentRows.some(row => row.is_cloud_supported === 'y');
let availableInInfo = '';
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@redpanda-data/docs-extensions-and-macros",
"version": "3.7.1",
"version": "3.7.2",
"description": "Antora extensions and macros developed for Redpanda documentation.",
"keywords": [
"antora",
Expand Down

0 comments on commit c37f7c6

Please sign in to comment.