From fcc584af7d2aacbe5ff8af0f11f0e16e8625a015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Wed, 20 Mar 2019 21:17:53 +0100 Subject: [PATCH] Import changes relevant to monorepo --- .../ISSUE_TEMPLATE/bug_report.md | 0 .../ISSUE_TEMPLATE/feature_request.md | 0 .../CODE_OF_CONDUCT.md => CODE_OF_CONDUCT.md | 0 backend/LICENSE.md => LICENSE.md | 0 backend/.github/ISSUE_TEMPLATE/bug_report.md | 20 -------- ...template.json => cypress.env.template.json | 0 webapp/cypress.json => cypress.json | 0 .../cypress => cypress}/fixtures/example.json | 0 .../cypress => cypress}/fixtures/users.json | 0 .../integration/01.Login.feature | 0 .../02.Internationalization.feature | 0 .../integration/03.TagsAndCategories.feature | 0 .../integration/04.AboutMeAndLocation.feature | 0 .../integration/06.Search.feature | 0 .../integration/06.WritePost.feature | 0 .../integration/common/admin.js | 0 .../integration/common/report.js | 0 .../integration/common/search.js | 0 .../integration/common/settings.js | 0 .../integration/common/steps.js | 0 .../integration/moderation/HidePosts.feature | 0 .../moderation/ReportContent.feature | 0 {webapp/cypress => cypress}/plugins/index.js | 0 .../cypress => cypress}/support/commands.js | 0 .../cypress => cypress}/support/factories.js | 5 +- .../cypress => cypress}/support/helpers.js | 2 +- {webapp/cypress => cypress}/support/index.js | 0 docker-compose.override.yml | 35 ++++++++++++++ docker-compose.travis.yml | 20 ++++++++ docker-compose.yml | 46 +++++++++++++++++++ .../.github/ISSUE_TEMPLATE/feature_request.md | 17 ------- webapp/CODE_OF_CONDUCT.md | 46 ------------------- webapp/LICENSE.md | 21 --------- webapp/components/ContentMenu.vue | 1 + webapp/nuxt.config.js | 1 + webapp/plugins/axios.js | 1 + webapp/plugins/i18n.js | 1 + 37 files changed, 108 insertions(+), 108 deletions(-) rename {webapp/.github => .github}/ISSUE_TEMPLATE/bug_report.md (100%) rename {backend/.github => .github}/ISSUE_TEMPLATE/feature_request.md (100%) rename backend/CODE_OF_CONDUCT.md => CODE_OF_CONDUCT.md (100%) rename backend/LICENSE.md => LICENSE.md (100%) delete mode 100644 backend/.github/ISSUE_TEMPLATE/bug_report.md rename webapp/cypress.env.template.json => cypress.env.template.json (100%) rename webapp/cypress.json => cypress.json (100%) rename {webapp/cypress => cypress}/fixtures/example.json (100%) rename {webapp/cypress => cypress}/fixtures/users.json (100%) rename {webapp/cypress => cypress}/integration/01.Login.feature (100%) rename {webapp/cypress => cypress}/integration/02.Internationalization.feature (100%) rename {webapp/cypress => cypress}/integration/03.TagsAndCategories.feature (100%) rename {webapp/cypress => cypress}/integration/04.AboutMeAndLocation.feature (100%) rename {webapp/cypress => cypress}/integration/06.Search.feature (100%) rename {webapp/cypress => cypress}/integration/06.WritePost.feature (100%) rename {webapp/cypress => cypress}/integration/common/admin.js (100%) rename {webapp/cypress => cypress}/integration/common/report.js (100%) rename {webapp/cypress => cypress}/integration/common/search.js (100%) rename {webapp/cypress => cypress}/integration/common/settings.js (100%) rename {webapp/cypress => cypress}/integration/common/steps.js (100%) rename {webapp/cypress => cypress}/integration/moderation/HidePosts.feature (100%) rename {webapp/cypress => cypress}/integration/moderation/ReportContent.feature (100%) rename {webapp/cypress => cypress}/plugins/index.js (100%) rename {webapp/cypress => cypress}/support/commands.js (100%) rename {webapp/cypress => cypress}/support/factories.js (84%) rename {webapp/cypress => cypress}/support/helpers.js (77%) rename {webapp/cypress => cypress}/support/index.js (100%) create mode 100644 docker-compose.override.yml create mode 100644 docker-compose.travis.yml create mode 100644 docker-compose.yml delete mode 100644 webapp/.github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 webapp/CODE_OF_CONDUCT.md delete mode 100644 webapp/LICENSE.md diff --git a/webapp/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from webapp/.github/ISSUE_TEMPLATE/bug_report.md rename to .github/ISSUE_TEMPLATE/bug_report.md diff --git a/backend/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from backend/.github/ISSUE_TEMPLATE/feature_request.md rename to .github/ISSUE_TEMPLATE/feature_request.md diff --git a/backend/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md similarity index 100% rename from backend/CODE_OF_CONDUCT.md rename to CODE_OF_CONDUCT.md diff --git a/backend/LICENSE.md b/LICENSE.md similarity index 100% rename from backend/LICENSE.md rename to LICENSE.md diff --git a/backend/.github/ISSUE_TEMPLATE/bug_report.md b/backend/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 87e0ad52e..000000000 --- a/backend/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Authenticate '...' -2. Post following data to endpoint '...' -3. See error - -**Expected behavior** -A clear and concise description of what you expected to happen - -**Additional context** -Add any other context about the problem here. diff --git a/webapp/cypress.env.template.json b/cypress.env.template.json similarity index 100% rename from webapp/cypress.env.template.json rename to cypress.env.template.json diff --git a/webapp/cypress.json b/cypress.json similarity index 100% rename from webapp/cypress.json rename to cypress.json diff --git a/webapp/cypress/fixtures/example.json b/cypress/fixtures/example.json similarity index 100% rename from webapp/cypress/fixtures/example.json rename to cypress/fixtures/example.json diff --git a/webapp/cypress/fixtures/users.json b/cypress/fixtures/users.json similarity index 100% rename from webapp/cypress/fixtures/users.json rename to cypress/fixtures/users.json diff --git a/webapp/cypress/integration/01.Login.feature b/cypress/integration/01.Login.feature similarity index 100% rename from webapp/cypress/integration/01.Login.feature rename to cypress/integration/01.Login.feature diff --git a/webapp/cypress/integration/02.Internationalization.feature b/cypress/integration/02.Internationalization.feature similarity index 100% rename from webapp/cypress/integration/02.Internationalization.feature rename to cypress/integration/02.Internationalization.feature diff --git a/webapp/cypress/integration/03.TagsAndCategories.feature b/cypress/integration/03.TagsAndCategories.feature similarity index 100% rename from webapp/cypress/integration/03.TagsAndCategories.feature rename to cypress/integration/03.TagsAndCategories.feature diff --git a/webapp/cypress/integration/04.AboutMeAndLocation.feature b/cypress/integration/04.AboutMeAndLocation.feature similarity index 100% rename from webapp/cypress/integration/04.AboutMeAndLocation.feature rename to cypress/integration/04.AboutMeAndLocation.feature diff --git a/webapp/cypress/integration/06.Search.feature b/cypress/integration/06.Search.feature similarity index 100% rename from webapp/cypress/integration/06.Search.feature rename to cypress/integration/06.Search.feature diff --git a/webapp/cypress/integration/06.WritePost.feature b/cypress/integration/06.WritePost.feature similarity index 100% rename from webapp/cypress/integration/06.WritePost.feature rename to cypress/integration/06.WritePost.feature diff --git a/webapp/cypress/integration/common/admin.js b/cypress/integration/common/admin.js similarity index 100% rename from webapp/cypress/integration/common/admin.js rename to cypress/integration/common/admin.js diff --git a/webapp/cypress/integration/common/report.js b/cypress/integration/common/report.js similarity index 100% rename from webapp/cypress/integration/common/report.js rename to cypress/integration/common/report.js diff --git a/webapp/cypress/integration/common/search.js b/cypress/integration/common/search.js similarity index 100% rename from webapp/cypress/integration/common/search.js rename to cypress/integration/common/search.js diff --git a/webapp/cypress/integration/common/settings.js b/cypress/integration/common/settings.js similarity index 100% rename from webapp/cypress/integration/common/settings.js rename to cypress/integration/common/settings.js diff --git a/webapp/cypress/integration/common/steps.js b/cypress/integration/common/steps.js similarity index 100% rename from webapp/cypress/integration/common/steps.js rename to cypress/integration/common/steps.js diff --git a/webapp/cypress/integration/moderation/HidePosts.feature b/cypress/integration/moderation/HidePosts.feature similarity index 100% rename from webapp/cypress/integration/moderation/HidePosts.feature rename to cypress/integration/moderation/HidePosts.feature diff --git a/webapp/cypress/integration/moderation/ReportContent.feature b/cypress/integration/moderation/ReportContent.feature similarity index 100% rename from webapp/cypress/integration/moderation/ReportContent.feature rename to cypress/integration/moderation/ReportContent.feature diff --git a/webapp/cypress/plugins/index.js b/cypress/plugins/index.js similarity index 100% rename from webapp/cypress/plugins/index.js rename to cypress/plugins/index.js diff --git a/webapp/cypress/support/commands.js b/cypress/support/commands.js similarity index 100% rename from webapp/cypress/support/commands.js rename to cypress/support/commands.js diff --git a/webapp/cypress/support/factories.js b/cypress/support/factories.js similarity index 84% rename from webapp/cypress/support/factories.js rename to cypress/support/factories.js index b9633d434..3bdb86800 100644 --- a/webapp/cypress/support/factories.js +++ b/cypress/support/factories.js @@ -1,6 +1,5 @@ -// TODO: find a better way how to import the factories -import Factory from '../../../Nitro-Backend/src/seed/factories' -import { getDriver } from '../../../Nitro-Backend/src/bootstrap/neo4j' +import Factory from '../../backend/src/seed/factories' +import { getDriver } from '../../backend/src/bootstrap/neo4j' const neo4jDriver = getDriver({ uri: Cypress.env('NEO4J_URI'), diff --git a/webapp/cypress/support/helpers.js b/cypress/support/helpers.js similarity index 77% rename from webapp/cypress/support/helpers.js rename to cypress/support/helpers.js index 1aed57de1..4a8376ec0 100644 --- a/webapp/cypress/support/helpers.js +++ b/cypress/support/helpers.js @@ -1,7 +1,7 @@ import find from 'lodash/find' const helpers = { - locales: require('../../locales'), + locales: require('../../webapp/locales'), getLangByName: name => { return find(helpers.locales, { name }) } diff --git a/webapp/cypress/support/index.js b/cypress/support/index.js similarity index 100% rename from webapp/cypress/support/index.js rename to cypress/support/index.js diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 000000000..1e4c3fa91 --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,35 @@ +version: "3.4" + +services: + webapp: + build: + context: webapp + target: build-and-test + volumes: + - ./webapp:/nitro-web + - webapp_node_modules:/nitro-web/node_modules + - nuxt:/nitro-web/.nuxt + command: yarn run dev + backend: + image: humanconnection/nitro-backend:builder + build: + context: backend + target: builder + volumes: + - ./backend:/nitro-backend + - backend_node_modules:/nitro-backend/node_modules + command: yarn run dev + neo4j: + environment: + - NEO4J_AUTH=none + ports: + - 7687:7687 + - 7474:7474 + volumes: + - neo4j-data:/data + +volumes: + webapp_node_modules: + backend_node_modules: + nuxt: + neo4j-data: diff --git a/docker-compose.travis.yml b/docker-compose.travis.yml new file mode 100644 index 000000000..ccc24b6b4 --- /dev/null +++ b/docker-compose.travis.yml @@ -0,0 +1,20 @@ +version: "3.4" + +services: + webapp: + build: + context: webapp + target: build-and-test + environment: + - BACKEND_URL=http://backend:4123 + backend: + image: humanconnection/nitro-backend:builder + build: + context: backend + target: builder + neo4j: + environment: + - NEO4J_AUTH=none + ports: + - 7687:7687 + - 7474:7474 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..be604e273 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,46 @@ +version: "3.4" + +services: + webapp: + image: humanconnection/nitro-web:latest + build: + context: webapp + target: production + ports: + - 3000:3000 + - 8080:8080 + networks: + - hc-network + environment: + - HOST=0.0.0.0 + - BACKEND_URL=http://backend:4000 + - MAPBOX_TOKEN="pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.bZ8KK9l70omjXbEkkbHGsQ" + backend: + image: humanconnection/nitro-backend:latest + build: + context: backend + target: production + networks: + - hc-network + depends_on: + - neo4j + ports: + - 4000:4000 + environment: + - NEO4J_URI=bolt://neo4j:7687 + - GRAPHQL_PORT=4000 + - GRAPHQL_URI=http://localhost:4000 + - CLIENT_URI=http://localhost:3000 + - JWT_SECRET=b/&&7b78BF&fv/Vd + - MOCK=false + - MAPBOX_TOKEN=pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ + - PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78 + neo4j: + image: humanconnection/neo4j:latest + build: + context: backend/neo4j + networks: + - hc-network + +networks: + hc-network: diff --git a/webapp/.github/ISSUE_TEMPLATE/feature_request.md b/webapp/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 066b2d920..000000000 --- a/webapp/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/webapp/CODE_OF_CONDUCT.md b/webapp/CODE_OF_CONDUCT.md deleted file mode 100644 index 19f3854c1..000000000 --- a/webapp/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at developer@human-connection.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/webapp/LICENSE.md b/webapp/LICENSE.md deleted file mode 100644 index 9d4508b38..000000000 --- a/webapp/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Human-Connection gGmbH - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/webapp/components/ContentMenu.vue b/webapp/components/ContentMenu.vue index 2a63bb99b..abab7897d 100644 --- a/webapp/components/ContentMenu.vue +++ b/webapp/components/ContentMenu.vue @@ -82,6 +82,7 @@ export default { routes.push({ name: this.$t(`comment.edit`), callback: () => { + /* eslint-disable-next-line no-console */ console.log('EDIT COMMENT') }, icon: 'edit' diff --git a/webapp/nuxt.config.js b/webapp/nuxt.config.js index 7f192aa57..9e3fa9575 100644 --- a/webapp/nuxt.config.js +++ b/webapp/nuxt.config.js @@ -142,6 +142,7 @@ module.exports = { // includeNodeModules: true, // optional, default: false (this includes graphql-tag for node_modules folder) // optional errorHandler(error) { + /* eslint-disable-next-line no-console */ console.log( '%cError', 'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;', diff --git a/webapp/plugins/axios.js b/webapp/plugins/axios.js index 621a4ca55..0071857ec 100644 --- a/webapp/plugins/axios.js +++ b/webapp/plugins/axios.js @@ -1,5 +1,6 @@ export default ({ $axios, app }) => { $axios.onRequest(config => { + /* eslint-disable-next-line no-console */ console.log(Object.keys(app)) // add current ui language config.headers['Accept-Language'] = app.$i18n.locale() diff --git a/webapp/plugins/i18n.js b/webapp/plugins/i18n.js index 549ae722b..836ba220f 100644 --- a/webapp/plugins/i18n.js +++ b/webapp/plugins/i18n.js @@ -47,6 +47,7 @@ export default ({ app, req, cookie, store }) => { Vue.use(vuexI18n.plugin, store, { onTranslationNotFound: function(locale, key) { if (debug) { + /* eslint-disable-next-line no-console */ console.warn( `vuex-i18n :: Key '${key}' not found for locale '${locale}'` )