Skip to content

Commit

Permalink
feat: point codestream qs to correct nerdlet
Browse files Browse the repository at this point in the history
  • Loading branch information
aswanson-nr committed Oct 20, 2021
1 parent e24d6e5 commit 159fa58
Show file tree
Hide file tree
Showing 4 changed files with 1,908 additions and 2,433 deletions.
15 changes: 1 addition & 14 deletions scripts/actions/fetch-quickstarts.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,10 @@ const validateEnvVars = () => {
* @param {String} token a New Relic API token
**/
const main = async (query, url, token) => {
const CODESTREAM_QUICKSTART_ID = '29bd9a4a-1c19-4219-9694-0942f6411ce7';
const CODESTREAM_INSTALL_PLAN = [
{
id: 'codestream-install',
name: 'CodeStream integration',
},
];
const results = await fetchQuickstarts(query, url, token);

if (results) {
// TODO: remove filter once we are ready to display codestream quickstart
const quickstarts = results.quickstarts.map((q) => {
if (q.id === CODESTREAM_QUICKSTART_ID) {
q.installPlans = CODESTREAM_INSTALL_PLAN;
}
return q;
});
const quickstarts = results.quickstarts;
console.log(`Found ${quickstarts.length} quickstarts.`);
console.log(`Writing ${QUICKSTARTS_FILE_PATH}`);
fs.writeFileSync(
Expand Down
12 changes: 10 additions & 2 deletions src/components/InstallButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
import {
NR1_GUIDED_INSTALL_NERDLET,
NR1_PACK_DETAILS_NERDLET,
NR1_CODESTREAM_INSTALL_NERDLET,
CODESTREAM_QUICKSTART_ID,
UTM_PARAMETERS,
SIGNUP_LINK,
} from '../data/constants';
Expand Down Expand Up @@ -74,7 +76,9 @@ const hasComponent = (quickstart, key) =>
quickstart[key] && quickstart[key].length > 0;

const InstallButton = ({ quickstart, location, ...props }) => {
const hasInstallableComponent = hasComponent(quickstart, 'installPlans');
const hasInstallableComponent =
hasComponent(quickstart, 'installPlans') ||
quickstart.id === CODESTREAM_QUICKSTART_ID;

const tessen = useTessen();

Expand All @@ -95,10 +99,14 @@ const InstallButton = ({ quickstart, location, ...props }) => {
return null;
}

const nerdletId = hasGuidedInstall
let nerdletId = hasGuidedInstall
? NR1_GUIDED_INSTALL_NERDLET
: NR1_PACK_DETAILS_NERDLET;

if (quickstart.id === CODESTREAM_QUICKSTART_ID) {
nerdletId = NR1_CODESTREAM_INSTALL_NERDLET;
}

const hasUtmParameters = checkUtmParameters(parameters);
// If we have an install-able component, generate a URL. Otherwise, link to the
// first documentation supplied.
Expand Down
3 changes: 3 additions & 0 deletions src/data/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const NR1_PACK_DETAILS_NERDLET =
export const NR1_GUIDED_INSTALL_NERDLET =
'nr1-install-newrelic.nr1-install-newrelic';

export const NR1_CODESTREAM_INSTALL_NERDLET = 'codestream-install.home';
export const CODESTREAM_QUICKSTART_ID = '29bd9a4a-1c19-4219-9694-0942f6411ce7';

export const NR1_EXPLORER_NERDLET = 'nr1-core.listing';

export const QUICKSTART_SUPPORT_LEVELS = {
Expand Down
Loading

0 comments on commit 159fa58

Please sign in to comment.