aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/src/components/SharingEntryInternal.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/src/components/SharingEntryInternal.vue')
-rw-r--r--apps/files_sharing/src/components/SharingEntryInternal.vue40
1 files changed, 25 insertions, 15 deletions
diff --git a/apps/files_sharing/src/components/SharingEntryInternal.vue b/apps/files_sharing/src/components/SharingEntryInternal.vue
index d3b55d4991c..027d2a3d5c3 100644
--- a/apps/files_sharing/src/components/SharingEntryInternal.vue
+++ b/apps/files_sharing/src/components/SharingEntryInternal.vue
@@ -1,4 +1,7 @@
-
+<!--
+ - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ - SPDX-License-Identifier: AGPL-3.0-or-later
+-->
<template>
<ul>
<SharingEntrySimple ref="shareEntrySimple"
@@ -9,12 +12,16 @@
<div class="avatar-external icon-external-white" />
</template>
- <NcActionLink :href="internalLink"
+ <NcActionButton :title="copyLinkTooltip"
:aria-label="copyLinkTooltip"
- :title="copyLinkTooltip"
- target="_blank"
- :icon="copied && copySuccess ? 'icon-checkmark-color' : 'icon-clippy'"
- @click.prevent="copyLink" />
+ @click="copyLink">
+ <template #icon>
+ <CheckIcon v-if="copied && copySuccess"
+ :size="20"
+ class="icon-checkmark-color" />
+ <ClipboardIcon v-else :size="20" />
+ </template>
+ </NcActionButton>
</SharingEntrySimple>
</ul>
</template>
@@ -22,15 +29,21 @@
<script>
import { generateUrl } from '@nextcloud/router'
import { showSuccess } from '@nextcloud/dialogs'
-import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink'
-import SharingEntrySimple from './SharingEntrySimple'
+import NcActionButton from '@nextcloud/vue/components/NcActionButton'
+
+import CheckIcon from 'vue-material-design-icons/Check.vue'
+import ClipboardIcon from 'vue-material-design-icons/ContentCopy.vue'
+
+import SharingEntrySimple from './SharingEntrySimple.vue'
export default {
name: 'SharingEntryInternal',
components: {
- NcActionLink,
+ NcActionButton,
SharingEntrySimple,
+ CheckIcon,
+ ClipboardIcon,
},
props: {
@@ -70,14 +83,11 @@ export default {
}
return t('files_sharing', 'Cannot copy, please copy the link manually')
}
- return t('files_sharing', 'Copy internal link to clipboard')
+ return t('files_sharing', 'Copy internal link')
},
internalLinkSubtitle() {
- if (this.fileInfo.type === 'dir') {
- return t('files_sharing', 'Only works for users with access to this folder')
- }
- return t('files_sharing', 'Only works for users with access to this file')
+ return t('files_sharing', 'For people who already have access')
},
},
@@ -86,7 +96,6 @@ export default {
try {
await navigator.clipboard.writeText(this.internalLink)
showSuccess(t('files_sharing', 'Link copied'))
- // focus and show the tooltip (note: cannot set ref on NcActionLink)
this.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus()
this.copySuccess = true
this.copied = true
@@ -118,6 +127,7 @@ export default {
}
.icon-checkmark-color {
opacity: 1;
+ color: var(--color-success);
}
}
</style>