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

Deploying #673

Closed
wants to merge 8 commits into from
Closed
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
1 change: 0 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ CRM_APP_SECRET=#{CRM_APP_SECRET}
CRM_SCOPE=#{CRM_SCOPE}
CRM_VIEW_CURRENT=#{CRM_VIEW_CURRENT}
CRM_VIEW_PAST=#{CRM_VIEW_PAST}
RULESWIDGET_APPINSIGHTS_INSTRUMENTATIONKEY=#{APPINSIGHTS_INSTRUMENTATIONKEY}
APPLICATIONINSIGHTS_CONNECTION_STRING=#{APPLICATIONINSIGHTS_CONNECTION_STRING}
16 changes: 0 additions & 16 deletions .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/template-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
CRM_VIEW_CURRENT: ${{ secrets.CRM_VIEW_CURRENT }}
CRM_VIEW_PAST: ${{ secrets.CRM_VIEW_PAST }}
APPLICATIONINSIGHTS_CONNECTION_STRING: ${{ secrets.APPLICATIONINSIGHTS_CONNECTION_STRING }}
RULESWIDGET_APPINSIGHTS_INSTRUMENTATIONKEY: ${{ secrets.RULESWIDGET_APPINSIGHTS_INSTRUMENTATIONKEY }}
CHINA_BUILD: FALSE
VERSION_DEPLOYED: ${{ github.run_number }}

Expand Down
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.2.cjs

This file was deleted.

925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.5.0.cjs

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs

supportedArchitectures:
os:
- 'darwin'
- 'linux'
- 'win32'
cpu:
- 'x64'
- 'x86'
- 'arm'
- 'arm64'
- 'ia32'
- x64
- x86
- arm
- arm64
- ia32
libc:
- 'glibc'
- 'musl'
- glibc
- musl
os:
- darwin
- linux
- win32

yarnPath: .yarn/releases/yarn-4.5.0.cjs
80 changes: 80 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import prettier from 'eslint-plugin-prettier';
import jsxA11Y from 'eslint-plugin-jsx-a11y';
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: [
'**/.DS_Store',
'**/node_modules/',
'**/.env*',
'**/logs',
'**/*.log',
'**/npm-debug.log*',
'**/yarn-debug.log*',
'**/yarn-error.log*',
'**/.cache/',
'**/public',
'**/build',
'**/lib/**/*',
],
},
...compat.extends(
'eslint:recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended'
),
{
plugins: {
prettier,
'jsx-a11y': jsxA11Y,
},

languageOptions: {
globals: {
...globals.browser,
...globals.node,
},

parser: babelParser,
ecmaVersion: 12,
sourceType: 'module',

parserOptions: {
requireConfigFile: false,

babelOptions: {
presets: ['@babel/preset-react'],
},
},
},

settings: {
react: {
version: 'detect',
},
},

rules: {
strict: 0,
'no-console': 'warn',
quotes: ['warn', 'single'],
'prettier/prettier': 'warn',
'react/prop-types': 'warn',
'no-unused-vars': 'warn',
},
},
];
2 changes: 1 addition & 1 deletion gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (!appInsightsConnectionString) {
}

// React Context in Browser
// eslint-disable-next-line react/prop-types

export const wrapRootElement = ({ element }) => {
return <AppProvider>{element}</AppProvider>;
};
Expand Down
35 changes: 23 additions & 12 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (!appInsightsConnectionString) {
const client = appInsights.defaultClient;

// Add a telemetry initializer if needed
client.addTelemetryProcessor((envelope, contextObjects) => {
client.addTelemetryProcessor((envelope) => {
envelope.tags[appInsights.defaultClient.context.keys.cloudRole] =
'GatsbyBuildProcess';
});
Expand Down Expand Up @@ -134,7 +134,7 @@ const loadSampleData = (crmData) => {
crmData.push(user);
}
});
} catch (err) {
} catch {
// if error, then we don't add anything
}
};
Expand Down Expand Up @@ -483,14 +483,19 @@ exports.createPages = async function ({ actions, graphql }) {

// if person has a nickname (even if they are alumni), create a redirect from it
if (person.nicknamePath && person.path !== person.nicknamePath) {
const nicknamePath = person.nicknamePath.replace(
alumniPrefix.replace('/', ''),
''
);
actions.createRedirect({
fromPath: person.nicknamePath.replace(
alumniPrefix.replace('/', ''),
''
),
fromPath: nicknamePath,
toPath: `/${person.path}`,
isPermanent: true,
});
/* eslint-disable no-console */
console.log(
'Creating redirect from ' + nicknamePath + ' to ' + person.path
);
}

if (person.path.includes('alumni')) {
Expand All @@ -513,14 +518,19 @@ exports.createPages = async function ({ actions, graphql }) {
const sanitisedMarkdown = (input) => {
const lines = input.split('\n');

const filteredLines = lines.filter((x) => {
const filteredLines = lines.filter((line) => {
const imgRegex = /!\[.*\](.*)/;
const emptyLineRegex = /^\s*$/; // this gets rid of '\r' lines

return (
!imgRegex.test(x) &&
!x.trim().includes('[[imgBadge]]') &&
!x.trim().includes('[Editing profiles]') &&
!x.trim().includes('<br/>') &&
x.length !== 0
!imgRegex.test(line) &&
!line.trim().includes('[[imgBadge]]') &&
!line.trim().includes('[Editing profiles]') &&
!line.trim().includes('<br/>') &&
!line.trim().includes('---') &&
!line.trim().startsWith('#') &&
!emptyLineRegex.test(line) &&
line.length !== 0
);
});

Expand All @@ -530,6 +540,7 @@ exports.createPages = async function ({ actions, graphql }) {

var profileData = {
skills: skills.join(' | '),
position: person.dataCRM.jobTitle.trim(),
presenter: {
name: person.dataCRM.fullName,
peopleProfileURL: 'https://www.ssw.com.au/people/' + person.path,
Expand Down
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "ssw-people",
"license": "MIT",
"author": "SSWDevelopers <[email protected]>",
"type": "commonjs",
"scripts": {
"dev": "gatsby develop",
"serve": "gatsby serve",
Expand All @@ -12,7 +13,7 @@
"build": "yarn run build:dir && yarn run build:favicons && gatsby build --prefix-paths --log-pages",
"devbuild": "yarn run build:dir && yarn run build:favicons && gatsby build",
"test": "ava **/*.test.js --verbose",
"lint": "eslint --max-warnings=0 . --ext ts --ext tsx --ext js --ext jsx"
"lint": "eslint --max-warnings=0 ."
},
"greenkeeper": {
"ignore": [
Expand All @@ -24,11 +25,11 @@
"@brainhubeu/react-carousel": "^2.0.4",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
"@microsoft/applicationinsights-web": "^3.3.1",
"@microsoft/applicationinsights-web": "^3.3.3",
"@raae/gatsby-remark-oembed": "^0.3.3",
"@reach/router": "^1.3.4",
"assert": "^2.1.0",
"axios": "^1.7.3",
"axios": "^1.7.7",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
"classnames": "^2.5.1",
Expand All @@ -44,13 +45,13 @@
"gatsby-plugin-react-svg": "^3.3.0",
"gatsby-plugin-sharp": "^5.13.1",
"gatsby-plugin-sitemap": "^6.13.1",
"gatsby-remark-copy-linked-files": "^6.13.1",
"gatsby-remark-copy-linked-files": "^6.13.2",
"gatsby-remark-custom-blocks": "^3.15.0",
"gatsby-remark-embed-video": "^3.2.1",
"gatsby-remark-figure-caption": "^2.0.0",
"gatsby-remark-images": "^7.13.1",
"gatsby-remark-images": "^7.13.2",
"gatsby-remark-relative-images": "^0.3.0",
"gatsby-remark-responsive-iframe": "^6.13.1",
"gatsby-remark-responsive-iframe": "^6.13.2",
"gatsby-source-filesystem": "^5.13.1",
"gatsby-source-git": "^1.1.0",
"gatsby-transformer-json": "^5.13.1",
Expand All @@ -63,7 +64,7 @@
"moment": "^2.30.1",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"postcss": "^8.4.41",
"postcss": "^8.4.47",
"postcss-import": "^16.1.0",
"postcss-nested": "^6.2.0",
"preval.macro": "^5.0.0",
Expand All @@ -72,19 +73,19 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-ga": "^3.3.1",
"react-github-calendar": "^4.2.2",
"react-github-calendar": "^4.3.1",
"react-helmet": "^6.1.0",
"react-hot-toast": "^2.4.1",
"react-jotform": "^1.0.2",
"react-lazy-youtube": "^1.0.1",
"react-pose": "^4.0.10",
"react-responsive-modal": "^6.4.2",
"react-youtube": "^10.1.0",
"ssw.megamenu": "^4.5.9",
"ssw.rules.widget": "^2.0.3",
"ssw.megamenu": "^4.6.2",
"ssw.rules.widget": "^2.0.5",
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"styled-components": "^6.1.12",
"styled-components": "^6.1.13",
"url": "^0.11.4",
"util": "^0.12.5",
"webpack-assets-manifest": "^5.2.1"
Expand All @@ -95,24 +96,24 @@
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"applicationinsights": "^3.2.1",
"applicationinsights": "^3.3.0",
"array-flat-polyfill": "^1.0.1",
"autoprefixer": "^10.4.20",
"ava": "^6.1.3",
"babel-eslint": "^10.1.0",
"chrome-launcher": "^1.1.2",
"directory-named-webpack-plugin": "^4.1.0",
"dotenv": "^16.4.5",
"eslint": "^9.9.0",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint": "^9.11.1",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react": "^7.36.1",
"favicons": "^6.2.2",
"gatsby-cli": "^5.13.3",
"lighthouse": "^12.2.0",
"lighthouse": "^12.2.1",
"mkdirp": "^3.0.1",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.9"
"tailwindcss": "^3.4.13"
},
"packageComments": {
"⚠️ gatsby-remark-custom-blocks": "Locked to ^3.2.0 - Higher versions are incompatible with gatsby-transformer-remark@^4.0.0 as per https://www.gatsbyjs.com/plugins/gatsby-remark-custom-blocks/",
Expand All @@ -124,5 +125,5 @@
"resolutions": {
"sharp": "0.33.2"
},
"packageManager": "yarn@4.0.2"
}
"packageManager": "yarn@4.5.0"
}
1 change: 0 additions & 1 deletion src/components/contact/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const Contact = ({ firstNameOrNickname, alumni }) => {

Contact.propTypes = {
firstNameOrNickname: PropTypes.string.isRequired,
fullName: PropTypes.string.isRequired,
alumni: PropTypes.bool.isRequired,
};

Expand Down
Loading
Loading