Moderator notes WIP (#144):

Displaying the nickname at time of note creation if it changed.
This commit is contained in:
John Livingston
2024-07-31 21:55:20 +02:00
parent 70f702f78e
commit 48763e6173
7 changed files with 17 additions and 5 deletions

View File

@ -12,6 +12,7 @@ export default class MUCNoteOccupantView extends CustomElement {
static get properties () {
return {
model: { type: Object, attribute: true },
note: { type: Object, attribute: true }, // optional associated note
full_display: { type: Boolean, attribute: true }
}
}
@ -21,7 +22,7 @@ export default class MUCNoteOccupantView extends CustomElement {
}
render () {
return tplMucNoteOccupant(this, this.model)
return tplMucNoteOccupant(this, this.model, this.note)
}
}

View File

@ -26,7 +26,7 @@ export function tplMUCNoteApp (el, mucModel) {
// eslint-disable-next-line no-undef
const i18nHelp = __(LOC_online_help)
const helpUrl = converseLocalizedHelpUrl({
page: 'documentation/user/streamers/notes'
page: 'documentation/user/streamers/moderator_notes'
})
return tplMUCApp(

View File

@ -7,7 +7,7 @@ import { api } from '@converse/headless'
import { getAuthorStyle } from '../../../../src/utils/color.js'
import { __ } from 'i18n'
export function tplMucNoteOccupant (el, occupant) {
export function tplMucNoteOccupant (el, occupant, note) {
const authorStyle = getAuthorStyle(occupant)
const jid = occupant.get('jid')
const occupantId = occupant.get('occupant_id')
@ -28,6 +28,13 @@ export function tplMucNoteOccupant (el, occupant) {
${
el.full_display
? html`<ul aria-hidden="true">
${
// user changed nick: display the original nick
note && note.get('about_nick') && note.get('about_nick') !== occupant.get('nick')
// eslint-disable-next-line no-undef
? html`<li title=${__(LOC_moderator_note_original_nick)}>${note.get('about_nick')}</li>`
: ''
}
${jid ? html`<li title=${__('XMPP Address')}>${jid}</li>` : ''}
${occupantId ? html`<li title=${__('Occupant Id')}>${occupantId}</li>` : ''}
</ul>`

View File

@ -24,6 +24,7 @@ export function tplMucNote (el, note) {
<livechat-converse-muc-note-occupant
.full_display=${el.is_ocupant_filter}
.model=${aboutOccupant}
.note=${note}
></livechat-converse-muc-note-occupant>`
: ''
}
@ -60,6 +61,7 @@ export function tplMucNote (el, note) {
<livechat-converse-muc-note-occupant
full_display=${true}
.model=${aboutOccupant}
.note=${note}
></livechat-converse-muc-note-occupant>
`
: ''