Skip to content

Commit

Permalink
Merge pull request #1660 from newrelic/maria/dynamically-change-insta…
Browse files Browse the repository at this point in the history
…ll-button

Dynamically change install button if there are installPlans
  • Loading branch information
aswanson-nr authored Sep 20, 2021
2 parents 92c60f3 + d937910 commit 47054af
Show file tree
Hide file tree
Showing 6 changed files with 1,430 additions and 4 deletions.
4 changes: 4 additions & 0 deletions scripts/actions/fetch-quickstarts.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ const quickstartQuery = `# gql
summary
websiteUrl
keywords
installPlans {
id
name
}
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/components/InstallButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ const hasComponent = (quickstart, key) =>
quickstart[key] && quickstart[key].length > 0;

const InstallButton = ({ quickstart, ...props }) => {
const hasInstallableComponent =
hasComponent(quickstart, 'dashboards') ||
hasComponent(quickstart, 'alerts');
const hasInstallableComponent = hasComponent(quickstart, 'installPlans');

// If there is nothing to install AND no documentation, don't show this button.
if (!hasInstallableComponent && !hasComponent(quickstart, 'documentation')) {
Expand Down
Loading

0 comments on commit 47054af

Please sign in to comment.