Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0c822b1
fix: user notifications aggregation seed
chrismclarke Feb 18, 2023
afdb432
fix: docs node 18 support
chrismclarke Feb 16, 2023
084a94c
Merge branch 'master' into fix/documentation-build
chrismclarke Feb 18, 2023
a90ff65
Merge branch 'master' into fix/user-notifications-aggregation-seed
chrismclarke Feb 18, 2023
d70b1c2
chore: update yarn and plugins
chrismclarke Feb 18, 2023
812bed8
chore: update yarn lock
chrismclarke Feb 18, 2023
b2f558f
chore: lint formatting
chrismclarke Feb 18, 2023
7c49a65
chore: bump prettier version
chrismclarke Feb 18, 2023
210b135
chore: fix deps resolution issue
chrismclarke Feb 18, 2023
09c79d1
chore: remove lint rule
chrismclarke Feb 18, 2023
94d3b40
Merge pull request #2097 from ONEARMY/fix/user-notifications-aggregat…
davehakkens Feb 18, 2023
ea7eec8
chore: downgrade prettier
chrismclarke Feb 18, 2023
bc3ffe2
Merge branch 'master' into chore/yarn-update-3-4-1
chrismclarke Feb 18, 2023
d81fc9d
Merge branch 'master' into fix/documentation-build
chrismclarke Feb 18, 2023
845080f
Merge pull request #2101 from ONEARMY/chore/yarn-update-3-4-1
chrismclarke Feb 18, 2023
4dbf0e0
Merge branch 'master' of https://github.com/ONEARMY/community-platfor…
chrismclarke Feb 18, 2023
d20c134
chore: bust circle-ci cache
chrismclarke Feb 18, 2023
f0c0247
chore: revert circle-ci cache change
chrismclarke Feb 18, 2023
e62e5fd
fix: functions webpack bin
chrismclarke Feb 18, 2023
05169a5
Merge pull request #2099 from ONEARMY/fix/documentation-build
chrismclarke Feb 18, 2023
bce4afb
fix: docs deploy action
chrismclarke Feb 18, 2023
d84a8a4
chore: add self-ref to action paths
chrismclarke Feb 18, 2023
2edf126
chore: add action test deploy
chrismclarke Feb 18, 2023
f70196a
chore: pin docs deploy action node version
chrismclarke Feb 18, 2023
d485f7c
chore: update action output
chrismclarke Feb 18, 2023
4f457ea
chore: fix indentation error
chrismclarke Feb 18, 2023
348c3e7
chore: remove legacy docs code
chrismclarke Feb 18, 2023
dbb3d8e
chore: fix docs baseUrl
chrismclarke Feb 18, 2023
3d17d38
chore: revert temp ci deployment
chrismclarke Feb 18, 2023
187f59d
chore: fix edit url
chrismclarke Feb 18, 2023
775b13c
chore: introduce linting to Cypress directory
thisislawatts Jan 29, 2023
3a667fa
chore: appease linting rules
thisislawatts Jan 29, 2023
d410591
chore: enforce no-assigning-return-values
thisislawatts Jan 29, 2023
d8682f7
Merge pull request #2104 from ONEARMY/fix/docs-deploy-action
chrismclarke Feb 19, 2023
a0e1011
Merge branch 'master' into chore/lint-cypress
chrismclarke Feb 19, 2023
74c705e
Merge pull request #2082 from ONEARMY/chore/lint-cypress
thisislawatts Feb 19, 2023
489720f
fix: admin notifications legacy format
chrismclarke Feb 20, 2023
d3b31d1
docs: update md guide
MIfoodie Feb 20, 2023
f4d6a8e
Merge pull request #2106 from ONEARMY/docs/style-guide-update
chrismclarke Feb 20, 2023
2226668
Merge branch 'master' into fix/admin-notifications-list
davehakkens Feb 20, 2023
365c69b
Merge pull request #2105 from ONEARMY/fix/admin-notifications-list
davehakkens Feb 20, 2023
751252e
Merge branch 'production' into master
davehakkens Feb 20, 2023
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
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
node_modules
functions
build
cypress
lib
storybook-static
dist
dist
shared/lib
24 changes: 13 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,20 @@
"@typescript-eslint/interface-name-prefix": "off",
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/naming-convention.md
// NOTE - typings throughout the platform are fairly inconsistent, hence the wide range of rules

// 2023-02-17 - Disable as lint check now blocking build (warnings treated as error)
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "default",
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"],
"leadingUnderscore": "allow"
},
{
"selector": "classMethod",
"format": ["camelCase"],
"leadingUnderscore": "allow"
}
"off"
// {
// "selector": "default",
// "format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"],
// "leadingUnderscore": "allow"
// },
// {
// "selector": "classMethod",
// "format": ["camelCase"],
// "leadingUnderscore": "allow"
// }
],
// Filenames - https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
"unicorn/filename-case": [
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ on:
# Only run action if changes have been made
# to the documentation or components packages
paths:
- "packages/documentation/**"
- "packages/components/**"
- 'packages/documentation/**'
- 'packages/components/**'
- '.github/workflows/docs-deploy.yml'
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.13.0'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
# Setup yarn 2 cache: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Setup Cache
uses: actions/cache@v2
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand Down
4 changes: 2 additions & 2 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

807 changes: 0 additions & 807 deletions .yarn/releases/yarn-3.3.0.cjs

This file was deleted.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.4.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.3.0.cjs
yarnPath: .yarn/releases/yarn-3.4.1.cjs
5 changes: 3 additions & 2 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"start": "ts-node scripts/start.ts",
"serve:live": "yarn copyDevConfig && yarn serve",
"lint": "tslint --project tsconfig.json",
"build": "webpack",
"watch": "webpack --watch",
"build": "./node_modules/.bin/webpack",
"watch": "./node_modules/.bin/webpack --watch",
"copyDevConfig": "firebase functions:config:get > .runtimeconfig.json",
"db:backup:local": "firestore-export -a service.json -b backup.json -p",
"shell": "yarn build && firebase functions:shell",
Expand Down Expand Up @@ -61,6 +61,7 @@
"firebase-functions-test": "^3.0.0",
"jest": "29.2.2",
"ts-jest": "29.0.3",
"ts-loader": "^9.4.2",
"ts-node": "^10.0.0",
"tslint": "^6.1.3",
"typescript": "4.5.5",
Expand Down
11 changes: 6 additions & 5 deletions functions/src/aggregations/userNotifications.aggregations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface INotificationAggregation extends IAggregation {
sourceFields: (keyof IUserDB)[]
}

const aggregations: INotificationAggregation[] = [
const UserNotificationAggregation: INotificationAggregation =
// When a user's list of notifications changes reflect to aggregation
{
sourceCollection: 'users',
Expand All @@ -19,7 +19,9 @@ const aggregations: INotificationAggregation[] = [
const user: IUserDB = dbChange.after.data() as any
const { _id, _authID, notification_settings, notifications } = user
const emailFrequency = notification_settings?.emailFrequency || null
const pending = notifications.filter((n) => !n.notified && !n.read)
const pending = (notifications || []).filter(
(n) => !n.notified && !n.read,
)
// remove user from list if they do not have emails enabled or no pending notifications
if (!emailFrequency || pending.length === 0) {
return {
Expand All @@ -31,12 +33,11 @@ const aggregations: INotificationAggregation[] = [
[_id]: { _authID, emailFrequency, notifications: pending },
}
},
},
]
}

/** Watch changes to all user docs and apply aggregations */
exports.default = functions.firestore
.document(`${DB_ENDPOINTS.users}/{id}`)
.onUpdate((change) => {
return handleDBAggregations(change, aggregations)
return handleDBAggregations(change, [UserNotificationAggregation])
})
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@
"last 1 safari version"
]
},
"resolutions": {
"__note1__": "Pin react version consistently in all child workspaces",
"react": "17.0.2",
"@types/react": "17.0.2"
},
"dependencies": {
"@emotion/react": "^11.8.2",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.8.1",
"@sentry/react": "^6.15.0",
"@uppy/core": "^2.1.4",
Expand Down Expand Up @@ -96,13 +101,12 @@
"pino": "^7.2.0",
"pino-logflare": "^0.3.12",
"pubsub-js": "^1.7.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-dropzone": "^10.1.10",
"react-final-form": "6.5.3",
"react-final-form-arrays": "^3.1.3",
"react-firebase-file-uploader": "2.4.4",
"react-flag-icon-css": "^1.0.25",
"react-foco": "^1.3.1",
"react-ga4": "^1.4.1",
"react-hamburger-menu": "^1.1.1",
Expand Down Expand Up @@ -147,8 +151,8 @@
"@types/jest": "^27.4.3",
"@types/node": "18",
"@types/pubsub-js": "^1.5.18",
"@types/react": "^16.9.53",
"@types/react-dom": "^17.0.3",
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2",
"@types/react-hamburger-menu": "^0.0.3",
"@types/react-lazy-load-image-component": "^1.5.1",
"@types/react-leaflet": "^1.1.6",
Expand All @@ -174,16 +178,18 @@
"env-cmd": "^10.1.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-mocha": "^10.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-sort-class-members": "^1.15.2",
"eslint-plugin-unicorn": "^36.0.0",
"husky": "^7.0.4",
"idb": "^6.0.0",
"lint-staged": "^8.1.5",
"mobx-react-devtools": "^6.0.3",
"prettier": "^2.6.1",
"prettier": "2.5.1",
"react-dev-utils": "^11.0.4",
"start-server-and-test": "^1.11.0",
"stream-browserify": "^3.0.0",
Expand All @@ -209,5 +215,5 @@
"npm": "please-use-yarn",
"node": ">=16.10.0 <19.0.0"
},
"packageManager": "yarn@3.3.0"
"packageManager": "yarn@3.4.1"
}
10 changes: 6 additions & 4 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@
"new-component": "ts-node scripts/newComponent.ts"
},
"dependencies": {
"@emotion/react": "^11.8.2",
"@emotion/styled": "^11.8.1",
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@faker-js/faker": "^7.6.0",
"@react-icons/all-files": "^4.1.0",
"date-fns": "^2.29.3",
"linkify-plugin-mention": "^4.0.2",
"linkify-react": "^4.0.2",
"linkifyjs": "^4.0.2",
"prettier": "^2.5.1",
"react": "^17.0.2",
"react-flag-icon-css": "^1.0.25",
"react-icons": "^4.3.1",
"react-portal": "^4.2.2",
Expand All @@ -38,6 +36,9 @@
"use-debounce": "^8.0.4",
"webpack": "^5.75.0"
},
"peerDependencies": {
"react": "17.0.2"
},
"devDependencies": {
"@babel/core": "^7.14.3",
"@react-theming/storybook-addon": "^1.1.5",
Expand All @@ -57,6 +58,7 @@
"eslint": "^7.32.0",
"eslint-plugin-import": "^2.25.4",
"mustache": "^4.2.0",
"prettier": "2.5.1",
"ts-node": "^10.7.0",
"typescript": "^4.5.5"
}
Expand Down
12 changes: 12 additions & 0 deletions packages/cypress/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": ["cypress", "mocha"],
"rules": {
"cypress/no-assigning-return-values": "error",
"cypress/no-unnecessary-waiting": "warn",
"cypress/assertion-before-screenshot": "warn",
"cypress/no-force": "warn",
"cypress/no-async-tests": "warn",
"cypress/no-pause": "warn",
"mocha/no-skipped-tests": "error"
}
}
25 changes: 23 additions & 2 deletions packages/cypress/src/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,29 @@
* ```
* or
* ```
* import * as MOCK_DATA from '../data
* import { MOCK_DATA } from '../data
* ```
*
**/
export * from 'oa-shared/mocks/data'

import {
categories,
events,
howtos,
mappins,
research,
tags,
users,
} from 'oa-shared/mocks/data'

export { howtos, users } from 'oa-shared/mocks/data'

export const MOCK_DATA = {
categories,
events,
howtos,
mappins,
research,
tags,
users,
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe('[Sign-in - authenticated user]', () => {
it('redirects to home page', () => {
cy.visit('/sign-in')
cy.login('howto_reader@test.com', 'test1234')
cy.wait(3000)
cy.visit('/sign-in').url().should('include', '/')
})
})
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { generatedId } from '../utils/test-utils'
import { generatedId } from '../utils/TestUtils'
import { FRIENDLY_MESSAGES } from 'oa-shared'

// existing user already created in auth system
Expand Down Expand Up @@ -69,7 +69,6 @@ describe('[Sign-up - new user]', () => {
describe('[Sign-up - authenticated user]', () => {
it('redirects to home page', () => {
cy.login('howto_reader@test.com', 'test1234')
cy.wait(3000)
cy.visit('/sign-up').url().should('include', '/')
})
})
2 changes: 1 addition & 1 deletion packages/cypress/src/integration/academy.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Page } from '../utils/test-utils'
import { Page } from '../utils/TestUtils'

describe('[Academy]', () => {
describe('[List instructions]', () => {
Expand Down
Loading