Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/SharingEntryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
<template>
<li :class="{'sharing-entry--share': share}" class="sharing-entry sharing-entry__link">
<div class="sharing-entry__desc" @click.prevent="toggleQuickShareSelect">
<span class="sharing-entry__title" :title="title">
{{ title }}
<span class="sharing-entry__title" :title="plainTitle" v-html="title">

Check warning on line 26 in src/components/SharingEntryLink.vue

View workflow job for this annotation

GitHub Actions / eslint

'v-html' directive can lead to XSS attack

Check warning on line 26 in src/components/SharingEntryLink.vue

View workflow job for this annotation

GitHub Actions / eslint

Require self-closing on HTML elements (<span>)
</span>
<p v-if="subtitle && false">
{{ subtitle }}
Expand Down Expand Up @@ -192,6 +191,12 @@

computed: {

plainTitle() {
const txt = document.createElement('textarea')
txt.innerHTML = this.title || ''
return txt.value
},

copyText() {
if (this.copied && this.copySuccess) {
return t('nmcsharing', 'Copied')
Expand Down Expand Up @@ -290,8 +295,8 @@
},
async set(enabled) {
// TODO: directly save after generation to make sure the share is always protected
Vue.set(this.share, 'password', enabled ? await GeneratePassword() : '')

Check warning on line 298 in src/components/SharingEntryLink.vue

View workflow job for this annotation

GitHub Actions / eslint

Caution: `Vue` also has a named export `set`. Check if you meant to write `import {set} from 'vue'` instead
Vue.set(this.share, 'newPassword', this.share.password)

Check warning on line 299 in src/components/SharingEntryLink.vue

View workflow job for this annotation

GitHub Actions / eslint

Caution: `Vue` also has a named export `set`. Check if you meant to write `import {set} from 'vue'` instead
},
},

Expand All @@ -300,9 +305,9 @@
return null
}

const expirationTime = moment(this.share.passwordExpirationTime)

Check warning on line 308 in src/components/SharingEntryLink.vue

View workflow job for this annotation

GitHub Actions / eslint

The global property or function moment was deprecated in Nextcloud 18.0.0

if (expirationTime.diff(moment()) < 0) {

Check warning on line 310 in src/components/SharingEntryLink.vue

View workflow job for this annotation

GitHub Actions / eslint

The global property or function moment was deprecated in Nextcloud 18.0.0
return false
}

Expand Down
4 changes: 2 additions & 2 deletions src/views/SharingDetailsTab.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div class="sharingTabDetailsView">
<span class="header-permissions">
<h2 class="header-permissions">
<ChevronLeftIcon :size="24" class="back-button" @click="$emit('close-sharing-details')" />
<h2 class="sharingTabDetailsView__header" style="margin-bottom: 0;">
{{ t('nmcsharing', 'Permissions') }}
</h2>
</span>
</h2>

<span class="sharingPopup__fileinfo">{{ fileInfo.name }} ⸱ {{ size }}</span>

Expand Down
Loading