3030 <!-- clipboard -->
3131 <div >
3232 <NcActions v-if =" share && (!isEmailShareType || isFileRequest) && share.token" ref =" copyButton" class =" sharing-entry__copy" >
33- <NcActionButton :aria-label =" copyLinkTooltip "
34- :title =" copyLinkTooltip "
33+ <NcActionButton :aria-label =" copyLinkLabel "
34+ :title =" copySuccess ? t('files_sharing', 'Successfully copied public link') : undefined "
3535 :href =" shareLink"
3636 @click.prevent =" copyLink" >
3737 <template #icon >
38- <CheckIcon v-if =" copied && copySuccess"
39- :size =" 20"
40- class =" icon-checkmark-color" />
41- <ClipboardIcon v-else :size =" 20" />
38+ <NcIconSvgWrapper class =" sharing-entry__copy-icon"
39+ :class =" { 'sharing-entry__copy-icon--success': copySuccess }"
40+ :path =" copySuccess ? mdiCheck : mdiContentCopy" />
4241 </template >
4342 </NcActionButton >
4443 </NcActions >
205204 </NcActions >
206205
207206 <!-- loading indicator to replace the menu -->
208- <div v-else class =" icon-loading-small sharing-entry__loading" />
207+ <NcLoadingIcon v-else class =" sharing-entry__loading" />
209208
210209 <!-- Modal to open whenever we have a QR code -->
211210 <NcDialog v-if =" showQRCode"
224223</template >
225224
226225<script >
226+ import { mdiCheck , mdiContentCopy } from ' @mdi/js'
227227import { showError , showSuccess } from ' @nextcloud/dialogs'
228228import { emit } from ' @nextcloud/event-bus'
229229import { t } from ' @nextcloud/l10n'
@@ -241,14 +241,15 @@ import NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'
241241import NcActions from ' @nextcloud/vue/components/NcActions'
242242import NcAvatar from ' @nextcloud/vue/components/NcAvatar'
243243import NcDialog from ' @nextcloud/vue/components/NcDialog'
244+ import NcIconSvgWrapper from ' @nextcloud/vue/components/NcIconSvgWrapper'
245+ import NcLoadingIcon from ' @nextcloud/vue/components/NcLoadingIcon'
244246
245247import Tune from ' vue-material-design-icons/Tune.vue'
246248import IconCalendarBlank from ' vue-material-design-icons/CalendarBlankOutline.vue'
247249import IconQr from ' vue-material-design-icons/Qrcode.vue'
248250import ErrorIcon from ' vue-material-design-icons/Exclamation.vue'
249251import LockIcon from ' vue-material-design-icons/LockOutline.vue'
250252import CheckIcon from ' vue-material-design-icons/CheckBold.vue'
251- import ClipboardIcon from ' vue-material-design-icons/ContentCopy.vue'
252253import CloseIcon from ' vue-material-design-icons/Close.vue'
253254import PlusIcon from ' vue-material-design-icons/Plus.vue'
254255
@@ -276,14 +277,15 @@ export default {
276277 NcActionSeparator,
277278 NcAvatar,
278279 NcDialog,
280+ NcIconSvgWrapper,
281+ NcLoadingIcon,
279282 VueQrcode,
280283 Tune,
281284 IconCalendarBlank,
282285 IconQr,
283286 ErrorIcon,
284287 LockIcon,
285288 CheckIcon,
286- ClipboardIcon,
287289 CloseIcon,
288290 PlusIcon,
289291 SharingEntryQuickShareSelect,
@@ -303,11 +305,17 @@ export default {
303305 },
304306 },
305307
308+ setup () {
309+ return {
310+ mdiCheck,
311+ mdiContentCopy,
312+ }
313+ },
314+
306315 data () {
307316 return {
308317 shareCreationComplete: false ,
309- copySuccess: true ,
310- copied: false ,
318+ copySuccess: false ,
311319 defaultExpirationDateEnabled: false ,
312320
313321 // Are we waiting for password/expiration date
@@ -539,17 +547,9 @@ export default {
539547 },
540548
541549 /**
542- * Tooltip message for copy button
543- *
544550 * @return {string}
545551 */
546- copyLinkTooltip () {
547- if (this .copied ) {
548- if (this .copySuccess ) {
549- return ' '
550- }
551- return t (' files_sharing' , ' Cannot copy, please copy the link manually' )
552- }
552+ copyLinkLabel () {
553553 return t (' files_sharing' , ' Copy public link of "{title}"' , { title: this .title })
554554 },
555555
@@ -783,16 +783,13 @@ export default {
783783 showSuccess (t (' files_sharing' , ' Link copied' ))
784784 // focus and show the tooltip
785785 this .$refs .copyButton .$el .focus ()
786- this .copySuccess = true
787- this .copied = true
788786 } catch (error) {
789- this .copySuccess = false
790- this .copied = true
791- console .error (error)
787+ logger .debug (' Failed to automatically copy share link' , { error })
788+ window .prompt (t (' files_sharing' , ' Your browser does not support copying, please copy the link manually:' ), this .shareLink )
792789 } finally {
790+ this .copySuccess = true
793791 setTimeout (() => {
794792 this .copySuccess = false
795- this .copied = false
796793 }, 4000 )
797794 }
798795 },
@@ -967,9 +964,8 @@ export default {
967964 }
968965 }
969966
970- .icon - checkmark- color {
971- opacity: 1 ;
972- color: var (-- color- success);
967+ & __copy- icon-- success {
968+ color: var (-- color- border- success);
973969 }
974970}
975971
0 commit comments