mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Rename node CaseFolder to Claim and relation FLAGGED to BELONGS_TO
This commit is contained in:
parent
a7aaee98c1
commit
02bdc5ea5d
@ -20,7 +20,7 @@ export default makeAugmentedSchema({
|
|||||||
'NOTIFIED',
|
'NOTIFIED',
|
||||||
'REPORTED',
|
'REPORTED',
|
||||||
'REVIEWED',
|
'REVIEWED',
|
||||||
'CaseFolder',
|
'Claim',
|
||||||
'Donations',
|
'Donations',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@ -2,10 +2,10 @@ export async function queryReviewedByModerator(label, parent, context) {
|
|||||||
if (typeof parent.reviewedByModerator !== 'undefined') return parent.reviewedByModerator
|
if (typeof parent.reviewedByModerator !== 'undefined') return parent.reviewedByModerator
|
||||||
const { id } = parent
|
const { id } = parent
|
||||||
const statement = `
|
const statement = `
|
||||||
MATCH (resource {id: $id})<-[:FLAGGED]-(caseFolder:CaseFolder)<-[review:REVIEWED]-(moderator:User)
|
MATCH (resource {id: $id})<-[:BELONGS_TO]-(claim:Claim)<-[review:REVIEWED]-(moderator:User)
|
||||||
WHERE $label IN labels(resource)
|
WHERE $label IN labels(resource)
|
||||||
RETURN moderator
|
RETURN moderator
|
||||||
ORDER BY caseFolder.updatedAt DESC, review.updatedAt DESC
|
ORDER BY claim.updatedAt DESC, review.updatedAt DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
`
|
`
|
||||||
let reviewedByModerator
|
let reviewedByModerator
|
||||||
|
|||||||
@ -10,14 +10,14 @@
|
|||||||
|
|
||||||
// // Wolle only review on reported resources
|
// // Wolle only review on reported resources
|
||||||
|
|
||||||
// MATCH (caseModerator:User)-[:REPORTED]->(caseFolder:CaseFolder {closed: false})-[:FLAGGED]->(resource {id: $resourceId})
|
// MATCH (caseModerator:User)-[:REPORTED]->(claim:Claim {closed: false})-[:BELONGS_TO]->(resource {id: $resourceId})
|
||||||
// WHERE resource:User OR resource:Post OR resource:Comment
|
// WHERE resource:User OR resource:Post OR resource:Comment
|
||||||
// RETURN caseFolder, caseModerator {.id}
|
// RETURN claim, caseModerator {.id}
|
||||||
// `,
|
// `,
|
||||||
// { resourceId },
|
// { resourceId },
|
||||||
// )
|
// )
|
||||||
// return queryOpenDecisionTransactionResponse.records.map(record => ({
|
// return queryOpenDecisionTransactionResponse.records.map(record => ({
|
||||||
// caseFolder: record.get('caseFolder'),
|
// claim: record.get('claim'),
|
||||||
// caseModerator: record.get('caseModerator'),
|
// caseModerator: record.get('caseModerator'),
|
||||||
// }))
|
// }))
|
||||||
// })
|
// })
|
||||||
@ -54,7 +54,7 @@ export default {
|
|||||||
|
|
||||||
// // Wolle openDecisionTxResult should not be undefined !!!
|
// // Wolle openDecisionTxResult should not be undefined !!!
|
||||||
// if (!openDecisionTxResult) {
|
// if (!openDecisionTxResult) {
|
||||||
// // no open caseFolder, then create one
|
// // no open claim, then create one
|
||||||
// if (disable === undefined) disable = false // default for creation
|
// if (disable === undefined) disable = false // default for creation
|
||||||
// if (closed === undefined) closed = false // default for creation
|
// if (closed === undefined) closed = false // default for creation
|
||||||
// cypherHeader = `
|
// cypherHeader = `
|
||||||
@ -68,9 +68,9 @@ export default {
|
|||||||
// SET decision.latest = true
|
// SET decision.latest = true
|
||||||
// `
|
// `
|
||||||
// } else {
|
// } else {
|
||||||
// // an open caseFolder, then change it
|
// // an open claim, then change it
|
||||||
// if (disable === undefined) disable = openDecisionTxResult.caseFolder.properties.disable // default set to existing
|
// if (disable === undefined) disable = openDecisionTxResult.claim.properties.disable // default set to existing
|
||||||
// if (closed === undefined) closed = openDecisionTxResult.caseFolder.properties.closed // default set to existing
|
// if (closed === undefined) closed = openDecisionTxResult.claim.properties.closed // default set to existing
|
||||||
// // current moderator is not the same as old
|
// // current moderator is not the same as old
|
||||||
// if (moderator.id !== openDecisionTxResult.caseModerator.id) {
|
// if (moderator.id !== openDecisionTxResult.caseModerator.id) {
|
||||||
// // from a different moderator, then create relation with properties to new moderator
|
// // from a different moderator, then create relation with properties to new moderator
|
||||||
@ -85,7 +85,7 @@ export default {
|
|||||||
// SET decision = oldDecision
|
// SET decision = oldDecision
|
||||||
// `
|
// `
|
||||||
// } else {
|
// } else {
|
||||||
// // an open caseFolder from same moderator, then match this
|
// // an open claim from same moderator, then match this
|
||||||
// cypherHeader = `
|
// cypherHeader = `
|
||||||
// MATCH (moderator:User)-[decision:DECIDED {closed: false}]->(resource {id: $resourceId})
|
// MATCH (moderator:User)-[decision:DECIDED {closed: false}]->(resource {id: $resourceId})
|
||||||
// WHERE resource:User OR resource:Comment OR resource:Post
|
// WHERE resource:User OR resource:Comment OR resource:Post
|
||||||
@ -121,17 +121,17 @@ export default {
|
|||||||
MATCH (resource {id: $resourceId})
|
MATCH (resource {id: $resourceId})
|
||||||
WHERE resource:User OR resource:Post OR resource:Comment
|
WHERE resource:User OR resource:Post OR resource:Comment
|
||||||
// report exists?
|
// report exists?
|
||||||
//WHERE (caseFolder)<-[report:REPORTED]-(submitter:User)
|
//WHERE (claim)<-[report:REPORTED]-(submitter:User)
|
||||||
|
|
||||||
// no open caseFolder, create one, update existing
|
// no open claim, create one, update existing
|
||||||
MERGE (resource)<-[:FLAGGED]-(caseFolder:CaseFolder {closed: false})
|
MERGE (resource)<-[:BELONGS_TO]-(claim:Claim {closed: false})
|
||||||
ON CREATE SET caseFolder.id = randomUUID(), caseFolder.createdAt = $dateTime, caseFolder.updatedAt = caseFolder.createdAt, caseFolder.rule = 'latestReviewUpdatedAtRules', caseFolder.disable = false, caseFolder.closed = false
|
ON CREATE SET claim.id = randomUUID(), claim.createdAt = $dateTime, claim.updatedAt = claim.createdAt, claim.rule = 'latestReviewUpdatedAtRules', claim.disable = false, claim.closed = false
|
||||||
ON MATCH SET caseFolder.updatedAt = $dateTime
|
ON MATCH SET claim.updatedAt = $dateTime
|
||||||
// caseFolder.disable and caseFolder.closed are set after setting them in review
|
// claim.disable and claim.closed are set after setting them in review
|
||||||
|
|
||||||
// Create review on caseFolder
|
// Create review on claim
|
||||||
WITH moderator, resource, caseFolder
|
WITH moderator, resource, claim
|
||||||
MERGE (caseFolder)<-[review:REVIEWED]-(moderator)
|
MERGE (claim)<-[review:REVIEWED]-(moderator)
|
||||||
ON CREATE SET review.createdAt = $dateTime, review.updatedAt = review.createdAt,
|
ON CREATE SET review.createdAt = $dateTime, review.updatedAt = review.createdAt,
|
||||||
review.disable = CASE WHEN $disable IS NULL
|
review.disable = CASE WHEN $disable IS NULL
|
||||||
THEN false
|
THEN false
|
||||||
@ -148,10 +148,10 @@ export default {
|
|||||||
THEN review.closed
|
THEN review.closed
|
||||||
ELSE $closed END
|
ELSE $closed END
|
||||||
|
|
||||||
SET caseFolder.disable = review.disable, caseFolder.closed = review.closed
|
SET claim.disable = review.disable, claim.closed = review.closed
|
||||||
SET resource.disabled = review.disable
|
SET resource.disabled = review.disable
|
||||||
|
|
||||||
RETURN moderator, review, caseFolder {.id}, resource, labels(resource)[0] AS type
|
RETURN moderator, review, claim {.id}, resource, labels(resource)[0] AS type
|
||||||
`
|
`
|
||||||
|
|
||||||
// Wolle console.log('cypher: ', cypher)
|
// Wolle console.log('cypher: ', cypher)
|
||||||
@ -184,7 +184,7 @@ export default {
|
|||||||
return mutateDecisionTransactionResponse.records.map(record => ({
|
return mutateDecisionTransactionResponse.records.map(record => ({
|
||||||
moderator: record.get('moderator'),
|
moderator: record.get('moderator'),
|
||||||
review: record.get('review'),
|
review: record.get('review'),
|
||||||
caseFolder: record.get('caseFolder'),
|
claim: record.get('claim'),
|
||||||
resource: record.get('resource'),
|
resource: record.get('resource'),
|
||||||
type: record.get('type'),
|
type: record.get('type'),
|
||||||
}))
|
}))
|
||||||
@ -200,11 +200,11 @@ export default {
|
|||||||
// comment: null,
|
// comment: null,
|
||||||
// user: null,
|
// user: null,
|
||||||
// }
|
// }
|
||||||
const { moderator: moderatorInResult, review, caseFolder, resource, type } = txResult[0]
|
const { moderator: moderatorInResult, review, claim, resource, type } = txResult[0]
|
||||||
createdRelationshipWithNestedAttributes = {
|
createdRelationshipWithNestedAttributes = {
|
||||||
...review.properties,
|
...review.properties,
|
||||||
moderator: moderatorInResult.properties,
|
moderator: moderatorInResult.properties,
|
||||||
caseFolderId: caseFolder.id,
|
claimId: claim.id,
|
||||||
type,
|
type,
|
||||||
post: null,
|
post: null,
|
||||||
comment: null,
|
comment: null,
|
||||||
|
|||||||
@ -13,14 +13,14 @@ export default {
|
|||||||
MATCH (submitter:User {id: $submitterId})
|
MATCH (submitter:User {id: $submitterId})
|
||||||
MATCH (resource {id: $resourceId})
|
MATCH (resource {id: $resourceId})
|
||||||
WHERE resource:User OR resource:Post OR resource:Comment
|
WHERE resource:User OR resource:Post OR resource:Comment
|
||||||
// no open caseFolder, create one
|
// no open claim, create one
|
||||||
MERGE (resource)<-[:FLAGGED]-(caseFolder:CaseFolder {closed: false})
|
MERGE (resource)<-[:BELONGS_TO]-(claim:Claim {closed: false})
|
||||||
ON CREATE SET caseFolder.id = randomUUID(), caseFolder.createdAt = $createdAt, caseFolder.updatedAt = caseFolder.createdAt, caseFolder.rule = 'latestReviewUpdatedAtRules', caseFolder.disable = false, caseFolder.closed = false
|
ON CREATE SET claim.id = randomUUID(), claim.createdAt = $createdAt, claim.updatedAt = claim.createdAt, claim.rule = 'latestReviewUpdatedAtRules', claim.disable = false, claim.closed = false
|
||||||
// Create report on caseFolder
|
// Create report on claim
|
||||||
WITH submitter, resource, caseFolder
|
WITH submitter, resource, claim
|
||||||
CREATE (caseFolder)<-[report:REPORTED {createdAt: $createdAt, reasonCategory: $reasonCategory, reasonDescription: $reasonDescription}]-(submitter)
|
CREATE (claim)<-[report:REPORTED {createdAt: $createdAt, reasonCategory: $reasonCategory, reasonDescription: $reasonDescription}]-(submitter)
|
||||||
|
|
||||||
RETURN submitter, report, caseFolder, resource, labels(resource)[0] AS type
|
RETURN submitter, report, claim, resource, labels(resource)[0] AS type
|
||||||
`,
|
`,
|
||||||
{
|
{
|
||||||
resourceId,
|
resourceId,
|
||||||
@ -33,7 +33,7 @@ export default {
|
|||||||
return reportRelationshipTransactionResponse.records.map(record => ({
|
return reportRelationshipTransactionResponse.records.map(record => ({
|
||||||
submitter: record.get('submitter'),
|
submitter: record.get('submitter'),
|
||||||
report: record.get('report'),
|
report: record.get('report'),
|
||||||
caseFolder: record.get('caseFolder'),
|
claim: record.get('claim'),
|
||||||
resource: record.get('resource').properties,
|
resource: record.get('resource').properties,
|
||||||
type: record.get('type'),
|
type: record.get('type'),
|
||||||
}))
|
}))
|
||||||
@ -41,13 +41,13 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const txResult = await writeTxResultPromise
|
const txResult = await writeTxResultPromise
|
||||||
if (!txResult[0]) return null
|
if (!txResult[0]) return null
|
||||||
const { submitter, report, caseFolder, resource, type } = txResult[0]
|
const { submitter, report, claim, resource, type } = txResult[0]
|
||||||
createdRelationshipWithNestedAttributes = {
|
createdRelationshipWithNestedAttributes = {
|
||||||
...report.properties,
|
...report.properties,
|
||||||
caseFolderId: caseFolder.properties.id,
|
claimId: claim.properties.id,
|
||||||
caseFolderUpdatedAt: caseFolder.properties.updatedAt,
|
claimUpdatedAt: claim.properties.updatedAt,
|
||||||
caseFolderDisable: caseFolder.properties.disable,
|
claimDisable: claim.properties.disable,
|
||||||
caseFolderClosed: caseFolder.properties.closed,
|
claimClosed: claim.properties.closed,
|
||||||
post: null,
|
post: null,
|
||||||
comment: null,
|
comment: null,
|
||||||
user: null,
|
user: null,
|
||||||
@ -89,10 +89,10 @@ export default {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const cypher = `
|
const cypher = `
|
||||||
MATCH (submitter:User)-[report:REPORTED]->(caseFolder:CaseFolder)-[:FLAGGED]->(resource)
|
MATCH (submitter:User)-[report:REPORTED]->(claim:Claim)-[:BELONGS_TO]->(resource)
|
||||||
// Wolle OPTIONAL MATCH (reviewer:User)-[:REVIEWED]->(caseFolder)
|
// Wolle OPTIONAL MATCH (reviewer:User)-[:REVIEWED]->(claim)
|
||||||
WHERE resource:User OR resource:Post OR resource:Comment
|
WHERE resource:User OR resource:Post OR resource:Comment
|
||||||
RETURN submitter, report, caseFolder, resource, labels(resource)[0] as type
|
RETURN submitter, report, claim, resource, labels(resource)[0] as type
|
||||||
${orderByClause}
|
${orderByClause}
|
||||||
`
|
`
|
||||||
const result = await session.run(cypher, {})
|
const result = await session.run(cypher, {})
|
||||||
@ -100,7 +100,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
submitter: r.get('submitter'),
|
submitter: r.get('submitter'),
|
||||||
report: r.get('report'),
|
report: r.get('report'),
|
||||||
caseFolder: r.get('caseFolder'),
|
claim: r.get('claim'),
|
||||||
resource: r.get('resource'),
|
resource: r.get('resource'),
|
||||||
type: r.get('type'),
|
type: r.get('type'),
|
||||||
}
|
}
|
||||||
@ -109,14 +109,14 @@ export default {
|
|||||||
|
|
||||||
response = []
|
response = []
|
||||||
dbResponse.forEach(ele => {
|
dbResponse.forEach(ele => {
|
||||||
const { report, submitter, caseFolder, resource, type } = ele
|
const { report, submitter, claim, resource, type } = ele
|
||||||
|
|
||||||
const responseEle = {
|
const responseEle = {
|
||||||
...report.properties,
|
...report.properties,
|
||||||
caseFolderId: caseFolder.properties.id,
|
claimId: claim.properties.id,
|
||||||
caseFolderUpdatedAt: caseFolder.properties.updatedAt,
|
claimUpdatedAt: claim.properties.updatedAt,
|
||||||
caseFolderDisable: caseFolder.properties.disable,
|
claimDisable: claim.properties.disable,
|
||||||
caseFolderClosed: caseFolder.properties.closed,
|
claimClosed: claim.properties.closed,
|
||||||
post: null,
|
post: null,
|
||||||
comment: null,
|
comment: null,
|
||||||
user: null,
|
user: null,
|
||||||
@ -154,6 +154,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
REPORTED: {
|
REPORTED: {
|
||||||
// Wolle ...undefinedToNullResolver(['caseFolderId', 'caseFolderDisable', 'caseFolderUpdatedAt', 'caseFolderClosed']),
|
// Wolle ...undefinedToNullResolver(['claimId', 'claimDisable', 'claimUpdatedAt', 'claimClosed']),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
type CaseFolder {
|
type Claim {
|
||||||
id: ID!
|
id: ID!
|
||||||
createdAt: String!
|
createdAt: String!
|
||||||
updatedAt: String!
|
updatedAt: String!
|
||||||
rule: CaseRule!
|
rule: ClaimRule!
|
||||||
disable: Boolean!
|
disable: Boolean!
|
||||||
# reasonCategory: ReasonCategory!
|
|
||||||
# reasonDescription: String!
|
|
||||||
closed: Boolean!
|
closed: Boolean!
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CaseRule {
|
enum ClaimRule {
|
||||||
latestReviewUpdatedAtRules
|
latestReviewUpdatedAtRules
|
||||||
}
|
}
|
||||||
@ -12,9 +12,9 @@ type Comment {
|
|||||||
reviewedByModerator: User
|
reviewedByModerator: User
|
||||||
@cypher(
|
@cypher(
|
||||||
statement: """
|
statement: """
|
||||||
MATCH (this)<-[:FLAGGED]-(caseFolder:CaseFolder)<-[review:REVIEWED]-(moderator:User)
|
MATCH (this)<-[:BELONGS_TO]-(claim:Claim)<-[review:REVIEWED]-(moderator:User)
|
||||||
RETURN moderator
|
RETURN moderator
|
||||||
ORDER BY caseFolder.updatedAt DESC, review.updatedAt DESC
|
ORDER BY claim.updatedAt DESC, review.updatedAt DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|||||||
@ -124,9 +124,9 @@ type Post {
|
|||||||
reviewedByModerator: User
|
reviewedByModerator: User
|
||||||
@cypher(
|
@cypher(
|
||||||
statement: """
|
statement: """
|
||||||
MATCH (this)<-[:FLAGGED]-(caseFolder:CaseFolder)<-[review:REVIEWED]-(moderator:User)
|
MATCH (this)<-[:BELONGS_TO]-(claim:Claim)<-[review:REVIEWED]-(moderator:User)
|
||||||
RETURN moderator
|
RETURN moderator
|
||||||
ORDER BY caseFolder.updatedAt DESC, review.updatedAt DESC
|
ORDER BY claim.updatedAt DESC, review.updatedAt DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|||||||
@ -3,10 +3,10 @@ type REPORTED {
|
|||||||
reasonCategory: ReasonCategory!
|
reasonCategory: ReasonCategory!
|
||||||
reasonDescription: String!
|
reasonDescription: String!
|
||||||
|
|
||||||
caseFolderId: ID!
|
claimId: ID!
|
||||||
caseFolderDisable: Boolean!
|
claimDisable: Boolean!
|
||||||
caseFolderUpdatedAt: String!
|
claimUpdatedAt: String!
|
||||||
caseFolderClosed: Boolean!
|
claimClosed: Boolean!
|
||||||
|
|
||||||
# Wolle decision: DECIDED
|
# Wolle decision: DECIDED
|
||||||
# @cypher(statement: "MATCH (resource)<-[decision:DECIDED {uuid: $decisionUuid}]-(user:User) RETURN decision")
|
# @cypher(statement: "MATCH (resource)<-[decision:DECIDED {uuid: $decisionUuid}]-(user:User) RETURN decision")
|
||||||
|
|||||||
@ -5,7 +5,7 @@ type REVIEWED {
|
|||||||
# reasonDescription: String
|
# reasonDescription: String
|
||||||
disable: Boolean!
|
disable: Boolean!
|
||||||
closed: Boolean!
|
closed: Boolean!
|
||||||
caseFolderId: ID!
|
claimId: ID!
|
||||||
# Wolle last: Boolean!
|
# Wolle last: Boolean!
|
||||||
|
|
||||||
moderator: User
|
moderator: User
|
||||||
|
|||||||
@ -36,9 +36,9 @@ type User {
|
|||||||
reviewedByModerator: User
|
reviewedByModerator: User
|
||||||
@cypher(
|
@cypher(
|
||||||
statement: """
|
statement: """
|
||||||
MATCH (this)<-[:FLAGGED]-(caseFolder:CaseFolder)<-[review:REVIEWED]-(moderator:User)
|
MATCH (this)<-[:BELONGS_TO]-(claim:Claim)<-[review:REVIEWED]-(moderator:User)
|
||||||
RETURN moderator
|
RETURN moderator
|
||||||
ORDER BY caseFolder.updatedAt DESC, review.updatedAt DESC
|
ORDER BY claim.updatedAt DESC, review.updatedAt DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|||||||
@ -16,23 +16,23 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
// convert old DISABLED to new REVIEWED-CaseFolder-FLAGGED structure
|
// convert old DISABLED to new REVIEWED-Claim-BELONGS_TO structure
|
||||||
MATCH (moderator:User)-[disabled:DISABLED]->(disabledResource)
|
MATCH (moderator:User)-[disabled:DISABLED]->(disabledResource)
|
||||||
WHERE disabledResource:User OR disabledResource:Comment OR disabledResource:Post
|
WHERE disabledResource:User OR disabledResource:Comment OR disabledResource:Post
|
||||||
DELETE disabled
|
DELETE disabled
|
||||||
CREATE (moderator)-[review:REVIEWED]->(caseFolder:CaseFolder)-[:FLAGGED]->(disabledResource)
|
CREATE (moderator)-[review:REVIEWED]->(claim:Claim)-[:BELONGS_TO]->(disabledResource)
|
||||||
SET review.createdAt = toString(datetime()), review.updatedAt = review.createdAt, review.disable = true
|
SET review.createdAt = toString(datetime()), review.updatedAt = review.createdAt, review.disable = true
|
||||||
SET caseFolder.id = randomUUID(), caseFolder.createdAt = toString(datetime()), caseFolder.updatedAt = caseFolder.createdAt, caseFolder.rule = 'latestReviewUpdatedAtRules', caseFolder.disable = true, caseFolder.closed = false
|
SET claim.id = randomUUID(), claim.createdAt = toString(datetime()), claim.updatedAt = claim.createdAt, claim.rule = 'latestReviewUpdatedAtRules', claim.disable = true, claim.closed = false
|
||||||
|
|
||||||
// if disabledResource has no report, then create a moderators default report
|
// if disabledResource has no report, then create a moderators default report
|
||||||
WITH moderator, disabledResource, caseFolder
|
WITH moderator, disabledResource, claim
|
||||||
OPTIONAL MATCH (disabledResourceReporter:User)-[existingReport:REPORTED]->(disabledResource)
|
OPTIONAL MATCH (disabledResourceReporter:User)-[existingReport:REPORTED]->(disabledResource)
|
||||||
FOREACH(disabledResource IN CASE WHEN existingReport IS NULL THEN [1] ELSE [] END |
|
FOREACH(disabledResource IN CASE WHEN existingReport IS NULL THEN [1] ELSE [] END |
|
||||||
CREATE (moderator)-[addModeratorReport:REPORTED]->(caseFolder)
|
CREATE (moderator)-[addModeratorReport:REPORTED]->(claim)
|
||||||
SET addModeratorReport.createdAt = toString(datetime()), addModeratorReport.reasonCategory = 'other', addModeratorReport.reasonDescription = 'Old DISABLED relation had no now mandatory report !!! Created automatically to ensure database consistency! Creation date is when the database manipulation happened.'
|
SET addModeratorReport.createdAt = toString(datetime()), addModeratorReport.reasonCategory = 'other', addModeratorReport.reasonDescription = 'Old DISABLED relation had no now mandatory report !!! Created automatically to ensure database consistency! Creation date is when the database manipulation happened.'
|
||||||
)
|
)
|
||||||
FOREACH(disabledResource IN CASE WHEN existingReport IS NOT NULL THEN [1] ELSE [] END |
|
FOREACH(disabledResource IN CASE WHEN existingReport IS NOT NULL THEN [1] ELSE [] END |
|
||||||
CREATE (disabledResourceReporter)-[moveModeratorReport:REPORTED]->(caseFolder)
|
CREATE (disabledResourceReporter)-[moveModeratorReport:REPORTED]->(claim)
|
||||||
SET moveModeratorReport = existingReport
|
SET moveModeratorReport = existingReport
|
||||||
DELETE existingReport
|
DELETE existingReport
|
||||||
)
|
)
|
||||||
@ -41,12 +41,12 @@ RETURN disabledResource {.id};
|
|||||||
" | cypher-shell
|
" | cypher-shell
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
// for REPORTED resources without DISABLED relation which are handled above, create new REPORTED-CaseFolder-FLAGGED structure
|
// for REPORTED resources without DISABLED relation which are handled above, create new REPORTED-Claim-BELONGS_TO structure
|
||||||
MATCH (reporter:User)-[oldReport:REPORTED]->(notDisabledResource)
|
MATCH (reporter:User)-[oldReport:REPORTED]->(notDisabledResource)
|
||||||
WHERE notDisabledResource:User OR notDisabledResource:Comment OR notDisabledResource:Post
|
WHERE notDisabledResource:User OR notDisabledResource:Comment OR notDisabledResource:Post
|
||||||
MERGE (caseFolder:CaseFolder)-[:FLAGGED]->(notDisabledResource)
|
MERGE (claim:Claim)-[:BELONGS_TO]->(notDisabledResource)
|
||||||
ON CREATE SET caseFolder.id = randomUUID(), caseFolder.createdAt = toString(datetime()), caseFolder.updatedAt = caseFolder.createdAt, caseFolder.rule = 'latestReviewUpdatedAtRules', caseFolder.disable = false, caseFolder.closed = false
|
ON CREATE SET claim.id = randomUUID(), claim.createdAt = toString(datetime()), claim.updatedAt = claim.createdAt, claim.rule = 'latestReviewUpdatedAtRules', claim.disable = false, claim.closed = false
|
||||||
CREATE (reporter)-[report:REPORTED]->(caseFolder)
|
CREATE (reporter)-[report:REPORTED]->(claim)
|
||||||
SET report = oldReport
|
SET report = oldReport
|
||||||
DELETE oldReport
|
DELETE oldReport
|
||||||
|
|
||||||
|
|||||||
@ -8,10 +8,10 @@ export const reportListQuery = () => {
|
|||||||
createdAt
|
createdAt
|
||||||
reasonCategory
|
reasonCategory
|
||||||
reasonDescription
|
reasonDescription
|
||||||
caseFolderId
|
claimId
|
||||||
caseFolderUpdatedAt
|
claimUpdatedAt
|
||||||
caseFolderDisable
|
claimDisable
|
||||||
caseFolderClosed
|
claimClosed
|
||||||
type
|
type
|
||||||
submitter {
|
submitter {
|
||||||
id
|
id
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
<template v-for="content in reportedContentStructure">
|
<template v-for="content in reportedContentStructure">
|
||||||
<thead
|
<thead
|
||||||
:class="[
|
:class="[
|
||||||
content.caseFolderClosed ? 'decision' : 'no-decision',
|
content.claimClosed ? 'decision' : 'no-decision',
|
||||||
'ds-table-col',
|
'ds-table-col',
|
||||||
'ds-table-head-col',
|
'ds-table-head-col',
|
||||||
'ds-table-head-col-border',
|
'ds-table-head-col-border',
|
||||||
@ -88,8 +88,8 @@
|
|||||||
<span v-else>—</span>
|
<span v-else>—</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="ds-table-col ds-table-head-col-border">
|
<td class="ds-table-col ds-table-head-col-border">
|
||||||
<!-- caseFolderClosed -->
|
<!-- claimClosed -->
|
||||||
<b v-if="content.caseFolderClosed">
|
<b v-if="content.claimClosed">
|
||||||
{{ $t('moderation.reports.decided') }}
|
{{ $t('moderation.reports.decided') }}
|
||||||
</b>
|
</b>
|
||||||
<ds-button
|
<ds-button
|
||||||
@ -104,7 +104,7 @@
|
|||||||
<!-- reviewedByModerator -->
|
<!-- reviewedByModerator -->
|
||||||
<div v-if="content.resource.reviewedByModerator">
|
<div v-if="content.resource.reviewedByModerator">
|
||||||
<br />
|
<br />
|
||||||
<div v-if="content.caseFolderDisable">
|
<div v-if="content.claimDisable">
|
||||||
<ds-icon name="eye-slash" class="ban" />
|
<ds-icon name="eye-slash" class="ban" />
|
||||||
{{ $t('moderation.reports.disabledBy') }}
|
{{ $t('moderation.reports.disabledBy') }}
|
||||||
</div>
|
</div>
|
||||||
@ -116,7 +116,7 @@
|
|||||||
:user="content.resource.reviewedByModerator"
|
:user="content.resource.reviewedByModerator"
|
||||||
:showAvatar="false"
|
:showAvatar="false"
|
||||||
:trunc="30"
|
:trunc="30"
|
||||||
:date-time="content.caseFolderUpdatedAt"
|
:date-time="content.claimUpdatedAt"
|
||||||
positionDatetime="below"
|
positionDatetime="below"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -226,10 +226,10 @@ export default {
|
|||||||
if (idx === -1) {
|
if (idx === -1) {
|
||||||
idx = newReportedContentStructure.length
|
idx = newReportedContentStructure.length
|
||||||
newReportedContentStructure.push({
|
newReportedContentStructure.push({
|
||||||
caseFolderId: report.caseFolderId,
|
claimId: report.claimId,
|
||||||
caseFolderUpdatedAt: report.caseFolderUpdatedAt,
|
claimUpdatedAt: report.claimUpdatedAt,
|
||||||
caseFolderDisable: report.caseFolderDisable,
|
claimDisable: report.claimDisable,
|
||||||
caseFolderClosed: report.caseFolderClosed,
|
claimClosed: report.claimClosed,
|
||||||
type: report.type,
|
type: report.type,
|
||||||
resource,
|
resource,
|
||||||
user: report.user,
|
user: report.user,
|
||||||
@ -267,7 +267,7 @@ export default {
|
|||||||
'moderation.reports.decideModal.' +
|
'moderation.reports.decideModal.' +
|
||||||
content.type +
|
content.type +
|
||||||
'.' +
|
'.' +
|
||||||
(content.caseFolderDisable ? 'disable' : 'enable')
|
(content.claimDisable ? 'disable' : 'enable')
|
||||||
this.$store.commit('modal/SET_OPEN', {
|
this.$store.commit('modal/SET_OPEN', {
|
||||||
name: 'confirm',
|
name: 'confirm',
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user