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

Fix #964 "Create How-to" button for not-logged in #1036

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
df8cf12
Merge pull request #477 from OneArmyWorld/v0.3.0
chrismclarke May 9, 2019
603198b
Merge pull request #478 from OneArmyWorld/v0.3.0
chrismclarke May 9, 2019
b6da044
Merge pull request #479 from OneArmyWorld/master
BenGamma May 9, 2019
7817316
Merge pull request #480 from OneArmyWorld/master
BenGamma May 9, 2019
ea2a3cb
Merge pull request #482 from OneArmyWorld/master
BenGamma May 9, 2019
06ad863
Merge pull request #485 from OneArmyWorld/master
chrismclarke May 9, 2019
8095819
Merge pull request #486 from OneArmyWorld/master
chrismclarke May 9, 2019
7bd8f17
Merge pull request #489 from OneArmyWorld/master
chrismclarke May 10, 2019
a15fd88
Merge pull request #502 from OneArmyWorld/master
chrismclarke May 29, 2019
dac531a
Merge pull request #510 from OneArmyWorld/master
chrismclarke Jun 20, 2019
6106242
Merge pull request #538 from OneArmyWorld/master
chrismclarke Aug 13, 2019
a556c3a
Merge pull request #543 from OneArmyWorld/master
chrismclarke Aug 20, 2019
6ec258b
Merge pull request #552 from ONEARMY/master
chrismclarke Aug 30, 2019
daa72cc
Merge pull request #556 from ONEARMY/master
BenGamma Sep 2, 2019
c50e97e
Merge pull request #579 from ONEARMY/master
chrismclarke Sep 15, 2019
ae96300
Merge pull request #580 from ONEARMY/master
BenGamma Sep 15, 2019
0e13245
Merge pull request #581 from ONEARMY/master
chrismclarke Sep 15, 2019
3dc13a2
Merge pull request #583 from ONEARMY/master
chrismclarke Sep 16, 2019
fd94731
Merge pull request #623 from ONEARMY/master
chrismclarke Oct 8, 2019
7c08ebb
Merge pull request #625 from ONEARMY/master
BenGamma Oct 8, 2019
bf53768
Merge pull request #748 from ONEARMY/master
chrismclarke Nov 5, 2019
8c2cedc
Merge pull request #749 from ONEARMY/master
chrismclarke Nov 5, 2019
6a78ab7
Merge pull request #767 from ONEARMY/master
BenGamma Nov 13, 2019
c5a4f9b
Merge pull request #770 from ONEARMY/master
BenGamma Nov 15, 2019
cf9c84b
Merge pull request #794 from ONEARMY/master
chrismclarke Nov 26, 2019
a201620
Merge pull request #812 from ONEARMY/master
BenGamma Dec 3, 2019
5585f21
Merge pull request #814 from ONEARMY/master
chrismclarke Dec 4, 2019
4bdd632
Merge pull request #855 from ONEARMY/master
BenGamma Jan 6, 2020
b6ae865
Merge pull request #857 from ONEARMY/master
BenGamma Jan 7, 2020
e0f84e7
Merge pull request #861 from ONEARMY/master
BenGamma Jan 7, 2020
a449b56
Merge pull request #862 from ONEARMY/master
BenGamma Jan 7, 2020
ee89fe0
Merge pull request #865 from ONEARMY/master
BenGamma Jan 8, 2020
1184ee5
Merge pull request #878 from ONEARMY/master
BenGamma Jan 16, 2020
000bdd5
Merge pull request #884 from ONEARMY/master
chrismclarke Feb 3, 2020
f00f162
Merge pull request #911 from ONEARMY/master
BenGamma Mar 11, 2020
65a8cb1
Merge pull request #914 from ONEARMY/master
BenGamma Mar 22, 2020
1d0f37e
Merge pull request #924 from ONEARMY/master
BenGamma Mar 28, 2020
ca6b738
Merge pull request #959 from ONEARMY/master
chrismclarke Apr 23, 2020
793746b
Merge pull request #978 from ONEARMY/master
chrismclarke Jun 9, 2020
84646ec
Format link in user settings to lower case
tudi2d Jul 8, 2020
0e6b720
Merge pull request #995 from tudi2d/986-link-lower-case
BenGamma Jul 13, 2020
1f9701b
redirect root page to /academy instead of /how-to
BenGamma Jul 13, 2020
4ce6a86
update test
BenGamma Jul 13, 2020
5f26ce1
Merge pull request #997 from ONEARMY/988-academy-landing-page
BenGamma Jul 13, 2020
4660bdd
Initial Commit- Changed 'Workspaces' to 'All Workspaces' in map compo…
Daniel-Davies Jul 15, 2020
a997c1e
added consistent dropdown
Daniel-Davies Jul 15, 2020
8bcc5ce
added custom arrow to dropdowns on map
Daniel-Davies Jul 15, 2020
b86031c
added black text placeholders on map page
Daniel-Davies Jul 15, 2020
fe4d066
tighter CSS constraints on multiselect class
Daniel-Davies Jul 15, 2020
33fbdec
resized arrow svg to similar as how-to page select
Daniel-Davies Jul 16, 2020
fa8c6a3
Bump lodash from 4.17.15 to 4.17.19 in /functions
dependabot[bot] Jul 16, 2020
9d3c67f
Algin icons vertical on mobile
tudi2d Jul 19, 2020
6197af1
Merge pull request #999 from ONEARMY/dependabot/npm_and_yarn/function…
BenGamma Jul 21, 2020
1ec10da
Merge pull request #998 from Daniel-Davies/master
BenGamma Jul 21, 2020
feb9949
Merge pull request #1001 from tudi2d/967-mobile-icons
BenGamma Jul 21, 2020
4dc5417
add / to link to profile page to ensure correct routing
BenGamma Jul 21, 2020
de03f2e
Bump dot-prop from 5.1.0 to 5.2.0 in /functions
dependabot[bot] Jul 30, 2020
5f3d24c
Bump elliptic from 6.5.2 to 6.5.3
dependabot[bot] Jul 30, 2020
4226350
Merge pull request #1004 from ONEARMY/dependabot/npm_and_yarn/functio…
BenGamma Aug 5, 2020
535f9f1
Merge pull request #1005 from ONEARMY/dependabot/npm_and_yarn/ellipti…
BenGamma Aug 5, 2020
be1fd12
Change map to cluster pins from different types together
tudi2d Aug 12, 2020
47fa3f2
Merge pull request #996 from ONEARMY/master
BenGamma Aug 19, 2020
f17461d
Merge pull request #1007 from tudi2d/1006-cluster-all-pins
BenGamma Aug 19, 2020
e68b1dc
update CI Production deploy
BenGamma Aug 19, 2020
635d140
deactivate CI for build
BenGamma Aug 21, 2020
252df32
Avoid notification when user edits pin or howto and it was previuosly…
alromh87 Aug 22, 2020
65266c2
update build script
BenGamma Aug 22, 2020
2bbc662
set declaration: false in tsconfig
BenGamma Aug 22, 2020
195a205
use type any for exported pages
BenGamma Aug 22, 2020
a7b1246
remove CI=true from build script in package.json
BenGamma Aug 22, 2020
b866c65
disable e2e test
BenGamma Aug 22, 2020
b6cfa4b
use latest firebase-admin package version
BenGamma Aug 22, 2020
2181b96
Merge pull request #1010 from ONEARMY/master
BenGamma Aug 22, 2020
04132f3
Revert "Fix deploys"
tudi2d Aug 24, 2020
4aa84b5
Merge pull request #1012 from tudi2d/revert-1010-master
davehakkens Aug 24, 2020
a1439eb
Revert "v1.2.1"
tudi2d Aug 24, 2020
8153d32
Merge pull request #1013 from tudi2d/revert-996-master
davehakkens Aug 24, 2020
4dcc417
set env.process.CI back to default true
BenGamma Aug 24, 2020
6ffdb70
Merge pull request #1014 from ONEARMY/master
BenGamma Aug 24, 2020
4da5f7b
fix all eslint warnings
BenGamma Aug 24, 2020
e1010bc
fix conflicts .eslintrc
BenGamma Aug 24, 2020
b01114b
fix conflicts again
BenGamma Aug 24, 2020
fb7f6ba
cherry pick fix eslint warnings
BenGamma Aug 24, 2020
000fc0d
Merge pull request #1018 from ONEARMY/master-good
BenGamma Aug 24, 2020
8c07079
revert commit a1439eb2769ef010104ed699356e2cf43beeb95a
BenGamma Aug 25, 2020
ba95377
cherry pick 195a2054a5a137ba7f6e76524c6fad21e60cb8bf
BenGamma Aug 22, 2020
494e203
use latest version of firebase-admin package
BenGamma Aug 25, 2020
4751f56
remove ts warning
BenGamma Aug 25, 2020
4d75866
cherry pick f17461dbd89174ba7ad71deb47026129312b1ad7
BenGamma Aug 19, 2020
aa5529a
Merge branch 'master' into alrhomh87-1008
BenGamma Aug 25, 2020
953ece8
Merge pull request #1020 from ONEARMY/alrhomh87-1008
BenGamma Aug 25, 2020
025b0d6
bump version 1.2.1
BenGamma Aug 25, 2020
1a20e43
Merge branch 'master' of https://github.com/ONEARMY/community-platform
BenGamma Aug 25, 2020
1a90ccc
feat: Adds more time options to how-to form
darigovresearch Aug 29, 2020
0b6e549
Update from master into 964_create-button-for-non-logged-user
alromh87 Aug 29, 2020
ef0e666
feat: Adds makePair to FormSettings.tsx following review
darigovresearch Aug 31, 2020
b49c9b5
refactor: Adjusts makePair to makeEntry in FormSettings.tsx
darigovresearch Aug 31, 2020
85723eb
add extra logs for login issue
chrismclarke Sep 3, 2020
e84d1e9
fix: Removes <10 hours from FormSettings.tsx
darigovresearch Sep 5, 2020
372b225
Merge pull request #1024 from darigovresearch/master
davehakkens Sep 5, 2020
2feacfa
Merge remote-tracking branch 'onearmy/master' into 964_create-button-…
alromh87 Sep 6, 2020
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
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"@typescript-eslint/no-empty-interface": "warn",
"react/prop-types": "off",
"react/no-unknown-property": "warn",
"@typescript-eslint/no-var-requires":"off"
"@typescript-eslint/no-var-requires": "off"
}
}
4 changes: 2 additions & 2 deletions cypress/integration/common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { UserMenuItem } from '../support/commands'

describe('[Common]', () => {
it('[Default Page]', () => {
cy.step('The home page is /how-to')
cy.step('The home page is /academy')
cy.visit('/')
.url()
.should('include', '/how-to')
.should('include', '/academy')
})

it('[Not-Found Page]', () => {
Expand Down
1 change: 0 additions & 1 deletion cypress/support/custom-assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const eqHowto = (chaiObj, utils) => {
expected.cover_image.name,
)


expected.steps.forEach((step, index) => {
expect(subject.steps[index], `Have step ${index}`).to.eqHowtoStep(
step,
Expand Down
2 changes: 1 addition & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"cors": "^2.8.5",
"dateformat": "^3.0.3",
"express": "^4.16.4",
"firebase-admin": "8.3.0",
"firebase-admin": "^8.3.0",
"firebase-functions": "^3.2.0",
"fs-extra": "^7.0.1",
"google-auth-library": "^2.0.1",
Expand Down
5 changes: 4 additions & 1 deletion functions/src/Integrations/firebase-discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export const notifyHowToAccepted = functions.firestore
.document('v3_howtos/{id}')
.onWrite(async (change, context) => {
const info = change.after.exists ? change.after.data() : null
if (info === null || info.moderation !== 'accepted') {
const prevInfo = change.before.exists ? change.before.data() : null
const beenAccepted =
prevInfo !== null ? prevInfo.moderation === 'accepted' : null
if (info === null || info.moderation !== 'accepted' || beenAccepted) {
return
}
const { _createdBy, title, slug } = info
Expand Down
8 changes: 8 additions & 0 deletions functions/src/Integrations/firebase-slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ export const notifyNewPin = functions.firestore
if (info === null || info.moderation !== 'awaiting-moderation' || prevModeration === 'awaiting-moderation') {
return
}
if (prevModeration === 'accepted' && info.moderation !== 'awaiting-moderation'){ // If edited after being accepted keep it accepted and avoid message #1008
return change.after.ref.parent.child('moderation').set('accepted');
}

const id = info._id
const type = info.type
Expand All @@ -42,9 +45,14 @@ export const notifyNewHowTo = functions.firestore
.document('v3_howtos/{id}')
.onWrite((change, context) => {
const info = change.after.exists ? change.after.data() : null
const prevInfo = change.before.exists ? change.before.data() : null
const prevModeration = (prevInfo !== null) ? prevInfo.moderation : null;
if (info === null || info.moderation !== 'awaiting-moderation') {
return
}
if (prevModeration === 'accepted' && info.moderation !== 'awaiting-moderation'){ // If edited after being accepted keep it accepted and avoid message #1008
return change.after.ref.parent.child('moderation').set('accepted');
}

const user = info._createdBy
const title = info.title
Expand Down
12 changes: 6 additions & 6 deletions functions/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,9 @@ diff@^3.2.0:
integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==

dot-prop@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.1.0.tgz#bdd8c986a77b83e3fca524e53786df916cabbd8a"
integrity sha512-n1oC6NBF+KM9oVXtjmen4Yo7HyAVWV2UUl50dCYJdw2924K6dX9bf9TTTWaKtYlRn0FEtxG27KS80ayVLixxJA==
version "5.2.0"
resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.2.0.tgz#c34ecc29556dc45f1f4c22697b6f4904e0cc4fcb"
integrity sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==
dependencies:
is-obj "^2.0.0"

Expand Down Expand Up @@ -1746,9 +1746,9 @@ lodash.once@^4.0.0:
integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=

lodash@^4.17.10, lodash@^4.17.14:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
version "4.17.19"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==

log-update@^3.2.0:
version "3.2.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "precious-plastic-community-platform",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"scripts": {
"start": "react-app-rewired start",
Expand Down
190 changes: 190 additions & 0 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
'use strict'

// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production'
process.env.NODE_ENV = 'production'

// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err
})

// Ensure environment variables are read.
require('../config/env')

const path = require('path')
const chalk = require('react-dev-utils/chalk')
const fs = require('fs-extra')
const webpack = require('webpack')
const bfj = require('bfj')
const configFactory = require('../config/webpack.config')
const paths = require('../config/paths')
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles')
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages')
const printHostingInstructions = require('react-dev-utils/printHostingInstructions')
const FileSizeReporter = require('react-dev-utils/FileSizeReporter')
const printBuildError = require('react-dev-utils/printBuildError')

const measureFileSizesBeforeBuild = FileSizeReporter.measureFileSizesBeforeBuild
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild
const useYarn = fs.existsSync(paths.yarnLockFile)

// These sizes are pretty large. We'll warn for bundles exceeding them.
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024

const isInteractive = process.stdout.isTTY

// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1)
}

// Process CLI arguments
const argv = process.argv.slice(2)
const writeStatsJson = argv.indexOf('--stats') !== -1

// Generate configuration
const config = configFactory('production')

// We require that you explicitly set browsers and do not fall back to
// browserslist defaults.
const { checkBrowsers } = require('react-dev-utils/browsersHelper')
checkBrowsers(paths.appPath, isInteractive)
.then(() => {
// First, read the current file sizes in build directory.
// This lets us display how much they changed later.
return measureFileSizesBeforeBuild(paths.appBuild)
})
.then(previousFileSizes => {
// Remove all content but keep the directory so that
// if you're in it, you don't end up in Trash
fs.emptyDirSync(paths.appBuild)
// Merge with the public folder
copyPublicFolder()
// Start the webpack build
return build(previousFileSizes)
})
.then(
({ stats, previousFileSizes, warnings }) => {
if (warnings.length) {
console.log(chalk.yellow('Compiled with warnings.\n'))
console.log(warnings.join('\n\n'))
console.log(
'\nSearch for the ' +
chalk.underline(chalk.yellow('keywords')) +
' to learn more about each warning.',
)
console.log(
'To ignore, add ' +
chalk.cyan('// eslint-disable-next-line') +
' to the line before.\n',
)
} else {
console.log(chalk.green('Compiled successfully.\n'))
}

console.log('File sizes after gzip:\n')
printFileSizesAfterBuild(
stats,
previousFileSizes,
paths.appBuild,
WARN_AFTER_BUNDLE_GZIP_SIZE,
WARN_AFTER_CHUNK_GZIP_SIZE,
)
console.log()

const appPackage = require(paths.appPackageJson)
const publicUrl = paths.publicUrl
const publicPath = config.output.publicPath
const buildFolder = path.relative(process.cwd(), paths.appBuild)
printHostingInstructions(
appPackage,
publicUrl,
publicPath,
buildFolder,
useYarn,
)
},
err => {
console.log(chalk.red('Failed to compile.\n'))
printBuildError(err)
process.exit(1)
},
)
.catch(err => {
if (err && err.message) {
console.log(err.message)
}
process.exit(1)
})

// Create the production build and print the deployment instructions.
function build(previousFileSizes) {
console.log('Creating an optimized production build...')

let compiler = webpack(config)
return new Promise((resolve, reject) => {
compiler.run((err, stats) => {
let messages
if (err) {
if (!err.message) {
return reject(err)
}
messages = formatWebpackMessages({
errors: [err.message],
warnings: [],
})
} else {
messages = formatWebpackMessages(
stats.toJson({ all: false, warnings: true, errors: true }),
)
}
if (messages.errors.length) {
// Only keep the first error. Others are often indicative
// of the same problem, but confuse the reader with noise.
if (messages.errors.length > 1) {
messages.errors.length = 1
}
return reject(new Error(messages.errors.join('\n\n')))
}
if (
process.env.CI &&
(typeof process.env.CI !== 'string' ||
process.env.CI.toLowerCase() !== 'false') &&
messages.warnings.length
) {
console.log(
chalk.yellow(
'\nTreating warnings as errors because process.env.CI = true.\n' +
'Most CI servers set it automatically.\n',
),
)
return reject(new Error(messages.warnings.join('\n\n')))
}

const resolveArgs = {
stats,
previousFileSizes,
warnings: messages.warnings,
}
if (writeStatsJson) {
return bfj
.write(paths.appBuild + '/bundle-stats.json', stats.toJson())
.then(() => resolve(resolveArgs))
.catch(error => reject(new Error(error)))
}

return resolve(resolveArgs)
})
})
}

function copyPublicFolder() {
fs.copySync(paths.appPublic, paths.appBuild, {
dereference: true,
filter: file => file !== paths.appHtml,
})
}
Loading