Merge branch 'disjointed-popovers' into shigusegubu-vue3
* disjointed-popovers: fix tests by just ignoring the html comments fix mentionsline extramentions lack of space don't show bookmark button for anon visitors
This commit is contained in:
commit
1ff33a78a7
4 changed files with 30 additions and 36 deletions
|
@ -89,6 +89,9 @@ const ExtraButtons = {
|
||||||
canMute () {
|
canMute () {
|
||||||
return !!this.currentUser
|
return !!this.currentUser
|
||||||
},
|
},
|
||||||
|
canBookmark () {
|
||||||
|
return !!this.currentUser
|
||||||
|
},
|
||||||
statusLink () {
|
statusLink () {
|
||||||
return `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}`
|
return `${this.$store.state.instance.server}${this.$router.resolve({ name: 'conversation', params: { id: this.status.id } }).href}`
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
icon="thumbtack"
|
icon="thumbtack"
|
||||||
/><span>{{ $t("status.unpin") }}</span>
|
/><span>{{ $t("status.unpin") }}</span>
|
||||||
</button>
|
</button>
|
||||||
|
<template v-if="canBookmark">
|
||||||
<button
|
<button
|
||||||
v-if="!status.bookmarked"
|
v-if="!status.bookmarked"
|
||||||
class="button-default dropdown-item dropdown-item-icon"
|
class="button-default dropdown-item dropdown-item-icon"
|
||||||
|
@ -73,6 +74,7 @@
|
||||||
icon="bookmark"
|
icon="bookmark"
|
||||||
/><span>{{ $t("status.unbookmark") }}</span>
|
/><span>{{ $t("status.unbookmark") }}</span>
|
||||||
</button>
|
</button>
|
||||||
|
</template>
|
||||||
<button
|
<button
|
||||||
v-if="canDelete"
|
v-if="canDelete"
|
||||||
class="button-default dropdown-item dropdown-item-icon"
|
class="button-default dropdown-item dropdown-item-icon"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
class="mention-link"
|
class="mention-link"
|
||||||
:content="mention.content"
|
:content="mention.content"
|
||||||
:url="mention.url"
|
:url="mention.url"
|
||||||
/><span
|
/> <span
|
||||||
v-if="manyMentions"
|
v-if="manyMentions"
|
||||||
class="extraMentions"
|
class="extraMentions"
|
||||||
>
|
>
|
||||||
|
|
|
@ -356,7 +356,6 @@ describe('RichContent', () => {
|
||||||
p(
|
p(
|
||||||
'<span class="MentionsLine">',
|
'<span class="MentionsLine">',
|
||||||
'<span class="MentionLink mention-link">',
|
'<span class="MentionLink mention-link">',
|
||||||
'<!-- eslint-disable vue/no-v-html -->',
|
|
||||||
'<a href="lol" class="original" target="_blank">',
|
'<a href="lol" class="original" target="_blank">',
|
||||||
'<span>',
|
'<span>',
|
||||||
'https://</span>',
|
'https://</span>',
|
||||||
|
@ -365,10 +364,7 @@ describe('RichContent', () => {
|
||||||
'<span>',
|
'<span>',
|
||||||
'</span>',
|
'</span>',
|
||||||
'</a>',
|
'</a>',
|
||||||
'<!-- eslint-enable vue/no-v-html -->',
|
|
||||||
'<!---->', // vue placeholder
|
|
||||||
'</span>',
|
'</span>',
|
||||||
'<!--v-if-->', // vue placeholder, mentionsline's extra mentions and stuff
|
|
||||||
'</span>'
|
'</span>'
|
||||||
),
|
),
|
||||||
p(
|
p(
|
||||||
|
@ -387,7 +383,7 @@ describe('RichContent', () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected))
|
expect(wrapper.html().replace(/\n/g, '').replace(/<!--.*?-->/g, '')).to.eql(compwrap(expected))
|
||||||
})
|
})
|
||||||
|
|
||||||
it('rich contents of nested mentions are handled properly', () => {
|
it('rich contents of nested mentions are handled properly', () => {
|
||||||
|
@ -419,7 +415,6 @@ describe('RichContent', () => {
|
||||||
'<span class="poast-style">',
|
'<span class="poast-style">',
|
||||||
'<span class="MentionsLine">',
|
'<span class="MentionsLine">',
|
||||||
'<span class="MentionLink mention-link">',
|
'<span class="MentionLink mention-link">',
|
||||||
'<!-- eslint-disable vue/no-v-html -->',
|
|
||||||
'<a href="lol" class="original" target="_blank">',
|
'<a href="lol" class="original" target="_blank">',
|
||||||
'<span>',
|
'<span>',
|
||||||
'https://</span>',
|
'https://</span>',
|
||||||
|
@ -428,11 +423,8 @@ describe('RichContent', () => {
|
||||||
'<span>',
|
'<span>',
|
||||||
'</span>',
|
'</span>',
|
||||||
'</a>',
|
'</a>',
|
||||||
'<!-- eslint-enable vue/no-v-html -->',
|
|
||||||
'<!---->', // vue placeholder, mentionlink's "new" (i.e. rich) display
|
|
||||||
'</span>',
|
'</span>',
|
||||||
'<span class="MentionLink mention-link">',
|
'<span class="MentionLink mention-link">',
|
||||||
'<!-- eslint-disable vue/no-v-html -->',
|
|
||||||
'<a href="lol" class="original" target="_blank">',
|
'<a href="lol" class="original" target="_blank">',
|
||||||
'<span>',
|
'<span>',
|
||||||
'https://</span>',
|
'https://</span>',
|
||||||
|
@ -441,10 +433,7 @@ describe('RichContent', () => {
|
||||||
'<span>',
|
'<span>',
|
||||||
'</span>',
|
'</span>',
|
||||||
'</a>',
|
'</a>',
|
||||||
'<!-- eslint-enable vue/no-v-html -->',
|
|
||||||
'<!---->', // vue placeholder, mentionlink's "new" (i.e. rich) display
|
|
||||||
'</span>',
|
'</span>',
|
||||||
'<!--v-if-->', // vue placeholder, mentionsline's extra mentions and stuff
|
|
||||||
'</span>',
|
'</span>',
|
||||||
' ',
|
' ',
|
||||||
'</span>',
|
'</span>',
|
||||||
|
@ -462,7 +451,7 @@ describe('RichContent', () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(wrapper.html().replace(/\n/g, '')).to.eql(compwrap(expected))
|
expect(wrapper.html().replace(/\n/g, '').replace(/<!--.*?-->/g, '')).to.eql(compwrap(expected))
|
||||||
})
|
})
|
||||||
|
|
||||||
it('rich contents of a link are handled properly', () => {
|
it('rich contents of a link are handled properly', () => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue