mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge branch 'merge-6336-into-6339-optimize-event-create-and-update' of github.com:Ocelot-Social-Community/Ocelot-Social into 6379-fix-event-teaser-date-from-start-to-end
This commit is contained in:
commit
c4a12a3a4a
@ -165,7 +165,7 @@ Factory.define('post')
|
|||||||
})
|
})
|
||||||
.after(async (buildObject, options) => {
|
.after(async (buildObject, options) => {
|
||||||
const [post, author, image, /* categories, */ tags] = await Promise.all([
|
const [post, author, image, /* categories, */ tags] = await Promise.all([
|
||||||
neode.create('Post', buildObject),
|
neode.create('Article', buildObject),
|
||||||
options.author,
|
options.author,
|
||||||
options.image,
|
options.image,
|
||||||
// options.categories,
|
// options.categories,
|
||||||
|
|||||||
@ -23,6 +23,7 @@ export function getNeode(options = {}) {
|
|||||||
if (!neodeInstance) {
|
if (!neodeInstance) {
|
||||||
const { uri, username, password } = { ...defaultOptions, ...options }
|
const { uri, username, password } = { ...defaultOptions, ...options }
|
||||||
neodeInstance = new Neode(uri, username, password).with(models)
|
neodeInstance = new Neode(uri, username, password).with(models)
|
||||||
|
neodeInstance.extend('Post', 'Article', {})
|
||||||
return neodeInstance
|
return neodeInstance
|
||||||
}
|
}
|
||||||
return neodeInstance
|
return neodeInstance
|
||||||
|
|||||||
@ -92,7 +92,7 @@ export default {
|
|||||||
[(submitter:User)-[filed:FILED]->(report) | filed {.*, submitter: properties(submitter)} ] as filed,
|
[(submitter:User)-[filed:FILED]->(report) | filed {.*, submitter: properties(submitter)} ] as filed,
|
||||||
[(moderator:User)-[reviewed:REVIEWED]->(report) | reviewed {.*, moderator: properties(moderator)} ] as reviewed,
|
[(moderator:User)-[reviewed:REVIEWED]->(report) | reviewed {.*, moderator: properties(moderator)} ] as reviewed,
|
||||||
[(resource)<-[:WROTE]-(author:User) | author {.*} ] as optionalAuthors,
|
[(resource)<-[:WROTE]-(author:User) | author {.*} ] as optionalAuthors,
|
||||||
[(resource)-[:COMMENTS]->(post:Post) | post {.*} ] as optionalCommentedPosts,
|
[(resource)-[:COMMENTS]->(post:Post)<-[:WROTE]-(author:User) | post {.*, author: properties(author), postType: filter(l IN labels(post) WHERE NOT l = "Post")} ] as optionalCommentedPosts,
|
||||||
resource {.*, __typename: labels(resource)[0] } as resourceWithType
|
resource {.*, __typename: labels(resource)[0] } as resourceWithType
|
||||||
WITH report, optionalAuthors, optionalCommentedPosts, reviewed, filed,
|
WITH report, optionalAuthors, optionalCommentedPosts, reviewed, filed,
|
||||||
resourceWithType {.*, post: optionalCommentedPosts[0], author: optionalAuthors[0] } as finalResource
|
resourceWithType {.*, post: optionalCommentedPosts[0], author: optionalAuthors[0] } as finalResource
|
||||||
@ -106,7 +106,7 @@ export default {
|
|||||||
})
|
})
|
||||||
try {
|
try {
|
||||||
const reports = await reportsReadTxPromise
|
const reports = await reportsReadTxPromise
|
||||||
return reports
|
return reports || []
|
||||||
} finally {
|
} finally {
|
||||||
session.close()
|
session.close()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,8 @@ const { parsed } = dotenv.config({ path: '../backend/.env' })
|
|||||||
module.exports = defineConfig({
|
module.exports = defineConfig({
|
||||||
e2e: {
|
e2e: {
|
||||||
projectId: "qa7fe2",
|
projectId: "qa7fe2",
|
||||||
defaultCommandTimeout: 10000,
|
defaultCommandTimeout: 60000,
|
||||||
|
pageLoadTimeout: 180000,
|
||||||
chromeWebSecurity: false,
|
chromeWebSecurity: false,
|
||||||
baseUrl: "http://localhost:3000",
|
baseUrl: "http://localhost:3000",
|
||||||
specPattern: "cypress/e2e/**/*.feature",
|
specPattern: "cypress/e2e/**/*.feature",
|
||||||
|
|||||||
@ -48,7 +48,7 @@ Cypress.Commands.add(
|
|||||||
Cypress.Commands.add(
|
Cypress.Commands.add(
|
||||||
'mutate',
|
'mutate',
|
||||||
{ prevSubject: true },
|
{ prevSubject: true },
|
||||||
(graphQLClient, mutation, variables) => {
|
(graphQLClient, mutation, variables, response) => {
|
||||||
return new Cypress.Promise((resolve, reject) => {
|
return new Cypress.Promise((resolve, reject) => {
|
||||||
graphQLClient.request(mutation, variables).then(() => resolve(graphQLClient))
|
graphQLClient.request(mutation, variables).then(() => resolve(graphQLClient))
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import { When } from "@badeball/cypress-cucumber-preprocessor";
|
import { When } from "@badeball/cypress-cucumber-preprocessor";
|
||||||
|
import 'cypress-network-idle';
|
||||||
|
|
||||||
When("I click on the avatar menu in the top right corner", () => {
|
When("I click on the avatar menu in the top right corner", () => {
|
||||||
cy.get(".avatar-menu").click();
|
cy.get(".avatar-menu").click();
|
||||||
|
cy.waitForNetworkIdle(2000);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,6 +1,108 @@
|
|||||||
import { Then } from "@badeball/cypress-cucumber-preprocessor";
|
import { Then } from "@badeball/cypress-cucumber-preprocessor";
|
||||||
|
|
||||||
Then('I see all the reported posts including the one from above', () => {
|
Then('I see all the reported posts including the one from above', () => {
|
||||||
|
cy.intercept({
|
||||||
|
method: 'POST',
|
||||||
|
url: '/api',
|
||||||
|
hostname: 'localhost',
|
||||||
|
}).as('getReports')
|
||||||
|
|
||||||
|
cy.wait(['@getReports'],{ timeout: 30000 }).then((interception) => {
|
||||||
|
console.log('Cypress interception:', interception)
|
||||||
|
cy.wrap(interception.response.statusCode).should('eq', 200)
|
||||||
|
cy.wrap(interception.request.body)
|
||||||
|
.should('have.property', 'query', `query ($orderBy: ReportOrdering, $first: Int, $offset: Int, $reviewed: Boolean, $closed: Boolean) {
|
||||||
|
reports(orderBy: $orderBy, first: $first, offset: $offset, reviewed: $reviewed, closed: $closed) {
|
||||||
|
id
|
||||||
|
createdAt
|
||||||
|
updatedAt
|
||||||
|
closed
|
||||||
|
reviewed {
|
||||||
|
createdAt
|
||||||
|
updatedAt
|
||||||
|
disable
|
||||||
|
moderator {
|
||||||
|
id
|
||||||
|
slug
|
||||||
|
name
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
resource {
|
||||||
|
__typename
|
||||||
|
... on User {
|
||||||
|
id
|
||||||
|
slug
|
||||||
|
name
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
... on Comment {
|
||||||
|
id
|
||||||
|
contentExcerpt
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
author {
|
||||||
|
id
|
||||||
|
slug
|
||||||
|
name
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
id
|
||||||
|
slug
|
||||||
|
title
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
... on Post {
|
||||||
|
id
|
||||||
|
slug
|
||||||
|
title
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
author {
|
||||||
|
id
|
||||||
|
slug
|
||||||
|
name
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filed {
|
||||||
|
submitter {
|
||||||
|
id
|
||||||
|
slug
|
||||||
|
name
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
createdAt
|
||||||
|
reasonCategory
|
||||||
|
reasonDescription
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
__typename
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
||||||
|
)
|
||||||
|
cy.wrap(interception.response.body)
|
||||||
|
.should('have.nested.property', 'data.reports.0.resource.author.id')
|
||||||
|
.and('equal', 'annoying-user')
|
||||||
|
})
|
||||||
|
|
||||||
cy.get('table tbody').within(() => {
|
cy.get('table tbody').within(() => {
|
||||||
cy.contains('tr', 'The Truth about the Holocaust')
|
cy.contains('tr', 'The Truth about the Holocaust')
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,6 +1,14 @@
|
|||||||
import { Given } from "@badeball/cypress-cucumber-preprocessor";
|
import { Given } from "@badeball/cypress-cucumber-preprocessor";
|
||||||
|
import 'cypress-network-idle';
|
||||||
|
|
||||||
Given('somebody reported the following posts:', table => {
|
Given('somebody reported the following posts:', table => {
|
||||||
|
const reportIdRegex = /^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$/
|
||||||
|
cy.intercept({
|
||||||
|
method: 'POST',
|
||||||
|
url: '/',
|
||||||
|
hostname: 'localhost',
|
||||||
|
}).as('postToLocalhost')
|
||||||
|
|
||||||
table.hashes().forEach(({ submitterEmail, resourceId, reasonCategory, reasonDescription }) => {
|
table.hashes().forEach(({ submitterEmail, resourceId, reasonCategory, reasonDescription }) => {
|
||||||
const submitter = {
|
const submitter = {
|
||||||
email: submitterEmail,
|
email: submitterEmail,
|
||||||
@ -18,5 +26,15 @@ Given('somebody reported the following posts:', table => {
|
|||||||
reasonCategory,
|
reasonCategory,
|
||||||
reasonDescription
|
reasonDescription
|
||||||
})
|
})
|
||||||
|
cy.wait(['@postToLocalhost']).then((interception) => {
|
||||||
|
cy.wrap(interception.response.statusCode).should('eq', 200)
|
||||||
|
})
|
||||||
|
cy.wait(['@postToLocalhost']).then((interception) => {
|
||||||
|
cy.wrap(interception.response.statusCode).should('eq', 200)
|
||||||
|
cy.wrap(interception.response.body)
|
||||||
|
.should('have.nested.property', 'data.fileReport.reportId')
|
||||||
|
.and('match', reportIdRegex)
|
||||||
|
})
|
||||||
|
cy.waitForNetworkIdle(2000)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import { When } from "@badeball/cypress-cucumber-preprocessor";
|
|||||||
When("mention {string} in the text", mention => {
|
When("mention {string} in the text", mention => {
|
||||||
cy.get(".ProseMirror")
|
cy.get(".ProseMirror")
|
||||||
.type(" @");
|
.type(" @");
|
||||||
cy.get(".suggestion-list__item")
|
cy.contains(".suggestion-list__item", mention)
|
||||||
.contains(mention)
|
|
||||||
.click();
|
.click();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import { Given } from "@badeball/cypress-cucumber-preprocessor";
|
import { Given } from "@badeball/cypress-cucumber-preprocessor";
|
||||||
|
import 'cypress-network-idle';
|
||||||
|
|
||||||
Given("I navigate to page {string}", page => {
|
Given("I navigate to page {string}", page => {
|
||||||
cy.visit(page);
|
cy.visit(page);
|
||||||
|
cy.waitForNetworkIdle(2000)
|
||||||
});
|
});
|
||||||
|
|||||||
@ -34,7 +34,8 @@
|
|||||||
"cucumber": "^6.0.5",
|
"cucumber": "^6.0.5",
|
||||||
"cypress": "^12.6.0",
|
"cypress": "^12.6.0",
|
||||||
"cypress-file-upload": "^3.5.3",
|
"cypress-file-upload": "^3.5.3",
|
||||||
"date-fns": "^2.30.0",
|
"cypress-network-idle": "^1.14.2",
|
||||||
|
"date-fns": "^2.25.0",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"expect": "^29.5.0",
|
"expect": "^29.5.0",
|
||||||
"graphql-request": "^2.0.0",
|
"graphql-request": "^2.0.0",
|
||||||
|
|||||||
@ -76,9 +76,9 @@
|
|||||||
@change="changeEventStart($event)"
|
@change="changeEventStart($event)"
|
||||||
></date-picker>
|
></date-picker>
|
||||||
</div>
|
</div>
|
||||||
<div class="chipbox event-grid-item-margin-helper">
|
<div v-if="errors && errors.eventStart" class="chipbox event-grid-item-margin-helper">
|
||||||
<ds-chip size="base" :color="errors && errors.eventStart && 'danger'">
|
<ds-chip size="base" :color="errors && errors.eventStart && 'danger'">
|
||||||
<base-icon v-if="errors && errors.eventStart" name="warning" />
|
<base-icon name="warning" />
|
||||||
</ds-chip>
|
</ds-chip>
|
||||||
</div>
|
</div>
|
||||||
</ds-grid-item>
|
</ds-grid-item>
|
||||||
|
|||||||
@ -20,9 +20,10 @@ module.exports = {
|
|||||||
lines: 83,
|
lines: 83,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
coverageProvider: 'v8',
|
||||||
setupFiles: ['<rootDir>/test/registerContext.js', '<rootDir>/test/testSetup.js'],
|
setupFiles: ['<rootDir>/test/registerContext.js', '<rootDir>/test/testSetup.js'],
|
||||||
transform: {
|
transform: {
|
||||||
'.*\\.(vue)$': 'vue-jest',
|
'.*\\.(vue)$': '@vue/vue2-jest',
|
||||||
'^.+\\.js$': 'babel-jest',
|
'^.+\\.js$': 'babel-jest',
|
||||||
},
|
},
|
||||||
testMatch: ['**/?(*.)+(spec|test).js?(x)'],
|
testMatch: ['**/?(*.)+(spec|test).js?(x)'],
|
||||||
|
|||||||
@ -66,9 +66,9 @@
|
|||||||
"zxcvbn": "^4.4.2"
|
"zxcvbn": "^4.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "~7.21.4",
|
"@babel/core": "~7.22.1",
|
||||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||||
"@babel/preset-env": "^7.20.2",
|
"@babel/preset-env": "^7.22.4",
|
||||||
"@faker-js/faker": "5.1.0",
|
"@faker-js/faker": "5.1.0",
|
||||||
"@nuxtjs/composition-api": "0.32.0",
|
"@nuxtjs/composition-api": "0.32.0",
|
||||||
"@storybook/addon-a11y": "^6.3.6",
|
"@storybook/addon-a11y": "^6.3.6",
|
||||||
@ -79,8 +79,9 @@
|
|||||||
"@vue/eslint-config-prettier": "~6.0.0",
|
"@vue/eslint-config-prettier": "~6.0.0",
|
||||||
"@vue/server-test-utils": "~1.0.0-beta.31",
|
"@vue/server-test-utils": "~1.0.0-beta.31",
|
||||||
"@vue/test-utils": "1.3.4",
|
"@vue/test-utils": "1.3.4",
|
||||||
|
"@vue/vue2-jest": "29",
|
||||||
"async-validator": "^3.2.4",
|
"async-validator": "^3.2.4",
|
||||||
"babel-core": "~7.0.0-bridge.0",
|
"babel-core": "^7.0.0-bridge.0",
|
||||||
"babel-eslint": "~10.1.0",
|
"babel-eslint": "~10.1.0",
|
||||||
"babel-jest": "29.5",
|
"babel-jest": "29.5",
|
||||||
"babel-loader": "~8.1.0",
|
"babel-loader": "~8.1.0",
|
||||||
@ -110,7 +111,6 @@
|
|||||||
"storybook-vue-router": "^1.0.7",
|
"storybook-vue-router": "^1.0.7",
|
||||||
"style-loader": "~0.23.1",
|
"style-loader": "~0.23.1",
|
||||||
"style-resources-loader": "~1.3.3",
|
"style-resources-loader": "~1.3.3",
|
||||||
"vue-jest": "~3.0.5",
|
|
||||||
"vue-svg-loader": "~0.16.0",
|
"vue-svg-loader": "~0.16.0",
|
||||||
"vue-template-compiler": "^2.6.11"
|
"vue-template-compiler": "^2.6.11"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -40,6 +40,13 @@ export default {
|
|||||||
user: 'auth/user',
|
user: 'auth/user',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
contribution: {
|
||||||
|
postType: ['Article'],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
async asyncData(context) {
|
async asyncData(context) {
|
||||||
const {
|
const {
|
||||||
app,
|
app,
|
||||||
|
|||||||
@ -8,6 +8,9 @@ import SearchResults from '~/components/_new/features/SearchResults/SearchResult
|
|||||||
export default {
|
export default {
|
||||||
layout: 'default',
|
layout: 'default',
|
||||||
watchQuery: ['search'],
|
watchQuery: ['search'],
|
||||||
|
data() {
|
||||||
|
return { search: null }
|
||||||
|
},
|
||||||
head() {
|
head() {
|
||||||
return {
|
return {
|
||||||
title: this.$t('search.title'),
|
title: this.$t('search.title'),
|
||||||
|
|||||||
1016
webapp/yarn.lock
1016
webapp/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user