aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/views/SharingInherited.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/src/views/SharingInherited.vue')
-rw-r--r--apps/files_sharing/src/views/SharingInherited.vue60
1 files changed, 28 insertions, 32 deletions
diff --git a/apps/files_sharing/src/views/SharingInherited.vue b/apps/files_sharing/src/views/SharingInherited.vue
index 3a3e4b633e2..809de522d93 100644
--- a/apps/files_sharing/src/views/SharingInherited.vue
+++ b/apps/files_sharing/src/views/SharingInherited.vue
@@ -1,61 +1,47 @@
<!--
- - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
- -
- - @author John Molakvoæ <skjnldsv@protonmail.com>
- -
- - @license GNU AGPL version 3 or any later version
- -
- - This program is free software: you can redistribute it and/or modify
- - it under the terms of the GNU Affero General Public License as
- - published by the Free Software Foundation, either version 3 of the
- - License, or (at your option) any later version.
- -
- - This program is distributed in the hope that it will be useful,
- - but WITHOUT ANY WARRANTY; without even the implied warranty of
- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- - GNU Affero General Public License for more details.
- -
- - You should have received a copy of the GNU Affero General Public License
- - along with this program. If not, see <http://www.gnu.org/licenses/>.
- -
- -->
+ - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ - SPDX-License-Identifier: AGPL-3.0-or-later
+-->
<template>
- <ul id="sharing-inherited-shares">
+ <ul v-if="shares.length" id="sharing-inherited-shares">
<!-- Main collapsible entry -->
<SharingEntrySimple class="sharing-entry__inherited"
:title="mainTitle"
- :subtitle="subTitle">
+ :subtitle="subTitle"
+ :aria-expanded="showInheritedShares">
<template #avatar>
<div class="avatar-shared icon-more-white" />
</template>
- <ActionButton :icon="showInheritedSharesIcon" @click.prevent.stop="toggleInheritedShares">
- {{ toggleTooltip }}
- </ActionButton>
+ <NcActionButton :icon="showInheritedSharesIcon"
+ :aria-label="toggleTooltip"
+ :title="toggleTooltip"
+ @click.prevent.stop="toggleInheritedShares" />
</SharingEntrySimple>
<!-- Inherited shares list -->
<SharingEntryInherited v-for="share in shares"
:key="share.id"
:file-info="fileInfo"
- :share="share" />
+ :share="share"
+ @remove:share="removeShare" />
</ul>
</template>
<script>
import { generateOcsUrl } from '@nextcloud/router'
-import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
+import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import axios from '@nextcloud/axios'
-import Share from '../models/Share'
-import SharingEntryInherited from '../components/SharingEntryInherited'
-import SharingEntrySimple from '../components/SharingEntrySimple'
+import Share from '../models/Share.ts'
+import SharingEntryInherited from '../components/SharingEntryInherited.vue'
+import SharingEntrySimple from '../components/SharingEntrySimple.vue'
export default {
name: 'SharingInherited',
components: {
- ActionButton,
+ NcActionButton,
SharingEntryInherited,
SharingEntrySimple,
},
@@ -91,7 +77,7 @@ export default {
},
subTitle() {
return (this.showInheritedShares && this.shares.length === 0)
- ? t('files_sharing', 'No other users with access found')
+ ? t('files_sharing', 'No other accounts with access found')
: ''
},
toggleTooltip() {
@@ -149,6 +135,16 @@ export default {
this.showInheritedShares = false
this.shares = []
},
+ /**
+ * Remove a share from the shares list
+ *
+ * @param {Share} share the share to remove
+ */
+ removeShare(share) {
+ const index = this.shares.findIndex(item => item === share)
+ // eslint-disable-next-line vue/no-mutating-props
+ this.shares.splice(index, 1)
+ },
},
}
</script>