diff --git a/client/package-lock.json b/client/package-lock.json index eb75d37c6e5..ce66e1ea149 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -23,7 +23,7 @@ "file-type": "^21.3.2", "ionicons": "^8.0.9", "luxon": "^3.5.0", - "megashark-lib": "git+https://github.com/Scille/megashark-lib.git#c7c5ab0be1ebe514a6cb163da597ef2bd8056e1a", + "megashark-lib": "git+https://github.com/Scille/megashark-lib.git#10ff7deb13133688ebb030c5d6e13b721faca797", "native-file-system-adapter": "^3.0.1", "pdfjs-dist": "^5.4.624", "qrcode-vue3": "^1.7.1", @@ -7144,8 +7144,8 @@ }, "node_modules/megashark-lib": { "version": "0.0.1", - "resolved": "git+ssh://git@github.com/Scille/megashark-lib.git#c7c5ab0be1ebe514a6cb163da597ef2bd8056e1a", - "integrity": "sha512-Qqe9LREfgmHF+5SJIoqq07Xxg9Yy9qavySejv32aXKGAZJxZw1AVd3tjqHL9J+ULBD/nddK65tY1szTLicWlAw==", + "resolved": "git+ssh://git@github.com/Scille/megashark-lib.git#10ff7deb13133688ebb030c5d6e13b721faca797", + "integrity": "sha512-L0fwbxaWXaORmVLicpVicZ8vFcaZif2fWJGw7kQhBy3IFRYuKF48VSwLq6HW3UKnrdJwarwqf1ut1YEvUZeA9g==", "dependencies": { "@stripe/stripe-js": "^9.2.0", "@vuepic/vue-datepicker": "^12.1.0", diff --git a/client/package.json b/client/package.json index 21a7585bb42..0e23fb3d85e 100644 --- a/client/package.json +++ b/client/package.json @@ -50,7 +50,7 @@ "file-type": "^21.3.2", "ionicons": "^8.0.9", "luxon": "^3.5.0", - "megashark-lib": "git+https://github.com/Scille/megashark-lib.git#c7c5ab0be1ebe514a6cb163da597ef2bd8056e1a", + "megashark-lib": "git+https://github.com/Scille/megashark-lib.git#10ff7deb13133688ebb030c5d6e13b721faca797", "native-file-system-adapter": "^3.0.1", "pdfjs-dist": "^5.4.624", "qrcode-vue3": "^1.7.1", diff --git a/client/src/components/organizations/OrganizationConfigurationInformation.vue b/client/src/components/organizations/OrganizationConfigurationInformation.vue index 6d8af980bee..dfee251f656 100644 --- a/client/src/components/organizations/OrganizationConfigurationInformation.vue +++ b/client/src/components/organizations/OrganizationConfigurationInformation.vue @@ -62,24 +62,13 @@ {{ orgInfo.organizationAddr }} - - - - - {{ $msTranslate('OrganizationPage.configuration.copyPath') }} - + :callback="copyAddress" + :normal-state="{ icon: copy }" + /> @@ -90,35 +79,16 @@ @@ -219,20 +189,6 @@ async function copyAddress(address: string): Promise { color: var(--parsec-color-light-success-700); } } - - #copy-link-btn { - color: var(--parsec-color-light-secondary-text); - margin: 0; - - &::part(native) { - padding: 0.5rem; - border-radius: var(--parsec-radius-6); - } - - &:hover { - color: var(--parsec-color-light-primary-600); - } - } } } diff --git a/client/src/components/users/InvitationPopoverItem.vue b/client/src/components/users/InvitationPopoverItem.vue index 269eb603f17..dc9a463d65f 100644 --- a/client/src/components/users/InvitationPopoverItem.vue +++ b/client/src/components/users/InvitationPopoverItem.vue @@ -25,32 +25,18 @@ @@ -132,17 +113,17 @@ import { exportRecoveryDevice, OrganizationID } from '@/parsec'; import { Information, InformationLevel, InformationManager, PresentationMode } from '@/services/informationManager'; import { IonButton, IonIcon, IonText } from '@ionic/vue'; -import { checkmarkCircle, copy, documentText } from 'ionicons/icons'; +import { copy, documentText } from 'ionicons/icons'; import { Clipboard, DownloadIcon, I18n, MsCheckbox, + MsFeedbackButton, MsImage, MsReportText, MsReportTheme, Translatable, - useWindowSize, } from 'megashark-lib'; import { computed, onMounted, ref, useTemplateRef } from 'vue'; @@ -159,9 +140,7 @@ const emits = defineEmits<{ const code = ref(''); const content = ref(new Uint8Array()); -const { isLargeDisplay } = useWindowSize(); const downloadLinkRef = useTemplateRef('downloadLink'); -const codeCopied = ref(undefined); const clipboardNotAvailable = ref(false); const fileDownloading = ref(false); const fileDownloaded = ref(false); @@ -187,19 +166,9 @@ onMounted(async () => { content.value = exportResult.value[1]; }); -async function copyCode(): Promise { +async function copyCode(): Promise { const copyResult = await Clipboard.writeText(code.value); - codeCopied.value = copyResult; - - if (!codeCopied.value) { - clipboardNotAvailable.value = true; - - codeCopied.value = undefined; - } else { - clipboardNotAvailable.value = false; - setTimeout(() => { - codeCopied.value = undefined; - }, 2000); + if (copyResult) { props.informationManager.present( new Information({ message: 'DevicesPage.greet.linkCopiedToClipboard', @@ -208,6 +177,7 @@ async function copyCode(): Promise { PresentationMode.Toast, ); } + return copyResult; } async function downloadRecoveryFile(): Promise { diff --git a/client/src/views/totp/ActivateTotpModal.vue b/client/src/views/totp/ActivateTotpModal.vue index d4515175207..bc3360343db 100644 --- a/client/src/views/totp/ActivateTotpModal.vue +++ b/client/src/views/totp/ActivateTotpModal.vue @@ -68,34 +68,12 @@
{{ code }} - - - - {{ $msTranslate('Authentication.mfa.step2.buttonCopy') }} - - - {{ $msTranslate('Authentication.mfa.step2.buttonCopied') }} - - - - {{ $msTranslate('Authentication.mfa.step2.copyError') }} - +
@@ -161,9 +139,19 @@ import { } from '@/parsec'; import { Resources, ResourcesManager } from '@/services/resourcesManager'; import PromptCurrentAuthentication from '@/views/users/PromptCurrentAuthentication.vue'; -import { IonButton, IonIcon, IonPage, IonText, modalController } from '@ionic/vue'; -import { checkmarkCircle, copy } from 'ionicons/icons'; -import { Clipboard, MsInput, MsModal, MsModalResult, MsReportText, MsReportTheme, MsSpinner, useWindowSize } from 'megashark-lib'; +import { IonPage, IonText, modalController } from '@ionic/vue'; +import { copy } from 'ionicons/icons'; +import { + Clipboard, + MsFeedbackButton, + MsInput, + MsModal, + MsModalResult, + MsReportText, + MsReportTheme, + MsSpinner, + useWindowSize, +} from 'megashark-lib'; import QRCodeVue3 from 'qrcode-vue3'; import { computed, onMounted, ref, toRaw } from 'vue'; @@ -185,7 +173,6 @@ const { isLargeDisplay } = useWindowSize(); const url = ref(''); const code = ref(''); const verifyCode = ref(''); -const codeCopied = ref(undefined); const currentStep = ref( props.params.mode === 'setup' || props.params.mode === 'activate' ? Steps.PromptAuthentication : Steps.Information, ); @@ -283,11 +270,8 @@ onMounted(async () => { } }); -async function copyCode(): Promise { - codeCopied.value = await Clipboard.writeText(code.value); - setTimeout(() => { - codeCopied.value = undefined; - }, 2000); +async function copyCode(): Promise { + return await Clipboard.writeText(code.value); } async function setupTotp(): Promise {