Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #379

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .env.local.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
# Prepend "NEXT_PUBLIC_" to Next.js env vars to expose them as process.env.NEXT_PUBLIC_ANALYTICS_ID, for example

NEXT_PUBLIC_API_URL=http://localhost:8080/api/
NEXT_PUBLIC_BASE_URL=http://localhost:8080
NEXT_PUBLIC_CONTACT_FORM_POST_URL="https://rubinobs.org"
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NEXT_PUBLIC_CONTACT_FORM_POST_URL=http://localhost:8080/actions/contact-form/send
NEXT_PUBLIC_GOOGLE_APP_ID=
NEXT_PUBLIC_PAGEPROOFER_ID=

CRAFT_REVALIDATE_SECRET_TOKEN=

# This should not be present in Production, but it's OK for dev.
# NODE_TLS_REJECT_UNAUTHORIZED=0
CLOUD_ENV = DEV
NEXT_PREVIEW_SLUG=
NEXT_PUBLIC_DEBUG_LOGGING=
NEXT_PUBLIC_RELEASE_URL=
NEXT_PUBLIC_EFD_URL=
NEXT_PUBLIC_HASURA_SECRET=
NEXT_PUBLIC_SURVEY_SPARROW=
1 change: 1 addition & 0 deletions .github/workflows/master-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
--build-arg NEXT_PUBLIC_EFD_URL=https://hasura-e3g4rcii3q-uc.a.run.app/v1/graphql \
--build-arg NEXT_PUBLIC_HASURA_SECRET=_qfq_tMbyR4brJ@KHCzuJRU7 \
--build-arg NEXT_PUBLIC_RELEASE_URL=`https://noirlab.edu/public/api/v2/releases/{{ID}}/?lang={{SITE}}&translation_mode=fallback` \
--build-arg NEXT_PUBLIC_SURVEY_SPARROW=true \
.
- name: Configure Docker Auth
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/prod-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
--build-arg NEXT_PUBLIC_EFD_URL=https://hasura-e3g4rcii3q-uc.a.run.app/v1/graphql \
--build-arg NEXT_PUBLIC_HASURA_SECRET=_qfq_tMbyR4brJ@KHCzuJRU7 \
--build-arg NEXT_PUBLIC_RELEASE_URL=`https://noirlab.edu/public/api/v2/releases/{{ID}}/?lang={{SITE}}&translation_mode=fallback` \
--build-arg NEXT_PUBLIC_SURVEY_SPARROW=true \
.
- name: Configure Docker Auth
run: gcloud --quiet auth configure-docker
Expand Down
2 changes: 1 addition & 1 deletion lib/localeStrings/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"gallery-items": "Items de la galería",
"jobs": "Trabajos",
"news": "Noticias",
"staff-profiles": "PVoces de Rubin",
"staff-profiles": "Voces de Rubin",
"slideshows": "Diapositivas",
"image": "Imagen",
"video": "Video",
Expand Down
61 changes: 61 additions & 0 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import GlobalStyles from "@/styles/globalStyles";
import styles from "@/styles/styles.scss";

const PLAUSIBLE_DOMAIN = process.env.NEXT_PUBLIC_PLAUSIBLE_DOMAIN;
const SURVEY_SPARROW = process.env.NEXT_PUBLIC_SURVEY_SPARROW;

function Client({ Component, pageProps }) {
const authData = useAuthentication({
Expand All @@ -30,6 +31,66 @@ function Client({ Component, pageProps }) {
strategy="afterInteractive"
/>
)}
{SURVEY_SPARROW && (
<>
<div id="ss_survey_widget"></div>
<Script
id="SS_SCRIPT"
dangerouslySetInnerHTML={{
__html: `
function sparrowLaunch(opts) {
// eslint-disable-next-line no-var, one-var
var e = "ss-widget",
t = "script",
a = document,
r = window,
l = localStorage;
// eslint-disable-next-line no-var, one-var
var s,
n,
c,
rm = a.getElementById("SS_SCRIPT");
r.SS_WIDGET_TOKEN = "tt-jCJ9T1UiXP2bVPQ1K3sF3g";
r.SS_ACCOUNT = "rockmanetal.surveysparrow.com";
r.SS_SURVEY_NAME = "rubin-pop-up---chat-survey";
if (
!a.getElementById(e) &&
!l.getItem("removed-ss-widget-tt-jCJ9T1UiXP2bVPQ1K3sF3g")
) {
// eslint-disable-next-line no-var
var S = function () {
S.update(arguments);
};
S.args = [];
S.update = function (e) {
S.args.push(e);
};
r.SparrowLauncher = S;
s = a.getElementsByTagName(t);
c = s[s.length - 1];
n = a.createElement(t);
n.type = "text/javascript";
n.async = !0;
n.id = e;
n.src = [
"https://",
"rockmanetal.surveysparrow.com/widget/",
r.SS_WIDGET_TOKEN,
"?",
"customParams=",
JSON.stringify(opts),
].join("");
c.parentNode.insertBefore(n, c);
r.SS_VARIABLES = opts;
rm.parentNode.removeChild(rm);
}
}
sparrowLaunch({/*add custom params here*/});
`,
}}
/>
</>
)}
<GlobalStyles />
<Component {...pageProps} />
</AuthenticationContextProvider>
Expand Down
Loading