From ea87a1287d08968909c3d5db0f83e71a2650cc52 Mon Sep 17 00:00:00 2001 From: Brice Schaffner Date: Thu, 12 Oct 2023 07:05:04 +0200 Subject: [PATCH 1/5] BGDIINF_SB-2430: Improved sharing embed previzualization --- .../menu/components/share/MenuShareEmbed.vue | 82 +++++++++++-------- .../share/MenuShareShortLinkInput.vue | 8 +- src/setup-fontawesome.js | 2 + 3 files changed, 55 insertions(+), 37 deletions(-) diff --git a/src/modules/menu/components/share/MenuShareEmbed.vue b/src/modules/menu/components/share/MenuShareEmbed.vue index 6b10f8d23..9109a9560 100644 --- a/src/modules/menu/components/share/MenuShareEmbed.vue +++ b/src/modules/menu/components/share/MenuShareEmbed.vue @@ -39,14 +39,11 @@ fluid @close="togglePreviewModal" > -
-
+
+
-
-
-
- - - x - -
-
-
+
+ + + + + + +
+ -
+
@@ -197,6 +193,10 @@ export default { } }, computed: { + embedPreviewModalWidth() { + // User the iframe with as maximal width for the embed preview modal window + return { 'max-width': this.iFrameWidth } + }, isPreviewSizeCustom() { return this.currentPreviewSize.i18nKey === EmbedSizes.CUSTOM.i18nKey }, @@ -255,7 +255,17 @@ export default { display: block; } } + +.embed-preview-modal { + min-width: 26rem; +} + .embed-preview-modal-size-selector { cursor: pointer; + max-width: 15rem; +} + +.custom-preview-input { + max-width: 6rem; } diff --git a/src/modules/menu/components/share/MenuShareShortLinkInput.vue b/src/modules/menu/components/share/MenuShareShortLinkInput.vue index 844454999..059aa3064 100644 --- a/src/modules/menu/components/share/MenuShareShortLinkInput.vue +++ b/src/modules/menu/components/share/MenuShareShortLinkInput.vue @@ -4,7 +4,7 @@
+ + diff --git a/src/setup-fontawesome.js b/src/setup-fontawesome.js index 15f2fbc54..963ba472f 100644 --- a/src/setup-fontawesome.js +++ b/src/setup-fontawesome.js @@ -54,6 +54,7 @@ import { faTimesCircle, faUser, faWindowMinimize, + faXmark, } from '@fortawesome/free-solid-svg-icons' library.add( @@ -102,6 +103,7 @@ library.add( faTimesCircle, faUser, faWindowMinimize, + faXmark, // Regular faCheckSquare, faClock, From 1cd15a5a18968d909a9ffde7d5a45dce7cf4f3bd Mon Sep 17 00:00:00 2001 From: Brice Schaffner Date: Thu, 12 Oct 2023 09:17:37 +0200 Subject: [PATCH 2/5] Allow   character in translation of button The non-breaking space character of the french and italian where displayed as  . It seems that in vue template we are not allowed to use html entity but need to use the escape character for nbsp, see https://lightrun.com/answers/kazupon-vue-i18n-non-breaking-space-nbsp-and-other-special-chars --- .../menu/components/share/MenuShareShortLinkInput.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/menu/components/share/MenuShareShortLinkInput.vue b/src/modules/menu/components/share/MenuShareShortLinkInput.vue index 059aa3064..258ab690c 100644 --- a/src/modules/menu/components/share/MenuShareShortLinkInput.vue +++ b/src/modules/menu/components/share/MenuShareShortLinkInput.vue @@ -15,7 +15,7 @@ data-cy="menu-share-shortlink-copy-button" @click="copyShortLinkInClipboard" > - {{ $t(copiedInClipboard ? copiedText : copyText) }} + {{ buttonText }}
@@ -55,6 +55,13 @@ export default { timeoutCopied: null, } }, + computed: { + buttonText() { + return this.$i18n + .t(this.copiedInClipboard ? this.copiedText : this.copyText) + .replace(' ', '\xa0') + }, + }, watch: { shortLink() { this.clearIsCopiedInClipboard() From e71064b27baa17723c1a8b36dc127a6f2b40c69e Mon Sep 17 00:00:00 2001 From: Brice Schaffner Date: Thu, 12 Oct 2023 15:35:46 +0200 Subject: [PATCH 3/5] BGDIINF_SB-2430: Renamed generic component --- .../menu/components/share/MenuShareEmbed.vue | 11 +++--- ...Input.vue => MenuShareInputCopyButton.vue} | 35 +++++++++---------- .../components/share/MenuShareSection.vue | 12 +++++-- .../integration/shareShortLink.cy.js | 2 +- 4 files changed, 31 insertions(+), 29 deletions(-) rename src/modules/menu/components/share/{MenuShareShortLinkInput.vue => MenuShareInputCopyButton.vue} (71%) diff --git a/src/modules/menu/components/share/MenuShareEmbed.vue b/src/modules/menu/components/share/MenuShareEmbed.vue index 9109a9560..5e9b0b7b9 100644 --- a/src/modules/menu/components/share/MenuShareEmbed.vue +++ b/src/modules/menu/components/share/MenuShareEmbed.vue @@ -56,13 +56,10 @@ {{ $t(size.i18nKey) }} -
@@ -127,7 +124,7 @@