mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Merge branch '1017-send-out-notifications-on-create-omment' of github.com:Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment
This commit is contained in:
commit
f0af231975
@ -7,13 +7,13 @@ const notifyMentions = async (label, id, idsOfMentionedUsers, context) => {
|
||||
const session = context.driver.session()
|
||||
const createdAt = new Date().toISOString()
|
||||
const cypher = `
|
||||
MATCH (source)
|
||||
MATCH (source)
|
||||
WHERE source.id = $id AND $label IN LABELS(source)
|
||||
MATCH(source)<-[:WROTE]-(author:User)
|
||||
MATCH(u:User)
|
||||
MATCH (source)<-[:WROTE]-(author: User)
|
||||
MATCH (u: User)
|
||||
WHERE u.id in $idsOfMentionedUsers
|
||||
AND NOT (u)<-[:BLOCKED]-(author)
|
||||
CREATE(n:Notification{id: apoc.create.uuid(), read: false, createdAt: $createdAt})
|
||||
CREATE (n: Notification {id: apoc.create.uuid(), read: false, createdAt: $createdAt })
|
||||
MERGE (source)-[:NOTIFIED]->(n)-[:NOTIFIED]->(u)
|
||||
`
|
||||
await session.run(cypher, {
|
||||
|
||||
@ -3,5 +3,6 @@ type Notification {
|
||||
read: Boolean
|
||||
user: User @relation(name: "NOTIFIED", direction: "OUT")
|
||||
post: Post @relation(name: "NOTIFIED", direction: "IN")
|
||||
comment: Comment @relation(name: "NOTIFIED", direction: "IN")
|
||||
createdAt: String
|
||||
}
|
||||
|
||||
@ -18,7 +18,9 @@
|
||||
<!-- if query is not empty and is find fully in the suggestions array ... -->
|
||||
<div v-if="query && !filteredItems.find(el => el.name === query)">
|
||||
<div class="suggestion-list__item is-empty">{{ $t('editor.hashtag.addHashtag') }}</div>
|
||||
<div class="suggestion-list__item" @click="selectItem({ name: query })">#{{ query }}</div>
|
||||
<div class="suggestion-list__item" @click="selectItem({ name: query })">
|
||||
#{{ query }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- otherwise if sanitized query is empty advice the user to add a char -->
|
||||
<div v-else-if="!query">
|
||||
@ -28,19 +30,19 @@
|
||||
</template>
|
||||
<!-- if "!hasResults" -->
|
||||
<div v-else>
|
||||
<div
|
||||
v-if="isMention"
|
||||
class="suggestion-list__item is-empty"
|
||||
>{{ $t('editor.mention.noUsersFound') }}</div>
|
||||
<div v-if="isMention" class="suggestion-list__item is-empty">
|
||||
{{ $t('editor.mention.noUsersFound') }}
|
||||
</div>
|
||||
<div v-if="isHashtag">
|
||||
<div
|
||||
v-if="query === ''"
|
||||
class="suggestion-list__item is-empty"
|
||||
>{{ $t('editor.hashtag.noHashtagsFound') }}</div>
|
||||
<div v-if="query === ''" class="suggestion-list__item is-empty">
|
||||
{{ $t('editor.hashtag.noHashtagsFound') }}
|
||||
</div>
|
||||
<!-- if "query" is not empty -->
|
||||
<div v-else>
|
||||
<div class="suggestion-list__item is-empty">{{ $t('editor.hashtag.addHashtag') }}</div>
|
||||
<div class="suggestion-list__item" @click="selectItem({ name: query })">#{{ query }}</div>
|
||||
<div class="suggestion-list__item" @click="selectItem({ name: query })">
|
||||
#{{ query }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -126,14 +128,18 @@
|
||||
size="small"
|
||||
:ghost="!isActive.heading({ level: 3 })"
|
||||
@click.prevent="commands.heading({ level: 3 })"
|
||||
>H3</ds-button>
|
||||
>
|
||||
H3
|
||||
</ds-button>
|
||||
|
||||
<ds-button
|
||||
class="menubar__button"
|
||||
size="small"
|
||||
:ghost="!isActive.heading({ level: 4 })"
|
||||
@click.prevent="commands.heading({ level: 4 })"
|
||||
>H4</ds-button>
|
||||
>
|
||||
H4
|
||||
</ds-button>
|
||||
|
||||
<ds-button
|
||||
class="menubar__button"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user