From 384bb97b97d81e5c9ed43c70940e744508ce79a5 Mon Sep 17 00:00:00 2001 From: Blake Mason Date: Mon, 11 Mar 2024 10:25:18 -0700 Subject: [PATCH 1/6] [B] Event times strip timezone offsets --- lib/utils.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index a488ad24..50c05c16 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -170,6 +170,11 @@ export const usePathData = () => { return { asPath, pathname, query }; }; +function dateWoTimezone(iso) { + // attuned to the iso-ish php dateformat from Craft + return new Date(iso.slice(0, -6)); +} + export const useDateString = (date, isShort = false) => { const localeInfo = useGlobalData("localeInfo"); const locale = localeInfo.language || "en-US"; @@ -184,15 +189,11 @@ export const useDateString = (date, isShort = false) => { return dateString; }; -export const useTimeString = (time) => { +export const useTimeString = (iso) => { const localeInfo = useGlobalData("localeInfo"); const locale = localeInfo.language || "en-US"; - - if (!time) return undefined; - - const newTime = new Date(time).toLocaleTimeString(locale); - - return newTime; + if (!iso) return undefined; + return dateWoTimezone(iso).toLocaleTimeString(locale); }; export const useTimeZone = (timezone) => { From e1bfe67bb1a5d7cfab470c2259a5ebb3899ef850 Mon Sep 17 00:00:00 2001 From: Eric Rosas Date: Mon, 11 Mar 2024 11:48:06 -0600 Subject: [PATCH 2/6] Removed GAE workflows, build args from Dockerfile Removed GAE workflows, build args from Dockerfile --- .github/workflows/dev-pull-request.yaml | 151 ------------------------ .github/workflows/dev-push.yaml | 60 ---------- .github/workflows/master-pr.yaml | 118 ------------------ .github/workflows/master-push.yaml | 59 --------- .github/workflows/prod-push.yaml | 65 ---------- Dockerfile | 13 +- 6 files changed, 1 insertion(+), 465 deletions(-) delete mode 100644 .github/workflows/dev-pull-request.yaml delete mode 100644 .github/workflows/dev-push.yaml delete mode 100644 .github/workflows/master-pr.yaml delete mode 100644 .github/workflows/master-push.yaml delete mode 100644 .github/workflows/prod-push.yaml diff --git a/.github/workflows/dev-pull-request.yaml b/.github/workflows/dev-pull-request.yaml deleted file mode 100644 index ae416f8d..00000000 --- a/.github/workflows/dev-pull-request.yaml +++ /dev/null @@ -1,151 +0,0 @@ -name: 'PR preview to Dev' - -on: - pull_request: - types: - - 'opened' - - 'synchronize' - - 'reopened' - - 'closed' - branches: - - 'develop' - -jobs: - build-push-deploy: - name: 'Build and Deploy PR preview to Development' - runs-on: ubuntu-latest - if: ${{ github.event.action != 'closed'}} - - # Checkout the repository to the GitHub Actions runner - steps: - - name: Checkout - uses: actions/checkout@v2 - - # gcloud CLI setup - - name: Login to GCP - uses: google-github-actions/setup-gcloud@v0 - with: - service_account_key: ${{ secrets.DEV_SA_KEY }} - project_id: ${{ secrets.SV_PROJ_NAME }} - export_default_credentials: true - - - name: Build Container Image - run: |- - docker build \ - -t "gcr.io/${{ secrets.SV_PROJ_NAME }}/rubin-obs-client:${{ github.sha }}" \ - --build-arg NEXT_PUBLIC_API_URL=https://api-dev.rubinobs.com/api \ - --build-arg NEXT_PUBLIC_BASE_URL=https://dev.rubinobs.com \ - --build-arg EDC_LOGGER_API_URL=https://us-central1-skyviewer.cloudfunctions.net/edc-logger \ - --build-arg NEXT_PUBLIC_DEBUG_LOGGING=false \ - --build-arg CLOUD_ENV=DEV \ - --build-arg NEXT_PUBLIC_GOOGLE_APP_ID=688095955960-t0fpaj4ec3gh5vsr9lhg8govapk2oeo9.apps.googleusercontent.com \ - --build-arg GOOGLE_APP_SECRET=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 \ - --build-arg NEXT_PUBLIC_CONTACT_FORM_POST_URL=https://api-dev.rubinobs.com/actions/contact-form/send \ - --build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN= \ - --build-arg NEXT_PREVIEW_SLUG=preview-in-craft-cms \ - --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` \ - . - - - name: Configure Docker Auth - run: gcloud --quiet auth configure-docker - - - name: Push Container Image to GCR - run: docker push gcr.io/${{ secrets.SV_PROJ_NAME }}/rubin-obs-client:${{ github.sha }} - - - name: Get app.yaml - run: gcloud secrets versions access latest --secret=rubin-obs-client-appyaml > app.yaml - - - name: Format version name - id: version_name - run: echo "version_name=$(echo \"${{ github.head_ref }}\" | tr -cd '[:alnum:]' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - - - name: Deploy branch-tagged version to App Engine - run: |- - gcloud app deploy app.yaml \ - --image-url=gcr.io/${{ secrets.SV_PROJ_NAME }}/rubin-obs-client:${{ github.sha }} \ - --version=${{ env.version_name }} \ - --no-promote \ - --project=${{ secrets.SV_PROJ_NAME }} - - - name: Get the version URL - run: echo "version_url=$(gcloud app versions list --uri --service=default --filter=version.id:${{ env.version_name }})" >> $GITHUB_ENV - - - name: Post the URL to the PR - uses: peter-evans/create-or-update-comment@v1 - with: - issue-number: ${{ github.event.pull_request.number }} - body: | - A preview of this PR will be available at ${{ env.version_url }} until the request is closed. - reactions: '+1' - - run-e2e-tests: - name: 'Run End-to-End Tests' - runs-on: ubuntu-latest - needs: build-push-deploy - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install Node.js/NPM - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Login to GCP - uses: google-github-actions/setup-gcloud@v0 - with: - service_account_key: ${{ secrets.DEV_SA_KEY }} - project_id: ${{ secrets.SV_PROJ_NAME }} - export_default_credentials: true - - - name: Format version name - id: version_name - run: echo "version_name=$(echo \"${{ github.head_ref }}\" | tr -cd '[:alnum:]' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - - - name: Get the version URL - id: get_version - run: echo "version_url=$(gcloud app versions list --uri --service=default --filter=version.id:${{ env.version_name }})" >> $GITHUB_ENV - - - name: E2E Tests - uses: cypress-io/github-action@v5 - with: - headed: false - env: - CYPRESS_BASE_URL: ${{ env.version_url }} - - - name: Component Tests - uses: cypress-io/github-action@v5 - with: - component: true - headed: false - env: - CYPRESS_BASE_URL: ${{ env.version_url }} - - cleanup: - name: 'Cleanup PR Preview' - runs-on: ubuntu-latest - if: ${{ github.event.action == 'closed'}} - - # Checkout the repository to the GitHub Actions runner - steps: - - name: Checkout - uses: actions/checkout@v2 - - # gcloud CLI setup - - name: Login to GCP - uses: google-github-actions/setup-gcloud@v0 - with: - service_account_key: ${{ secrets.DEV_SA_KEY }} - project_id: ${{ secrets.SV_PROJ_NAME }} - export_default_credentials: true - - - name: Format version name - id: version_name - run: echo "version_name=$(echo \"${{ github.head_ref }}\" | tr -cd '[:alnum:]' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - - # Destruct! - - name: Destroy version - run: gcloud app versions delete ${{ env.version_name }} --service=default diff --git a/.github/workflows/dev-push.yaml b/.github/workflows/dev-push.yaml deleted file mode 100644 index d782dc72..00000000 --- a/.github/workflows/dev-push.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: 'Deploy to Dev' - -on: - push: - branches: - - 'develop' - -jobs: - build-push-deploy: - name: 'Build and Deploy to Development' - runs-on: ubuntu-latest - - # Checkout the repository to the GitHub Actions runner - steps: - - name: Checkout - uses: actions/checkout@v2 - - # gcloud CLI setup - - name: Login to GCP - uses: google-github-actions/setup-gcloud@v0 - with: - service_account_key: ${{ secrets.DEV_SA_KEY }} - project_id: ${{ secrets.SV_PROJ_NAME }} - export_default_credentials: true - - - name: Build Container Image - run: |- - docker build \ - -t "gcr.io/${{ secrets.SV_PROJ_NAME }}/rubin-obs-client:${{ github.sha }}" \ - --build-arg NEXT_PUBLIC_API_URL=https://api-dev.rubinobs.com/api \ - --build-arg EDC_LOGGER_API_URL=https://us-central1-skyviewer.cloudfunctions.net/edc-logger \ - --build-arg NEXT_PUBLIC_DEBUG_LOGGING=true \ - --build-arg CLOUD_ENV=DEV \ - --build-arg NEXT_PUBLIC_BASE_URL=https://dev.rubinobs.com \ - --build-arg NEXT_PUBLIC_GOOGLE_APP_ID=688095955960-t0fpaj4ec3gh5vsr9lhg8govapk2oeo9.apps.googleusercontent.com \ - --build-arg GOOGLE_APP_SECRET=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 \ - --build-arg NEXT_PUBLIC_CONTACT_FORM_POST_URL=https://api-dev.rubinobs.com/actions/contact-form/send \ - --build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN= \ - --build-arg NEXT_PREVIEW_SLUG=preview-in-craft-cms \ - --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` \ - . - - - name: Configure Docker Auth - run: gcloud --quiet auth configure-docker - - - name: Push Container Image to GCR - run: docker push gcr.io/${{ secrets.SV_PROJ_NAME }}/rubin-obs-client:${{ github.sha }} - - - name: Get app.yaml - run: gcloud secrets versions access latest --secret=rubin-obs-client-appyaml > app.yaml - - - name: Deploy to App Engine - run: |- - gcloud app deploy app.yaml \ - --quiet \ - --image-url=gcr.io/${{ secrets.SV_PROJ_NAME }}/rubin-obs-client:${{ github.sha }} \ - --promote \ - --project=${{ secrets.SV_PROJ_NAME }} diff --git a/.github/workflows/master-pr.yaml b/.github/workflows/master-pr.yaml deleted file mode 100644 index 917994a8..00000000 --- a/.github/workflows/master-pr.yaml +++ /dev/null @@ -1,118 +0,0 @@ -name: 'PR preview to Int' - -on: - pull_request: - types: - - 'opened' - - 'synchronize' - - 'reopened' - - 'closed' - branches: - - 'master' - -jobs: - build-push-deploy: - name: 'Build and Deploy PR preview to Integration' - runs-on: ubuntu-latest - if: ${{ github.event.action != 'closed'}} - - # Checkout the repository to the GitHub Actions runner - steps: - - name: Checkout - uses: actions/checkout@v2 - - # gcloud CLI setup - - name: Login to GCP - uses: google-github-actions/setup-gcloud@v0 - with: - service_account_key: ${{ secrets.SKYVIEWER_INT_SERVICE_ACCOUNT }} - project_id: edc-int-6c5e - export_default_credentials: true - - - name: Build Container Image - run: |- - docker build \ - -t "gcr.io/edc-int-6c5e/rubin-obs-client:${{ github.sha }}" \ - --build-arg NEXT_PUBLIC_API_URL=https://api-int.rubinobs.dev/api \ - --build-arg EDC_LOGGER_API_URL=https://us-central1-skyviewer.cloudfunctions.net/edc-logger \ - --build-arg NEXT_PUBLIC_DEBUG_LOGGING=false \ - --build-arg CLOUD_ENV=INT \ - --build-arg NEXT_PUBLIC_BASE_URL=https://int.rubinobs.dev \ - --build-arg NEXT_PUBLIC_GOOGLE_APP_ID=422617727806-q7opitpsisom3fekpplsh8b77s0oe6n2.apps.googleusercontent.com \ - --build-arg GOOGLE_APP_SECRET=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 \ - --build-arg NEXT_PUBLIC_CONTACT_FORM_POST_URL=https://api-int.rubinobs.dev/actions/contact-form/send \ - --build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN= \ - --build-arg NEXT_PREVIEW_SLUG=preview-in-craft-cms \ - --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` \ - . - - - name: Configure Docker Auth - run: gcloud --quiet auth configure-docker - - - name: Push Container Image to GCR - run: docker push gcr.io/edc-int-6c5e/rubin-obs-client:${{ github.sha }} - - - name: Format version name - id: version_name - run: echo "version_name=$(echo \"${{ github.head_ref }}\" | tr -cd '[:alnum:]' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - - - name: Get app.yaml - run: gcloud secrets versions access latest --secret=rubin-obs-client-appyaml > app.yaml - - - name: Deploy branch-tagged version to App Engine - run: |- - gcloud app deploy app.yaml \ - --image-url=gcr.io/edc-int-6c5e/rubin-obs-client:${{ github.sha }} \ - --version=${{ env.version_name }} \ - --no-promote \ - --project=edc-int-6c5e - - - name: Get the version URL - id: get_version - run: echo "version_url=$(gcloud app versions list --uri --service=default --filter=version.id:${{ env.version_name }})" >> $GITHUB_ENV - - # Create or update a comment with the URL - - name: Find Comment - uses: peter-evans/find-comment@v1 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: A preview of this PR - - - name: Create or update a comment with the URL to the PR - uses: peter-evans/create-or-update-comment@v1 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - A preview of this PR will be available at ${{ env.version_url }} until the request is closed. - reactions: '+1' - - cleanup: - name: 'Cleanup PR Preview' - runs-on: ubuntu-latest - if: ${{ github.event.action == 'closed'}} - - # Checkout the repository to the GitHub Actions runner - steps: - - name: Checkout - uses: actions/checkout@v2 - - # gcloud CLI setup - - name: Login to GCP - uses: google-github-actions/setup-gcloud@v0 - with: - service_account_key: ${{ secrets.SKYVIEWER_INT_SERVICE_ACCOUNT }} - project_id: edc-int-6c5e - export_default_credentials: true - - - name: Format version name - id: version_name - run: echo "version_name=$(echo \"${{ github.head_ref }}\" | tr -cd '[:alnum:]' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - - # Destruct! - - name: Destroy version - run: gcloud app versions delete ${{ env.version_name }} --service=default diff --git a/.github/workflows/master-push.yaml b/.github/workflows/master-push.yaml deleted file mode 100644 index ccec1b63..00000000 --- a/.github/workflows/master-push.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: 'Deploy to Int' - -on: - push: - branches: - - 'master' - -jobs: - build-push-deploy: - name: 'Build and Deploy to Integration' - runs-on: ubuntu-latest - - # Checkout the repository to the GitHub Actions runner - steps: - - name: Checkout - uses: actions/checkout@v2 - - # gcloud CLI setup - - name: Login to GCP - uses: google-github-actions/setup-gcloud@v0 - with: - service_account_key: ${{ secrets.SKYVIEWER_INT_SERVICE_ACCOUNT }} - project_id: edc-int-6c5e - export_default_credentials: true - - - name: Build Container Image - run: |- - docker build \ - -t "gcr.io/edc-int-6c5e/skyviewer-client:${{ github.sha }}" \ - --build-arg NEXT_PUBLIC_API_URL=https://api-int.rubinobs.dev/api \ - --build-arg NEXT_PUBLIC_BASE_URL=https://int.rubinobs.dev \ - --build-arg EDC_LOGGER_API_URL=https://us-central1-skyviewer.cloudfunctions.net/edc-logger \ - --build-arg NEXT_PUBLIC_DEBUG_LOGGING=false \ - --build-arg CLOUD_ENV=INT \ - --build-arg NEXT_PUBLIC_GOOGLE_APP_ID=422617727806-q7opitpsisom3fekpplsh8b77s0oe6n2.apps.googleusercontent.com \ - --build-arg GOOGLE_APP_SECRET=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 \ - --build-arg NEXT_PUBLIC_CONTACT_FORM_POST_URL=https://api-int.rubinobs.dev/actions/contact-form/send \ - --build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN= \ - --build-arg NEXT_PREVIEW_SLUG=preview-in-craft-cms \ - --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` \ - . - - - name: Configure Docker Auth - run: gcloud --quiet auth configure-docker - - - name: Push Container Image to GCR - run: docker push gcr.io/edc-int-6c5e/skyviewer-client:${{ github.sha }} - - - name: Get app.yaml - run: gcloud secrets versions access latest --secret=rubin-obs-client-appyaml > app.yaml - - - name: Deploy to App Engine - run: |- - gcloud app deploy app.yaml \ - --image-url=gcr.io/edc-int-6c5e/skyviewer-client:${{ github.sha }} \ - --promote \ - --project=edc-int-6c5e diff --git a/.github/workflows/prod-push.yaml b/.github/workflows/prod-push.yaml deleted file mode 100644 index f7209e06..00000000 --- a/.github/workflows/prod-push.yaml +++ /dev/null @@ -1,65 +0,0 @@ -name: 'Deploy to Prod' - -on: - push: - branches: - - '!*' - tags: - - 'v*' - -jobs: - build-push-deploy: - name: 'Build and Deploy to Production' - runs-on: ubuntu-latest - - # Checkout the repository to the GitHub Actions runner - steps: - - name: Checkout - uses: actions/checkout@v2 - - # gcloud CLI setup - - name: Login to GCP - uses: google-github-actions/setup-gcloud@v0 - with: - service_account_key: ${{ secrets.PIPELINE_EPO_PROD_PROJECT }} - project_id: edc-prod-eef0 - export_default_credentials: true - - - name: Format version name - id: version_name - run: echo "version_name=$(echo \"${{ github.ref_name }}\" | sed 's/[_.,\/]/-/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV - - - name: Build Container Image - run: |- - docker build \ - -t "gcr.io/edc-prod-eef0/rubin-obs-client:${{ env.version_name }}" \ - --build-arg NEXT_PUBLIC_API_URL=https://api.rubinobs.org/api \ - --build-arg NEXT_PUBLIC_BASE_URL=https://rubinobservatory.org \ - --build-arg EDC_LOGGER_API_URL=https://us-central1-skyviewer.cloudfunctions.net/edc-logger \ - --build-arg NEXT_PUBLIC_DEBUG_LOGGING=false \ - --build-arg CLOUD_ENV=PROD \ - --build-arg NEXT_PUBLIC_GOOGLE_APP_ID=596747551410-vcqlrp7erg5c5gm0dkvc0k21mgi0ilg0.apps.googleusercontent.com \ - --build-arg GOOGLE_APP_SECRET=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 \ - --build-arg NEXT_PUBLIC_CONTACT_FORM_POST_URL=https://api.rubinobs.org/actions/contact-form/send \ - --build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN=rubinobservatory.org,all.epo.sites \ - --build-arg NEXT_PREVIEW_SLUG=preview-in-craft-cms \ - --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` \ - . - - name: Configure Docker Auth - run: gcloud --quiet auth configure-docker - - - name: Push Container Image to GCR - run: docker push gcr.io/edc-prod-eef0/rubin-obs-client:${{ env.version_name }} - - - name: Get app.yaml - run: gcloud secrets versions access latest --secret=rubin-obs-client-appyaml > app.yaml - - - name: Deploy to App Engine - run: |- - gcloud app deploy app.yaml \ - --image-url=gcr.io/edc-prod-eef0/rubin-obs-client:${{ env.version_name }} \ - --version=${{ env.version_name }} \ - --promote \ - --project=edc-prod-eef0 diff --git a/Dockerfile b/Dockerfile index d4e090a0..d4ed5202 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,17 +22,6 @@ WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . -ARG NEXT_PUBLIC_API_URL=https://api.rubinobs.org/api -ARG EDC_LOGGER_API_URL=https://us-central1-skyviewer.cloudfunctions.net/edc-logger -ARG NEXT_PUBLIC_BASE_URL=https://rubinobs.org -ARG NEXT_PUBLIC_GOOGLE_APP_ID=688095955960-t0fpaj4ec3gh5vsr9lhg8govapk2oeo9.apps.googleusercontent.com -ARG NEXT_PUBLIC_CONTACT_FORM_POST_URL=https://api.rubinobs.org/actions/contact-form/send -ARG NEXT_PUBLIC_PLAUSIBLE_DOMAIN=rubinobs.org -ARG CLOUD_ENV=PROD -ARG NEXT_PUBLIC_EFD_URL=https://hasura-e3g4rcii3q-uc.a.run.app/v1/graphql -ARG NEXT_PUBLIC_HASURA_SECRET=_qfq_tMbyR4brJ@KHCzuJRU7 -ARG NEXT_PUBLIC_RELEASE_URL=`https://noirlab.edu/public/api/v2/releases/{{ID}}/?lang={{SITE}}&translation_mode=fallback` - ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL ENV EDC_LOGGER_API_URL=$EDC_LOGGER_API_URL ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL @@ -73,4 +62,4 @@ EXPOSE 8080 ENV PORT 8080 -CMD ["yarn", "start"] \ No newline at end of file +CMD ["yarn", "start"] From 2e8f6162513f9772ad4d0477f8430039f682f2b6 Mon Sep 17 00:00:00 2001 From: Eric Rosas Date: Mon, 11 Mar 2024 13:07:52 -0600 Subject: [PATCH 3/6] Removed build env var refs in `Dockerfile` Removed build env var refs in `Dockerfile` --- Dockerfile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d4ed5202..a8a975a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,14 +22,6 @@ WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . -ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL -ENV EDC_LOGGER_API_URL=$EDC_LOGGER_API_URL -ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL -ENV NEXT_PUBLIC_GOOGLE_APP_ID=$NEXT_PUBLIC_GOOGLE_APP_ID -ENV NEXT_PUBLIC_CONTACT_FORM_POST_URL=$NEXT_PUBLIC_CONTACT_FORM_POST_URL -ENV NEXT_PUBLIC_PLAUSIBLE_DOMAIN=$NEXT_PUBLIC_PLAUSIBLE_DOMAIN -ENV CLOUD_ENV=$CLOUD_ENV - # Next.js collects completely anonymous telemetry data about general usage. # Learn more here: https://nextjs.org/telemetry # Uncomment the following line in case you want to disable telemetry during the build. From 68ff718ffe89ceee66ae3fed1286f0f95d806f9e Mon Sep 17 00:00:00 2001 From: Blake Mason Date: Tue, 12 Mar 2024 13:10:26 -0700 Subject: [PATCH 4/6] [B] NewsGrid thumbnails fallback to hero - Includes some aliasing of the `image` property when destructuring Entry objects to better distinguish `featureImage`, `releaseImage`, and `heroImage` --- components/content-blocks/Callout/CalloutEntry/index.js | 7 +++++-- components/content-blocks/GridBlock/NewsGrid.js | 8 +++++--- components/dynamic/EventList/index.js | 4 ++-- components/dynamic/NewsList/index.js | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/components/content-blocks/Callout/CalloutEntry/index.js b/components/content-blocks/Callout/CalloutEntry/index.js index da3d19e4..be5a3254 100644 --- a/components/content-blocks/Callout/CalloutEntry/index.js +++ b/components/content-blocks/Callout/CalloutEntry/index.js @@ -46,7 +46,8 @@ export default function CalloutEntry({ callout }) { url, description, subtitle, - image, + hero, + image: featureImage, images: releaseImages, entryType, } = entryWithRelease || entry[0]; @@ -59,7 +60,9 @@ export default function CalloutEntry({ callout }) { lang ); const calloutImage = - image?.[0] || makeReleaseFeature(releaseImages, "thumb700x")?.[0]; + featureImage?.[0] || + makeReleaseFeature(releaseImages, "thumb700x")?.[0] || + hero?.[0]; return ( diff --git a/components/content-blocks/GridBlock/NewsGrid.js b/components/content-blocks/GridBlock/NewsGrid.js index 5e0f9647..ec554541 100644 --- a/components/content-blocks/GridBlock/NewsGrid.js +++ b/components/content-blocks/GridBlock/NewsGrid.js @@ -45,7 +45,8 @@ const NewsGrid = ({ items = [], limit, listTypeId, sectionHandle, pageId }) => { description, subtitle, id, - image, + image: featureImage, + hero, images: releaseImages, newsAssets, postType, @@ -61,8 +62,9 @@ const NewsGrid = ({ items = [], limit, listTypeId, sectionHandle, pageId }) => { button: t("read-more"), }} image={ - image?.[0] || - makeReleaseFeature(releaseImages, "thumb700x")?.[0] + featureImage?.[0] || + makeReleaseFeature(releaseImages, "thumb700x")?.[0] || + hero?.[0] } isFeature={i === 0} link={uri} diff --git a/components/dynamic/EventList/index.js b/components/dynamic/EventList/index.js index 62176cd7..e68e79b1 100644 --- a/components/dynamic/EventList/index.js +++ b/components/dynamic/EventList/index.js @@ -43,7 +43,7 @@ const EventList = ({ description, id, hero, - image, + image: featureImage, eventType, registrationCloseDate, registrationOpenDate, @@ -83,7 +83,7 @@ const EventList = ({ } : null } - image={image?.[0] || hero?.[0]} + image={featureImage?.[0] || hero?.[0]} link={uri} pretitle={ gridType === "events" && eventType?.[0]?.title diff --git a/components/dynamic/NewsList/index.js b/components/dynamic/NewsList/index.js index 3d324c3c..077b6c03 100644 --- a/components/dynamic/NewsList/index.js +++ b/components/dynamic/NewsList/index.js @@ -52,7 +52,7 @@ const NewsList = ({ subtitle, id, hero, - image, + image: featureImage, images: releaseImages, newsAssets, postType, @@ -72,7 +72,7 @@ const NewsList = ({ : null } image={ - image?.[0] || + featureImage?.[0] || makeReleaseFeature(releaseImages)?.[0] || hero?.[0] } From b400f928e1a9ff8a48e2fdfe69385480303796f8 Mon Sep 17 00:00:00 2001 From: Blake Mason Date: Wed, 13 Mar 2024 10:38:03 -0700 Subject: [PATCH 5/6] [B] News/Events with fallback used in all thumbnail contexts --- .../GridBlock/CarouselGrid/index.js | 12 ++++++++--- components/dynamic/RelatedList/index.js | 20 ++++++++++++++++-- lib/api/fragments/content-blocks.js | 21 ++++++++++++++++--- lib/api/fragments/event.js | 2 +- lib/api/fragments/news-post.js | 2 +- lib/api/noirlabReleases.js | 1 - pages/api/charming-overlords.js | 4 ---- 7 files changed, 47 insertions(+), 15 deletions(-) diff --git a/components/content-blocks/GridBlock/CarouselGrid/index.js b/components/content-blocks/GridBlock/CarouselGrid/index.js index cd2f4e87..aaf0aa82 100644 --- a/components/content-blocks/GridBlock/CarouselGrid/index.js +++ b/components/content-blocks/GridBlock/CarouselGrid/index.js @@ -5,7 +5,7 @@ import chunk from "lodash/chunk"; import Tile from "@/atomic/Tile"; import Loader from "@/atomic/Loader"; import { Grid } from "@rubin-epo/epo-react-lib"; -import { normalizeItemData, useList } from "@/lib/utils"; +import { normalizeItemData, makeReleaseFeature, useList } from "@/lib/utils"; import * as Styled from "./styles"; function CarouselGrid({ @@ -43,7 +43,9 @@ function CarouselGrid({ title, description, plainText, - image, + image: featureImage, + hero, + images: releaseImages, mixedLink, externalUrl, uri, @@ -51,7 +53,11 @@ function CarouselGrid({ }) => ( 0 && ( {entries.map( - ({ id, description, hero, image, title, uri }, i) => ( + ( + { + id, + description, + hero, + image: featureImage, + images: releaseImages, + title, + uri, + }, + i + ) => ( Date: Wed, 13 Mar 2024 10:39:38 -0700 Subject: [PATCH 6/6] [F] Event page related items is 3 newest events even if past --- components/dynamic/EventList/index.js | 5 +++-- components/templates/EventPage/index.js | 1 + lib/api/entries.js | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/components/dynamic/EventList/index.js b/components/dynamic/EventList/index.js index e68e79b1..38207e7a 100644 --- a/components/dynamic/EventList/index.js +++ b/components/dynamic/EventList/index.js @@ -8,6 +8,7 @@ import { checkIfBetweenDates, createLocationString } from "@/lib/utils"; import * as Styled from "./styles"; const EventList = ({ + section = "events", button, excludeId = null, header, @@ -23,7 +24,7 @@ const EventList = ({ isRelatedList={isRelatedList} excludeId={excludeId} limit={limit} - section="events" + section={section} width={isWide ? "regular" : "narrow"} header={header} footerButton={button} @@ -65,7 +66,6 @@ const EventList = ({ const lock = registration === "open" ? "LockOpen" : "LockClosed"; - return ( /* eslint-disable */