diff --git a/.travis.yml b/.travis.yml index d3391ae4c..f598594cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: - docker-compose -f docker-compose.yml -f docker-compose.build-and-test.yml build # just tagging, just be quite fast - docker-compose -f docker-compose.yml -f docker-compose.build-and-test.yml up -d - wait-on http://localhost:7474 - - docker-compose -f docker-compose.yml -f docker-compose.build-and-test.yml exec neo4j db_setup + - docker-compose -f docker-compose.yml -f docker-compose.build-and-test.yml exec backend yarn run db:migrate init script: - export CYPRESS_RETRIES=1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0926678b..ae1150aa6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,7 +64,7 @@ Regular pair programming sessions * we team up and work on an issue together (often using Visual Studio live sharing sessions) Open-Source Community Meeting -* every Thursday 13:00 +* bi-weekly on Mondays 13:00 (when there is no sprint retrospective) * the link will be posted in the [discord chat](https://discord.gg/6ub73U3) and on the [Agile Ventures website](https://www.agileventures.org/events?utf8=%E2%9C%93&project_id=220&commit=Filter+by+Project) * all contributors welcome! @@ -99,3 +99,34 @@ We believe in open source contributions as a learning experience – everyone is We use pair programming sessions as a tool for knowledge sharing. We can learn a lot from each other and only by sharing what we know and overcoming challenges together can we grow as a team and truly own this project collectively. As a volunteeer you have no commitment except your own self development and your awesomeness by contributing to this free and open-source software project. Cheers to you! + + +## Open-Source Bounties + +There are so many good reasons to contribute to Human Connection +* You learn state-of-the-art technologies +* You build your portfolio +* You contribute to a good cause + +Now there is one more good reason: You can receive a small fincancial +compensation for your contribution! :tada: + +### How it works + +Before you can benefit from the Open-Source bounty program you **must get one +pull request approved and merged for free**. You can choose something really +quick and easy. What's important is starting a working relationship with the +team, learning the workflow, and understanding this contribution guide. You can +filter issues by 'good first issue', to get an idea where to start. Please join +our our [community chat](https://human-connection.org/discord), too. + +You can filter Github issues with label [bounty](https://github.com/Human-Connection/Human-Connection/issues?q=is%3Aopen+is%3Aissue+label%3Abounty). These issues should have a second label `€` +which indicate their respective financial compensation in Euros. + +You can bill us after your pull request got approved and merged into `master`. +Payment methods are up to you: Bank transfer or PayPal is fine for us. Just send +us your invoice as .pdf file attached to an E-Mail once you are done. + +Our Open-Source bounty program is a work-in-progress. Based on our future +experience we will make changes and improvements. So keep an eye on this +contribution guide. diff --git a/README.md b/README.md index eaf71acb8..998f722f0 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,10 @@ Check out the [contribution guideline](./CONTRIBUTING.md), too! [![](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/images/0)](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/links/0)[![](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/images/1)](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/links/1)[![](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/images/2)](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/links/2)[![](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/images/3)](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/links/3)[![](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/images/4)](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/links/4)[![](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/images/5)](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/links/5)[![](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/images/6)](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/links/6)[![](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/images/7)](https://sourcerer.io/fame/roschaefer/Human-Connection/Human-Connection/links/7) +## Open-Source Bounties + +You can get a small financial compensation for your contribution :moneybag: See +details in our [Contribution Guidelines](./CONTRIBUTING.md#open-source-bounties). ## Attributions diff --git a/backend/README.md b/backend/README.md index 14e6d0ddd..7fd49faf8 100644 --- a/backend/README.md +++ b/backend/README.md @@ -53,6 +53,27 @@ can issue GraphQL requests or access GraphQL Playground in the browser. ![GraphQL Playground](../.gitbook/assets/graphql-playground.png) +### Database Indices and Constraints + +Database indices and constraints need to be created when the database and the +backend is running: + +{% tabs %} +{% tab title="Docker" %} +```bash +docker-compose exec backend yarn run db:migrate init +``` +{% endtab %} + +{% tab title="Without Docker" %} +```bash +# in folder backend/ +# make sure your database is running on http://localhost:7474/browser/ +yarn run db:migrate init +``` +{% endtab %} +{% endtabs %} + #### Seed Database @@ -73,7 +94,7 @@ $ docker-compose exec backend yarn run db:reset # you could also wipe out your neo4j database and delete all volumes with: $ docker-compose down -v # if container is not running, run this command to set up your database indeces and contstraints -$ docker-compose run neo4j db_setup +$ docker-compose run backend yarn run db:migrate init ``` {% endtab %} @@ -90,6 +111,38 @@ $ yarn run db:reset {% endtab %} {% endtabs %} +### Data migrations + +Although Neo4J is schema-less,you might find yourself in a situation in which +you have to migrate your data e.g. because your data modeling has changed. + +{% tabs %} +{% tab title="Docker" %} +Generate a data migration file: +```bash +$ docker-compose exec backend yarn run db:migrate:create your_data_migration +# Edit the file in ./src/db/migrations/ +``` + +To run the migration: +```bash +$ docker-compose exec backend yarn run db:migrate up +``` +{% endtab %} +{% tab title="Without Docker" %} +Generate a data migration file: +```bash +$ yarn run db:migrate:create your_data_migration +# Edit the file in ./src/db/migrations/ +``` + +To run the migration: +```bash +$ yarn run db:migrate up +``` +{% endtab %} +{% endtabs %} + # Testing **Beware**: We have no multiple database setup at the moment. We clean the diff --git a/backend/package.json b/backend/package.json index 3bf6f70f3..63d895802 100644 --- a/backend/package.json +++ b/backend/package.json @@ -4,14 +4,19 @@ "description": "GraphQL Backend for Human Connection", "main": "src/index.js", "scripts": { - "build": "babel src/ -d dist/ --copy-files", + "__migrate": "migrate --compiler 'js:@babel/register' --migrations-dir ./src/db/migrations", + "prod:migrate": "migrate --migrations-dir ./dist/db/migrations --store ./dist/db/migrate/store.js", "start": "node dist/", + "build": "babel src/ -d dist/ --copy-files", "dev": "nodemon --exec babel-node src/ -e js,gql", "dev:debug": "nodemon --exec babel-node --inspect=0.0.0.0:9229 src/ -e js,gql", "lint": "eslint src --config .eslintrc.js", "test": "jest --forceExit --detectOpenHandles --runInBand", - "db:reset": "babel-node src/seed/reset-db.js", - "db:seed": "babel-node src/seed/seed-db.js" + "db:clean": "babel-node src/db/clean.js", + "db:reset": "yarn run db:clean", + "db:seed": "babel-node src/db/seed.js", + "db:migrate": "yarn run __migrate --store ./src/db/migrate/store.js", + "db:migrate:create": "yarn run __migrate --template-file ./src/db/migrate/template.js --date-format 'yyyymmddHHmmss' create" }, "author": "Human Connection gGmbH", "license": "MIT", @@ -33,7 +38,7 @@ }, "dependencies": { "@hapi/joi": "^17.1.0", - "@sentry/node": "^5.11.1", + "@sentry/node": "^5.11.2", "apollo-cache-inmemory": "~1.6.5", "apollo-client": "~2.6.8", "apollo-link-context": "~1.0.19", @@ -44,40 +49,41 @@ "bcryptjs": "~2.4.3", "cheerio": "~1.0.0-rc.3", "cors": "~2.8.5", - "cross-env": "~6.0.3", + "cross-env": "~7.0.0", "date-fns": "2.9.0", "debug": "~4.1.1", "dotenv": "~8.2.0", "express": "^4.17.1", "faker": "Marak/faker.js#master", - "graphql": "^14.5.8", + "graphql": "^14.6.0", "graphql-custom-directives": "~0.2.14", "graphql-iso-date": "~3.6.1", "graphql-middleware": "~4.0.2", "graphql-middleware-sentry": "^3.2.1", - "graphql-shield": "~7.0.7", + "graphql-shield": "~7.0.9", "graphql-tag": "~2.10.1", "helmet": "~3.21.2", "jsonwebtoken": "~8.5.1", "linkifyjs": "~2.1.8", "lodash": "~4.17.14", "merge-graphql-schemas": "^1.7.6", - "metascraper": "^5.10.5", - "metascraper-audio": "^5.10.5", - "metascraper-author": "^5.10.5", + "metascraper": "^5.10.6", + "metascraper-audio": "^5.10.6", + "metascraper-author": "^5.10.6", "metascraper-clearbit-logo": "^5.3.0", - "metascraper-date": "^5.10.5", - "metascraper-description": "^5.10.5", - "metascraper-image": "^5.10.5", - "metascraper-lang": "^5.10.5", + "metascraper-date": "^5.10.6", + "metascraper-description": "^5.10.6", + "metascraper-image": "^5.10.6", + "metascraper-lang": "^5.10.6", "metascraper-lang-detector": "^4.10.2", - "metascraper-logo": "^5.10.5", - "metascraper-publisher": "^5.10.5", - "metascraper-soundcloud": "^5.10.5", - "metascraper-title": "^5.10.5", - "metascraper-url": "^5.10.5", - "metascraper-video": "^5.10.5", - "metascraper-youtube": "^5.10.5", + "metascraper-logo": "^5.10.6", + "metascraper-publisher": "^5.10.6", + "metascraper-soundcloud": "^5.10.6", + "metascraper-title": "^5.10.6", + "metascraper-url": "^5.10.6", + "metascraper-video": "^5.10.6", + "metascraper-youtube": "^5.10.6", + "migrate": "^1.6.2", "minimatch": "^3.0.4", "mustache": "^4.0.0", "neo4j-driver": "^4.0.1", @@ -89,28 +95,28 @@ "npm-run-all": "~4.1.5", "request": "~2.88.0", "sanitize-html": "~1.21.1", - "slug": "~2.1.0", + "slug": "~2.1.1", "trunc-html": "~1.1.2", "uuid": "~3.4.0", - "validator": "^12.1.0", + "validator": "^12.2.0", "wait-on": "~4.0.0", "xregexp": "^4.2.4" }, "devDependencies": { - "@babel/cli": "~7.8.3", - "@babel/core": "~7.8.3", - "@babel/node": "~7.8.3", + "@babel/cli": "~7.8.4", + "@babel/core": "~7.8.4", + "@babel/node": "~7.8.4", "@babel/plugin-proposal-throw-expressions": "^7.8.3", - "@babel/preset-env": "~7.8.3", - "@babel/register": "~7.8.3", + "@babel/preset-env": "~7.8.4", + "@babel/register": "^7.8.3", "apollo-server-testing": "~2.9.16", "babel-core": "~7.0.0-0", "babel-eslint": "~10.0.3", - "babel-jest": "~24.9.0", + "babel-jest": "~25.1.0", "chai": "~4.2.0", "cucumber": "~6.0.5", "eslint": "~6.8.0", - "eslint-config-prettier": "~6.9.0", + "eslint-config-prettier": "~6.10.0", "eslint-config-standard": "~14.1.0", "eslint-plugin-import": "~2.20.0", "eslint-plugin-jest": "~23.6.0", diff --git a/backend/src/activitypub/routes/webfinger.spec.js b/backend/src/activitypub/routes/webfinger.spec.js index 4e9b2196d..06ca4577d 100644 --- a/backend/src/activitypub/routes/webfinger.spec.js +++ b/backend/src/activitypub/routes/webfinger.spec.js @@ -1,6 +1,6 @@ import { handler } from './webfinger' -import Factory from '../../seed/factories' -import { getDriver } from '../../bootstrap/neo4j' +import Factory from '../../factories' +import { getDriver } from '../../db/neo4j' let resource, res, json, status, contentType diff --git a/backend/src/seed/reset-db.js b/backend/src/db/clean.js similarity index 91% rename from backend/src/seed/reset-db.js rename to backend/src/db/clean.js index 125d135d8..cbb1412e2 100644 --- a/backend/src/seed/reset-db.js +++ b/backend/src/db/clean.js @@ -1,4 +1,4 @@ -import { cleanDatabase } from './factories' +import { cleanDatabase } from '../factories' if (process.env.NODE_ENV === 'production') { throw new Error(`You cannot clean the database in production environment!`) diff --git a/backend/src/db/migrate/store.js b/backend/src/db/migrate/store.js new file mode 100644 index 000000000..8bc73b511 --- /dev/null +++ b/backend/src/db/migrate/store.js @@ -0,0 +1,97 @@ +import { getDriver, getNeode } from '../../db/neo4j' + +class Store { + async init(next) { + const neode = getNeode() + const { driver } = neode + const session = driver.session() + // eslint-disable-next-line no-console + const writeTxResultPromise = session.writeTransaction(async txc => { + await txc.run('CALL apoc.schema.assert({},{},true)') // drop all indices + return Promise.all( + [ + 'CALL db.index.fulltext.createNodeIndex("post_fulltext_search",["Post"],["title", "content"])', + 'CALL db.index.fulltext.createNodeIndex("user_fulltext_search",["User"],["name", "slug"])', + ].map(statement => txc.run(statement)), + ) + }) + try { + await writeTxResultPromise + await getNeode().schema.install() + // eslint-disable-next-line no-console + console.log('Successfully created database indices and constraints!') + next() + } catch (error) { + console.log(error) // eslint-disable-line no-console + next(error, null) + } finally { + session.close() + driver.close() + } + } + + async load(next) { + const driver = getDriver() + const session = driver.session() + const readTxResultPromise = session.readTransaction(async txc => { + const result = await txc.run( + 'MATCH (migration:Migration) RETURN migration {.*} ORDER BY migration.timestamp DESC', + ) + return result.records.map(r => r.get('migration')) + }) + try { + const migrations = await readTxResultPromise + if (migrations.length <= 0) { + // eslint-disable-next-line no-console + console.log( + "No migrations found in database. If it's the first time you run migrations, then this is normal.", + ) + return next(null, {}) + } + const [{ title: lastRun }] = migrations + next(null, { lastRun, migrations }) + } catch (error) { + console.log(error) // eslint-disable-line no-console + next(error) + } finally { + session.close() + } + } + + async save(set, next) { + const driver = getDriver() + const session = driver.session() + const { migrations } = set + const writeTxResultPromise = session.writeTransaction(txc => { + return Promise.all( + migrations.map(async migration => { + const { title, description, timestamp } = migration + const properties = { title, description, timestamp } + const migrationResult = await txc.run( + ` + MERGE (migration:Migration { title: $properties.title }) + ON MATCH SET + migration += $properties + ON CREATE SET + migration += $properties, + migration.migratedAt = toString(datetime()) + `, + { properties }, + ) + return migrationResult + }), + ) + }) + try { + await writeTxResultPromise + next() + } catch (error) { + console.log(error) // eslint-disable-line no-console + next(error) + } finally { + session.close() + } + } +} + +module.exports = Store diff --git a/backend/src/db/migrate/template.js b/backend/src/db/migrate/template.js new file mode 100644 index 000000000..1d63673b4 --- /dev/null +++ b/backend/src/db/migrate/template.js @@ -0,0 +1,45 @@ +import { getDriver } from '../../db/neo4j' + +export const description = '' + +export async function up(next) { + const driver = getDriver() + const session = driver.session() + const transaction = session.beginTransaction() + + try { + // Implement your migration here. + await transaction.run(``) + await transaction.commit() + next() + } catch (error) { + // eslint-disable-next-line no-console + console.log(error) + await transaction.rollback() + // eslint-disable-next-line no-console + console.log('rolled back') + } finally { + session.close() + } +} + +export async function down(next) { + const driver = getDriver() + const session = driver.session() + const transaction = session.beginTransaction() + + try { + // Implement your migration here. + await transaction.run(``) + await transaction.commit() + next() + } catch (error) { + // eslint-disable-next-line no-console + console.log(error) + await transaction.rollback() + // eslint-disable-next-line no-console + console.log('rolled back') + } finally { + session.close() + } +} diff --git a/backend/src/db/migrations/20200123150105-merge_duplicate_user_accounts.js b/backend/src/db/migrations/20200123150105-merge_duplicate_user_accounts.js new file mode 100644 index 000000000..ec38befc5 --- /dev/null +++ b/backend/src/db/migrations/20200123150105-merge_duplicate_user_accounts.js @@ -0,0 +1,84 @@ +import { throwError, concat } from 'rxjs' +import { flatMap, mergeMap, map, catchError, filter } from 'rxjs/operators' +import { getDriver } from '../neo4j' +import normalizeEmail from '../../schema/resolvers//helpers/normalizeEmail' + +export const description = ` + This migration merges duplicate :User and :EmailAddress nodes. It became + necessary after we implemented the email normalization but forgot to migrate + the existing data. Some (40) users decided to just register with a new account + but the same email address. On signup our backend would normalize the email, + which is good, but would also keep the existing unnormalized email address. + + This led to about 40 duplicate user and email address nodes in our database. +` +export function up(next) { + const driver = getDriver() + const rxSession = driver.rxSession() + rxSession + .beginTransaction() + .pipe( + flatMap(txc => + concat( + txc + .run('MATCH (email:EmailAddress) RETURN email {.email}') + .records() + .pipe( + map(record => { + const { email } = record.get('email') + const normalizedEmail = normalizeEmail(email) + return { email, normalizedEmail } + }), + filter(({ email, normalizedEmail }) => email !== normalizedEmail), + mergeMap(({ email, normalizedEmail }) => { + return txc + .run( + ` + MATCH (oldUser:User)-[:PRIMARY_EMAIL]->(oldEmail:EmailAddress {email: $email}), (oldUser)-[previousRelationship]-(oldEmail) + MATCH (user:User)-[:PRIMARY_EMAIL]->(email:EmailAddress {email: $normalizedEmail}) + DELETE previousRelationship + WITH oldUser, oldEmail, user, email + CALL apoc.refactor.mergeNodes([user, oldUser], { properties: 'discard', mergeRels: true }) YIELD node as mergedUser + CALL apoc.refactor.mergeNodes([email, oldEmail], { properties: 'discard', mergeRels: true }) YIELD node as mergedEmail + RETURN user {.*}, email {.*} + `, + { email, normalizedEmail }, + ) + .records() + .pipe( + map(r => ({ + oldEmail: email, + email: r.get('email'), + user: r.get('user'), + })), + ) + }), + ), + txc.commit(), + ).pipe(catchError(err => txc.rollback().pipe(throwError(err)))), + ), + ) + .subscribe({ + next: ({ user, email, oldUser, oldEmail }) => + // eslint-disable-next-line no-console + console.log(` + Merged: + ============================= + userId: ${user.id} + email: ${oldEmail} => ${email.email} + ============================= + `), + complete: () => { + // eslint-disable-next-line no-console + console.log('Merging of duplicate users completed') + next() + }, + error: error => { + next(new Error(error), null) + }, + }) +} + +export function down(next) { + next(new Error('Irreversible migration')) +} diff --git a/backend/src/db/migrations/20200123150110-merge_duplicate_location_nodes.js b/backend/src/db/migrations/20200123150110-merge_duplicate_location_nodes.js new file mode 100644 index 000000000..b2d6b260f --- /dev/null +++ b/backend/src/db/migrations/20200123150110-merge_duplicate_location_nodes.js @@ -0,0 +1,77 @@ +import { throwError, concat } from 'rxjs' +import { flatMap, mergeMap, map, catchError } from 'rxjs/operators' +import { getDriver } from '../neo4j' + +export const description = ` + This migration merges duplicate :Location nodes. It became + necessary after we realized that we had not set up constraints for Location.id in production. +` +export function up(next) { + const driver = getDriver() + const rxSession = driver.rxSession() + rxSession + .beginTransaction() + .pipe( + flatMap(transaction => + concat( + transaction + .run( + ` + MATCH (location:Location) + RETURN location {.id} + `, + ) + .records() + .pipe( + map(record => { + const { id: locationId } = record.get('location') + return { locationId } + }), + mergeMap(({ locationId }) => { + return transaction + .run( + ` + MATCH(location:Location {id: $locationId}), (location2:Location {id: $locationId}) + WHERE location.id = location2.id AND id(location) < id(location2) + CALL apoc.refactor.mergeNodes([location, location2], { properties: 'combine', mergeRels: true }) YIELD node as updatedLocation + RETURN location {.*},updatedLocation {.*} + `, + { locationId }, + ) + .records() + .pipe( + map(record => ({ + location: record.get('location'), + updatedLocation: record.get('updatedLocation'), + })), + ) + }), + ), + transaction.commit(), + ).pipe(catchError(error => transaction.rollback().pipe(throwError(error)))), + ), + ) + .subscribe({ + next: ({ updatedLocation, location }) => + // eslint-disable-next-line no-console + console.log(` + Merged: + ============================= + locationId: ${location.id} + updatedLocation: ${location.id} => ${updatedLocation.id} + ============================= + `), + complete: () => { + // eslint-disable-next-line no-console + console.log('Merging of duplicate locations completed') + next() + }, + error: error => { + next(new Error(error), null) + }, + }) +} + +export function down(next) { + next(new Error('Irreversible migration')) +} diff --git a/backend/src/db/migrations/20200127110135-create_muted_relationship_between_existing_blocked_relationships.js b/backend/src/db/migrations/20200127110135-create_muted_relationship_between_existing_blocked_relationships.js new file mode 100644 index 000000000..ce46be9d6 --- /dev/null +++ b/backend/src/db/migrations/20200127110135-create_muted_relationship_between_existing_blocked_relationships.js @@ -0,0 +1,46 @@ +import { getDriver } from '../../db/neo4j' + +export const description = ` + This migration creates a MUTED relationship between two edges(:User) that have a pre-existing BLOCKED relationship. + It also sets the createdAt date for the BLOCKED relationship to the datetime the migration was run. This became + necessary after we redefined what it means to block someone, and what it means to mute them. Muting is about filtering + another user's content, whereas blocking means preventing that user from interacting with you/your contributions. + A blocked user will still be able to see your contributions, but will not be able to interact with them and vice versa. +` + +export async function up(next) { + const driver = getDriver() + const session = driver.session() + const transaction = session.beginTransaction() + try { + await transaction.run( + ` + MATCH (blocker:User)-[blocked:BLOCKED]->(blockee:User) + MERGE (blocker)-[muted:MUTED]->(blockee) + SET muted.createdAt = toString(datetime()), blocked.createdAt = toString(datetime()) + `, + ) + await transaction.commit() + } catch (error) { + // eslint-disable-next-line no-console + console.log(error) + await transaction.rollback() + // eslint-disable-next-line no-console + console.log('rolled back') + } finally { + session.close() + } +} + +export function down(next) { + const driver = getDriver() + const session = driver.session() + try { + // Rollback your migration here. + next() + } catch (err) { + next(err) + } finally { + session.close() + } +} diff --git a/backend/src/bootstrap/neo4j.js b/backend/src/db/neo4j.js similarity index 100% rename from backend/src/bootstrap/neo4j.js rename to backend/src/db/neo4j.js diff --git a/backend/src/seed/seed-db.js b/backend/src/db/seed.js similarity index 99% rename from backend/src/seed/seed-db.js rename to backend/src/db/seed.js index 6fb16e3c0..ba6352770 100644 --- a/backend/src/seed/seed-db.js +++ b/backend/src/db/seed.js @@ -2,8 +2,8 @@ import faker from 'faker' import sample from 'lodash/sample' import { createTestClient } from 'apollo-server-testing' import createServer from '../server' -import Factory from './factories' -import { getNeode, getDriver } from '../bootstrap/neo4j' +import Factory from '../factories' +import { getNeode, getDriver } from '../db/neo4j' import { gql } from '../helpers/jest' const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] diff --git a/backend/src/seed/factories/badges.js b/backend/src/factories/badges.js similarity index 100% rename from backend/src/seed/factories/badges.js rename to backend/src/factories/badges.js diff --git a/backend/src/seed/factories/categories.js b/backend/src/factories/categories.js similarity index 100% rename from backend/src/seed/factories/categories.js rename to backend/src/factories/categories.js diff --git a/backend/src/seed/factories/comments.js b/backend/src/factories/comments.js similarity index 100% rename from backend/src/seed/factories/comments.js rename to backend/src/factories/comments.js diff --git a/backend/src/seed/factories/donations.js b/backend/src/factories/donations.js similarity index 100% rename from backend/src/seed/factories/donations.js rename to backend/src/factories/donations.js diff --git a/backend/src/seed/factories/emailAddresses.js b/backend/src/factories/emailAddresses.js similarity index 100% rename from backend/src/seed/factories/emailAddresses.js rename to backend/src/factories/emailAddresses.js diff --git a/backend/src/seed/factories/index.js b/backend/src/factories/index.js similarity index 96% rename from backend/src/seed/factories/index.js rename to backend/src/factories/index.js index ff6a52a76..c3ab14f64 100644 --- a/backend/src/seed/factories/index.js +++ b/backend/src/factories/index.js @@ -1,4 +1,4 @@ -import { getDriver, getNeode } from '../../bootstrap/neo4j' +import { getDriver, getNeode } from '../db/neo4j' const factories = { Badge: require('./badges.js').default, diff --git a/backend/src/seed/factories/locations.js b/backend/src/factories/locations.js similarity index 100% rename from backend/src/seed/factories/locations.js rename to backend/src/factories/locations.js diff --git a/backend/src/seed/factories/posts.js b/backend/src/factories/posts.js similarity index 72% rename from backend/src/seed/factories/posts.js rename to backend/src/factories/posts.js index 55f4f95fb..d997b738f 100644 --- a/backend/src/seed/factories/posts.js +++ b/backend/src/factories/posts.js @@ -21,11 +21,15 @@ export default function create() { categoryIds: [], imageBlurred: false, imageAspectRatio: 1.333, + pinned: null, } args = { ...defaults, ...args, } + // Convert false to null + args.pinned = args.pinned || null + args.slug = args.slug || slugify(args.title, { lower: true }) args.contentExcerpt = args.contentExcerpt || args.content @@ -50,9 +54,33 @@ export default function create() { if (author && authorId) throw new Error('You provided both author and authorId') if (authorId) author = await neodeInstance.find('User', authorId) author = author || (await factoryInstance.create('User')) - const post = await neodeInstance.create('Post', args) + + const { commentContent } = args + let comment + delete args.commentContent + if (commentContent) + comment = await factoryInstance.create('Comment', { + contentExcerpt: commentContent, + post, + author, + }) + await post.relateTo(author, 'author') + if (comment) await post.relateTo(comment, 'comments') + + if (args.pinned) { + args.pinnedAt = args.pinnedAt || new Date().toISOString() + if (!args.pinnedBy) { + const admin = await factoryInstance.create('User', { + role: 'admin', + updatedAt: new Date().toISOString(), + }) + await admin.relateTo(post, 'pinned') + args.pinnedBy = admin + } + } + await Promise.all(categories.map(c => c.relateTo(post, 'post'))) await Promise.all(tags.map(t => t.relateTo(post, 'post'))) return post diff --git a/backend/src/seed/factories/reports.js b/backend/src/factories/reports.js similarity index 100% rename from backend/src/seed/factories/reports.js rename to backend/src/factories/reports.js diff --git a/backend/src/seed/factories/socialMedia.js b/backend/src/factories/socialMedia.js similarity index 100% rename from backend/src/seed/factories/socialMedia.js rename to backend/src/factories/socialMedia.js diff --git a/backend/src/seed/factories/tags.js b/backend/src/factories/tags.js similarity index 100% rename from backend/src/seed/factories/tags.js rename to backend/src/factories/tags.js diff --git a/backend/src/seed/factories/unverifiedEmailAddresses.js b/backend/src/factories/unverifiedEmailAddresses.js similarity index 100% rename from backend/src/seed/factories/unverifiedEmailAddresses.js rename to backend/src/factories/unverifiedEmailAddresses.js diff --git a/backend/src/seed/factories/users.js b/backend/src/factories/users.js similarity index 95% rename from backend/src/seed/factories/users.js rename to backend/src/factories/users.js index d56c42d0a..57f69b76b 100644 --- a/backend/src/seed/factories/users.js +++ b/backend/src/factories/users.js @@ -1,6 +1,6 @@ import faker from 'faker' import uuid from 'uuid/v4' -import encryptPassword from '../../helpers/encryptPassword' +import encryptPassword from '../helpers/encryptPassword' import slugify from 'slug' export default function create() { diff --git a/backend/src/jest/helpers.js b/backend/src/jest/helpers.js deleted file mode 100644 index 201d68c14..000000000 --- a/backend/src/jest/helpers.js +++ /dev/null @@ -1,5 +0,0 @@ -//* This is a fake ES2015 template string, just to benefit of syntax -// highlighting of `gql` template strings in certain editors. -export function gql(strings) { - return strings.join('') -} diff --git a/backend/src/jwt/decode.spec.js b/backend/src/jwt/decode.spec.js index 7aa703d97..71444a3e5 100644 --- a/backend/src/jwt/decode.spec.js +++ b/backend/src/jwt/decode.spec.js @@ -1,5 +1,5 @@ -import Factory from '../seed/factories/index' -import { getDriver, getNeode } from '../bootstrap/neo4j' +import Factory from '../factories/index' +import { getDriver, getNeode } from '../db/neo4j' import decode from './decode' const factory = Factory() diff --git a/backend/src/middleware/hashtags/hashtagsMiddleware.spec.js b/backend/src/middleware/hashtags/hashtagsMiddleware.spec.js index 0fa1e2dc5..2247e692d 100644 --- a/backend/src/middleware/hashtags/hashtagsMiddleware.spec.js +++ b/backend/src/middleware/hashtags/hashtagsMiddleware.spec.js @@ -1,7 +1,7 @@ import { gql } from '../../helpers/jest' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { createTestClient } from 'apollo-server-testing' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' let server diff --git a/backend/src/middleware/notifications/notificationsMiddleware.js b/backend/src/middleware/notifications/notificationsMiddleware.js index dce35883d..e927d5979 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.js +++ b/backend/src/middleware/notifications/notificationsMiddleware.js @@ -30,7 +30,7 @@ const postAuthorOfComment = async (commentId, { context }) => { try { postAuthorId = await session.readTransaction(transaction => { return transaction.run( - ` + ` MATCH (author:User)-[:WROTE]->(:Post)<-[:COMMENTS]-(:Comment { id: $commentId }) RETURN author { .id } as authorId `, @@ -54,7 +54,7 @@ const notifyUsersOfMention = async (label, id, idsOfUsers, reason, context) => { MATCH (post: Post { id: $id })<-[:WROTE]-(author: User) MATCH (user: User) WHERE user.id in $idsOfUsers - AND NOT (user)<-[:BLOCKED]-(author) + AND NOT (user)-[:BLOCKED]-(author) MERGE (post)-[notification:NOTIFIED {reason: $reason}]->(user) ` break @@ -64,8 +64,8 @@ const notifyUsersOfMention = async (label, id, idsOfUsers, reason, context) => { MATCH (postAuthor: User)-[:WROTE]->(post: Post)<-[:COMMENTS]-(comment: Comment { id: $id })<-[:WROTE]-(author: User) MATCH (user: User) WHERE user.id in $idsOfUsers - AND NOT (user)<-[:BLOCKED]-(author) - AND NOT (user)<-[:BLOCKED]-(postAuthor) + AND NOT (user)-[:BLOCKED]-(author) + AND NOT (user)-[:BLOCKED]-(postAuthor) MERGE (comment)-[notification:NOTIFIED {reason: $reason}]->(user) ` break diff --git a/backend/src/middleware/notifications/notificationsMiddleware.spec.js b/backend/src/middleware/notifications/notificationsMiddleware.spec.js index 538b0b50c..725fb5c6f 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.spec.js +++ b/backend/src/middleware/notifications/notificationsMiddleware.spec.js @@ -1,7 +1,7 @@ import { gql } from '../../helpers/jest' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { createTestClient } from 'apollo-server-testing' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' let server, query, mutate, notifiedUser, authenticatedUser diff --git a/backend/src/middleware/orderByMiddleware.spec.js b/backend/src/middleware/orderByMiddleware.spec.js index 129f3a8b4..8d92a5b5d 100644 --- a/backend/src/middleware/orderByMiddleware.spec.js +++ b/backend/src/middleware/orderByMiddleware.spec.js @@ -1,6 +1,6 @@ import { gql } from '../helpers/jest' -import Factory from '../seed/factories' -import { getNeode, getDriver } from '../bootstrap/neo4j' +import Factory from '../factories' +import { getNeode, getDriver } from '../db/neo4j' import { createTestClient } from 'apollo-server-testing' import createServer from '../server' diff --git a/backend/src/middleware/permissionsMiddleware.js b/backend/src/middleware/permissionsMiddleware.js index faeeb8594..755ddabf8 100644 --- a/backend/src/middleware/permissionsMiddleware.js +++ b/backend/src/middleware/permissionsMiddleware.js @@ -1,5 +1,5 @@ import { rule, shield, deny, allow, or } from 'graphql-shield' -import { getNeode } from '../bootstrap/neo4j' +import { getNeode } from '../db/neo4j' import CONFIG from '../config' const debug = !!CONFIG.DEBUG @@ -102,6 +102,7 @@ export default shield( PostsEmotionsCountByEmotion: allow, PostsEmotionsByCurrentUser: isAuthenticated, mutedUsers: isAuthenticated, + blockedUsers: isAuthenticated, notifications: isAuthenticated, Donations: isAuthenticated, }, @@ -139,6 +140,8 @@ export default shield( RemovePostEmotions: isAuthenticated, muteUser: isAuthenticated, unmuteUser: isAuthenticated, + blockUser: isAuthenticated, + unblockUser: isAuthenticated, markAsRead: isAuthenticated, AddEmailAddress: isAuthenticated, VerifyEmailAddress: isAuthenticated, diff --git a/backend/src/middleware/permissionsMiddleware.spec.js b/backend/src/middleware/permissionsMiddleware.spec.js index 60aff961d..a4f13ea0c 100644 --- a/backend/src/middleware/permissionsMiddleware.spec.js +++ b/backend/src/middleware/permissionsMiddleware.spec.js @@ -1,8 +1,8 @@ import { createTestClient } from 'apollo-server-testing' import createServer from '../server' -import Factory from '../seed/factories' +import Factory from '../factories' import { gql } from '../helpers/jest' -import { getDriver, getNeode } from '../bootstrap/neo4j' +import { getDriver, getNeode } from '../db/neo4j' const factory = Factory() const instance = getNeode() diff --git a/backend/src/middleware/slugifyMiddleware.spec.js b/backend/src/middleware/slugifyMiddleware.spec.js index 1c2e59317..cf9f0941c 100644 --- a/backend/src/middleware/slugifyMiddleware.spec.js +++ b/backend/src/middleware/slugifyMiddleware.spec.js @@ -1,6 +1,6 @@ -import Factory from '../seed/factories' +import Factory from '../factories' import { gql } from '../helpers/jest' -import { getNeode, getDriver } from '../bootstrap/neo4j' +import { getNeode, getDriver } from '../db/neo4j' import createServer from '../server' import { createTestClient } from 'apollo-server-testing' diff --git a/backend/src/middleware/softDelete/softDeleteMiddleware.spec.js b/backend/src/middleware/softDelete/softDeleteMiddleware.spec.js index b7c16dfd3..6e1735af2 100644 --- a/backend/src/middleware/softDelete/softDeleteMiddleware.spec.js +++ b/backend/src/middleware/softDelete/softDeleteMiddleware.spec.js @@ -1,6 +1,6 @@ -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' import { createTestClient } from 'apollo-server-testing' diff --git a/backend/src/middleware/validation/validationMiddleware.spec.js b/backend/src/middleware/validation/validationMiddleware.spec.js index d093f939a..38cd010b4 100644 --- a/backend/src/middleware/validation/validationMiddleware.spec.js +++ b/backend/src/middleware/validation/validationMiddleware.spec.js @@ -1,6 +1,6 @@ import { gql } from '../../helpers/jest' -import Factory from '../../seed/factories' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import Factory from '../../factories' +import { getNeode, getDriver } from '../../db/neo4j' import { createTestClient } from 'apollo-server-testing' import createServer from '../../server' diff --git a/backend/src/middleware/xssMiddleware.js b/backend/src/middleware/xssMiddleware.js index 9b4e3e759..1292abb67 100644 --- a/backend/src/middleware/xssMiddleware.js +++ b/backend/src/middleware/xssMiddleware.js @@ -20,6 +20,7 @@ function clean(dirty) { 'hr', 'b', 'i', + 'u', 'em', 'strong', 'a', diff --git a/backend/src/models/Category.js b/backend/src/models/Category.js index faf5f189f..223bb4f87 100644 --- a/backend/src/models/Category.js +++ b/backend/src/models/Category.js @@ -3,7 +3,7 @@ import uuid from 'uuid/v4' export default { id: { type: 'string', primary: true, default: uuid }, name: { type: 'string', required: true, default: false }, - slug: { type: 'string' }, + slug: { type: 'string', unique: 'true' }, icon: { type: 'string', required: true, default: false }, createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, updatedAt: { diff --git a/backend/src/models/Migration.js b/backend/src/models/Migration.js new file mode 100644 index 000000000..8f16b800a --- /dev/null +++ b/backend/src/models/Migration.js @@ -0,0 +1,5 @@ +export default { + title: { type: 'string', primary: true, token: true }, + description: { type: 'string' }, + migratedAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, +} diff --git a/backend/src/models/Post.js b/backend/src/models/Post.js index fd1e5b2ac..154456cf1 100644 --- a/backend/src/models/Post.js +++ b/backend/src/models/Post.js @@ -11,7 +11,7 @@ export default { direction: 'in', }, title: { type: 'string', disallow: [null], min: 3 }, - slug: { type: 'string', allow: [null] }, + slug: { type: 'string', allow: [null], unique: 'true' }, content: { type: 'string', disallow: [null], min: 3 }, contentExcerpt: { type: 'string', allow: [null] }, image: { type: 'string', allow: [null] }, @@ -41,4 +41,16 @@ export default { language: { type: 'string', allow: [null] }, imageBlurred: { type: 'boolean', default: false }, imageAspectRatio: { type: 'float', default: 1.0 }, + comments: { + type: 'relationship', + relationship: 'COMMENTS', + target: 'Comment', + direction: 'in', + properties: { + createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, + updatedAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, + }, + }, + pinned: { type: 'boolean', default: null, valid: [null, true] }, + pinnedAt: { type: 'string', isoDate: true }, } diff --git a/backend/src/models/UnverifiedEmailAddress.js b/backend/src/models/UnverifiedEmailAddress.js index 489e8517a..c582ed011 100644 --- a/backend/src/models/UnverifiedEmailAddress.js +++ b/backend/src/models/UnverifiedEmailAddress.js @@ -1,5 +1,5 @@ export default { - email: { type: 'string', primary: true, lowercase: true, email: true }, + email: { type: 'string', lowercase: true, email: true }, createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, nonce: { type: 'string', token: true }, belongsTo: { diff --git a/backend/src/models/User.js b/backend/src/models/User.js index 8dbfffb7a..055cbfc83 100644 --- a/backend/src/models/User.js +++ b/backend/src/models/User.js @@ -4,7 +4,7 @@ export default { id: { type: 'string', primary: true, default: uuid }, // TODO: should be type: 'uuid' but simplified for our tests actorId: { type: 'string', allow: [null] }, name: { type: 'string', disallow: [null], min: 3 }, - slug: { type: 'string', regex: /^[a-z0-9_-]+$/, lowercase: true }, + slug: { type: 'string', unique: 'true', regex: /^[a-z0-9_-]+$/, lowercase: true }, encryptedPassword: 'string', avatar: { type: 'string', allow: [null] }, coverImg: { type: 'string', allow: [null] }, @@ -77,12 +77,18 @@ export default { relationship: 'BLOCKED', target: 'User', direction: 'out', + properties: { + createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, + }, }, muted: { type: 'relationship', relationship: 'MUTED', target: 'User', direction: 'out', + properties: { + createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() }, + }, }, notifications: { type: 'relationship', diff --git a/backend/src/models/User.spec.js b/backend/src/models/User.spec.js index 433cc5a6f..7bdde7014 100644 --- a/backend/src/models/User.spec.js +++ b/backend/src/models/User.spec.js @@ -1,5 +1,5 @@ -import Factory from '../seed/factories' -import { getNeode } from '../bootstrap/neo4j' +import Factory from '../factories' +import { getNeode } from '../db/neo4j' const factory = Factory() const neode = getNeode() diff --git a/backend/src/models/index.js b/backend/src/models/index.js index 047ace67c..dbb6a927e 100644 --- a/backend/src/models/index.js +++ b/backend/src/models/index.js @@ -13,4 +13,5 @@ export default { Location: require('./Location.js').default, Donations: require('./Donations.js').default, Report: require('./Report.js').default, + Migration: require('./Migration.js').default, } diff --git a/backend/src/schema/resolvers/comments.spec.js b/backend/src/schema/resolvers/comments.spec.js index f96a60514..9877161db 100644 --- a/backend/src/schema/resolvers/comments.spec.js +++ b/backend/src/schema/resolvers/comments.spec.js @@ -1,8 +1,8 @@ -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' import { createTestClient } from 'apollo-server-testing' import createServer from '../../server' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' const driver = getDriver() const neode = getNeode() diff --git a/backend/src/schema/resolvers/donations.spec.js b/backend/src/schema/resolvers/donations.spec.js index d8dd5db06..c382eb475 100644 --- a/backend/src/schema/resolvers/donations.spec.js +++ b/backend/src/schema/resolvers/donations.spec.js @@ -1,7 +1,7 @@ import { createTestClient } from 'apollo-server-testing' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' let mutate, query, authenticatedUser, variables diff --git a/backend/src/schema/resolvers/emails.spec.js b/backend/src/schema/resolvers/emails.spec.js index 82ce43337..97a1f0c29 100644 --- a/backend/src/schema/resolvers/emails.spec.js +++ b/backend/src/schema/resolvers/emails.spec.js @@ -1,6 +1,6 @@ -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getDriver, getNeode } from '../../bootstrap/neo4j' +import { getDriver, getNeode } from '../../db/neo4j' import createServer from '../../server' import { createTestClient } from 'apollo-server-testing' diff --git a/backend/src/schema/resolvers/follow.js b/backend/src/schema/resolvers/follow.js index 0416fe3d2..80cce8400 100644 --- a/backend/src/schema/resolvers/follow.js +++ b/backend/src/schema/resolvers/follow.js @@ -1,4 +1,4 @@ -import { getNeode } from '../../bootstrap/neo4j' +import { getNeode } from '../../db/neo4j' const neode = getNeode() diff --git a/backend/src/schema/resolvers/follow.spec.js b/backend/src/schema/resolvers/follow.spec.js index ff884666e..ad836a461 100644 --- a/backend/src/schema/resolvers/follow.spec.js +++ b/backend/src/schema/resolvers/follow.spec.js @@ -1,6 +1,6 @@ import { createTestClient } from 'apollo-server-testing' -import Factory from '../../seed/factories' -import { getDriver, getNeode } from '../../bootstrap/neo4j' +import Factory from '../../factories' +import { getDriver, getNeode } from '../../db/neo4j' import createServer from '../../server' import { gql } from '../../helpers/jest' diff --git a/backend/src/schema/resolvers/locations.spec.js b/backend/src/schema/resolvers/locations.spec.js index f4a846afd..aba11f9bc 100644 --- a/backend/src/schema/resolvers/locations.spec.js +++ b/backend/src/schema/resolvers/locations.spec.js @@ -1,6 +1,6 @@ -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' import { createTestClient } from 'apollo-server-testing' diff --git a/backend/src/schema/resolvers/moderation.spec.js b/backend/src/schema/resolvers/moderation.spec.js index f76cbdf46..cd502be75 100644 --- a/backend/src/schema/resolvers/moderation.spec.js +++ b/backend/src/schema/resolvers/moderation.spec.js @@ -1,7 +1,7 @@ import { createTestClient } from 'apollo-server-testing' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' const factory = Factory() diff --git a/backend/src/schema/resolvers/notifications.spec.js b/backend/src/schema/resolvers/notifications.spec.js index 71a60405c..22035e44a 100644 --- a/backend/src/schema/resolvers/notifications.spec.js +++ b/backend/src/schema/resolvers/notifications.spec.js @@ -1,6 +1,6 @@ -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getDriver } from '../../bootstrap/neo4j' +import { getDriver } from '../../db/neo4j' import { createTestClient } from 'apollo-server-testing' import createServer from '../.././server' diff --git a/backend/src/schema/resolvers/passwordReset.spec.js b/backend/src/schema/resolvers/passwordReset.spec.js index be3c8c085..d7b3a0157 100644 --- a/backend/src/schema/resolvers/passwordReset.spec.js +++ b/backend/src/schema/resolvers/passwordReset.spec.js @@ -1,6 +1,6 @@ -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createPasswordReset from './helpers/createPasswordReset' import createServer from '../../server' import { createTestClient } from 'apollo-server-testing' diff --git a/backend/src/schema/resolvers/posts.spec.js b/backend/src/schema/resolvers/posts.spec.js index dcbd16d5d..56a47afa7 100644 --- a/backend/src/schema/resolvers/posts.spec.js +++ b/backend/src/schema/resolvers/posts.spec.js @@ -1,7 +1,7 @@ import { createTestClient } from 'apollo-server-testing' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' const driver = getDriver() @@ -682,58 +682,62 @@ describe('UpdatePost', () => { }) describe('PostOrdering', () => { - let pinnedPost, admin beforeEach(async () => { - ;[pinnedPost] = await Promise.all([ - neode.create('Post', { - id: 'im-a-pinned-post', - pinned: true, - }), - neode.create('Post', { - id: 'i-was-created-after-pinned-post', - createdAt: '2019-10-22T17:26:29.070Z', // this should always be 3rd - }), - ]) - admin = await user.update({ - role: 'admin', - name: 'Admin', - updatedAt: new Date().toISOString(), + await factory.create('Post', { + id: 'im-a-pinned-post', + createdAt: '2019-11-22T17:26:29.070Z', + pinned: true, + }) + await factory.create('Post', { + id: 'i-was-created-before-pinned-post', + // fairly old, so this should be 3rd + createdAt: '2019-10-22T17:26:29.070Z', }) - await admin.relateTo(pinnedPost, 'pinned') }) - it('pinned post appear first even when created before other posts', async () => { - const postOrderingQuery = gql` - query($orderBy: [_PostOrdering]) { - Post(orderBy: $orderBy) { - id - pinnedAt + describe('order by `pinned_asc` and `createdAt_desc`', () => { + beforeEach(() => { + // this is the ordering in the frontend + variables = { orderBy: ['pinned_asc', 'createdAt_desc'] } + }) + + it('pinned post appear first even when created before other posts', async () => { + const postOrderingQuery = gql` + query($orderBy: [_PostOrdering]) { + Post(orderBy: $orderBy) { + id + pinned + createdAt + pinnedAt + } } - } - ` - const expected = { - data: { - Post: [ - { - id: 'im-a-pinned-post', - pinnedAt: expect.any(String), - }, - { - id: 'p9876', - pinnedAt: null, - }, - { - id: 'i-was-created-after-pinned-post', - pinnedAt: null, - }, - ], - }, - errors: undefined, - } - variables = { orderBy: ['pinned_desc', 'createdAt_desc'] } - await expect(query({ query: postOrderingQuery, variables })).resolves.toMatchObject( - expected, - ) + ` + await expect(query({ query: postOrderingQuery, variables })).resolves.toMatchObject({ + data: { + Post: [ + { + id: 'im-a-pinned-post', + pinned: true, + createdAt: '2019-11-22T17:26:29.070Z', + pinnedAt: expect.any(String), + }, + { + id: 'p9876', + pinned: null, + createdAt: expect.any(String), + pinnedAt: null, + }, + { + id: 'i-was-created-before-pinned-post', + pinned: null, + createdAt: '2019-10-22T17:26:29.070Z', + pinnedAt: null, + }, + ], + }, + errors: undefined, + }) + }) }) }) }) diff --git a/backend/src/schema/resolvers/registration.js b/backend/src/schema/resolvers/registration.js index e03f294cd..1e7708395 100644 --- a/backend/src/schema/resolvers/registration.js +++ b/backend/src/schema/resolvers/registration.js @@ -1,5 +1,5 @@ import { UserInputError } from 'apollo-server' -import { getNeode } from '../../bootstrap/neo4j' +import { getNeode } from '../../db/neo4j' import fileUpload from './fileUpload' import encryptPassword from '../../helpers/encryptPassword' import generateNonce from './helpers/generateNonce' diff --git a/backend/src/schema/resolvers/registration.spec.js b/backend/src/schema/resolvers/registration.spec.js index 8f3a7ac39..23b1f9d2a 100644 --- a/backend/src/schema/resolvers/registration.spec.js +++ b/backend/src/schema/resolvers/registration.spec.js @@ -1,6 +1,6 @@ -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getDriver, getNeode } from '../../bootstrap/neo4j' +import { getDriver, getNeode } from '../../db/neo4j' import createServer from '../../server' import { createTestClient } from 'apollo-server-testing' diff --git a/backend/src/schema/resolvers/reports.spec.js b/backend/src/schema/resolvers/reports.spec.js index 8b1bb925d..7f827b111 100644 --- a/backend/src/schema/resolvers/reports.spec.js +++ b/backend/src/schema/resolvers/reports.spec.js @@ -1,8 +1,8 @@ import { createTestClient } from 'apollo-server-testing' import createServer from '../.././server' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getDriver, getNeode } from '../../bootstrap/neo4j' +import { getDriver, getNeode } from '../../db/neo4j' const factory = Factory() const instance = getNeode() diff --git a/backend/src/schema/resolvers/rewards.js b/backend/src/schema/resolvers/rewards.js index 44bdab770..311cfd2e6 100644 --- a/backend/src/schema/resolvers/rewards.js +++ b/backend/src/schema/resolvers/rewards.js @@ -1,4 +1,4 @@ -import { getNeode } from '../../bootstrap/neo4j' +import { getNeode } from '../../db/neo4j' import { UserInputError } from 'apollo-server' const neode = getNeode() diff --git a/backend/src/schema/resolvers/rewards.spec.js b/backend/src/schema/resolvers/rewards.spec.js index e6f67ecab..fe2807f25 100644 --- a/backend/src/schema/resolvers/rewards.spec.js +++ b/backend/src/schema/resolvers/rewards.spec.js @@ -1,7 +1,7 @@ import { createTestClient } from 'apollo-server-testing' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' const factory = Factory() diff --git a/backend/src/schema/resolvers/searches.js b/backend/src/schema/resolvers/searches.js index 5316ccd9a..994d19fa2 100644 --- a/backend/src/schema/resolvers/searches.js +++ b/backend/src/schema/resolvers/searches.js @@ -20,7 +20,7 @@ export default { AND NOT ( author.deleted = true OR author.disabled = true OR resource.deleted = true OR resource.disabled = true - OR (:User { id: $thisUserId })-[:BLOCKED]-(author) + OR (:User {id: $thisUserId})-[:MUTED]->(author) ) WITH resource, author, [(resource)<-[:COMMENTS]-(comment:Comment) | comment] as comments, @@ -40,8 +40,7 @@ export default { YIELD node as resource, score MATCH (resource) WHERE score >= 0.5 - AND NOT (resource.deleted = true OR resource.disabled = true - OR (:User { id: $thisUserId })-[:BLOCKED]-(resource)) + AND NOT (resource.deleted = true OR resource.disabled = true) RETURN resource {.*, __typename: labels(resource)[0]} LIMIT $limit ` diff --git a/backend/src/schema/resolvers/shout.spec.js b/backend/src/schema/resolvers/shout.spec.js index e747946aa..104a28399 100644 --- a/backend/src/schema/resolvers/shout.spec.js +++ b/backend/src/schema/resolvers/shout.spec.js @@ -1,7 +1,7 @@ import { createTestClient } from 'apollo-server-testing' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' let mutate, query, authenticatedUser, variables diff --git a/backend/src/schema/resolvers/socialMedia.js b/backend/src/schema/resolvers/socialMedia.js index c206778e5..c5b9dcd91 100644 --- a/backend/src/schema/resolvers/socialMedia.js +++ b/backend/src/schema/resolvers/socialMedia.js @@ -1,4 +1,4 @@ -import { getNeode } from '../../bootstrap/neo4j' +import { getNeode } from '../../db/neo4j' import Resolver from './helpers/Resolver' const neode = getNeode() diff --git a/backend/src/schema/resolvers/socialMedia.spec.js b/backend/src/schema/resolvers/socialMedia.spec.js index 8f6d91d43..f292b58a0 100644 --- a/backend/src/schema/resolvers/socialMedia.spec.js +++ b/backend/src/schema/resolvers/socialMedia.spec.js @@ -1,8 +1,8 @@ import { createTestClient } from 'apollo-server-testing' import createServer from '../../server' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' const driver = getDriver() const factory = Factory() diff --git a/backend/src/schema/resolvers/statistics.spec.js b/backend/src/schema/resolvers/statistics.spec.js index 48baf00cd..e2b9dafe4 100644 --- a/backend/src/schema/resolvers/statistics.spec.js +++ b/backend/src/schema/resolvers/statistics.spec.js @@ -1,7 +1,7 @@ import { createTestClient } from 'apollo-server-testing' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' let query, authenticatedUser diff --git a/backend/src/schema/resolvers/user_management.js b/backend/src/schema/resolvers/user_management.js index 4d035d9fa..4d40a6f63 100644 --- a/backend/src/schema/resolvers/user_management.js +++ b/backend/src/schema/resolvers/user_management.js @@ -1,7 +1,7 @@ import encode from '../../jwt/encode' import bcrypt from 'bcryptjs' import { AuthenticationError } from 'apollo-server' -import { getNeode } from '../../bootstrap/neo4j' +import { getNeode } from '../../db/neo4j' import normalizeEmail from './helpers/normalizeEmail' import log from './helpers/databaseLogger' diff --git a/backend/src/schema/resolvers/user_management.spec.js b/backend/src/schema/resolvers/user_management.spec.js index 3527e5dc2..5e7043e74 100644 --- a/backend/src/schema/resolvers/user_management.spec.js +++ b/backend/src/schema/resolvers/user_management.spec.js @@ -1,11 +1,11 @@ import jwt from 'jsonwebtoken' import CONFIG from './../../config' -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' import { createTestClient } from 'apollo-server-testing' import createServer, { context } from '../../server' import encode from '../../jwt/encode' -import { getNeode } from '../../bootstrap/neo4j' +import { getNeode } from '../../db/neo4j' const factory = Factory() const neode = getNeode() diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js index a680f5e41..d1d9111b6 100644 --- a/backend/src/schema/resolvers/users.js +++ b/backend/src/schema/resolvers/users.js @@ -1,6 +1,6 @@ import { neo4jgraphql } from 'neo4j-graphql-js' import fileUpload from './fileUpload' -import { getNeode } from '../../bootstrap/neo4j' +import { getNeode } from '../../db/neo4j' import { UserInputError, ForbiddenError } from 'apollo-server' import Resolver from './helpers/Resolver' import log from './helpers/databaseLogger' @@ -23,6 +23,21 @@ export const getMutedUsers = async context => { return mutedUsers } +export const getBlockedUsers = async context => { + const { neode } = context + const userModel = neode.model('User') + let blockedUsers = neode + .query() + .match('user', userModel) + .where('user.id', context.user.id) + .relationship(userModel.relationships().get('blocked')) + .to('blocked', userModel) + .return('blocked') + blockedUsers = await blockedUsers.execute() + blockedUsers = blockedUsers.records.map(r => r.get('blocked').properties) + return blockedUsers +} + export default { Query: { mutedUsers: async (object, args, context, resolveInfo) => { @@ -32,6 +47,13 @@ export default { throw new UserInputError(e.message) } }, + blockedUsers: async (object, args, context, resolveInfo) => { + try { + return getBlockedUsers(context) + } catch (e) { + throw new UserInputError(e.message) + } + }, User: async (object, args, context, resolveInfo) => { const { email } = args if (email) { @@ -86,7 +108,7 @@ export default { const unmutedUser = await neode.find('User', params.id) return unmutedUser.toJson() }, - block: async (object, args, context, resolveInfo) => { + blockUser: async (object, args, context, resolveInfo) => { const { user: currentUser } = context if (currentUser.id === args.id) return null await neode.cypher( @@ -103,7 +125,7 @@ export default { await user.relateTo(blockedUser, 'blocked') return blockedUser.toJson() }, - unblock: async (object, args, context, resolveInfo) => { + unblockUser: async (object, args, context, resolveInfo) => { const { user: currentUser } = context if (currentUser.id === args.id) return null await neode.cypher( @@ -229,7 +251,7 @@ export default { boolean: { followedByCurrentUser: 'MATCH (this)<-[:FOLLOWS]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', - isBlocked: + blocked: 'MATCH (this)<-[:BLOCKED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', isMuted: 'MATCH (this)<-[:MUTED]-(u:User {id: $cypherParams.currentUserId}) RETURN COUNT(u) >= 1', diff --git a/backend/src/schema/resolvers/users.spec.js b/backend/src/schema/resolvers/users.spec.js index 5d1ebd8e2..cfd84fcf7 100644 --- a/backend/src/schema/resolvers/users.spec.js +++ b/backend/src/schema/resolvers/users.spec.js @@ -1,6 +1,6 @@ -import Factory from '../../seed/factories' +import Factory from '../../factories' import { gql } from '../../helpers/jest' -import { getNeode, getDriver } from '../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../db/neo4j' import createServer from '../../server' import { createTestClient } from 'apollo-server-testing' diff --git a/backend/src/schema/resolvers/users/location.spec.js b/backend/src/schema/resolvers/users/location.spec.js index 59d093afb..f7315174c 100644 --- a/backend/src/schema/resolvers/users/location.spec.js +++ b/backend/src/schema/resolvers/users/location.spec.js @@ -1,6 +1,6 @@ import { gql } from '../../../helpers/jest' -import Factory from '../../../seed/factories' -import { getNeode, getDriver } from '../../../bootstrap/neo4j' +import Factory from '../../../factories' +import { getNeode, getDriver } from '../../../db/neo4j' import { createTestClient } from 'apollo-server-testing' import createServer from '../../../server' diff --git a/backend/src/schema/resolvers/users/mutedUsers.spec.js b/backend/src/schema/resolvers/users/mutedUsers.spec.js index 3dab70278..130df08ce 100644 --- a/backend/src/schema/resolvers/users/mutedUsers.spec.js +++ b/backend/src/schema/resolvers/users/mutedUsers.spec.js @@ -1,8 +1,8 @@ import { createTestClient } from 'apollo-server-testing' import createServer from '../../../server' -import Factory from '../../../seed/factories' +import Factory from '../../../factories' import { gql } from '../../../helpers/jest' -import { getNeode, getDriver } from '../../../bootstrap/neo4j' +import { getNeode, getDriver } from '../../../db/neo4j' const driver = getDriver() const factory = Factory() diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql index 4eb04a638..71cc1edb0 100644 --- a/backend/src/schema/types/type/User.gql +++ b/backend/src/schema/types/type/User.gql @@ -68,10 +68,11 @@ type User { RETURN COUNT(u) >= 1 """ ) - isBlocked: Boolean! @cypher( + + blocked: Boolean! @cypher( statement: """ - MATCH (this)<-[: BLOCKED]-(u: User { id: $cypherParams.currentUserId}) - RETURN COUNT(u) >= 1 + MATCH (this)-[:BLOCKED]-(user:User {id: $cypherParams.currentUserId}) + RETURN COUNT(user) >= 1 """ ) @@ -207,6 +208,6 @@ type Mutation { muteUser(id: ID!): User unmuteUser(id: ID!): User - block(id: ID!): User - unblock(id: ID!): User + blockUser(id: ID!): User + unblockUser(id: ID!): User } diff --git a/backend/src/seed/seed-helpers.js b/backend/src/seed/seed-helpers.js deleted file mode 100644 index 913ca1d54..000000000 --- a/backend/src/seed/seed-helpers.js +++ /dev/null @@ -1,134 +0,0 @@ -const _ = require('lodash') -const faker = require('faker') -const unsplashTopics = [ - 'love', - 'family', - 'spring', - 'business', - 'nature', - 'travel', - 'happy', - 'landscape', - 'health', - 'friends', - 'computer', - 'autumn', - 'space', - 'animal', - 'smile', - 'face', - 'people', - 'portrait', - 'amazing', -] -let unsplashTopicsTmp = [] - -const ngoLogos = [ - 'http://www.fetchlogos.com/wp-content/uploads/2015/11/Girl-Scouts-Of-The-Usa-Logo.jpg', - 'http://logos.textgiraffe.com/logos/logo-name/Ngo-designstyle-friday-m.png', - 'http://seeklogo.com/images/N/ngo-logo-BD53A3E024-seeklogo.com.png', - 'https://dcassetcdn.com/design_img/10133/25833/25833_303600_10133_image.jpg', - 'https://cdn.tutsplus.com/vector/uploads/legacy/articles/08bad_ngologos/20.jpg', - 'https://cdn.tutsplus.com/vector/uploads/legacy/articles/08bad_ngologos/33.jpg', - null, -] - -const difficulties = ['easy', 'medium', 'hard'] - -export default { - randomItem: (items, filter) => { - const ids = filter - ? Object.keys(items).filter(id => { - return filter(items[id]) - }) - : _.keys(items) - const randomIds = _.shuffle(ids) - return items[randomIds.pop()] - }, - randomItems: (items, key = 'id', min = 1, max = 1) => { - const randomIds = _.shuffle(_.keys(items)) - const res = [] - - const count = _.random(min, max) - - for (let i = 0; i < count; i++) { - let r = items[randomIds.pop()][key] - if (key === 'id') { - r = r.toString() - } - res.push(r) - } - return res - }, - random: items => { - return _.shuffle(items).pop() - }, - randomDifficulty: () => { - return _.shuffle(difficulties).pop() - }, - randomLogo: () => { - return _.shuffle(ngoLogos).pop() - }, - randomUnsplashUrl: () => { - if (Math.random() < 0.6) { - // do not attach images in 60 percent of the cases (faster seeding) - return - } - if (unsplashTopicsTmp.length < 2) { - unsplashTopicsTmp = _.shuffle(unsplashTopics) - } - return ( - 'https://source.unsplash.com/daily?' + unsplashTopicsTmp.pop() + ',' + unsplashTopicsTmp.pop() - ) - }, - randomCategories: (seederstore, allowEmpty = false) => { - let count = Math.round(Math.random() * 3) - if (allowEmpty === false && count === 0) { - count = 1 - } - const categorieIds = _.shuffle(_.keys(seederstore.categories)) - const ids = [] - for (let i = 0; i < count; i++) { - ids.push(categorieIds.pop()) - } - return ids - }, - randomAddresses: () => { - const count = Math.round(Math.random() * 3) - const addresses = [] - for (let i = 0; i < count; i++) { - addresses.push({ - city: faker.address.city(), - zipCode: faker.address.zipCode(), - street: faker.address.streetAddress(), - country: faker.address.countryCode(), - lat: 54.032726 - Math.random() * 10, - lng: 6.558838 + Math.random() * 10, - }) - } - return addresses - }, - /** - * Get array of ids from the given seederstore items after mapping them by the key in the values - * - * @param items items from the seederstore - * @param values values for which you need the ids - * @param key the field key that is represented in the values (slug, name, etc.) - */ - mapIdsByKey: (items, values, key) => { - const res = [] - values.forEach(value => { - res.push(_.find(items, [key, value]).id.toString()) - }) - return res - }, - genInviteCode: () => { - const chars = '23456789abcdefghkmnpqrstuvwxyzABCDEFGHJKLMNPRSTUVWXYZ' - let code = '' - for (let i = 0; i < 8; i++) { - const n = _.random(0, chars.length - 1) - code += chars.substr(n, 1) - } - return code - }, -} diff --git a/backend/src/server.js b/backend/src/server.js index bd9973a39..02e166b71 100644 --- a/backend/src/server.js +++ b/backend/src/server.js @@ -3,7 +3,7 @@ import helmet from 'helmet' import { ApolloServer } from 'apollo-server-express' import CONFIG from './config' import middleware from './middleware' -import { getNeode, getDriver } from './bootstrap/neo4j' +import { getNeode, getDriver } from './db/neo4j' import decode from './jwt/decode' import schema from './schema' import webfinger from './activitypub/routes/webfinger' diff --git a/backend/test/features/support/steps.js b/backend/test/features/support/steps.js index 73d059348..70802f4e2 100644 --- a/backend/test/features/support/steps.js +++ b/backend/test/features/support/steps.js @@ -3,7 +3,7 @@ import { Given, When, Then, AfterAll } from 'cucumber' import { expect } from 'chai' // import { client } from '../../../src/activitypub/apollo-client' import { GraphQLClient } from 'graphql-request' -import Factory from '../../../src/seed/factories' +import Factory from '../../../src/factories' const debug = require('debug')('ea:test:steps') const factory = Factory() diff --git a/backend/yarn.lock b/backend/yarn.lock index 267c54eb3..3df6b1593 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -33,10 +33,10 @@ resolved "https://registry.yarnpkg.com/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.24.tgz#3ce939cb127fb8aaa3ffc1e90dff9b8af9f2e3dc" integrity sha512-8GqG48m1XqyXh4mIZrtB5xOhUwSsh1WsrrsaZQOEYYql3YN9DEu9OOSg0ILzXHZo/h2Q74777YE4YzlArQzQEQ== -"@babel/cli@~7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.8.3.tgz#121beb7c273e0521eb2feeb3883a2b7435d12328" - integrity sha512-K2UXPZCKMv7KwWy9Bl4sa6+jTNP7JyDiHKzoOiUUygaEDbC60vaargZDnO9oFMvlq8pIKOOyUUgeMYrsaN9djA== +"@babel/cli@~7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.8.4.tgz#505fb053721a98777b2b175323ea4f090b7d3c1c" + integrity sha512-XXLgAm6LBbaNxaGhMAznXXaxtCWfuv6PIDJ9Alsy9JYTOh+j2jJz+L/162kkfU1j/pTSxK1xGmlwI4pdIMkoag== dependencies: commander "^4.0.1" convert-source-map "^1.1.0" @@ -56,26 +56,26 @@ dependencies: "@babel/highlight" "^7.8.3" -"@babel/compat-data@^7.8.0", "@babel/compat-data@^7.8.1": - version "7.8.1" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.8.1.tgz#fc0bbbb7991e4fb2b47e168e60f2cc2c41680be9" - integrity sha512-Z+6ZOXvyOWYxJ50BwxzdhRnRsGST8Y3jaZgxYig575lTjVSs3KtJnmESwZegg6e2Dn0td1eDhoWlp1wI4BTCPw== +"@babel/compat-data@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.8.4.tgz#bbe65d05a291667a8394fe8a0e0e277ef22b0d2a" + integrity sha512-lHLhlsvFjJAqNU71b7k6Vv9ewjmTXKvqaMv7n0G1etdCabWLw3nEYE8mmgoVOxMIFE07xOvo7H7XBASirX6Rrg== dependencies: - browserslist "^4.8.2" + browserslist "^4.8.5" invariant "^2.2.4" semver "^5.5.0" -"@babel/core@^7.1.0", "@babel/core@^7.7.5", "@babel/core@~7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.3.tgz#30b0ebb4dd1585de6923a0b4d179e0b9f5d82941" - integrity sha512-4XFkf8AwyrEG7Ziu3L2L0Cv+WyY47Tcsp70JFmpftbAA1K7YL/sgE9jh9HyNj08Y/U50ItUchpN0w6HxAoX1rA== +"@babel/core@^7.1.0", "@babel/core@^7.7.5", "@babel/core@~7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.8.4.tgz#d496799e5c12195b3602d0fddd77294e3e38e80e" + integrity sha512-0LiLrB2PwrVI+a2/IEskBopDYSd8BCb3rOvH7D5tzoWd696TBEduBvuLVm4Nx6rltrLZqvI3MCalB2K2aVzQjA== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.3" - "@babel/helpers" "^7.8.3" - "@babel/parser" "^7.8.3" + "@babel/generator" "^7.8.4" + "@babel/helpers" "^7.8.4" + "@babel/parser" "^7.8.4" "@babel/template" "^7.8.3" - "@babel/traverse" "^7.8.3" + "@babel/traverse" "^7.8.4" "@babel/types" "^7.8.3" convert-source-map "^1.7.0" debug "^4.1.0" @@ -86,10 +86,10 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.4.0", "@babel/generator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.3.tgz#0e22c005b0a94c1c74eafe19ef78ce53a4d45c03" - integrity sha512-WjoPk8hRpDRqqzRpvaR8/gDUPkrnOOeuT2m8cNICJtZH6mwaCo3v0OKMI7Y6SM1pBtyijnLtAL0HDi41pf41ug== +"@babel/generator@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.8.4.tgz#35bbc74486956fe4251829f9f6c48330e8d0985e" + integrity sha512-PwhclGdRpNAf3IxZb0YVuITPZmmrXz9zf6fH8lT4XbrmfQKr6ryBzhv593P5C6poJRciFCL/eHGW2NuGrgEyxA== dependencies: "@babel/types" "^7.8.3" jsesc "^2.5.1" @@ -120,15 +120,15 @@ "@babel/traverse" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helper-compilation-targets@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.3.tgz#2deedc816fd41dca7355ef39fd40c9ea69f0719a" - integrity sha512-JLylPCsFjhLN+6uBSSh3iYdxKdeO9MNmoY96PE/99d8kyBFaXLORtAVhqN6iHa+wtPeqxKLghDOZry0+Aiw9Tw== +"@babel/helper-compilation-targets@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.4.tgz#03d7ecd454b7ebe19a254f76617e61770aed2c88" + integrity sha512-3k3BsKMvPp5bjxgMdrFyq0UaEO48HciVrOVF0+lon8pp95cyJ2ujAh0TrBHNMnJGT2rr0iKOJPFFbSqjDyf/Pg== dependencies: - "@babel/compat-data" "^7.8.1" - browserslist "^4.8.2" + "@babel/compat-data" "^7.8.4" + browserslist "^4.8.5" invariant "^2.2.4" - levenary "^1.1.0" + levenary "^1.1.1" semver "^5.5.0" "@babel/helper-create-regexp-features-plugin@^7.8.3": @@ -270,13 +270,13 @@ "@babel/traverse" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/helpers@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.8.3.tgz#382fbb0382ce7c4ce905945ab9641d688336ce85" - integrity sha512-LmU3q9Pah/XyZU89QvBgGt+BCsTPoQa+73RxAQh8fb8qkDyIfeQnmgs+hvzhTCKTzqOyk7JTkS3MS1S8Mq5yrQ== +"@babel/helpers@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73" + integrity sha512-VPbe7wcQ4chu4TDQjimHv/5tj73qz88o12EPkO2ValS2QiQS/1F2SsjyIGNnAD0vF/nZS6Cf9i+vW6HIlnaR8w== dependencies: "@babel/template" "^7.8.3" - "@babel/traverse" "^7.8.3" + "@babel/traverse" "^7.8.4" "@babel/types" "^7.8.3" "@babel/highlight@^7.8.3": @@ -288,10 +288,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/node@~7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/node/-/node-7.8.3.tgz#29784d445e135ca7214a9ac40535f2b8d2f980aa" - integrity sha512-GZpHg1gPnZTk1PvHRc4g/M5c50nHERkk3ojb5AuUTZFAjEKzDhBJcqvwWa7NrNT3W3Nf8t8Sj8JjA6rtXJ1z/g== +"@babel/node@~7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/node/-/node-7.8.4.tgz#59b2ed7e5a9df2224592f83292d77d616fbf1ab8" + integrity sha512-MlczXI/VYRnoaWHjicqrzq2z4DhRPaWQIC+C3ISEQs5z+mEccBsn7IAI5Q97ZDTnFYw6ts5IUTzqArilC/g7nw== dependencies: "@babel/register" "^7.8.3" commander "^4.0.1" @@ -302,10 +302,10 @@ resolve "^1.13.1" v8flags "^3.1.1" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.7.5", "@babel/parser@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.3.tgz#790874091d2001c9be6ec426c2eed47bc7679081" - integrity sha512-/V72F4Yp/qmHaTALizEm9Gf2eQHV3QyTL3K0cNfijwnMnb1L+LDlAubb/ZnSdGAVzVSWakujHYs1I26x66sMeQ== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.7.5", "@babel/parser@^7.8.3", "@babel/parser@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.8.4.tgz#d1dbe64691d60358a974295fa53da074dd2ce8e8" + integrity sha512-0fKu/QqildpXmPVaRBoXOlyBb3MC+J0A66x97qEfLOMkn3u6nfY5esWogQwi/K0BjASYy4DbnsEWnpNL6qT5Mw== "@babel/plugin-proposal-async-generator-functions@^7.8.3": version "7.8.3" @@ -532,10 +532,10 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-for-of@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.3.tgz#15f17bce2fc95c7d59a24b299e83e81cedc22e18" - integrity sha512-ZjXznLNTxhpf4Q5q3x1NsngzGA38t9naWH8Gt+0qYZEJAcvPI9waSStSh56u19Ofjr7QmD0wUsQ8hw8s/p1VnA== +"@babel/plugin-transform-for-of@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.8.4.tgz#6fe8eae5d6875086ee185dd0b098a8513783b47d" + integrity sha512-iAXNlOWvcYUYoV8YIxwS7TxGRJcxyl8eQCfT+A5j8sKUzRFvJdcyjp97jL2IghWSRDaL2PU2O2tX8Cu9dTBq5A== dependencies: "@babel/helper-plugin-utils" "^7.8.3" @@ -620,10 +620,10 @@ "@babel/helper-plugin-utils" "^7.8.3" "@babel/helper-replace-supers" "^7.8.3" -"@babel/plugin-transform-parameters@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.3.tgz#7890576a13b17325d8b7d44cb37f21dc3bbdda59" - integrity sha512-/pqngtGb54JwMBZ6S/D3XYylQDFtGjWrnoCF4gXZOUpFV/ujbxnoNGNvDGu6doFWRPBveE72qTx/RRU44j5I/Q== +"@babel/plugin-transform-parameters@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.8.4.tgz#1d5155de0b65db0ccf9971165745d3bb990d77d3" + integrity sha512-IsS3oTxeTsZlE5KqzTbcC2sV0P9pXdec53SU+Yxv7o/6dvGM5AkTotQKhoSffhNgZ/dftsSiOoxy7evCYJXzVA== dependencies: "@babel/helper-call-delegate" "^7.8.3" "@babel/helper-get-function-arity" "^7.8.3" @@ -680,10 +680,10 @@ "@babel/helper-annotate-as-pure" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-transform-typeof-symbol@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.3.tgz#5cffb216fb25c8c64ba6bf5f76ce49d3ab079f4d" - integrity sha512-3TrkKd4LPqm4jHs6nPtSDI/SV9Cm5PRJkHLUgTcqRQQTMAZ44ZaAdDZJtvWFSaRcvT0a1rTmJ5ZA5tDKjleF3g== +"@babel/plugin-transform-typeof-symbol@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz#ede4062315ce0aaf8a657a920858f1a2f35fc412" + integrity sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg== dependencies: "@babel/helper-plugin-utils" "^7.8.3" @@ -695,13 +695,13 @@ "@babel/helper-create-regexp-features-plugin" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" -"@babel/preset-env@~7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.8.3.tgz#dc0fb2938f52bbddd79b3c861a4b3427dd3a6c54" - integrity sha512-Rs4RPL2KjSLSE2mWAx5/iCH+GC1ikKdxPrhnRS6PfFVaiZeom22VFKN4X8ZthyN61kAaR05tfXTbCvatl9WIQg== +"@babel/preset-env@~7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.8.4.tgz#9dac6df5f423015d3d49b6e9e5fa3413e4a72c4e" + integrity sha512-HihCgpr45AnSOHRbS5cWNTINs0TwaR8BS8xIIH+QwiW8cKL0llV91njQMpeMReEPVs+1Ao0x3RLEBLtt1hOq4w== dependencies: - "@babel/compat-data" "^7.8.0" - "@babel/helper-compilation-targets" "^7.8.3" + "@babel/compat-data" "^7.8.4" + "@babel/helper-compilation-targets" "^7.8.4" "@babel/helper-module-imports" "^7.8.3" "@babel/helper-plugin-utils" "^7.8.3" "@babel/plugin-proposal-async-generator-functions" "^7.8.3" @@ -730,7 +730,7 @@ "@babel/plugin-transform-dotall-regex" "^7.8.3" "@babel/plugin-transform-duplicate-keys" "^7.8.3" "@babel/plugin-transform-exponentiation-operator" "^7.8.3" - "@babel/plugin-transform-for-of" "^7.8.3" + "@babel/plugin-transform-for-of" "^7.8.4" "@babel/plugin-transform-function-name" "^7.8.3" "@babel/plugin-transform-literals" "^7.8.3" "@babel/plugin-transform-member-expression-literals" "^7.8.3" @@ -741,7 +741,7 @@ "@babel/plugin-transform-named-capturing-groups-regex" "^7.8.3" "@babel/plugin-transform-new-target" "^7.8.3" "@babel/plugin-transform-object-super" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.8.4" "@babel/plugin-transform-property-literals" "^7.8.3" "@babel/plugin-transform-regenerator" "^7.8.3" "@babel/plugin-transform-reserved-words" "^7.8.3" @@ -749,16 +749,16 @@ "@babel/plugin-transform-spread" "^7.8.3" "@babel/plugin-transform-sticky-regex" "^7.8.3" "@babel/plugin-transform-template-literals" "^7.8.3" - "@babel/plugin-transform-typeof-symbol" "^7.8.3" + "@babel/plugin-transform-typeof-symbol" "^7.8.4" "@babel/plugin-transform-unicode-regex" "^7.8.3" "@babel/types" "^7.8.3" - browserslist "^4.8.2" + browserslist "^4.8.5" core-js-compat "^3.6.2" invariant "^2.2.2" - levenary "^1.1.0" + levenary "^1.1.1" semver "^5.5.0" -"@babel/register@^7.8.3", "@babel/register@~7.8.3": +"@babel/register@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.8.3.tgz#5d5d30cfcc918437535d724b8ac1e4a60c5db1f8" integrity sha512-t7UqebaWwo9nXWClIPLPloa5pN33A2leVs8Hf0e9g9YwUP8/H9NeR7DJU+4CXo23QtjChQv5a3DjEtT83ih1rg== @@ -784,7 +784,7 @@ dependencies: regenerator-runtime "^0.13.2" -"@babel/template@^7.4.0", "@babel/template@^7.7.4", "@babel/template@^7.8.3": +"@babel/template@^7.7.4", "@babel/template@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.3.tgz#e02ad04fe262a657809327f578056ca15fd4d1b8" integrity sha512-04m87AcQgAFdvuoyiQ2kgELr2tV8B4fP/xJAVUL3Yb3bkNdMedD3d0rlSQr3PegP0cms3eHjl1F7PWlvWbU8FQ== @@ -793,22 +793,22 @@ "@babel/parser" "^7.8.3" "@babel/types" "^7.8.3" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.7.4", "@babel/traverse@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.3.tgz#a826215b011c9b4f73f3a893afbc05151358bf9a" - integrity sha512-we+a2lti+eEImHmEXp7bM9cTxGzxPmBiVJlLVD+FuuQMeeO7RaDbutbgeheDkw+Xe3mCfJHnGOWLswT74m2IPg== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.7.4", "@babel/traverse@^7.8.3", "@babel/traverse@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.8.4.tgz#f0845822365f9d5b0e312ed3959d3f827f869e3c" + integrity sha512-NGLJPZwnVEyBPLI+bl9y9aSnxMhsKz42so7ApAv9D+b4vAFPpY013FTS9LdKxcABoIYFU52HcYga1pPlx454mg== dependencies: "@babel/code-frame" "^7.8.3" - "@babel/generator" "^7.8.3" + "@babel/generator" "^7.8.4" "@babel/helper-function-name" "^7.8.3" "@babel/helper-split-export-declaration" "^7.8.3" - "@babel/parser" "^7.8.3" + "@babel/parser" "^7.8.4" "@babel/types" "^7.8.3" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.8.3": +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.8.3.tgz#5a383dffa5416db1b73dedffd311ffd0788fb31c" integrity sha512-jBD+G8+LWpMBBWvVcdr4QysjUE4mU/syrhN17o1u3gx0/WzJB1kwiVZAXRtWbsIPOwW8pF/YJV5+nmetPzepXg== @@ -982,15 +982,6 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== -"@jest/console@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0" - integrity sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ== - dependencies: - "@jest/source-map" "^24.9.0" - chalk "^2.0.1" - slash "^2.0.0" - "@jest/console@^25.1.0": version "25.1.0" resolved "https://registry.yarnpkg.com/@jest/console/-/console-25.1.0.tgz#1fc765d44a1e11aec5029c08e798246bd37075ab" @@ -1044,15 +1035,6 @@ "@jest/types" "^25.1.0" jest-mock "^25.1.0" -"@jest/fake-timers@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.9.0.tgz#ba3e6bf0eecd09a636049896434d306636540c93" - integrity sha512-eWQcNa2YSwzXWIMC5KufBh3oWRIijrQFROsIqt6v/NS9Io/gknw1jsAC9c+ih/RQX4A3O7SeWAhQeN0goKhT9A== - dependencies: - "@jest/types" "^24.9.0" - jest-message-util "^24.9.0" - jest-mock "^24.9.0" - "@jest/fake-timers@^25.1.0": version "25.1.0" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-25.1.0.tgz#a1e0eff51ffdbb13ee81f35b52e0c1c11a350ce8" @@ -1097,15 +1079,6 @@ optionalDependencies: node-notifier "^6.0.0" -"@jest/source-map@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.9.0.tgz#0e263a94430be4b41da683ccc1e6bffe2a191714" - integrity sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg== - dependencies: - callsites "^3.0.0" - graceful-fs "^4.1.15" - source-map "^0.6.0" - "@jest/source-map@^25.1.0": version "25.1.0" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-25.1.0.tgz#b012e6c469ccdbc379413f5c1b1ffb7ba7034fb0" @@ -1115,15 +1088,6 @@ graceful-fs "^4.2.3" source-map "^0.6.0" -"@jest/test-result@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.9.0.tgz#11796e8aa9dbf88ea025757b3152595ad06ba0ca" - integrity sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA== - dependencies: - "@jest/console" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/istanbul-lib-coverage" "^2.0.0" - "@jest/test-result@^25.1.0": version "25.1.0" resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-25.1.0.tgz#847af2972c1df9822a8200457e64be4ff62821f7" @@ -1145,28 +1109,6 @@ jest-runner "^25.1.0" jest-runtime "^25.1.0" -"@jest/transform@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.9.0.tgz#4ae2768b296553fadab09e9ec119543c90b16c56" - integrity sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ== - dependencies: - "@babel/core" "^7.1.0" - "@jest/types" "^24.9.0" - babel-plugin-istanbul "^5.1.0" - chalk "^2.0.1" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" - graceful-fs "^4.1.15" - jest-haste-map "^24.9.0" - jest-regex-util "^24.9.0" - jest-util "^24.9.0" - micromatch "^3.1.10" - pirates "^4.0.1" - realpath-native "^1.1.0" - slash "^2.0.0" - source-map "^0.6.1" - write-file-atomic "2.4.1" - "@jest/transform@^25.1.0": version "25.1.0" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-25.1.0.tgz#221f354f512b4628d88ce776d5b9e601028ea9da" @@ -1189,15 +1131,6 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^24.9.0": - version "24.9.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" - integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^13.0.0" - "@jest/types@^25.1.0": version "25.1.0" resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.1.0.tgz#b26831916f0d7c381e11dbb5e103a72aed1b4395" @@ -1242,10 +1175,10 @@ url-regex "~4.1.1" video-extensions "~1.1.0" -"@metascraper/helpers@^5.10.5": - version "5.10.5" - resolved "https://registry.yarnpkg.com/@metascraper/helpers/-/helpers-5.10.5.tgz#c3558533f30144bacecf9599fd02ac88d839a0cc" - integrity sha512-noTBDk3cF3UzKoPrC9/Sye1f9945PVEDju6br7S19YWyUpceEXoDrPF1YaqN37ku62f1s7bul11+Lv/xAYuEVQ== +"@metascraper/helpers@^5.10.6": + version "5.10.6" + resolved "https://registry.yarnpkg.com/@metascraper/helpers/-/helpers-5.10.6.tgz#0b786607212925a577926fd0cd0313a49de3499c" + integrity sha512-/jvhlM3RKGYMoUK8D8S1r3tN03/EYizCqWF7zDx0aBMC8Ihp33DRGs9oNdsgkgwzVF7O/YpDm55l9K+qVJlsyQ== dependencies: audio-extensions "0.0.0" chrono-node "~1.4.2" @@ -1256,7 +1189,7 @@ image-extensions "~1.1.0" is-relative-url "~3.0.0" is-uri "~1.2.0" - iso-639-3 "~1.2.0" + iso-639-3 "~2.0.0" isostring "0.0.1" lodash "~4.17.15" memoize-one "~5.1.1" @@ -1342,65 +1275,65 @@ resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= -"@sentry/apm@5.11.1": - version "5.11.1" - resolved "https://registry.yarnpkg.com/@sentry/apm/-/apm-5.11.1.tgz#cc89fa4150056fbf009f92eca94fccc3980db34e" - integrity sha512-4iZH11p/7w9IMLT9hqNY1+EqLESltiIoF6/YsbpK93sXWGEs8VQ83IuvGuKWxajvHgDmj4ND0TxIliTsYqTqFw== +"@sentry/apm@5.11.2": + version "5.11.2" + resolved "https://registry.yarnpkg.com/@sentry/apm/-/apm-5.11.2.tgz#35961b9d2319ad21ae91f1b697998a8c523f1919" + integrity sha512-qn4HiSZ+6b1Gg+DlXdHVpiPPEbRu4IicGSbI8HTJLzrlsjoaBQPPkDwtuQUBVq21tU3RYXnTwrl9m45KuX6alA== dependencies: - "@sentry/browser" "5.11.1" - "@sentry/hub" "5.11.1" - "@sentry/minimal" "5.11.1" + "@sentry/browser" "5.11.2" + "@sentry/hub" "5.11.2" + "@sentry/minimal" "5.11.2" "@sentry/types" "5.11.0" "@sentry/utils" "5.11.1" tslib "^1.9.3" -"@sentry/browser@5.11.1": - version "5.11.1" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.11.1.tgz#337ffcb52711b23064c847a07629e966f54a5ebb" - integrity sha512-oqOX/otmuP92DEGRyZeBuQokXdeT9HQRxH73oqIURXXNLMP3PWJALSb4HtT4AftEt/2ROGobZLuA4TaID6My/Q== +"@sentry/browser@5.11.2": + version "5.11.2" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.11.2.tgz#f0b19bd97e9f09a20e9f93a9835339ed9ab1f5a4" + integrity sha512-ls6ARX5m+23ld8OsuoPnR+kehjR5ketYWRcDYlmJDX2VOq5K4EzprujAo8waDB0o5a92yLXQ0ZSoK/zzAV2VoA== dependencies: - "@sentry/core" "5.11.1" + "@sentry/core" "5.11.2" "@sentry/types" "5.11.0" "@sentry/utils" "5.11.1" tslib "^1.9.3" -"@sentry/core@5.11.1": - version "5.11.1" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.11.1.tgz#9e2da485e196ae32971545c1c49ee6fe719930e2" - integrity sha512-BpvPosVNT20Xso4gAV54Lu3KqDmD20vO63HYwbNdST5LUi8oYV4JhvOkoBraPEM2cbBwQvwVcFdeEYKk4tin9A== +"@sentry/core@5.11.2": + version "5.11.2" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.11.2.tgz#f2d9d37940d291dbcb9a9e4a012f76919474bdf6" + integrity sha512-IFCXGy7ebqIq/Kb8RVryCo/SjwhPcrfBmOjkicr4+DxN1UybLre2N3p9bejQMPIteOfDVHlySLYeipjTf+mxZw== dependencies: - "@sentry/hub" "5.11.1" - "@sentry/minimal" "5.11.1" + "@sentry/hub" "5.11.2" + "@sentry/minimal" "5.11.2" "@sentry/types" "5.11.0" "@sentry/utils" "5.11.1" tslib "^1.9.3" -"@sentry/hub@5.11.1": - version "5.11.1" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.11.1.tgz#ddcb865563fae53852d405885c46b4c6de68a91b" - integrity sha512-ucKprYCbGGLLjVz4hWUqHN9KH0WKUkGf5ZYfD8LUhksuobRkYVyig0ZGbshECZxW5jcDTzip4Q9Qimq/PkkXBg== +"@sentry/hub@5.11.2": + version "5.11.2" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.11.2.tgz#a3b7ec27cd4cea2cddd75c372fbf1b4bc04c6aae" + integrity sha512-5BiDin6ZPsaiTm29rCC41MAjP1vOaKniqfjtXHVPm7FeOBA2bpHm95ncjLkshKGJTPfPZHXTpX/1IZsHrfGVEA== dependencies: "@sentry/types" "5.11.0" "@sentry/utils" "5.11.1" tslib "^1.9.3" -"@sentry/minimal@5.11.1": - version "5.11.1" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.11.1.tgz#0e705d01a567282d8fbbda2aed848b4974cc3cec" - integrity sha512-HK8zs7Pgdq7DsbZQTThrhQPrJsVWzz7MaluAbQA0rTIAJ3TvHKQpsVRu17xDpjZXypqWcKCRsthDrC4LxDM1Bg== +"@sentry/minimal@5.11.2": + version "5.11.2" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.11.2.tgz#ae417699342266ecd109a97e53cd9519c0893b21" + integrity sha512-oNuJuz3EZhVtamzABmPdr6lcYo06XHLWb2LvgnoNaYcMD1ExUSvhepOSyZ2h5STCMbmVgGVfXBNPV9RUTp8GZg== dependencies: - "@sentry/hub" "5.11.1" + "@sentry/hub" "5.11.2" "@sentry/types" "5.11.0" tslib "^1.9.3" -"@sentry/node@^5.11.1": - version "5.11.1" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.11.1.tgz#2a9c18cd1209cfdf7a69b9d91303413149d2c910" - integrity sha512-FbJs0blJ36gEzE0rc2yBfA/KE+kXOLl8MUfFTcyJCBdCGF8XMETDCmgINnJ4TyBUJviwKoPw2TCk9TL2pa/A1w== +"@sentry/node@^5.11.2": + version "5.11.2" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.11.2.tgz#575c320b624c218d2155183f6bbe82b732bfb1f2" + integrity sha512-jYq9u76BdAbOKPuYg39Xh/+797MevzjMkCIC9cw/bQxAm6nHc3FXeKqd79O33jO4Jag0JL+Bz/0JidgrKgKgXg== dependencies: - "@sentry/apm" "5.11.1" - "@sentry/core" "5.11.1" - "@sentry/hub" "5.11.1" + "@sentry/apm" "5.11.2" + "@sentry/core" "5.11.2" + "@sentry/hub" "5.11.2" "@sentry/types" "5.11.0" "@sentry/utils" "5.11.1" cookie "^0.3.1" @@ -1667,13 +1600,6 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.0.0.tgz#453743c5bbf9f1bed61d959baab5b06be029b2d0" integrity sha512-wBlsw+8n21e6eTd4yVv8YD/E3xq0O6nNnJIquutAsFGE7EyMKz7W6RNT6BRu1SmdgmlCZ9tb0X+j+D6HGr8pZw== -"@types/yargs@^13.0.0": - version "13.0.2" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.2.tgz#a64674fc0149574ecd90ba746e932b5a5f7b3653" - integrity sha512-lwwgizwk/bIIU+3ELORkyuOgDjCh7zuWDFqRtPPhhVgq9N1F7CvLNKg1TX4f2duwtKQ0p044Au9r1PLIXHrIzQ== - dependencies: - "@types/yargs-parser" "*" - "@types/yargs@^15.0.0": version "15.0.1" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.1.tgz#9266a9d7be68cfcc982568211085a49a277f7c96" @@ -1681,10 +1607,10 @@ dependencies: "@types/yargs-parser" "*" -"@types/yup@0.26.27": - version "0.26.27" - resolved "https://registry.yarnpkg.com/@types/yup/-/yup-0.26.27.tgz#b928b1d644ffe98766e1440131222aefd3ca8f89" - integrity sha512-Rlsq3DExOHfWur75nQUAa5I0fXA2vSrw0u0qK3SI4PAkyOWjNzZsTaK+U9/sofWm3ttwWYn+C92pSq0s4rob4w== +"@types/yup@0.26.29": + version "0.26.29" + resolved "https://registry.yarnpkg.com/@types/yup/-/yup-0.26.29.tgz#5a533ad6f74e442436698e20b1441c68a7a1c931" + integrity sha512-M81oZOgLap0b0I/BySnpLwHjOj1BFxUKV1ytG2Kqj3jmkh8F3H11PEnk658UniftpjTXdueloOL+KZYn+SMQ9w== "@types/zen-observable@^0.8.0": version "0.8.0" @@ -1837,6 +1763,11 @@ ansi-regex@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + ansi-styles@^3.1.0, ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -2331,7 +2262,7 @@ babel-eslint@~10.0.3: eslint-visitor-keys "^1.0.0" resolve "^1.12.0" -babel-jest@^25.1.0: +babel-jest@^25.1.0, babel-jest@~25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-25.1.0.tgz#206093ac380a4b78c4404a05b3277391278f80fb" integrity sha512-tz0VxUhhOE2y+g8R2oFrO/2VtVjA1lkJeavlhExuRBg3LdNJY9gwQ+Vcvqt9+cqy71MCTJhewvTB7Qtnnr9SWg== @@ -2344,19 +2275,6 @@ babel-jest@^25.1.0: chalk "^3.0.0" slash "^3.0.0" -babel-jest@~24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz#3fc327cb8467b89d14d7bc70e315104a783ccd54" - integrity sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw== - dependencies: - "@jest/transform" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/babel__core" "^7.1.0" - babel-plugin-istanbul "^5.1.0" - babel-preset-jest "^24.9.0" - chalk "^2.4.2" - slash "^2.0.0" - babel-plugin-dynamic-import-node@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" @@ -2364,16 +2282,6 @@ babel-plugin-dynamic-import-node@^2.3.0: dependencies: object.assign "^4.1.0" -babel-plugin-istanbul@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" - integrity sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - find-up "^3.0.0" - istanbul-lib-instrument "^3.3.0" - test-exclude "^5.2.3" - babel-plugin-istanbul@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765" @@ -2385,13 +2293,6 @@ babel-plugin-istanbul@^6.0.0: istanbul-lib-instrument "^4.0.0" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.9.0.tgz#4f837091eb407e01447c8843cbec546d0002d756" - integrity sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw== - dependencies: - "@types/babel__traverse" "^7.0.6" - babel-plugin-jest-hoist@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-25.1.0.tgz#fb62d7b3b53eb36c97d1bc7fec2072f9bd115981" @@ -2406,14 +2307,6 @@ babel-plugin-transform-runtime@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-preset-jest@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz#192b521e2217fb1d1f67cf73f70c336650ad3cdc" - integrity sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg== - dependencies: - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - babel-plugin-jest-hoist "^24.9.0" - babel-preset-jest@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-25.1.0.tgz#d0aebfebb2177a21cde710996fce8486d34f1d33" @@ -2568,14 +2461,14 @@ browser-resolve@^1.11.3: dependencies: resolve "1.1.7" -browserslist@^4.8.2, browserslist@^4.8.3: - version "4.8.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.3.tgz#65802fcd77177c878e015f0e3189f2c4f627ba44" - integrity sha512-iU43cMMknxG1ClEZ2MDKeonKE1CCrFVkQK2AqO2YWFmvIrx4JWrvQ4w4hQez6EpVI8rHTtqh/ruHHDHSOKxvUg== +browserslist@^4.8.3, browserslist@^4.8.5: + version "4.8.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.6.tgz#96406f3f5f0755d272e27a66f4163ca821590a7e" + integrity sha512-ZHao85gf0eZ0ESxLfCp73GG9O/VTytYDIkIiZDlURppLTI9wErSM/5yAKEq6rcUdxBLjMELmrYUJGg5sxGKMHg== dependencies: - caniuse-lite "^1.0.30001017" - electron-to-chromium "^1.3.322" - node-releases "^1.1.44" + caniuse-lite "^1.0.30001023" + electron-to-chromium "^1.3.341" + node-releases "^1.1.47" bser@^2.0.0: version "2.1.0" @@ -2654,10 +2547,10 @@ camelize@1.0.0: resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b" integrity sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs= -caniuse-lite@^1.0.30001017: - version "1.0.30001020" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001020.tgz#3f04c1737500ffda78be9beb0b5c1e2070e15926" - integrity sha512-yWIvwA68wRHKanAVS1GjN8vajAv7MBFshullKCeq/eKpK7pJBVDgFFEqvgWTkcP2+wIDeQGYFRXECjKZnLkUjA== +caniuse-lite@^1.0.30001023: + version "1.0.30001023" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001023.tgz#b82155827f3f5009077bdd2df3d8968bcbcc6fc4" + integrity sha512-C5TDMiYG11EOhVOA62W1p3UsJ2z4DsHtMBQtjzp3ZsUglcQn62WOUgW0y795c7A5uZ+GCEIvzkMatLIlAsbNTA== capture-exit@^2.0.0: version "2.0.0" @@ -2697,6 +2590,17 @@ chalk@2.3.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -2934,6 +2838,11 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +commander@^2.9.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + commander@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" @@ -3078,12 +2987,12 @@ create-error-class@^3.0.0: dependencies: capture-stack-trace "^1.0.0" -cross-env@~6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-6.0.3.tgz#4256b71e49b3a40637a0ce70768a6ef5c72ae941" - integrity sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag== +cross-env@~7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.0.tgz#5a3b2ddce51ec713ea58f2fb79ce22e65b4f5479" + integrity sha512-rV6M9ldNgmwP7bx5u6rZsTbYidzwvrwIYZnT08hSGLcQCcggofgFW+sNe7IhA1SRauPS0QuLbbX+wdNtpqE5CQ== dependencies: - cross-spawn "^7.0.0" + cross-spawn "^7.0.1" cross-spawn@^5.0.1: version "5.1.0" @@ -3105,14 +3014,14 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.0.tgz#21ef9470443262f33dba80b2705a91db959b2e03" - integrity sha512-6U/8SMK2FBNnB21oQ4+6Nsodxanw1gTkntYA2zBdkFYFu3ZDx65P2ONEXGSvob/QS6REjVHQ9zxzdOafwFdstw== +cross-spawn@^7.0.0, cross-spawn@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14" + integrity sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg== dependencies: path-key "^3.1.0" - shebang-command "^1.2.0" - which "^1.2.9" + shebang-command "^2.0.0" + which "^2.0.1" crypto-random-string@^1.0.0: version "1.0.0" @@ -3231,6 +3140,11 @@ date-fns@2.9.0: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.9.0.tgz#d0b175a5c37ed5f17b97e2272bbc1fa5aec677d2" integrity sha512-khbFLu/MlzLjEzy9Gh8oY1hNt/Dvxw3J6Rbc28cVoYWQaC1S3YI4xwkF9ZWcjDLscbZlY9hISMr66RFzZagLsA== +dateformat@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" + integrity sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI= + dayjs@^1.8.19: version "1.8.19" resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.19.tgz#5117dc390d8f8e586d53891dbff3fa308f51abfe" @@ -3525,10 +3439,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.3.322: - version "1.3.322" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.322.tgz#a6f7e1c79025c2b05838e8e344f6e89eb83213a8" - integrity sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA== +electron-to-chromium@^1.3.341: + version "1.3.344" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.344.tgz#f1397a633c35e726730c24be1084cd25c3ee8148" + integrity sha512-tvbx2Wl8WBR+ym3u492D0L6/jH+8NoQXqe46+QhbWH3voVPauGuZYeb1QAXYoOAWuiP2dbSvlBx0kQ1F3hu/Mw== emoji-regex@^7.0.1: version "7.0.3" @@ -3653,7 +3567,7 @@ escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -3675,10 +3589,10 @@ escodegen@^1.11.1: optionalDependencies: source-map "~0.6.1" -eslint-config-prettier@~6.9.0: - version "6.9.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.9.0.tgz#430d24822e82f7deb1e22a435bfa3999fae4ad64" - integrity sha512-k4E14HBtcLv0uqThaI6I/n1LEqROp8XaPu6SO9Z32u5NlGRC07Enu1Bh2KEFw4FNHbekH8yzbIU9kUGxbiGmCA== +eslint-config-prettier@~6.10.0: + version "6.10.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.0.tgz#7b15e303bf9c956875c948f6b21500e48ded6a7f" + integrity sha512-AtndijGte1rPILInUdHjvKEGbIV06NuvPrqlIEaEaWtbtvJh464mDeyGMdZEQMsGvC0ZVkiex1fSNcC4HAbRGg== dependencies: get-stdin "^6.0.0" @@ -4075,7 +3989,6 @@ extsprintf@^1.2.0: faker@Marak/faker.js#master: version "4.1.0" - uid "3b2fa4aebccee52ae1bafc15d575061fb30c3cf1" resolved "https://codeload.github.com/Marak/faker.js/tar.gz/3b2fa4aebccee52ae1bafc15d575061fb30c3cf1" fast-deep-equal@^2.0.1: @@ -4508,7 +4421,7 @@ got@^9.6.0, got@~9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.2.2" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== @@ -4563,12 +4476,12 @@ graphql-middleware@~4.0.2: dependencies: graphql-tools "^4.0.5" -graphql-shield@~7.0.7: - version "7.0.7" - resolved "https://registry.yarnpkg.com/graphql-shield/-/graphql-shield-7.0.7.tgz#6b1e029a291924482949e108569fd7f95ea18d61" - integrity sha512-T7Ds9ailm9dFQ/u7E4pmyE/nu6I7RbG4L2Bice6zqz3ajuV4AvMGB57mCg9xB5RFZ3wpVHd+s9aFLPB0FpWtjg== +graphql-shield@~7.0.9: + version "7.0.9" + resolved "https://registry.yarnpkg.com/graphql-shield/-/graphql-shield-7.0.9.tgz#8248916e9636a7e3c05719a52fd13f2d37ccaeb2" + integrity sha512-2Dfddd2hcObCSqAj64c/Aaxvs7gaoD2QU14crj7H486QjS8jIAtEPUyLVyv8SmJ1ZD7jT6wqx6wrB15Npn5Sgw== dependencies: - "@types/yup" "0.26.27" + "@types/yup" "0.26.29" object-hash "^2.0.0" yup "^0.28.0" @@ -4605,10 +4518,10 @@ graphql-upload@^8.0.2: http-errors "^1.7.2" object-path "^0.11.4" -graphql@^14.2.1, graphql@^14.5.8: - version "14.5.8" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.5.8.tgz#504f3d3114cb9a0a3f359bbbcf38d9e5bf6a6b3c" - integrity sha512-MMwmi0zlVLQKLdGiMfWkgQD7dY/TUKt4L+zgJ/aR0Howebod3aNgP5JkgvAULiR2HPVZaP2VEElqtdidHweLkg== +graphql@^14.2.1, graphql@^14.6.0: + version "14.6.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.6.0.tgz#57822297111e874ea12f5cd4419616930cd83e49" + integrity sha512-VKzfvHEKybTKjQVpTFrA5yUq2S9ihcZvfJAtsDBBCuV6wauPu1xl/f9ehgVf0FcEJJs4vz6ysb/ZMkGigQZseg== dependencies: iterall "^1.2.2" @@ -4630,6 +4543,13 @@ har-validator@~5.1.0: ajv "^6.5.5" har-schema "^2.0.0" +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" @@ -5336,10 +5256,10 @@ iso-639-3@~1.1.0: resolved "https://registry.yarnpkg.com/iso-639-3/-/iso-639-3-1.1.0.tgz#83722daf55490a707c318ae18a33ba3bab06c843" integrity sha512-l3BAnxNpyRIZA4mEzI2md/YVrxQ3hI8hiQe7TFyQknjyOh8vCzobZuAXTFHELco0FBkYRx4FkAlIqkKrHhnzgw== -iso-639-3@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/iso-639-3/-/iso-639-3-1.2.0.tgz#eee1f5e6ca2bbb33e3ecc910857c1c12e8b295be" - integrity sha512-jNvD2P4JHNckQH7pc0R0SQ4oPCpyEtgs0nTtjB+DZCUDdygz0cOAxlcnq5KgNjjsqMHbR4Sbgwz2+DflzAZvlQ== +iso-639-3@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/iso-639-3/-/iso-639-3-2.0.0.tgz#5844c6b885cbeac3571d407de5b5fdcb92f3505f" + integrity sha512-Pp+ctEs/pna6/rj05a5VR3qYxJHBZi95wp20C6Snf/WeghrkR/4G44LPJFqlbyo67XntkcUaxwrGmMeyY+F4mA== isobject@^2.0.0: version "2.1.0" @@ -5363,29 +5283,11 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" - integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== - istanbul-lib-coverage@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" integrity sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg== -istanbul-lib-instrument@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" - integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== - dependencies: - "@babel/generator" "^7.4.0" - "@babel/parser" "^7.4.3" - "@babel/template" "^7.4.0" - "@babel/traverse" "^7.4.3" - "@babel/types" "^7.4.0" - istanbul-lib-coverage "^2.0.5" - semver "^6.0.0" - istanbul-lib-instrument@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.0.tgz#53321a7970f076262fd3292c8f9b2e4ac544aae1" @@ -5537,25 +5439,6 @@ jest-get-type@^25.1.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.1.0.tgz#1cfe5fc34f148dc3a8a3b7275f6b9ce9e2e8a876" integrity sha512-yWkBnT+5tMr8ANB6V+OjmrIJufHtCAqI5ic2H40v+tRqxDmE0PGnIiTyvRWFOMtmVHYpwRqyazDbTnhpjsGvLw== -jest-haste-map@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d" - integrity sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ== - dependencies: - "@jest/types" "^24.9.0" - anymatch "^2.0.0" - fb-watchman "^2.0.0" - graceful-fs "^4.1.15" - invariant "^2.2.4" - jest-serializer "^24.9.0" - jest-util "^24.9.0" - jest-worker "^24.9.0" - micromatch "^3.1.10" - sane "^4.0.3" - walker "^1.0.7" - optionalDependencies: - fsevents "^1.2.7" - jest-haste-map@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-25.1.0.tgz#ae12163d284f19906260aa51fd405b5b2e5a4ad3" @@ -5615,20 +5498,6 @@ jest-matcher-utils@^25.1.0: jest-get-type "^25.1.0" pretty-format "^25.1.0" -jest-message-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.9.0.tgz#527f54a1e380f5e202a8d1149b0ec872f43119e3" - integrity sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw== - dependencies: - "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - "@types/stack-utils" "^1.0.1" - chalk "^2.0.1" - micromatch "^3.1.10" - slash "^2.0.0" - stack-utils "^1.0.1" - jest-message-util@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-25.1.0.tgz#702a9a5cb05c144b9aa73f06e17faa219389845e" @@ -5643,13 +5512,6 @@ jest-message-util@^25.1.0: slash "^3.0.0" stack-utils "^1.0.1" -jest-mock@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.9.0.tgz#c22835541ee379b908673ad51087a2185c13f1c6" - integrity sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w== - dependencies: - "@jest/types" "^24.9.0" - jest-mock@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-25.1.0.tgz#411d549e1b326b7350b2e97303a64715c28615fd" @@ -5662,11 +5524,6 @@ jest-pnp-resolver@^1.2.1: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== -jest-regex-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636" - integrity sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA== - jest-regex-util@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-25.1.0.tgz#efaf75914267741838e01de24da07b2192d16d87" @@ -5748,11 +5605,6 @@ jest-runtime@^25.1.0: strip-bom "^4.0.0" yargs "^15.0.0" -jest-serializer@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.9.0.tgz#e6d7d7ef96d31e8b9079a714754c5d5c58288e73" - integrity sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ== - jest-serializer@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-25.1.0.tgz#73096ba90e07d19dec4a0c1dd89c355e2f129e5d" @@ -5777,24 +5629,6 @@ jest-snapshot@^25.1.0: pretty-format "^25.1.0" semver "^7.1.1" -jest-util@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.9.0.tgz#7396814e48536d2e85a37de3e4c431d7cb140162" - integrity sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg== - dependencies: - "@jest/console" "^24.9.0" - "@jest/fake-timers" "^24.9.0" - "@jest/source-map" "^24.9.0" - "@jest/test-result" "^24.9.0" - "@jest/types" "^24.9.0" - callsites "^3.0.0" - chalk "^2.0.1" - graceful-fs "^4.1.15" - is-ci "^2.0.0" - mkdirp "^0.5.1" - slash "^2.0.0" - source-map "^0.6.0" - jest-util@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-25.1.0.tgz#7bc56f7b2abd534910e9fa252692f50624c897d9" @@ -5829,14 +5663,6 @@ jest-watcher@^25.1.0: jest-util "^25.1.0" string-length "^3.1.0" -jest-worker@^24.9.0: - version "24.9.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" - integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== - dependencies: - merge-stream "^2.0.0" - supports-color "^6.1.0" - jest-worker@^25.1.0: version "25.1.0" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-25.1.0.tgz#75d038bad6fdf58eba0d2ec1835856c497e3907a" @@ -6054,10 +5880,10 @@ leven@^3.1.0: resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== -levenary@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/levenary/-/levenary-1.1.0.tgz#fc146fe75f32dc483a0a2c64aef720f602cd6210" - integrity sha512-VHcwhO0UTpUW7rLPN2/OiWJdgA1e9BqEDALhrgCe/F+uUJnep6CoUsTzMeP8Rh0NGr9uKquXxqe7lwLZo509nQ== +levenary@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/levenary/-/levenary-1.1.1.tgz#842a9ee98d2075aa7faeedbe32679e9205f46f77" + integrity sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ== dependencies: leven "^3.1.0" @@ -6328,19 +6154,19 @@ merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== -metascraper-audio@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-audio/-/metascraper-audio-5.10.5.tgz#7f292bfb66516753672a52dec083fabdc05edfbd" - integrity sha512-S3Wrzfgf0zpl8rjYN1NBMEz0FCcpbtTV/+QxktLqSeJv/kzLfUWrYQadOMv9++EQpIc8umBgVwHeZ6+1TCBVgA== +metascraper-audio@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-audio/-/metascraper-audio-5.10.6.tgz#095892445b90d40bc54e54f69536a80e36fd9e4c" + integrity sha512-wTVtYK8Ico82caIi6HlkyGgUaBC21X/vhT2aQ4LKcg+gHoOhJcmWNd5me9VhaRJ7gTV/7yKkL5A54fBcjcn8Kg== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" -metascraper-author@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-author/-/metascraper-author-5.10.5.tgz#f863dfc577ea4069f984c74608a46f22c67fd082" - integrity sha512-5fN5LS0RwbfUE5W4Tw9+Vn598+P3zAvkXBkVAaWxy92Uoy4gQyIptjTIs1at9GIOOr2eLgN9pD2qxIso6SU/hw== +metascraper-author@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-author/-/metascraper-author-5.10.6.tgz#1ceaacec776d46629300db25e17657fe35a14a20" + integrity sha512-L2P/Fp0npaQcowbwi1vHKJbSYc99cio58/yYRm205xGfgMCRMpYOrYB+ecizXgeSSRiv8G8SXLrLXOLJ5K+SdA== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" lodash "~4.17.15" metascraper-clearbit-logo@^5.3.0: @@ -6350,26 +6176,26 @@ metascraper-clearbit-logo@^5.3.0: dependencies: got "~9.6.0" -metascraper-date@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-date/-/metascraper-date-5.10.5.tgz#07be5149b9a0502e872080f1d474b2fff34c8361" - integrity sha512-BPujzdQ61XYjpPWZLwDmz5ZuQ4Sd4sB9+WKHN7j0gaHfmiWbm7QAKQm8YIjyNwuFysOYBYPI772cEePN6zdn7Q== +metascraper-date@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-date/-/metascraper-date-5.10.6.tgz#dbdc0ddb4f4220ad1ea412b4a686900c1b138cf6" + integrity sha512-WfZw7WhkMKrrq96ZcAxS01/YjiDBpAPt5e3ggnCfLi2ZzC370w9J0INUo7gAtujaNZvgTTSEcrDD7AbTVMSYKA== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" -metascraper-description@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-description/-/metascraper-description-5.10.5.tgz#5db8a3fe05ea19e75058fb55d72aed1d50539aff" - integrity sha512-LAEO8s0CkV5B/unBZR8hNpA/b18zedQuE0gP3KusBXQYTm0z+1wsdDdulxhoLmgEJPUjYwnn5LKS0jUME7PXaA== +metascraper-description@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-description/-/metascraper-description-5.10.6.tgz#ebb4459a4e1acdc473534d1b898b7958b1769eb6" + integrity sha512-d3d6UMsNnD8Dy7gxA05iTOj5QmJrFQTw1+IrW9CiOfdNsYq0H+m265a9lRaXcyJdqkzmGnv/d52C0BtUDOrkRw== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" -metascraper-image@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-image/-/metascraper-image-5.10.5.tgz#3c4b897abacab78b7794d472fade1e195a4e7031" - integrity sha512-1YTNu3NaOGwRs0XmlQnmatEepYggwA5HyVxE05IxzNZ9oZdb26A0bwxbXSxSNNRerhcMNdePReHlqjVAk/W1TA== +metascraper-image@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-image/-/metascraper-image-5.10.6.tgz#b23ec4bfab0467342b294f3d049c7b7e9a1dd071" + integrity sha512-/+m0VaaqnBgNREun/8jcq+clc4s9Z0FAuMO/TQf/mrz9SbcmpHeTD0WpiGJgEa9zYSbuEQYHdBkxhpw+SdJPCA== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" metascraper-lang-detector@^4.10.2: version "4.10.2" @@ -6380,74 +6206,74 @@ metascraper-lang-detector@^4.10.2: franc "~4.0.0" iso-639-3 "~1.1.0" -metascraper-lang@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-lang/-/metascraper-lang-5.10.5.tgz#8d62f8a398863b8bf785f730319f0cf0a5bff3ba" - integrity sha512-DzpZSkze6p/MDIrK4g+jl/lbgTIBW8FdERCD8LnmzFLtSYDr/U3e9SB+d7wLlrWSPm0JBKkVajwzkQGx6GKqGQ== +metascraper-lang@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-lang/-/metascraper-lang-5.10.6.tgz#d4130257f6604095e9af8d796a6bde5815f6c667" + integrity sha512-JDhNbP1iSnPV7d6PklIIdBSzlwqbtvH+n810Isa5/PGuvUkJzNkTAUN+eTM1i6YcTlMp1N2gYsQG9uwfpMwFog== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" -metascraper-logo@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-logo/-/metascraper-logo-5.10.5.tgz#5bbd3981391b0984bf85e67644a94ad65b04868b" - integrity sha512-ygKvX+EIuU6eCqigW+nGFPkXri1EyHeSpu6P37Sg6jXfgo+eZL8B2ophKtG4lOnc5yZjMFKdv+PaADGhXUsUWg== +metascraper-logo@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-logo/-/metascraper-logo-5.10.6.tgz#22223ce79e4017f159b2a9ddc311d2eb636043b5" + integrity sha512-/uGW+X43T6Oj5DxWqAhANII9BdhQuM+e7O6/Vu116uLqW6cOJ/RDp5qp7ngKF41L0zCLd8Q2Xw2nduHi6tC4Uw== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" -metascraper-publisher@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-publisher/-/metascraper-publisher-5.10.5.tgz#8797e419886f084adefcb7b8a642552b2a65ea38" - integrity sha512-YTY5UlkVa/htrm8t+O8qCrl2l24PffXkwvGStYJB2vA984WsR0XfhDuDqHqUZiQoSYBx/Za9wi74k6LWPnL4yA== +metascraper-publisher@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-publisher/-/metascraper-publisher-5.10.6.tgz#95dde6ecef3c7b890ac625893ab374096bebe1f4" + integrity sha512-4jTOpbIwXBADl6z39UzQ4DZLeVoj4Q+5dcHbEgGn9MQ9878FgxiJKyrHzYvqfe9fRNd0PcaFMuuwLyhz58haoA== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" -metascraper-soundcloud@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-soundcloud/-/metascraper-soundcloud-5.10.5.tgz#741e1e1fb127192a295b77bf55a694c6ed510eec" - integrity sha512-h3hXX0msfEIozsH06Cca+X29ZLP73+nEbMPPsQWt1nQPDkM0nW+JiJ+Ai9AygqLe28X/KAo5p1T7nWNQD30xNA== +metascraper-soundcloud@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-soundcloud/-/metascraper-soundcloud-5.10.6.tgz#7aff2e17214b6939719ea726a0f5a5fe2a48c5a5" + integrity sha512-WO+B81e04Hng4/YOtq4dpNv9CrGWVemrNuZk3iIJU+B+gF3YpzdERxS4aIpM7KHcY/c8xu3xDM3LrSUWXWjM3g== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" tldts "~5.6.3" -metascraper-title@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-title/-/metascraper-title-5.10.5.tgz#719164bfc2d934ddad4fa3bae86eba750729a0bd" - integrity sha512-ukiLgQ4CNto1eA9edKB1QN0qFczJRZItBsTpmns6AEezQfDYs4M/LZyjnMCTVmZXYABliU53Ut+Yhf5g9uvX+w== +metascraper-title@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-title/-/metascraper-title-5.10.6.tgz#0fd9a9bed7a0b990663086cdab45d11cd8cd3c7d" + integrity sha512-x4P8zr0x6Gh3gt26tf2xfjikG9xNS9MC3z4N2VP+OrYNuCc7Vz6TU+DR/DLAeZphsb1flgTd3P4iUfPUcWVTEQ== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" lodash "~4.17.15" -metascraper-url@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-url/-/metascraper-url-5.10.5.tgz#b4a9951143e19f39e3bf62d93e060ece9bdba6d4" - integrity sha512-fdPPDk1/hq8vRTxwnLtUV55FpclJfhfBLxYLekTSRGqQbqSlXLNpncj2LjrvRUc0yw0oT2fEsTYzb56OQmh2Aw== +metascraper-url@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-url/-/metascraper-url-5.10.6.tgz#45f0ea173fecfe56d60b3cddd3c018f9f4fd9b92" + integrity sha512-7F6uAsI27iVXxUMwwzXH0ret81CX1jgtoGCMz+TvZkyS0z4aUs0r8QpYRYEQuXrW+JawRVik0up54F/ScslObQ== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" -metascraper-video@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-video/-/metascraper-video-5.10.5.tgz#56e5d286a83dcd90c76308c59890b272fc1c9bb9" - integrity sha512-wqTyROU5TbvNhmyhhO9G2Dko0Hiho8dzfVIUh4rF760Kf3J3O9FEXo9NTgKJJGB7Gg0sNaWZt7fvWsmWIzY7UA== +metascraper-video@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-video/-/metascraper-video-5.10.6.tgz#8425d2dfc378b20612e8ef9324989a33bc0341b3" + integrity sha512-DzWBCe/z86QFv6mN9ZDmvk32FMWv+nPDSkyMEL7RCU6VeQOFFAOjwhDglp2qBMs8Xif358bQ4H/0akLZpDUfvw== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" lodash "~4.17.15" -metascraper-youtube@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper-youtube/-/metascraper-youtube-5.10.5.tgz#ce0ff223fc50aaf9572f0e12c33d8eb752aa8201" - integrity sha512-Y0pVcQWXghdXb7rNZ/i459bCIFWpt43sc4zkvjn6+tsMYqQC9gn2ZLCy7eF5AWcZ/aReTychO6HPVGWal10oWQ== +metascraper-youtube@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper-youtube/-/metascraper-youtube-5.10.6.tgz#6cacabb1791b06ed98a7da69aa00c1c6c50a2dfe" + integrity sha512-Yl5kEFawqpSGmVSG2yTVZj7mGfRSFGQ2A4cxpqSbaPIUCGJwG9BUJkMzyUG0m6jGrg0zI5CmeZGNBAXzgKGz4g== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" get-video-id "~3.1.4" is-reachable "~4.0.0" p-locate "~4.1.0" -metascraper@^5.10.5: - version "5.10.5" - resolved "https://registry.yarnpkg.com/metascraper/-/metascraper-5.10.5.tgz#d23a6f76ea0ae3222aa88ed4e93026926bdacbdd" - integrity sha512-2ZeEbI9668ByIurvyZC8fmE6PGMgJ3kWWQYtmGUVsfK2USuoq4z1e9SpP9s4+fSRpZNyaAZFrnRUtpu9E9chiQ== +metascraper@^5.10.6: + version "5.10.6" + resolved "https://registry.yarnpkg.com/metascraper/-/metascraper-5.10.6.tgz#d1249577a768566b86bd099cc2256df45cf05181" + integrity sha512-mPEDvoyHLWb0AlTE05W43vfKGgBJ99s5AYAhB4IiRgGR9uq8j7/ktTZaS/+pyFopYrEoe71L/k4KbYgNPQRASA== dependencies: - "@metascraper/helpers" "^5.10.5" + "@metascraper/helpers" "^5.10.6" cheerio "~1.0.0-rc.3" cheerio-advanced-selectors "~2.0.1" lodash "~4.17.15" @@ -6485,6 +6311,20 @@ micromatch@^4.0.2: braces "^3.0.1" picomatch "^2.0.5" +migrate@^1.6.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/migrate/-/migrate-1.6.2.tgz#8970d596780553fe9f545bdf83806df8473f025b" + integrity sha512-XAFab+ArPTo9BHzmihKjsZ5THKRryenA+lwob0R+ax0hLDs7YzJFJT5YZE3gtntZgzdgcuFLs82EJFB/Dssr+g== + dependencies: + chalk "^1.1.3" + commander "^2.9.0" + dateformat "^2.0.0" + dotenv "^4.0.0" + inherits "^2.0.3" + minimatch "^3.0.3" + mkdirp "^0.5.1" + slug "^0.9.2" + mime-db@1.40.0: version "1.40.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" @@ -6529,7 +6369,7 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== -minimatch@^3.0.4: +minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -6780,10 +6620,10 @@ node-pre-gyp@^0.12.0: semver "^5.3.0" tar "^4" -node-releases@^1.1.44: - version "1.1.45" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.45.tgz#4cf7e9175d71b1317f15ffd68ce63bce1d53e9f2" - integrity sha512-cXvGSfhITKI8qsV116u2FTzH5EWZJfgG7d4cpqwF8I8+1tWpD6AsvvGRKq2onR0DNj1jfqsjkXZsm14JMS7Cyg== +node-releases@^1.1.47: + version "1.1.47" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.47.tgz#c59ef739a1fd7ecbd9f0b7cf5b7871e8a8b591e4" + integrity sha512-k4xjVPx5FpwBUj0Gw7uvFOTF4Ep8Hok1I6qjwL3pLfwe7Y0REQSAqOwwv9TWBCUtMHxcXfY4PgRLRozcChvTcA== dependencies: semver "^6.3.0" @@ -7603,14 +7443,6 @@ read-pkg-up@^2.0.0: find-up "^2.0.0" read-pkg "^2.0.0" -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" - read-pkg@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" @@ -8122,11 +7954,23 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shell-quote@^1.6.1: version "1.7.1" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.1.tgz#3161d969886fb14f9140c65245a5dd19b6f0b06b" @@ -8166,10 +8010,17 @@ slice-ansi@^2.1.0: astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" -slug@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slug/-/slug-2.1.0.tgz#293f8d53de7e55c15871846fd1bc36114841a8c7" - integrity sha512-Q4foEgcE7E8UB/BFg4kEzFUICoppzsbbfRjrdKiOM4Z4EFZF5tdn6amkgeaGur3kI4lMWP2BoMv7XJcKZvLg9Q== +slug@^0.9.2: + version "0.9.4" + resolved "https://registry.yarnpkg.com/slug/-/slug-0.9.4.tgz#fad5f1ef33150830c7688cd8500514576eccabd8" + integrity sha512-3YHq0TeJ4+AIFbJm+4UWSQs5A1mmeWOTQqydW3OoPmQfNKxlO96NDRTIrp+TBkmvEsEFrd+Z/LXw8OD/6OlZ5g== + dependencies: + unicode ">= 0.3.1" + +slug@~2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/slug/-/slug-2.1.1.tgz#08df390d4b4d51bafb41ac0067c0c2dd70734ef2" + integrity sha512-yNGhDdS0DR0JyxnPC84qIx/Vd01RHVY4guJeBqBNdBoOLNWnzw5zkWJvxVSmsuUb92bikdnQFnw3PfGY8uZ82g== dependencies: unicode ">= 0.3.1" @@ -8564,6 +8415,11 @@ supertest@~4.0.2: methods "^1.1.2" superagent "^3.8.3" +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + supports-color@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" @@ -8653,16 +8509,6 @@ terminal-link@^2.0.0: ansi-escapes "^4.2.1" supports-hyperlinks "^2.0.0" -test-exclude@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" - integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== - dependencies: - glob "^7.1.3" - minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^2.0.0" - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -9185,10 +9031,10 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -validator@^12.1.0: - version "12.1.0" - resolved "https://registry.yarnpkg.com/validator/-/validator-12.1.0.tgz#a3a7315d5238cbc15e46ad8d5e479aafa7119925" - integrity sha512-gIC2RBuFRi574Rb9vewGCJ7TCLxHXNx6EKthEgs+Iz0pYa9a9Te1VLG/bGLsAyGWrqR5FfR7tbFUI7FEF2LiGA== +validator@^12.2.0: + version "12.2.0" + resolved "https://registry.yarnpkg.com/validator/-/validator-12.2.0.tgz#660d47e96267033fd070096c3b1a6f2db4380a0a" + integrity sha512-jJfE/DW6tIK1Ek8nCfNFqt8Wb3nzMoAbocBF6/Icgg1ZFSBpObdnwVY2jQj6qUqzhx5jc71fpvBWyLGO7Xl+nQ== vary@^1, vary@~1.1.2: version "1.1.2" @@ -9282,6 +9128,13 @@ which@^1.2.9, which@^1.3.1: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + whoops@~4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/whoops/-/whoops-4.1.0.tgz#f42e51514c7af19a9491a44cabf2712292c6a8e1" @@ -9323,15 +9176,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" - integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - write-file-atomic@^2.0.0: version "2.4.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" diff --git a/cypress/features.md b/cypress/features.md index 3adfd8771..60980703d 100644 --- a/cypress/features.md +++ b/cypress/features.md @@ -249,10 +249,12 @@ Shows automatically related actions for existing post. ### Administration +[Cucumber Features](https://github.com/Human-Connection/Human-Connection/tree/master/cypress/integration/administration) + * Provide Admin-Interface to send Users Invite Code * Static Pages for Data Privacy Statement ... * Create, edit and delete Announcements -* Show Announcements on top of User Interface +* Pin a post to inform users ### Invitation diff --git a/cypress/integration/administration/PinPost.feature b/cypress/integration/administration/PinPost.feature new file mode 100644 index 000000000..40ff9cda5 --- /dev/null +++ b/cypress/integration/administration/PinPost.feature @@ -0,0 +1,36 @@ +Feature: Pin a post + As an admin + I want to pin a post so that it always appears at the top + In order to make sure all network users read it - e.g. notify people about security incidents, maintenance downtimes + + + Background: + Given we have the following posts in our database: + | id | title | pinned | createdAt | + | p1 | Some other post | | 2020-01-21 | + | p2 | Houston we have a problem | x | 2020-01-20 | + | p3 | Yet another post | | 2020-01-19 | + + Scenario: Pinned post always appears on the top of the newsfeed + Given I am logged in with a "user" role + Then the first post on the landing page has the title: + """ + Houston we have a problem + """ + And the post with title "Houston we have a problem" has a ribbon for pinned posts + + Scenario: Ordinary users cannot pin a post + Given I am logged in with a "user" role + When I open the content menu of post "Yet another post" + Then there is no button to pin a post + + Scenario: Admins are allowed to pin a post + Given I am logged in with a "admin" role + And I open the content menu of post "Yet another post" + When I click on 'Pin post' + Then I see a toaster with "Post pinned successfully" + And the first post on the landing page has the title: + """ + Yet another post + """ + And the post with title "Yet another post" has a ribbon for pinned posts diff --git a/cypress/integration/common/post.js b/cypress/integration/common/post.js index 4d1856bcc..39407ef4f 100644 --- a/cypress/integration/common/post.js +++ b/cypress/integration/common/post.js @@ -17,8 +17,13 @@ Then("I click on the {string} button", text => { .click(); }); +Then("I click on the reply button", () => { + cy.get(".reply-button") + .click(); +}); + Then("my comment should be successfully created", () => { - cy.get(".iziToast-message").contains("Comment Submitted"); + cy.get(".iziToast-message").contains("Comment submitted!"); }); Then("I should see my comment", () => { @@ -44,3 +49,37 @@ Then("I should see an abreviated version of my comment", () => { Then("the editor should be cleared", () => { cy.get(".ProseMirror p").should("have.class", "is-empty"); }); + +Then("it should create a mention in the CommentForm", () => { + cy.get(".ProseMirror a") + .should('have.class', 'mention') + .should('contain', '@peter-pan') +}) + +When("I open the content menu of post {string}", (title)=> { + cy.contains('.post-card', title) + .find('.content-menu .base-button') + .click() +}) + +When("I click on 'Pin post'", (string)=> { + cy.get("a.ds-menu-item-link").contains("Pin post") + .click() +}) + +Then("there is no button to pin a post", () => { + cy.get("a.ds-menu-item-link") + .should('contain', "Report Post") // sanity check + .should('not.contain', "Pin post") +}) + +And("the post with title {string} has a ribbon for pinned posts", (title) => { + cy.get("article.post-card").contains(title) + .parent() + .find("div.ribbon.ribbon--pinned") + .should("contain", "Announcement") +}) + +Then("I see a toaster with {string}", (title) => { + cy.get(".iziToast-message").should("contain", title); +}) diff --git a/cypress/integration/common/report.js b/cypress/integration/common/report.js index 1ba3e2e83..710928ff2 100644 --- a/cypress/integration/common/report.js +++ b/cypress/integration/common/report.js @@ -170,5 +170,4 @@ When("they have a post someone has reported", () => { authorId: 'annnoying-user', title, }); - }) diff --git a/cypress/integration/common/search.js b/cypress/integration/common/search.js index f6589763b..c42ec3ff0 100644 --- a/cypress/integration/common/search.js +++ b/cypress/integration/common/search.js @@ -11,15 +11,24 @@ Then("I should have one item in the select dropdown", () => { }); }); -Then("the search has no results", () => { +Then("the search should not contain posts by the annoying user", () => { cy.get(".searchable-input .ds-select-dropdown").should($li => { expect($li).to.have.length(1); - }); - cy.get(".ds-select-dropdown").should("contain", 'Nothing found'); + }) + cy.get(".ds-select-dropdown") + .should("not.have.class", '.search-post') + .should("not.contain", 'Spam') +}); + +Then("the search should contain the annoying user", () => { + cy.get(".searchable-input .ds-select-dropdown").should($li => { + expect($li).to.have.length(1); + }) + cy.get(".ds-select-dropdown .user-teaser .slug").should("contain", '@spammy-spammer'); cy.get(".searchable-input .ds-select-search") .focus() .type("{esc}"); -}); +}) Then("I should see the following posts in the select dropdown:", table => { table.hashes().forEach(({ title }) => { diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js index 9311bead8..ce03d0d14 100644 --- a/cypress/integration/common/steps.js +++ b/cypress/integration/common/steps.js @@ -31,6 +31,7 @@ const narratorParams = { const annoyingParams = { email: "spammy-spammer@example.org", + slug: 'spammy-spammer', password: "1234", ...termsAndConditionsAgreedVersion }; @@ -39,8 +40,12 @@ Given("I am logged in", () => { cy.login(loginCredentials); }); -Given("I am logged in as the muted user", () => { - cy.login({ email: annoyingParams.email, password: '1234' }); +Given("the {string} user searches for {string}", (_, postTitle) => { + cy.logout() + .login({ email: annoyingParams.email, password: '1234' }) + .get(".searchable-input .ds-select-search") + .focus() + .type(postTitle); }); Given("we have a selection of categories", () => { @@ -123,6 +128,12 @@ When("I visit the {string} page", page => { cy.openPage(page); }); +When("a blocked user visits the post page of one of my authored posts", () => { + cy.logout() + .login({ email: annoyingParams.email, password: annoyingParams.password }) + .openPage('/post/previously-created-post') +}) + Given("I am on the {string} page", page => { cy.openPage(page); }); @@ -212,6 +223,7 @@ Given("we have the following posts in our database:", table => { ...postAttributes, deleted: Boolean(postAttributes.deleted), disabled: Boolean(postAttributes.disabled), + pinned: Boolean(postAttributes.pinned), categoryIds: ['cat-456'] } cy.factory().create("Post", postAttributes); @@ -485,7 +497,7 @@ Given("I follow the user {string}", name => { }); }); -Given('"Spammy Spammer" wrote a post {string}', title => { +Given('{string} wrote a post {string}', (_, title) => { cy.createCategories("cat21") .factory() .create("Post", { @@ -500,7 +512,7 @@ Then("the list of posts of this user is empty", () => { cy.get(".main-container").find(".ds-space.hc-empty"); }); -Then("nobody is following the user profile anymore", () => { +Then("I get removed from his follower collection", () => { cy.get(".ds-card-content").not(".post-link"); cy.get(".main-container").contains( ".ds-card-content", @@ -532,6 +544,20 @@ When("I mute the user {string}", name => { }); }); +When("I block the user {string}", name => { + cy.neode() + .first("User", { + name + }) + .then(blockedUser => { + cy.neode() + .first("User", { + name: narratorParams.name + }) + .relateTo(blockedUser, "blocked"); + }); +}); + When("I log in with:", table => { const [firstRow] = table.hashes(); const { @@ -550,3 +576,11 @@ Then("I see only one post with the title {string}", title => { .should("have.length", 1); cy.get(".main-container").contains(".post-link", title); }); + +Then("they should not see the comment from", () => { + cy.get(".ds-card-footer").children().should('not.have.class', 'comment-form') +}) + +Then("they should see a text explaining commenting is not possible", () => { + cy.get('.ds-placeholder').should('contain', "Commenting is not possible at this time on this post.") +}) \ No newline at end of file diff --git a/cypress/integration/moderation/ReportContent.feature b/cypress/integration/moderation/ReportContent.feature index c87d41230..105bad5e6 100644 --- a/cypress/integration/moderation/ReportContent.feature +++ b/cypress/integration/moderation/ReportContent.feature @@ -9,10 +9,10 @@ Feature: Report and Moderate Background: Given we have the following user accounts: - | id | name | - | u67 | David Irving | + | id | name | + | u67 | David Irving | | annoying-user | I'm gonna mute Moderators and Admins HA HA HA | - + Given we have the following posts in our database: | authorId | id | title | content | | u67 | p1 | The Truth about the Holocaust | It never existed! | diff --git a/cypress/integration/post/Comment.feature b/cypress/integration/post/Comment.feature index 50284d6f5..66cf7a6d7 100644 --- a/cypress/integration/post/Comment.feature +++ b/cypress/integration/post/Comment.feature @@ -4,10 +4,10 @@ Feature: Post Comment To be able to express my thoughts and emotions about these, discuss, and add give further information. Background: - Given we have the following posts in our database: - | id | title | slug | - | bWBjpkTKZp | 101 Essays that will change the way you think | 101-essays | - And I have a user account + Given I have a user account + And we have the following posts in our database: + | id | title | slug | authorId | commentContent | + | bWBjpkTKZp | 101 Essays that will change the way you think | 101-essays | id-of-peter-pan | @peter-pan reply to me | And I am logged in Scenario: Comment creation @@ -36,3 +36,8 @@ Feature: Post Comment Then my comment should be successfully created And I should see an abreviated version of my comment And the editor should be cleared + + Scenario: Direct reply to Comment + Given I visit "post/bWBjpkTKZp/101-essays" + And I click on the reply button + Then it should create a mention in the CommentForm diff --git a/cypress/integration/user_profile/BlockUser.feature b/cypress/integration/user_profile/BlockUser.feature new file mode 100644 index 000000000..43efe7807 --- /dev/null +++ b/cypress/integration/user_profile/BlockUser.feature @@ -0,0 +1,46 @@ +Feature: Block a User + As a user + I'd like to have a button to block another user + To prevent him from seeing and interacting with my contributions + + Background: + Given I have a user account + And there is an annoying user called "Harassing User" + And I am logged in + + Scenario: Block a user + Given I am on the profile page of the annoying user + When I click on "Block user" from the content menu in the user info box + And I navigate to my "Blocked users" settings page + Then I can see the following table: + | Avatar | Name | + | | Harassing User | + + Scenario: Blocked user cannot interact with my contributions + Given I block the user "Harassing User" + And I previously created a post + And a blocked user visits the post page of one of my authored posts + Then they should not see the comment from + And they should see a text explaining commenting is not possible + + Scenario: Block a previously followed user + Given I follow the user "Harassing User" + When I visit the profile page of the annoying user + And I click on "Block user" from the content menu in the user info box + And I get removed from his follower collection + + Scenario: Posts of blocked users are not filtered from search results + Given "Harassing User" wrote a post "You can still see my posts" + And I block the user "Harassing User" + When I search for "see" + Then I should see the following posts in the select dropdown: + | title | + | You can still see my posts | + + Scenario: Blocked users can still see my posts + Given I previously created a post + And I block the user "Harassing User" + And the "blocked" user searches for "previously created" + Then I should see the following posts in the select dropdown: + | title | + | previously created post | diff --git a/cypress/integration/user_profile/mute-users/Mute.feature b/cypress/integration/user_profile/mute-users/Mute.feature index b52faeeaa..03ac4370b 100644 --- a/cypress/integration/user_profile/mute-users/Mute.feature +++ b/cypress/integration/user_profile/mute-users/Mute.feature @@ -1,8 +1,7 @@ Feature: Mute a User As a user I'd like to have a button to mute another user - To prevent him from seeing and interacting with my contributions and also to avoid seeing his/her posts - + To prevent him from seeing and interacting with my contributions Background: Given I have a user account And there is an annoying user called "Spammy Spammer" @@ -22,9 +21,9 @@ Feature: Mute a User When I visit the profile page of the annoying user And I click on "Mute user" from the content menu in the user info box Then the list of posts of this user is empty - And nobody is following the user profile anymore + And I get removed from his follower collection - Scenario: Posts of muted users are filtered from search results + Scenario: Posts of muted users are filtered from search results, users are not Given we have the following posts in our database: | id | title | content | | im-not-muted | Post that should be seen | cause I'm not muted | @@ -36,18 +35,17 @@ Feature: Mute a User When I mute the user "Spammy Spammer" And I refresh the page And I search for "Spam" - Then the search has no results + Then the search should not contain posts by the annoying user + But the search should contain the annoying user But I search for "not muted" Then I should see the following posts in the select dropdown: | title | | Post that should be seen | - + Scenario: Muted users can still see my posts Given I previously created a post And I mute the user "Spammy Spammer" - Given I log out - And I am logged in as the muted user - When I search for "previously created" + And the "muted" user searches for "previously created" Then I should see the following posts in the select dropdown: | title | | previously created post | diff --git a/cypress/support/commands.js b/cypress/support/commands.js index c9a2e213a..16ac43a19 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -15,7 +15,6 @@ /* globals Cypress cy */ import "cypress-file-upload"; import helpers from "./helpers"; -import users from "../fixtures/users.json"; import { GraphQLClient, request } from 'graphql-request' import { gql } from '../../backend/src/helpers/jest' import config from '../../backend/src/config' diff --git a/cypress/support/factories.js b/cypress/support/factories.js index e0b6210d8..1b76a1a01 100644 --- a/cypress/support/factories.js +++ b/cypress/support/factories.js @@ -1,5 +1,5 @@ -import Factory from '../../backend/src/seed/factories' -import { getDriver, getNeode } from '../../backend/src/bootstrap/neo4j' +import Factory from '../../backend/src/factories' +import { getDriver, getNeode } from '../../backend/src/db/neo4j' const neo4jConfigs = { uri: Cypress.env('NEO4J_URI'), diff --git a/features/support/steps.js b/features/support/steps.js index 923dc9766..71f493834 100644 --- a/features/support/steps.js +++ b/features/support/steps.js @@ -1,6 +1,6 @@ // features/support/steps.js import { Given, When, Then, After, AfterAll } from 'cucumber' -import Factory from '../../backend/src/seed/factories' +import Factory from '../../backend/src/factories' import dotenv from 'dotenv' import expect from 'expect' diff --git a/neo4j/db_manipulation/add_image_aspect_ratio.sh b/neo4j/.archived/add_image_aspect_ratio.sh old mode 100755 new mode 100644 similarity index 100% rename from neo4j/db_manipulation/add_image_aspect_ratio.sh rename to neo4j/.archived/add_image_aspect_ratio.sh diff --git a/neo4j/db_manipulation/add_notification_from_report_to_filing_user.sh b/neo4j/.archived/add_notification_from_report_to_filing_user.sh similarity index 100% rename from neo4j/db_manipulation/add_notification_from_report_to_filing_user.sh rename to neo4j/.archived/add_notification_from_report_to_filing_user.sh diff --git a/neo4j/db_manipulation/change_disabled_relationship_to_report_node_first_solution.sh b/neo4j/.archived/change_disabled_relationship_to_report_node.sh old mode 100755 new mode 100644 similarity index 99% rename from neo4j/db_manipulation/change_disabled_relationship_to_report_node_first_solution.sh rename to neo4j/.archived/change_disabled_relationship_to_report_node.sh index 2f44b8e59..3227ec63a --- a/neo4j/db_manipulation/change_disabled_relationship_to_report_node_first_solution.sh +++ b/neo4j/.archived/change_disabled_relationship_to_report_node.sh @@ -23,7 +23,6 @@ DELETE disabled CREATE (moderator)-[review:REVIEWED]->(report:Report)-[:BELONGS_TO]->(disabledResource) SET review.createdAt = toString(datetime()), review.updatedAt = review.createdAt, review.disable = true SET report.id = randomUUID(), report.createdAt = toString(datetime()), report.updatedAt = report.createdAt, report.rule = 'latestReviewUpdatedAtRules', report.closed = false - // if disabledResource has no filed report, then create a moderators default filed report WITH moderator, disabledResource, report OPTIONAL MATCH (disabledResourceReporter:User)-[existingFiledReport:FILED]->(disabledResource) @@ -36,7 +35,6 @@ FOREACH(disabledResource IN CASE WHEN existingFiledReport IS NOT NULL THEN [1] E SET moveModeratorReport = existingFiledReport DELETE existingFiledReport ) - RETURN disabledResource {.id}; " | cypher-shell @@ -49,7 +47,5 @@ ON CREATE SET report.id = randomUUID(), report.createdAt = toString(datetime()), CREATE (reporter)-[filed:FILED]->(report) SET report = oldReport DELETE oldReport - RETURN notDisabledResource {.id}; " | cypher-shell - diff --git a/neo4j/Dockerfile b/neo4j/Dockerfile index 22dabe114..b068b22b2 100644 --- a/neo4j/Dockerfile +++ b/neo4j/Dockerfile @@ -4,7 +4,5 @@ LABEL Description="Neo4J database of the Social Network Human-Connection.org wit ARG BUILD_COMMIT ENV BUILD_COMMIT=$BUILD_COMMIT -COPY db_setup.sh /usr/local/bin/db_setup - RUN apt-get update && apt-get -y install wget htop RUN wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.5.0.4/apoc-3.5.0.4-all.jar -P plugins/ diff --git a/neo4j/README.md b/neo4j/README.md index fe8825734..a4242b512 100644 --- a/neo4j/README.md +++ b/neo4j/README.md @@ -18,15 +18,6 @@ docker-compose up You can access Neo4J through [http://localhost:7474/](http://localhost:7474/) for an interactive cypher shell and a visualization of the graph. -### Database Indices and Constraints - -Database indices and constraints need to be created when the database is -running. So start the container with the command above and run: - -```bash -docker-compose exec neo4j db_setup -``` - ## Installation without Docker @@ -45,20 +36,6 @@ Then make sure to allow Apoc procedures by adding the following line to your Neo ``` dbms.security.procedures.unrestricted=apoc.* ``` -### Database Indices and Constraints - -If you have `cypher-shell` available with your local installation of neo4j you -can run: - -```bash -# in folder neo4j/ -$ cp .env.template .env -$ ./db_setup.sh -``` - -Otherwise, if you don't have `cypher-shell` available, copy the cypher -statements [from the `db_setup.sh` script](https://github.com/Human-Connection/Human-Connection/blob/master/neo4j/db_setup.sh) and paste the scripts into your -[database browser frontend](http://localhost:7474). ### Alternatives diff --git a/neo4j/db_manipulation/change_disabled_relationship_to_report_node.sh b/neo4j/db_manipulation/change_disabled_relationship_to_report_node.sh deleted file mode 100755 index e611382f0..000000000 --- a/neo4j/db_manipulation/change_disabled_relationship_to_report_node.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -ENV_FILE=$(dirname "$0")/.env -[[ -f "$ENV_FILE" ]] && source "$ENV_FILE" - -if [ -z "$NEO4J_USERNAME" ] || [ -z "$NEO4J_PASSWORD" ]; then - echo "Please set NEO4J_USERNAME and NEO4J_PASSWORD environment variables." - echo "Database manipulation is not possible without connecting to the database." - echo "E.g. you could \`cp .env.template .env\` unless you run the script in a docker container" -fi - -until echo 'RETURN "Connection successful" as info;' | cypher-shell -do - echo "Connecting to neo4j failed, trying again..." - sleep 1 -done - -echo " - :begin - MATCH(user)-[reported:REPORTED]->(resource) - WITH reported, resource, COLLECT(user) as users - MERGE(report:Report)-[:BELONGS_TO]->(resource) - SET report.id = randomUUID(), report.createdAt = toString(datetime()), report.updatedAt = report.createdAt, report.rule = 'latestReviewUpdatedAtRules', report.closed = false - WITH report, users, reported - UNWIND users as user - MERGE (user)-[filed:FILED]->(report) - SET filed = reported - DELETE reported; - - MATCH(moderator)-[disabled:DISABLED]->(resource) - MATCH(report:Report)-[:BELONGS_TO]->(resource) - WITH disabled, resource, COLLECT(moderator) as moderators, report - DELETE disabled - WITH report, moderators, disabled - UNWIND moderators as moderator - MERGE (moderator)-[review:REVIEWED {disable: true}]->(report) - SET review.createdAt = toString(datetime()), review.updatedAt = review.createdAt, review.disable = true; - - MATCH(moderator)-[disabled:DISABLED]->(resource) - WITH disabled, resource, COLLECT(moderator) as moderators - MERGE(report:Report)-[:BELONGS_TO]->(resource) - SET report.id = randomUUID(), report.createdAt = toString(datetime()), report.updatedAt = report.createdAt, report.rule = 'latestReviewUpdatedAtRules', report.closed = false - DELETE disabled - WITH report, moderators, disabled - UNWIND moderators as moderator - MERGE(moderator)-[filed:FILED]->(report) - SET filed.createdAt = toString(datetime()), filed.reasonCategory = 'other', filed.reasonDescription = 'Old DISABLED relations didn\'t enforce mandatory reporting !!! Created automatically to ensure database consistency! Creation date is when the database manipulation happened.' - MERGE (moderator)-[review:REVIEWED {disable: true}]->(report) - SET review.createdAt = toString(datetime()), review.updatedAt = review.createdAt, review.disable = true; - :commit -" | cypher-shell \ No newline at end of file diff --git a/neo4j/db_setup.sh b/neo4j/db_setup.sh deleted file mode 100755 index b7562d0c9..000000000 --- a/neo4j/db_setup.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -ENV_FILE=$(dirname "$0")/.env -[[ -f "$ENV_FILE" ]] && source "$ENV_FILE" -if [ -z "$NEO4J_USERNAME" ] || [ -z "$NEO4J_PASSWORD" ]; then - echo "Please set NEO4J_USERNAME and NEO4J_PASSWORD environment variables." - echo "Setting up database constraints and indexes will probably fail because of authentication errors." - echo "E.g. you could \`cp .env.template .env\` unless you run the script in a docker container" -fi - -until echo 'RETURN "Connection successful" as info;' | cypher-shell -do - echo "Connecting to neo4j failed, trying again..." - sleep 1 -done - -echo ' -RETURN "Here is a list of indexes and constraints BEFORE THE SETUP:" as info; -CALL db.indexes(); -' | cypher-shell - -echo ' -CALL db.index.fulltext.createNodeIndex("post_fulltext_search",["Post"],["title", "content"]); -CALL db.index.fulltext.createNodeIndex("user_fulltext_search",["User"],["name", "slug"]); -CREATE CONSTRAINT ON (p:Post) ASSERT p.id IS UNIQUE; -CREATE CONSTRAINT ON (c:Comment) ASSERT c.id IS UNIQUE; -CREATE CONSTRAINT ON (c:Category) ASSERT c.id IS UNIQUE; -CREATE CONSTRAINT ON (u:User) ASSERT u.id IS UNIQUE; -CREATE CONSTRAINT ON (t:Tag) ASSERT t.id IS UNIQUE; - -CREATE CONSTRAINT ON (p:Post) ASSERT p.slug IS UNIQUE; -CREATE CONSTRAINT ON (c:Category) ASSERT c.slug IS UNIQUE; -CREATE CONSTRAINT ON (u:User) ASSERT u.slug IS UNIQUE; - -CREATE CONSTRAINT ON (e:EmailAddress) ASSERT e.email IS UNIQUE; -' | cypher-shell - -echo ' -RETURN "Setting up all the indexes and constraints seems to have been successful. Here is a list AFTER THE SETUP:" as info; -CALL db.indexes(); -' | cypher-shell diff --git a/package.json b/package.json index b162d2c2d..43756b67c 100644 --- a/package.json +++ b/package.json @@ -25,27 +25,27 @@ "release": "standard-version" }, "devDependencies": { - "@babel/core": "^7.8.3", - "@babel/preset-env": "^7.8.3", + "@babel/core": "^7.8.4", + "@babel/preset-env": "^7.8.4", "@babel/register": "^7.8.3", "auto-changelog": "^1.16.2", "bcryptjs": "^2.4.3", - "codecov": "^3.6.1", + "codecov": "^3.6.2", "cross-env": "^6.0.3", "cucumber": "^6.0.5", - "cypress": "^3.8.2", + "cypress": "^3.8.3", "cypress-cucumber-preprocessor": "^2.0.1", "cypress-file-upload": "^3.5.3", "cypress-plugin-retries": "^1.5.2", "date-fns": "^2.9.0", "dotenv": "^8.2.0", - "expect": "^24.9.0", + "expect": "^25.1.0", "faker": "Marak/faker.js#master", "graphql-request": "^1.8.2", "neo4j-driver": "^4.0.1", "neode": "^0.3.7", "npm-run-all": "^4.1.5", - "slug": "^2.1.0", + "slug": "^2.1.1", "standard-version": "^7.1.0" }, "resolutions": { diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 146d342c9..f52e053f1 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash sed -i "s//${TRAVIS_COMMIT}/g" $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml sed -i "s//${TRAVIS_COMMIT}/g" $TRAVIS_BUILD_DIR/scripts/patches/patch-configmap.yaml -kubectl --namespace=human-connection patch configmap configmap -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-configmap.yaml)" -kubectl --namespace=human-connection patch deployment backend -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" -kubectl --namespace=human-connection patch deployment web -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" +kubectl --namespace=human-connection patch configmap develop-configmap -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-configmap.yaml)" +kubectl --namespace=human-connection patch deployment develop-backend -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" +kubectl --namespace=human-connection patch deployment develop-webapp -p "$(cat $TRAVIS_BUILD_DIR/scripts/patches/patch-deployment.yaml)" diff --git a/webapp/assets/_new/icons/svgs/level-down.svg b/webapp/assets/_new/icons/svgs/level-down.svg new file mode 100755 index 000000000..e6455391e --- /dev/null +++ b/webapp/assets/_new/icons/svgs/level-down.svg @@ -0,0 +1,5 @@ + + +level-down + + diff --git a/webapp/assets/_new/icons/svgs/underline.svg b/webapp/assets/_new/icons/svgs/underline.svg new file mode 100755 index 000000000..f4c6e698c --- /dev/null +++ b/webapp/assets/_new/icons/svgs/underline.svg @@ -0,0 +1,5 @@ + + +underline + + diff --git a/webapp/components/AvatarMenu/AvatarMenu.vue b/webapp/components/AvatarMenu/AvatarMenu.vue index 97b937a88..f65c6f6cf 100644 --- a/webapp/components/AvatarMenu/AvatarMenu.vue +++ b/webapp/components/AvatarMenu/AvatarMenu.vue @@ -11,7 +11,7 @@ " @click.prevent="toggleMenu" > - + @@ -127,6 +127,10 @@ export default { display: flex; align-items: center; padding-left: $space-xx-small; + + > .user-avatar { + margin-right: $space-xx-small; + } } .avatar-menu-popover { padding-top: $space-x-small; diff --git a/webapp/components/Comment/Comment.spec.js b/webapp/components/Comment/Comment.spec.js index b307700d9..1ba238bf5 100644 --- a/webapp/components/Comment/Comment.spec.js +++ b/webapp/components/Comment/Comment.spec.js @@ -1,17 +1,15 @@ -import { config, shallowMount } from '@vue/test-utils' +import { config, mount } from '@vue/test-utils' import Comment from './Comment.vue' import Vuex from 'vuex' const localVue = global.localVue +localVue.directive('scrollTo', jest.fn()) config.stubs['client-only'] = '' +config.stubs['nuxt-link'] = '' describe('Comment.vue', () => { - let propsData - let mocks - let getters - let wrapper - let Wrapper + let propsData, mocks, stubs, getters, wrapper, Wrapper beforeEach(() => { propsData = {} @@ -39,6 +37,9 @@ describe('Comment.vue', () => { }), }, } + stubs = { + ContentViewer: true, + } getters = { 'auth/user': () => { return {} @@ -47,18 +48,19 @@ describe('Comment.vue', () => { } }) - describe('shallowMount', () => { + describe('mount', () => { beforeEach(jest.useFakeTimers) Wrapper = () => { const store = new Vuex.Store({ getters, }) - return shallowMount(Comment, { + return mount(Comment, { store, propsData, mocks, localVue, + stubs, }) } @@ -68,6 +70,7 @@ describe('Comment.vue', () => { id: '2', contentExcerpt: 'Hello I am a comment content', content: 'Hello I am comment content', + author: { id: 'commentAuthorId', slug: 'ogerly' }, } }) @@ -199,6 +202,24 @@ describe('Comment.vue', () => { }) }) }) + + describe('click reply button', () => { + beforeEach(async () => { + wrapper = Wrapper() + await wrapper.find('.reply-button').trigger('click') + }) + + it('emits "reply"', () => { + expect(wrapper.emitted('reply')).toEqual([ + [ + { + id: 'commentAuthorId', + slug: 'ogerly', + }, + ], + ]) + }) + }) }) }) }) diff --git a/webapp/components/Comment/Comment.vue b/webapp/components/Comment/Comment.vue index b413e03f6..5c47a3656 100644 --- a/webapp/components/Comment/Comment.vue +++ b/webapp/components/Comment/Comment.vue @@ -33,7 +33,7 @@
-
+ @@ -64,9 +73,10 @@ import { COMMENT_MAX_UNTRUNCATED_LENGTH, COMMENT_TRUNCATE_TO_LENGTH } from '~/co import UserTeaser from '~/components/UserTeaser/UserTeaser' import ContentMenu from '~/components/ContentMenu/ContentMenu' import ContentViewer from '~/components/Editor/ContentViewer' -import HcCommentForm from '~/components/CommentForm/CommentForm' +import CommentForm from '~/components/CommentForm/CommentForm' import CommentMutations from '~/graphql/CommentMutations' import scrollToAnchor from '~/mixins/scrollToAnchor.js' +import BaseButton from '~/components/_new/generic/BaseButton/BaseButton' export default { mixins: [scrollToAnchor], @@ -85,7 +95,8 @@ export default { UserTeaser, ContentMenu, ContentViewer, - HcCommentForm, + CommentForm, + BaseButton, }, props: { routeHash: { type: String, default: () => '' }, @@ -105,7 +116,6 @@ export default { if (this.isLongComment && this.isCollapsed) { return this.$filters.truncate(this.comment.content, COMMENT_TRUNCATE_TO_LENGTH) } - return this.comment.content }, displaysComment() { @@ -141,6 +151,10 @@ export default { }, }, methods: { + reply() { + const message = { slug: this.comment.author.slug, id: this.comment.author.id } + this.$emit('reply', message) + }, checkAnchor(anchor) { return `#${this.anchor}` === anchor }, @@ -193,6 +207,14 @@ export default { float: right; } +.reply-button { + float: right; + top: 0px; +} +.reply-button:after { + clear: both; +} + @keyframes highlight { 0% { border: 1px solid $color-primary; diff --git a/webapp/components/CommentForm/CommentForm.vue b/webapp/components/CommentForm/CommentForm.vue index 063a3d599..9e4158876 100644 --- a/webapp/components/CommentForm/CommentForm.vue +++ b/webapp/components/CommentForm/CommentForm.vue @@ -51,6 +51,9 @@ export default { } }, methods: { + reply(message) { + this.$refs.editor.insertReply(message) + }, updateEditorContent(value) { const sanitizedContent = this.$filters.removeHtml(value, false) if (!this.update) { @@ -133,8 +136,8 @@ export default { query() { return minimisedUserQuery() }, - result(result) { - this.users = result.data.User + update({ User }) { + this.users = User }, }, }, diff --git a/webapp/components/CommentList/CommentList.spec.js b/webapp/components/CommentList/CommentList.spec.js index 064b8f136..ac7b88c0e 100644 --- a/webapp/components/CommentList/CommentList.spec.js +++ b/webapp/components/CommentList/CommentList.spec.js @@ -1,10 +1,13 @@ import { config, mount } from '@vue/test-utils' import CommentList from './CommentList' +import Comment from '~/components/Comment/Comment' import Vuex from 'vuex' +import Vue from 'vue' const localVue = global.localVue localVue.filter('truncate', string => string) +localVue.directive('scrollTo', jest.fn()) config.stubs['v-popover'] = '' config.stubs['nuxt-link'] = '' @@ -97,5 +100,27 @@ describe('CommentList.vue', () => { }) }) }) + + describe('Comment', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('Comment emitted reply()', () => { + wrapper.find(Comment).vm.$emit('reply', { + id: 'commentAuthorId', + slug: 'ogerly', + }) + Vue.nextTick() + expect(wrapper.emitted('reply')).toEqual([ + [ + { + id: 'commentAuthorId', + slug: 'ogerly', + }, + ], + ]) + }) + }) }) }) diff --git a/webapp/components/CommentList/CommentList.vue b/webapp/components/CommentList/CommentList.vue index 96edf9bc3..ef6e3b096 100644 --- a/webapp/components/CommentList/CommentList.vue +++ b/webapp/components/CommentList/CommentList.vue @@ -12,9 +12,11 @@ :comment="comment" :post="post" :routeHash="routeHash" + class="comment-tag" @deleteComment="updateCommentList" @updateComment="updateCommentList" @toggleNewCommentForm="toggleNewCommentForm" + @reply="reply" /> @@ -35,6 +37,9 @@ export default { post: { type: Object, default: () => {} }, }, methods: { + reply(message) { + this.$emit('reply', message) + }, checkAnchor(anchor) { return anchor === '#comments' }, diff --git a/webapp/components/ContentMenu/ContentMenu.vue b/webapp/components/ContentMenu/ContentMenu.vue index a22bc3267..5ce73c461 100644 --- a/webapp/components/ContentMenu/ContentMenu.vue +++ b/webapp/components/ContentMenu/ContentMenu.vue @@ -161,7 +161,7 @@ export default { callback: () => { this.$emit('unmute', this.resource) }, - icon: 'user-plus', + icon: 'eye', }) } else { routes.push({ @@ -169,6 +169,23 @@ export default { callback: () => { this.$emit('mute', this.resource) }, + icon: 'eye-slash', + }) + } + if (this.resource.blocked) { + routes.push({ + label: this.$t(`settings.blocked-users.unblock`), + callback: () => { + this.$emit('unblock', this.resource) + }, + icon: 'user-plus', + }) + } else { + routes.push({ + label: this.$t(`settings.blocked-users.block`), + callback: () => { + this.$emit('block', this.resource) + }, icon: 'user-times', }) } diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index 235437c32..44ed0d15e 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -141,7 +141,6 @@ export default { methods: { openSuggestionList({ items, query, range, command, virtualNode }, suggestionType) { this.suggestionType = suggestionType - this.query = this.sanitizeQuery(query) this.filteredItems = items this.suggestionRange = range @@ -237,6 +236,9 @@ export default { const content = e.getHTML() this.$emit('input', content) }, + insertReply(message) { + this.editor.commands.mention({ id: message.id, label: message.slug }) + }, toggleLinkInput(attrs, element) { if (!this.isLinkInputActive && attrs && element) { this.$refs.linkInput.linkUrl = attrs.href diff --git a/webapp/components/Editor/MenuBar.vue b/webapp/components/Editor/MenuBar.vue index 4e43050e9..d1e084f2d 100644 --- a/webapp/components/Editor/MenuBar.vue +++ b/webapp/components/Editor/MenuBar.vue @@ -5,6 +5,12 @@ + +
- + {{ $t('profile.userAnonym') }}
.user-avatar { flex-shrink: 0; diff --git a/webapp/components/_new/generic/UserAvatar/UserAvatar.vue b/webapp/components/_new/generic/UserAvatar/UserAvatar.vue index c29f8e402..b9007b919 100644 --- a/webapp/components/_new/generic/UserAvatar/UserAvatar.vue +++ b/webapp/components/_new/generic/UserAvatar/UserAvatar.vue @@ -6,7 +6,7 @@ v-else :src="user.avatar | proxyApiUrl" class="image" - @error="event.target.style.display = 'none'" + @error="$event.target.style.display = 'none'" /> @@ -75,7 +75,6 @@ export default { > .image { position: relative; - z-index: 5; width: 100%; object-fit: cover; object-position: center; diff --git a/webapp/components/generic/SearchableInput/SearchableInput.vue b/webapp/components/generic/SearchableInput/SearchableInput.vue index 448c154e0..3260ff082 100644 --- a/webapp/components/generic/SearchableInput/SearchableInput.vue +++ b/webapp/components/generic/SearchableInput/SearchableInput.vue @@ -71,7 +71,7 @@ export default { }, computed: { emptyText() { - return this.isActive && !this.pending ? this.$t('search.failed') : this.$t('search.hint') + return this.isActive && !this.loading ? this.$t('search.failed') : this.$t('search.hint') }, isActive() { return !isEmpty(this.previousSearchTerm) @@ -104,7 +104,7 @@ export default { */ onEnter(event) { clearTimeout(this.searchProcess) - if (!this.pending) { + if (!this.loading) { this.previousSearchTerm = this.unprocessedSearchInput this.$emit('query', this.unprocessedSearchInput) } diff --git a/webapp/graphql/Fragments.js b/webapp/graphql/Fragments.js index 1edcd364c..cb7af1624 100644 --- a/webapp/graphql/Fragments.js +++ b/webapp/graphql/Fragments.js @@ -52,6 +52,7 @@ export const postFragment = gql` } pinnedAt imageAspectRatio + pinned } ` diff --git a/webapp/graphql/PostQuery.js b/webapp/graphql/PostQuery.js index c59c894a5..5ddac9c1f 100644 --- a/webapp/graphql/PostQuery.js +++ b/webapp/graphql/PostQuery.js @@ -29,6 +29,7 @@ export default i18n => { ...user ...userCounts ...locationAndBadges + blocked } comments(orderBy: createdAt_asc) { ...comment diff --git a/webapp/graphql/User.js b/webapp/graphql/User.js index 6bf4861cb..2aec0aca2 100644 --- a/webapp/graphql/User.js +++ b/webapp/graphql/User.js @@ -24,6 +24,7 @@ export default i18n => { createdAt followedByCurrentUser isMuted + blocked following(first: 7) { ...user ...userCounts diff --git a/webapp/graphql/settings/BlockedUsers.js b/webapp/graphql/settings/BlockedUsers.js new file mode 100644 index 000000000..94f2121b1 --- /dev/null +++ b/webapp/graphql/settings/BlockedUsers.js @@ -0,0 +1,43 @@ +import gql from 'graphql-tag' + +export const blockedUsers = () => { + return gql` + { + blockedUsers { + id + name + slug + avatar + about + disabled + deleted + } + } + ` +} + +export const blockUser = () => { + return gql` + mutation($id: ID!) { + blockUser(id: $id) { + id + name + blocked + followedByCurrentUser + } + } + ` +} + +export const unblockUser = () => { + return gql` + mutation($id: ID!) { + unblockUser(id: $id) { + id + name + blocked + followedByCurrentUser + } + } + ` +} diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 2f8db037a..db7b1efd5 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -70,6 +70,11 @@ "passwordStrength4": "Sehr sicheres Passwort" } }, + "privacy": { + "name": "Privatsphäre", + "make-shouts-public": "Teile von mir empfohlene Artikel öffentlich auf meinem Profil", + "success-update": "Privatsphäre-Einstellungen gespeichert" + }, "invites": { "name": "Einladungen" }, @@ -143,27 +148,44 @@ "successDelete": "Social-Media gelöscht. Profil aktualisiert!" }, "muted-users": { - "name": "Stummgeschaltete Benutzer", - "explanation": { - "intro": "Wenn ein anderer Benutzer von dir stummgeschaltet wurde, dann passiert folgendes:", - "your-perspective": "In deiner Beitragsübersicht tauchen keine Beiträge der stummgeschalteten Person mehr auf.", - "search": "Die Beiträge von stummgeschalteten Personen verschwinden aus deinen Suchergebnissen." - }, - "columns": { - "name": "Name", - "slug": "Alias", - "unmute": "Entsperren" - }, - "empty": "Bislang hast du niemanden stummgeschaltet.", - "how-to": "Du kannst andere Benutzer auf deren Profilseite über das Inhaltsmenü stummschalten.", - "mute": "Stumm schalten", - "unmute": "Stummschaltung aufheben", - "unmuted": "{name} ist nicht mehr stummgeschaltet" + "name": "Stummgeschaltete Benutzer", + "explanation": { + "intro": "Wenn ein anderer Benutzer von dir stummgeschaltet wurde, dann passiert folgendes:", + "your-perspective": "In deiner Beitragsübersicht tauchen keine Beiträge der stummgeschalteten Person mehr auf.", + "search": "Die Beiträge von stummgeschalteten Personen verschwinden aus deinen Suchergebnissen." + }, + "columns": { + "name": "Name", + "slug": "Alias", + "unmute": "Entsperren" + }, + "empty": "Bislang hast du niemanden stummgeschaltet.", + "how-to": "Du kannst andere Benutzer auf deren Profilseite über das Inhaltsmenü stummschalten.", + "mute": "Stumm schalten", + "unmute": "Stummschaltung aufheben", + "unmuted": "{name} ist nicht mehr stummgeschaltet" }, - "privacy": { - "name": "Privatsphäre", - "make-shouts-public": "Teile von mir empfohlene Artikel öffentlich auf meinem Profil", - "success-update": "Privatsphäre-Einstellungen gespeichert" + "blocked-users": { + "name": "Blocked users", + "explanation": { + "intro": "Wenn ein anderer Benutzer von dir blockiert wurde, dann passiert folgendes:", + "your-perspective": "Du kannst keine Beiträge der blockierten Person mehr kommentieren.", + "their-perspective": "Die blockierte Person kann deine Beiträge nicht mehr kommentieren", + "notifications": "Von dir blockierte Personen erhalten keine Benachrichtigungen mehr, wenn sie in deinen Beiträgen erwähnt werden.", + "closing": "Das sollte fürs Erste genügen, damit blockierte Benutzer dich nicht mehr länger belästigen können.", + "commenting-disabled": "Du kannst den Beitrag derzeit nicht kommentieren.", + "commenting-explanation": "Dafür kann es mehrere Gründe geben, bitte schau in unsere " + }, + "columns": { + "name": "Name", + "slug": "Alias", + "unblock": "Entsperren" + }, + "empty": "Bislang hast du niemanden blockiert.", + "how-to": "Du kannst andere Benutzer auf deren Profilseite über das Inhaltsmenü blockieren.", + "block": "Nutzer blockieren", + "unblock": "Nutzer entsperren", + "unblocked": "{name} ist wieder entsperrt" } }, "admin": { @@ -257,8 +279,9 @@ }, "comment": { "submit": "Kommentiere", - "submitted": "Kommentar gesendet", - "updated": "Änderungen gespeichert" + "submitted": "Kommentar gesendet!", + "updated": "Änderungen gespeichert", + "reply": "Antworten" }, "edited": "bearbeitet" }, diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 5cee3d8eb..cfb21b017 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -339,6 +339,28 @@ "mute": "Mute user", "unmute": "Unmute user", "unmuted": "{name} is unmuted again" + }, + "blocked-users": { + "name": "Blocked users", + "explanation": { + "intro": "If another user has been blocked by you, this is what happens:", + "your-perspective": "You will no longer be able to interact with their contributions.", + "their-perspective": "Vice versa: The blocked person will also no longer be able to interact with your contributions.", + "notifications": "Blocked users will no longer receive notifications if they mention each other.", + "closing": "This should be sufficient for now so that blocked users can no longer bother you.", + "commenting-disabled": "Commenting is not possible at this time on this post.", + "commenting-explanation": "This can happen for several reasons, please see our " + }, + "columns": { + "name": "Name", + "slug": "Slug", + "unblock": "Unblock" + }, + "empty": "So far, you have not blocked anybody.", + "how-to": "You can block other users on their profile page via the content menu.", + "block": "Block user", + "unblock": "Unblock user", + "unblocked": "{name} is unblocked again" } }, "admin": { @@ -423,8 +445,8 @@ "name": "Take action" }, "menu": { - "edit": "Edit Post", - "delete": "Delete Post", + "edit": "Edit post", + "delete": "Delete post", "pin": "Pin post", "pinnedSuccessfully": "Post pinned successfully!", "unpin": "Unpin post", @@ -432,8 +454,9 @@ }, "comment": { "submit": "Comment", - "submitted": "Comment Submitted", - "updated": "Changes Saved" + "submitted": "Comment submitted!", + "updated": "Changes saved!", + "reply": "Reply" }, "edited": "edited" }, diff --git a/webapp/package.json b/webapp/package.json index c2b8aa92b..8f44913e7 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -59,20 +59,20 @@ "dependencies": { "@human-connection/styleguide": "0.5.22", "@nuxtjs/apollo": "^4.0.0-rc19", - "@nuxtjs/axios": "~5.9.3", + "@nuxtjs/axios": "~5.9.4", "@nuxtjs/dotenv": "~1.4.1", "@nuxtjs/pwa": "^3.0.0-beta.19", - "@nuxtjs/sentry": "^3.0.1", + "@nuxtjs/sentry": "^3.1.0", "@nuxtjs/style-resources": "~1.0.0", "accounting": "~0.4.1", "apollo-cache-inmemory": "~1.6.5", "apollo-client": "~2.6.8", - "cookie-universal-nuxt": "~2.1.0", + "cookie-universal-nuxt": "~2.1.1", "cropperjs": "^1.5.5", - "cross-env": "~6.0.3", + "cross-env": "~7.0.0", "date-fns": "2.9.0", "express": "~4.17.1", - "graphql": "~14.5.8", + "graphql": "~14.6.0", "jsonwebtoken": "~8.5.1", "linkify-it": "~2.2.0", "node-fetch": "^2.6.0", @@ -85,7 +85,7 @@ "tiptap-extensions": "~1.28.6", "trunc-html": "^1.1.2", "v-tooltip": "~2.0.3", - "validator": "^12.1.0", + "validator": "^12.2.0", "vue-count-to": "~1.0.13", "vue-infinite-loading": "^2.4.4", "vue-izitoast": "^1.2.1", @@ -96,13 +96,13 @@ "zxcvbn": "^4.4.2" }, "devDependencies": { - "@babel/core": "~7.8.3", + "@babel/core": "~7.8.4", "@babel/plugin-syntax-dynamic-import": "^7.8.3", - "@babel/preset-env": "~7.8.3", - "@storybook/addon-a11y": "^5.3.8", - "@storybook/addon-actions": "^5.3.7", - "@storybook/addon-notes": "^5.3.8", - "@storybook/vue": "~5.3.7", + "@babel/preset-env": "~7.8.4", + "@storybook/addon-a11y": "^5.3.9", + "@storybook/addon-actions": "^5.3.9", + "@storybook/addon-notes": "^5.3.9", + "@storybook/vue": "~5.3.9", "@vue/cli-shared-utils": "~4.1.2", "@vue/eslint-config-prettier": "~6.0.0", "@vue/server-test-utils": "~1.0.0-beta.31", @@ -110,14 +110,14 @@ "async-validator": "^3.2.3", "babel-core": "~7.0.0-bridge.0", "babel-eslint": "~10.0.3", - "babel-jest": "~24.9.0", + "babel-jest": "~25.1.0", "babel-loader": "~8.0.6", "babel-plugin-require-context-hook": "^1.0.0", "babel-preset-vue": "~2.0.2", "core-js": "~2.6.10", "css-loader": "~3.4.2", "eslint": "~6.8.0", - "eslint-config-prettier": "~6.9.0", + "eslint-config-prettier": "~6.10.0", "eslint-config-standard": "~14.1.0", "eslint-loader": "~3.0.3", "eslint-plugin-import": "~2.20.0", @@ -131,12 +131,12 @@ "flush-promises": "^1.0.2", "fuse.js": "^3.4.6", "identity-obj-proxy": "^3.0.0", - "jest": "~24.9.0", + "jest": "~25.1.0", "mutation-observer": "^1.0.3", "node-sass": "~4.13.1", "prettier": "~1.19.1", "sass-loader": "~8.0.2", - "storybook-design-token": "^0.5.0", + "storybook-design-token": "^0.5.1", "storybook-vue-router": "^1.0.7", "style-loader": "~0.23.1", "style-resources-loader": "~1.3.3", diff --git a/webapp/pages/post/_id/_slug/index.spec.js b/webapp/pages/post/_id/_slug/index.spec.js index db960bb67..6c5cb5259 100644 --- a/webapp/pages/post/_id/_slug/index.spec.js +++ b/webapp/pages/post/_id/_slug/index.spec.js @@ -1,29 +1,33 @@ -import { config, shallowMount } from '@vue/test-utils' -import PostSlug from './index.vue' +import { config, mount } from '@vue/test-utils' import Vuex from 'vuex' - -const localVue = global.localVue +import PostSlug from './index.vue' +import CommentList from '~/components/CommentList/CommentList' config.stubs['client-only'] = '' +config.stubs['nuxt-link'] = '' +config.stubs['router-link'] = '' + +const localVue = global.localVue +localVue.directive('scrollTo', jest.fn()) describe('PostSlug', () => { - let wrapper - let Wrapper - let store - let mocks + let store, propsData, mocks, stubs, wrapper, Wrapper beforeEach(() => { store = new Vuex.Store({ getters: { 'auth/user': () => { - return {} + return { id: '1stUser' } }, + 'auth/isModerator': () => false, }, }) + propsData = {} mocks = { $t: jest.fn(), $filters: { truncate: a => a, + removeHtml: a => a, }, $route: { hash: '', @@ -40,38 +44,53 @@ describe('PostSlug', () => { }, $apollo: { mutate: jest.fn().mockResolvedValue(), + query: jest.fn().mockResolvedValue({ data: { PostEmotionsCountByEmotion: {} } }), }, + $scrollTo: jest.fn(), } + stubs = { + HcEditor: { render: () => {}, methods: { insertReply: jest.fn(() => null) } }, + ContentViewer: true, + } + jest.useFakeTimers() + wrapper = Wrapper() + wrapper.setData({ + post: { + id: '1', + author: { + id: '1stUser', + }, + comments: [ + { + id: 'comment134', + contentExcerpt: 'this is a comment', + content: 'this is a comment', + author: { + id: '1stUser', + slug: '1st-user', + }, + }, + ], + }, + ready: true, + }) }) - describe('shallowMount', () => { + describe('mount', () => { Wrapper = () => { - return shallowMount(PostSlug, { + return mount(PostSlug, { store, mocks, localVue, + propsData, + stubs, }) } - beforeEach(jest.useFakeTimers) - describe('test Post callbacks', () => { - beforeEach(() => { - wrapper = Wrapper() - wrapper.setData({ - post: { - id: 'p23', - name: 'It is a post', - author: { - id: 'u1', - }, - }, - }) - }) - describe('deletion of Post from Page by invoking "deletePostCallback()"', () => { - beforeEach(() => { - wrapper.vm.deletePostCallback() + beforeEach(async () => { + await wrapper.vm.deletePostCallback() }) describe('after timeout', () => { @@ -91,5 +110,18 @@ describe('PostSlug', () => { }) }) }) + + describe('reply method called when emitted reply received', () => { + it('CommentList', async () => { + wrapper.find(CommentList).vm.$emit('reply', { + id: 'commentAuthorId', + slug: 'ogerly', + }) + expect(stubs.HcEditor.methods.insertReply).toHaveBeenCalledWith({ + id: 'commentAuthorId', + slug: 'ogerly', + }) + }) + }) }) }) diff --git a/webapp/pages/post/_id/_slug/index.vue b/webapp/pages/post/_id/_slug/index.vue index 7c524973c..1d107941a 100644 --- a/webapp/pages/post/_id/_slug/index.vue +++ b/webapp/pages/post/_id/_slug/index.vue @@ -84,13 +84,25 @@
- - + + + {{ $t('settings.blocked-users.explanation.commenting-disabled') }} +
+ {{ $t('settings.blocked-users.explanation.commenting-explanation') }} + FAQ +
@@ -103,8 +115,8 @@ import HcHashtag from '~/components/Hashtag/Hashtag' import ContentMenu from '~/components/ContentMenu/ContentMenu' import UserTeaser from '~/components/UserTeaser/UserTeaser' import HcShoutButton from '~/components/ShoutButton.vue' -import HcCommentForm from '~/components/CommentForm/CommentForm' -import HcCommentList from '~/components/CommentList/CommentList' +import CommentForm from '~/components/CommentForm/CommentForm' +import CommentList from '~/components/CommentList/CommentList' import { postMenuModalsData, deletePostMutation } from '~/components/utils/PostHelpers' import PostQuery from '~/graphql/PostQuery' import HcEmotions from '~/components/Emotions/Emotions' @@ -122,8 +134,8 @@ export default { UserTeaser, HcShoutButton, ContentMenu, - HcCommentForm, - HcCommentList, + CommentForm, + CommentList, HcEmotions, ContentViewer, }, @@ -139,15 +151,10 @@ export default { title: 'loading', showNewCommentForm: true, blurred: false, + blocked: null, + postAuthor: null, } }, - watch: { - Post(post) { - this.post = post[0] || {} - this.title = this.post.title - this.blurred = this.post.imageBlurred - }, - }, mounted() { setTimeout(() => { // NOTE: quick fix for jumping flexbox implementation @@ -165,6 +172,9 @@ export default { }, }, methods: { + reply(message) { + this.$refs.commentForm && this.$refs.commentForm.reply(message) + }, isAuthor(id) { return this.$store.getters['auth/user'].id === id }, @@ -216,6 +226,12 @@ export default { id: this.$route.params.id, } }, + update({ Post }) { + this.post = Post[0] || {} + this.title = this.post.title + this.blurred = this.post.imageBlurred + this.postAuthor = this.post.author + }, fetchPolicy: 'cache-and-network', }, }, diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue index ce220b66b..80471fff4 100644 --- a/webapp/pages/profile/_id/_slug.vue +++ b/webapp/pages/profile/_id/_slug.vue @@ -24,6 +24,8 @@ class="user-content-menu" @mute="muteUser" @unmute="unmuteUser" + @block="blockUser" + @unblock="unblockUser" /> @@ -64,20 +66,21 @@ - - - +
+ + {{ $t('settings.blocked-users.unblock') }} + + + {{ $t('settings.muted-users.unmute') }} + + +