mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Update ReportModal to work with back end
This commit is contained in:
parent
d848929302
commit
842d68c129
@ -90,24 +90,19 @@ export default {
|
||||
this.$store.commit('modal/SET_OPEN', {})
|
||||
},
|
||||
report() {
|
||||
console.log('')
|
||||
this.loading = true
|
||||
this.disabled = true
|
||||
this.$apollo
|
||||
.mutate({
|
||||
mutation: gql`
|
||||
mutation($id: ID!, $type: ResourceEnum!, $description: String) {
|
||||
report(
|
||||
resource: { id: $id, type: $type }
|
||||
description: $description
|
||||
) {
|
||||
mutation($id: ID!, $description: String) {
|
||||
report(id: $id, description: $description) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
id: this.data.id,
|
||||
type: this.data.context,
|
||||
description: '-'
|
||||
}
|
||||
})
|
||||
|
||||
@ -15,7 +15,7 @@ Feature: Report and Moderate
|
||||
Scenario Outline: Report a post from various pages
|
||||
Given I am logged in with a "user" role
|
||||
When I see David Irving's post on the <Page>
|
||||
And I click on "Report Contribution" from the triple dot menu of the post
|
||||
And I click on "Report Post" from the triple dot menu of the post
|
||||
And I confirm the reporting dialog because it is a criminal act under German law:
|
||||
"""
|
||||
Do you really want to report the contribution "The Truth about the Holocaust"?
|
||||
|
||||
@ -39,18 +39,15 @@ Given('I am logged in with a {string} role', role => {
|
||||
})
|
||||
})
|
||||
|
||||
When(
|
||||
'I click on "Report Contribution" from the triple dot menu of the post',
|
||||
() => {
|
||||
When('I click on "Report Post" from the triple dot menu of the post', () => {
|
||||
cy.contains('.ds-card', davidIrvingPostTitle)
|
||||
.find('.content-menu-trigger')
|
||||
.click()
|
||||
|
||||
cy.get('.popover .ds-menu-item-link')
|
||||
.contains('Report Contribution')
|
||||
.contains('Report Post')
|
||||
.click()
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
When(
|
||||
'I click on "Report User" from the triple dot menu in the user info box',
|
||||
@ -122,16 +119,16 @@ When(/^I confirm the reporting dialog .*:$/, message => {
|
||||
|
||||
Given('somebody reported the following posts:', table => {
|
||||
table.hashes().forEach(({ id }) => {
|
||||
const reporter = {
|
||||
email: `reporter${id}@example.org`,
|
||||
const submitter = {
|
||||
email: `submitter${id}@example.org`,
|
||||
password: '1234'
|
||||
}
|
||||
cy.factory()
|
||||
.create('User', reporter)
|
||||
.authenticateAs(reporter)
|
||||
.create('User', submitter)
|
||||
.authenticateAs(submitter)
|
||||
.create('Report', {
|
||||
description: "I don't like this post",
|
||||
resource: { id, type: 'contribution' }
|
||||
id,
|
||||
description: "Offensive content"
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -144,7 +144,7 @@
|
||||
"message": "Do you really want to report the user \"<b>{name}</b>\"?"
|
||||
},
|
||||
"contribution": {
|
||||
"title": "Report Contribution",
|
||||
"title": "Report Post",
|
||||
"type": "Contribution",
|
||||
"message": "Do you really want to report the contribution \"<b>{name}</b>\"?"
|
||||
},
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@human-connection/styleguide": "~0.5.2",
|
||||
"@nuxtjs/apollo": "4.0.0-rc4",
|
||||
"@nuxtjs/axios": "~5.4.1",
|
||||
"@nuxtjs/dotenv": "~1.3.0",
|
||||
@ -43,6 +44,7 @@
|
||||
"apollo-client": "~2.5.1",
|
||||
"cookie-universal-nuxt": "~2.0.14",
|
||||
"cross-env": "~5.2.0",
|
||||
"cypress": "^3.1.5",
|
||||
"date-fns": "2.0.0-alpha.27",
|
||||
"express": "~4.16.4",
|
||||
"graphql": "~14.1.1",
|
||||
@ -51,12 +53,11 @@
|
||||
"nuxt": "~2.4.5",
|
||||
"nuxt-env": "~0.1.0",
|
||||
"portal-vue": "~1.5.1",
|
||||
"@human-connection/styleguide": "~0.5.2",
|
||||
"v-tooltip": "~2.0.0-rc.33",
|
||||
"vue-count-to": "~1.0.13",
|
||||
"string-hash": "^1.1.3",
|
||||
"tiptap": "^1.13.0",
|
||||
"tiptap-extensions": "^1.13.0",
|
||||
"v-tooltip": "~2.0.0-rc.33",
|
||||
"vue-count-to": "~1.0.13",
|
||||
"vue-izitoast": "1.1.2",
|
||||
"vue-sweetalert-icons": "~3.2.0",
|
||||
"vuex-i18n": "~1.11.0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user