From 4398139b33d2fdfb32736ec0420c1056b5ea5f53 Mon Sep 17 00:00:00 2001 From: Alec Swanson Date: Fri, 7 May 2021 14:11:31 -0700 Subject: [PATCH] feat: Update theme to include A/B testing button --- gatsby-config.js | 13 + package.json | 2 +- .../__snapshots__/Header.spec.js.snap | 107 ++- .../__snapshots__/collection.spec.js.snap | 169 +++-- .../external-projects.spec.js.snap | 169 +++-- .../__snapshots__/index.spec.js.snap | 183 +++-- .../__snapshots__/oss-category.spec.js.snap | 173 +++-- .../external-project-page.spec.js.snap | 639 ++++++++---------- yarn.lock | 192 +++--- 9 files changed, 778 insertions(+), 869 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index 99fc03c950..b5dbd04313 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -78,6 +78,19 @@ module.exports = { }), }, }, + splitio: { + // Mocked features only used when in localhost mode + // https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#localhost-mode + features: { + free_account_button_color: { + treatment: 'off', + }, + }, + core: { + authorizationKey: process.env.SPLITIO_AUTH_KEY || 'localhost', + }, + debug: false, + }, }, }, { diff --git a/package.json b/package.json index 7790418f42..50d9dc2320 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@emotion/styled": "^11.3.0", "@mdx-js/mdx": "^1.6.22", "@mdx-js/react": "^1.6.22", - "@newrelic/gatsby-theme-newrelic": "^2.0.1", + "@newrelic/gatsby-theme-newrelic": "2.2.0", "@splitsoftware/splitio-react": "^1.2.4", "date-fns": "^2.17.0", "feather-icons": "^4.28.0", diff --git a/src/components/__tests__/__snapshots__/Header.spec.js.snap b/src/components/__tests__/__snapshots__/Header.spec.js.snap index aa80cd1fa8..89af96a428 100644 --- a/src/components/__tests__/__snapshots__/Header.spec.js.snap +++ b/src/components/__tests__/__snapshots__/Header.spec.js.snap @@ -2,7 +2,16 @@ exports[`Header renders correctly 1`] = ` Array [ - .emotion-87 { + @keyframes animation-0 { + to { + -webkit-transform: rotate(1turn); + -moz-transform: rotate(1turn); + -ms-transform: rotate(1turn); + transform: rotate(1turn); + } +} + +.emotion-86 { background-color: var(--color-neutrals-100); position: -webkit-sticky; position: sticky; @@ -11,20 +20,20 @@ Array [ z-index: 700; } -.dark-mode .emotion-87 { +.dark-mode .emotion-86 { background-color: var(--color-dark-100); } -.emotion-87 ul { +.emotion-86 ul { line-height: 14px; font-size: 16px; } -.emotion-87 a { +.emotion-86 a { border-bottom: none; } -.emotion-86 { +.emotion-85 { height: var(--global-header-height); display: -webkit-box; display: -webkit-flex; @@ -1763,7 +1772,7 @@ Array [ color: var(--color-dark-700); } -.emotion-85 { +.emotion-84 { margin: 0; margin-left: 1rem; padding: 0; @@ -1781,18 +1790,18 @@ Array [ flex: 1; } -.emotion-85 >li { +.emotion-84 >li { -webkit-transition: all 0.2s ease-out; transition: all 0.2s ease-out; color: var(--secondary-text-color); } -.emotion-85 >li:not(:first-of-type) { +.emotion-84 >li:not(:first-of-type) { margin-left: 0.5rem; } @media screen and (max-width: 760px) { - .emotion-85 { + .emotion-84 { -webkit-flex: unset; -ms-flex: unset; flex: unset; @@ -2025,7 +2034,7 @@ Array [ } } -.emotion-84 { +.emotion-83 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -2033,49 +2042,35 @@ Array [ } .emotion-82 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - padding: 0.5rem 1rem; - font-size: 0.875rem; - font-weight: 600; - border-radius: 3px; - font-family: var(--primary-font-family); - line-height: 1; - cursor: pointer; - border: 1px solid transparent; - -webkit-transition: all 0.15s ease-out; - transition: all 0.15s ease-out; - white-space: nowrap; - -webkit-text-decoration: none; - text-decoration: none; - color: var(--color-white); - background-color: var(--color-brand-600); - font-size: 0.625rem; - padding: 0.375rem 0.625rem; - border-radius: 0.125rem; + --spinner-size: 1rem; + display: inline-block; + position: relative; + height: 100%; + width: 100%; } -.emotion-82:hover { - color: var(--color-white); - background-color: var(--color-brand-500); +.emotion-82:after { + -webkit-animation: animation-0 0.5s linear infinite; + animation: animation-0 0.5s linear infinite; + border-radius: 50%; + border-right: 1px solid transparent; + border-top: 1px solid; + content: ''; + left: calc(50% + 1px); + margin-left: calc(var(--spinner-size) / 2 * -1); + margin-top: calc(var(--spinner-size) / 2 * -1); + position: absolute; + top: calc(50% + 1px); + width: var(--spinner-size); + height: var(--spinner-size); }
diff --git a/src/pages/__tests__/__snapshots__/collection.spec.js.snap b/src/pages/__tests__/__snapshots__/collection.spec.js.snap index 61039236e7..1996998dab 100644 --- a/src/pages/__tests__/__snapshots__/collection.spec.js.snap +++ b/src/pages/__tests__/__snapshots__/collection.spec.js.snap @@ -1,7 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Data Collection Agents Page Renders correctly 1`] = ` -.emotion-138 { +@keyframes animation-0 { + to { + -webkit-transform: rotate(1turn); + -moz-transform: rotate(1turn); + -ms-transform: rotate(1turn); + transform: rotate(1turn); + } +} + +.emotion-137 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -14,7 +23,7 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` position: relative; } -.emotion-87 { +.emotion-86 { background-color: var(--color-neutrals-100); position: -webkit-sticky; position: sticky; @@ -23,20 +32,20 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` z-index: 700; } -.dark-mode .emotion-87 { +.dark-mode .emotion-86 { background-color: var(--color-dark-100); } -.emotion-87 ul { +.emotion-86 ul { line-height: 14px; font-size: 16px; } -.emotion-87 a { +.emotion-86 a { border-bottom: none; } -.emotion-86 { +.emotion-85 { height: var(--global-header-height); display: -webkit-box; display: -webkit-flex; @@ -1775,7 +1784,7 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` color: var(--color-dark-700); } -.emotion-85 { +.emotion-84 { margin: 0; margin-left: 1rem; padding: 0; @@ -1793,18 +1802,18 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` flex: 1; } -.emotion-85 >li { +.emotion-84 >li { -webkit-transition: all 0.2s ease-out; transition: all 0.2s ease-out; color: var(--secondary-text-color); } -.emotion-85 >li:not(:first-of-type) { +.emotion-84 >li:not(:first-of-type) { margin-left: 0.5rem; } @media screen and (max-width: 760px) { - .emotion-85 { + .emotion-84 { -webkit-flex: unset; -ms-flex: unset; flex: unset; @@ -2037,7 +2046,7 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` } } -.emotion-84 { +.emotion-83 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -2045,61 +2054,47 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` } .emotion-82 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - padding: 0.5rem 1rem; - font-size: 0.875rem; - font-weight: 600; - border-radius: 3px; - font-family: var(--primary-font-family); - line-height: 1; - cursor: pointer; - border: 1px solid transparent; - -webkit-transition: all 0.15s ease-out; - transition: all 0.15s ease-out; - white-space: nowrap; - -webkit-text-decoration: none; - text-decoration: none; - color: var(--color-white); - background-color: var(--color-brand-600); - font-size: 0.625rem; - padding: 0.375rem 0.625rem; - border-radius: 0.125rem; + --spinner-size: 1rem; + display: inline-block; + position: relative; + height: 100%; + width: 100%; } -.emotion-82:hover { - color: var(--color-white); - background-color: var(--color-brand-500); +.emotion-82:after { + -webkit-animation: animation-0 0.5s linear infinite; + animation: animation-0 0.5s linear infinite; + border-radius: 50%; + border-right: 1px solid transparent; + border-top: 1px solid; + content: ''; + left: calc(50% + 1px); + margin-left: calc(var(--spinner-size) / 2 * -1); + margin-top: calc(var(--spinner-size) / 2 * -1); + position: absolute; + top: calc(50% + 1px); + width: var(--spinner-size); + height: var(--spinner-size); } -.emotion-109 { +.emotion-108 { display: block; width: 257px; } @media screen and (max-width: 724px) { - .emotion-109 { + .emotion-108 { width: 160px; z-index: 500; } } -.emotion-108 { +.emotion-107 { fill: none; width: 100%; } -.emotion-110 { +.emotion-109 { width: 100%; max-width: 980px; margin: 0 auto; @@ -2113,28 +2108,28 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` max-width: 1180px; } -.emotion-110>hr { +.emotion-109>hr { height: 2px; margin: 36px 0; background-color: var(--color-neutrals-200); border: none; } -.emotion-137 { +.emotion-136 { color: var(--secondary-text-color); background-color: var(--color-neutrals-050); z-index: 1; } -.dark-mode .emotion-137 { +.dark-mode .emotion-136 { background-color: var(--color-dark-050); } -.emotion-137 a { +.emotion-136 a { color: currentColor; } -.emotion-132 { +.emotion-131 { font-size: 0.75rem; -webkit-align-items: center; -webkit-box-align: center; @@ -2153,7 +2148,7 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` } @media screen and (max-width: 550px) { - .emotion-132 { + .emotion-131 { -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; @@ -2164,27 +2159,27 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` } } -.emotion-131 { +.emotion-130 { fill: none; width: 150px; display: block; } @media screen and (max-width: 550px) { - .emotion-131 { + .emotion-130 { margin-bottom: 1rem; } } -.emotion-136 { +.emotion-135 { background-color: rgba(0, 0, 0, 0.05); } -.dark-mode .emotion-136 { +.dark-mode .emotion-135 { background-color: rgba(0, 0, 0, 0.2); } -.emotion-135 { +.emotion-134 { font-size: 0.75rem; -webkit-align-items: center; -webkit-box-align: center; @@ -2202,7 +2197,7 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` } @media screen and (max-width: 760px) { - .emotion-135 { + .emotion-134 { -webkit-box-pack: center; -ms-flex-pack: center; -webkit-justify-content: center; @@ -2214,14 +2209,14 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` } } -.emotion-133 { +.emotion-132 { grid-area: copyright; text-transform: uppercase; font-size: 0.5rem; letter-spacing: 0.1rem; } -.emotion-134 { +.emotion-133 { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; @@ -2237,20 +2232,20 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` grid-area: legal; } -.emotion-134 a { +.emotion-133 a { margin-left: 0.75rem; white-space: nowrap; }
@@ -2669,11 +2656,11 @@ exports[`Data Collection Agents Page Renders correctly 1`] = ` " > @@ -2794,7 +2781,7 @@ exports[`Data Collection Agents Page Renders correctly 1`] = `