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

Release/ADAPT-000 Gallery/Campaign page logo fix #235

Merged
merged 19 commits into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-transform-react-jsx"
]
}
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build/
dist/
node_modules/
.snapshots/
*.min.js
*.test.js
43 changes: 26 additions & 17 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
{
parser: "@typescript-eslint/parser",
extends: [
"parser": "@babel/eslint-parser",
"extends": [
"plugin:react/recommended",
"plugin:prettier/recommended"
],
settings: {
react: {
version: "detect"
"settings": {
"react": {
"version": "detect"
}
},
env: {
browser: true,
node: true,
es6: true
"env": {
"browser": true,
"node": true,
"es6": true
},
plugins: ["react", "prettier"],
parserOptions: {
ecmaFeatures: {
jsx: true
"plugins": ["react", "prettier"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
ecmaVersion: 2018,
sourceType: "module"
"ecmaVersion": 2018,
"sourceType": "module"
},
rules: {
"rules": {
"react/prop-types": "off",
"prettier/prettier": "error"
"prettier/prettier": [
"error",
{
"endOfLine": "lf",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
]
}
}
9 changes: 9 additions & 0 deletions .github/auto-label.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"rules": {
"patch": ["package.json"],
"frontend": ["*.js", "*.css", "*.scss", "*.jsx"],
"component": ["src/components"],
"backend": ["gatsby-*.js", "lambda/*"],
"ci": [".circleci", ".codeclimate", ".github"]
}
}
9 changes: 9 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
feature: ['feature/*', 'feat/*', 'feature-*']
fix: ['fix/*', 'bug/*', 'bugfix/*', 'hotfix/*']
task: ['task/*', 'chore/*']
major: '*[major]*'
minor: '*[minor]*'
patch: '*[patch]*'
alpha: '*[alpha]*'
beta: '*[beta]*'
rc: '*[rc]*'
15 changes: 15 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- title: '🧰 Maintenance'
label: 'task'
template: |
## Release Notes:

$CHANGES
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint
on: push

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set the correct Node version using nvm
shell: bash -l {0}
run: nvm install
- uses: bahmutov/npm-install@v1
- name: Run Lint
run: npm run lint
26 changes: 26 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PR Labeler
on:
pull_request:
types: [opened, synchronize]

jobs:
pr-labeler:
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v3
with:
configuration-path: .github/pr-labeler.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_max_size: '100'
s_max_size: '250'
m_max_size: '500'
l_max_size: '3000'
fail_if_xl: 'false'
- uses: banyan/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: Release
timeout-minutes: 10
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
# Specify a different token to allow pushing changes to main later
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- name: Set Git user
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Action"
- name: Version Bump
id: version_bump
uses: 'phips28/gh-action-bump-version@master'
with:
skip-tag: 'true'
commit-message: "ci: version bump to {{version}} [skip ci]"
# Specify a different token to allow pushing change to main
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- name: Publish Release
id: release
uses: release-drafter/release-drafter@v5
with:
version: ${{ steps.version_bump.outputs.newTag }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- name: Merge release back into dev
uses: devmasx/[email protected]
with:
type: now
from_branch: main
target_branch: dev
github_token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [ADAPT OOD GIVING](https://github.com/SU-SWS/ood_giving_site)
##### Version: 1.0.0

<a href="https://codeclimate.com/repos/5f6cf2ceafd47c7359000865/maintainability"><img src="https://api.codeclimate.com/v1/badges/681fbc135f73271ae120/maintainability" /></a>
<a href="https://codeclimate.com/github/SU-SWS/ood_giving_site/maintainability"><img src="https://api.codeclimate.com/v1/badges/dc1a243d09f8aa5c903a/maintainability" /></a>

[![Netlify Status](https://api.netlify.com/api/v1/badges/b539dff9-d21b-4a2e-8edc-b9cb898c26b2/deploy-status)](https://app.netlify.com/sites/adapt-giving/deploys)

Expand Down
61 changes: 37 additions & 24 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
const path = require("path");

const activeEnv =
process.env.GATSBY_ACTIVE_ENV || process.env.NODE_ENV || "development"
process.env.GATSBY_ACTIVE_ENV || process.env.NODE_ENV || "development";

console.log(`Using environment config: '${activeEnv}'`)
console.log(`Using environment config: '${activeEnv}'`);

require("dotenv").config({
path: `.env.${activeEnv}`,
})
});

// Support for Gatsby CLI
let siteUrl = 'http://localhost:8000';

// Support for Production site builds.
if (process.env.CONTEXT === 'production') {
siteUrl = process.env.URL;
}
// Support for non-production netlify builds (branch/preview)
else if (process.env.CONTEXT !== 'production' && process.env.NETLIFY) {
siteUrl = process.env.DEPLOY_PRIME_URL;
}
// Support for Netlify CLI.
else if (process.env.NETLIFY_DEV === true) {
siteUrl = 'http://localhost:64946';
}

/**
* Resolve relations for storyblok.
Expand All @@ -27,11 +43,11 @@ module.exports = {
title: `Giving to Stanford`,
description: `Giving to Stanford.`,
author: `Stanford University Office of Development`,
siteUrl: `https://giving.stanford.edu`,
siteUrl,
// This key is for metadata only and can be statically queried
storyblok: {
resolveRelations: storyblokRelations,
}
},
},
plugins: [
{
Expand Down Expand Up @@ -88,20 +104,18 @@ module.exports = {
}
}
`,
resolvePages: ({
allSitePage: { edges: allPages }
}) => {
return allPages.map(page => {
return { ...page.node }
})
resolvePages: ({ allSitePage: { edges: allPages } }) => {
return allPages.map((page) => {
return { ...page.node };
});
},
resolveSiteUrl: () => 'https://giving.stanford.edu',
resolveSiteUrl: () => siteUrl,
excludes: [
'/editor',
'/editor/**',
'/global-components/**',
'/test-items/**',
'/403',
"/editor",
"/editor/**",
"/global-components/**",
"/test-items/**",
"/403",
],
},
},
Expand All @@ -111,6 +125,7 @@ module.exports = {
accessToken: process.env.GATSBY_STORYBLOK_ACCESS_TOKEN,
homeSlug: "home",
resolveRelations: storyblokRelations,
resolveLinks: 'url',
version: process.env.NODE_ENV == "production" ? "published" : "draft", // show only published on the front end site
// version: 'draft' // would show any including drafts
},
Expand All @@ -120,9 +135,7 @@ module.exports = {
options: {
implementation: require("node-sass"),
sassOptions: {
includePaths: [
path.resolve(__dirname, "node_modules")
],
includePaths: [path.resolve(__dirname, "node_modules")],
},
cssLoaderOptions: {
camelCase: false,
Expand Down Expand Up @@ -150,14 +163,14 @@ module.exports = {
// enablePartialUpdates: true,
queries: require("./src/utilities/algoliaQueries"),
// we skip the indexing completely on non-prod builds.
skipIndexing: process.env.CONTEXT != 'production',
skipIndexing: !!(process.env.ALGOLIA_SKIP_INDEXING || process.env.CONTEXT !== 'production')
},
},
{
resolve: `gatsby-plugin-netlify`,
options: {
mergeSecurityHeaders: false,
}
}
},
},
],
}
};
26 changes: 20 additions & 6 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,28 @@
Referrer-Policy = "origin-when-cross-origin"
Strict-Transport-Security = "max-age=2592000"
Permissions-Policy = "vibrate=(), geolocation=(), midi=(), notifications=(), push=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=()"

X-Frame-Options = "DENY"
[[context.dev.headers]]
for = "/*"
[context.dev.headers.values]
Basic-Auth = "adapt:letmein2021"
[[headers]]
for = "/editor"
[headers.values]
X-Frame-Options = "ALLOWALL"
# SUBMIT SITEMAP PLUGIN
# https://www.npmjs.com/package/netlify-plugin-submit-sitemap
# ###############################################################################
[[plugins]]
package = "netlify-plugin-submit-sitemap"
[plugins.inputs]
# Path to the sitemap URL (optional, default = /sitemap.xml)
sitemapPath = "/sitemap/sitemap-index.xml"
# Production context:
# All deploys from the main repository branch
# will inherit these settings.
[context.main]
# Deploys from main branch run this plugin in the build.
# Plugins context requires double brackets.
[[context.main.plugins]]
package = "netlify-plugin-submit-sitemap"
[context.main.plugins.inputs]
# Path to the sitemap URL (optional, default = /sitemap.xml)
sitemapPath = "/sitemap/sitemap-index.xml"
# REDIRECTS are located in static/_redirects
# ###############################################################################
Loading