From b1c46db7cce68a1b10b44fd4b8de158be5cb308b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grabowski?= Date: Tue, 10 Oct 2023 12:49:56 +0200 Subject: [PATCH 1/5] IBX-6725: Autosave notification is in wrong place --- .../Resources/public/scss/_edit-header.scss | 22 ++++++------------- .../themes/admin/ui/edit_header.html.twig | 8 +++---- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/bundle/Resources/public/scss/_edit-header.scss b/src/bundle/Resources/public/scss/_edit-header.scss index 71ad2675a6..47e8d5a20b 100644 --- a/src/bundle/Resources/public/scss/_edit-header.scss +++ b/src/bundle/Resources/public/scss/_edit-header.scss @@ -62,6 +62,8 @@ flex-direction: column; justify-content: center; padding-left: 0; + margin-top: calculateRem(20px); + height: calculateRem(48px); .ibexa-icon { margin-right: calculateRem(8px); @@ -77,14 +79,6 @@ color: $ibexa-color-dark-400; } } - - &--right { - .ibexa-autosave { - position: absolute; - top: calculateRem(96px); - right: calculateRem(64px); - } - } } &__context-actions { @@ -110,6 +104,7 @@ color: $ibexa-color-dark-400; opacity: 1; transition: all $ibexa-admin-transition-duration $ibexa-admin-transition; + margin: 0; } &__subtitle { @@ -137,8 +132,10 @@ } .ibexa-autosave { - opacity: 1; - transition: all $ibexa-admin-transition-duration $ibexa-admin-transition; + display: inline-block; + border-left: calculateRem(1px) solid $ibexa-color-light; + padding-left: calculateRem(12px); + margin-left: calculateRem(12px); } &--slim { @@ -193,10 +190,5 @@ } } } - - .ibexa-autosave { - opacity: 0; - height: 0; - } } } diff --git a/src/bundle/Resources/views/themes/admin/ui/edit_header.html.twig b/src/bundle/Resources/views/themes/admin/ui/edit_header.html.twig index a760bcc257..06e0850bcf 100644 --- a/src/bundle/Resources/views/themes/admin/ui/edit_header.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/edit_header.html.twig @@ -16,6 +16,9 @@ {{ action_object|default('') }} {{ content_type_name|default('') }} + {% if show_autosave_status|default(false) %} + {% include '@ibexadesign/ui/autosave.html.twig' %} + {% endif %}
@@ -58,11 +61,6 @@
{{ subtitle }}
{% endif %}
-
- {% if show_autosave_status|default(false) %} - {% include '@ibexadesign/ui/autosave.html.twig' %} - {% endif %} -
{% if show_extra_bottom_content %}
{{ block('extra_bottom_content') }} From 4357e927536cc499fae67e5cba827978d750d9c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grabowski?= Date: Fri, 20 Oct 2023 13:59:41 +0200 Subject: [PATCH 2/5] adjust text --- features/standard/Autosave.feature | 2 +- .../Resources/public/js/scripts/admin.content.edit.js | 2 +- src/bundle/Resources/translations/ibexa_content.en.xliff | 4 ++-- src/bundle/Resources/translations/messages.en.xliff | 8 ++++---- .../themes/admin/ui/component/autosave/autosave.html.twig | 6 ++++-- src/lib/Behat/BrowserContext/ContentUpdateContext.php | 2 +- src/lib/Behat/Page/ContentUpdateItemPage.php | 4 ++-- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/features/standard/Autosave.feature b/features/standard/Autosave.feature index 7375e9f890..71d8db2e94 100644 --- a/features/standard/Autosave.feature +++ b/features/standard/Autosave.feature @@ -45,7 +45,7 @@ Feature: Content Items creation | label | value | | Title | Test Article Autosave Off draft | | Short title | Test Article Autosave Off draft | - And I check if "Autosave is off" notification is displayed + And I check if "Autosave is off, draft not created" notification is displayed And I open the "Dashboard" page in admin SiteAccess Then there's no draft "Test Article Autosave Off draft" on Dashboard list diff --git a/src/bundle/Resources/public/js/scripts/admin.content.edit.js b/src/bundle/Resources/public/js/scripts/admin.content.edit.js index 6627502684..b02ba13322 100644 --- a/src/bundle/Resources/public/js/scripts/admin.content.edit.js +++ b/src/bundle/Resources/public/js/scripts/admin.content.edit.js @@ -159,7 +159,7 @@ const saveDate = ibexa.helpers.timezone.convertDateToTimezone(new Date(), userPreferredTimezone); const saveTime = moment(saveDate).formatICU('HH:mm'); const saveMessage = Translator.trans( - /*@Desc("Draft saved %time%")*/ 'content_edit.autosave.status_saved.message.full', + /*@Desc("Autosave is on, draft created %time%")*/ 'content_edit.autosave.status_saved.message.full', { time: saveTime }, 'ibexa_content', ); diff --git a/src/bundle/Resources/translations/ibexa_content.en.xliff b/src/bundle/Resources/translations/ibexa_content.en.xliff index 5cac0dfa24..23ce8b9df2 100644 --- a/src/bundle/Resources/translations/ibexa_content.en.xliff +++ b/src/bundle/Resources/translations/ibexa_content.en.xliff @@ -52,8 +52,8 @@ key: content.reveal.success - Draft saved %time% - Draft saved %time% + Autosave is on, draft created %time% + Autosave is on, draft created %time% key: content_edit.autosave.status_saved.message.full diff --git a/src/bundle/Resources/translations/messages.en.xliff b/src/bundle/Resources/translations/messages.en.xliff index e4274df093..ec5660463a 100644 --- a/src/bundle/Resources/translations/messages.en.xliff +++ b/src/bundle/Resources/translations/messages.en.xliff @@ -187,13 +187,13 @@ key: content_edit.autosave.status_error.message - Autosave is off - Autosave is off + Autosave is off, draft not created + Autosave is off, draft not created key: content_edit.autosave.status_off.message - Autosave is on - Autosave is on + Autosave is on, draft created %time% + Autosave is on, draft created %time% key: content_edit.autosave.status_on.message diff --git a/src/bundle/Resources/views/themes/admin/ui/component/autosave/autosave.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/autosave/autosave.html.twig index bfa427eddd..701fc2155b 100644 --- a/src/bundle/Resources/views/themes/admin/ui/component/autosave/autosave.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/component/autosave/autosave.html.twig @@ -24,10 +24,12 @@ {{ 'content_edit.autosave.status_error.message'|trans()|desc('Saving error') }}
- {{ 'content_edit.autosave.status_off.message'|trans()|desc('Autosave is off') }} + {{ 'content_edit.autosave.status_off.message'|trans()|desc('Autosave is off, draft not created') }}
- {{ 'content_edit.autosave.status_on.message'|trans()|desc('Autosave is on') }} + {% set current_time = 'now'|date('H:i', ibexa_user_settings.timezone) %} + + {{ 'content_edit.autosave.status_on.message'|trans({ '%time%': current_time })|desc('Autosave is on, draft created %time%') }}
diff --git a/src/lib/Behat/BrowserContext/ContentUpdateContext.php b/src/lib/Behat/BrowserContext/ContentUpdateContext.php index 89277411f3..28d7221512 100644 --- a/src/lib/Behat/BrowserContext/ContentUpdateContext.php +++ b/src/lib/Behat/BrowserContext/ContentUpdateContext.php @@ -134,7 +134,7 @@ public function iWaitForAutosaveNotification(): void } /** - * @When I check if "Autosave is off" notification is displayed + * @When I check if "Autosave is off, draft not created" notification is displayed */ public function iCheckAutosaveNotification(): void { diff --git a/src/lib/Behat/Page/ContentUpdateItemPage.php b/src/lib/Behat/Page/ContentUpdateItemPage.php index d458d5c0a5..77821fae6a 100644 --- a/src/lib/Behat/Page/ContentUpdateItemPage.php +++ b/src/lib/Behat/Page/ContentUpdateItemPage.php @@ -255,7 +255,7 @@ public function verifyAutosaveNotificationIsDisplayed(): void { $this->getHTMLPage() ->find($this->getLocator('autosaveIsOnInfo')) - ->assert()->textContains('Autosave is on'); + ->assert()->textContains('Autosave is on, draft created'); } public function verifyAutosaveDraftIsSavedNotificationIsDisplayed(): void @@ -284,6 +284,6 @@ public function verifyAutosaveIsOffNotificationIsDisplayed(): void { $this->getHTMLPage() ->find($this->getLocator('autosaveIsOffInfo')) - ->assert()->textContains('Autosave is off'); + ->assert()->textContains('Autosave is off, draft not created'); } } From 80b96cc6fbfa354866920bd45862579f91e43a9c Mon Sep 17 00:00:00 2001 From: tomaszszopinski Date: Thu, 26 Oct 2023 11:40:15 +0200 Subject: [PATCH 3/5] [behat] updated assertion --- src/lib/Behat/Page/ContentUpdateItemPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Behat/Page/ContentUpdateItemPage.php b/src/lib/Behat/Page/ContentUpdateItemPage.php index 77821fae6a..fe0027b439 100644 --- a/src/lib/Behat/Page/ContentUpdateItemPage.php +++ b/src/lib/Behat/Page/ContentUpdateItemPage.php @@ -277,7 +277,7 @@ public function isAutosaveDraftSavedNotificationVisible(): bool return $this->getHTMLPage() ->setTimeout(0) ->findAll($this->getLocator('autosaveSavedInfo')) - ->filterBy(new ElementTextFragmentCriterion('Draft saved'))->any(); + ->filterBy(new ElementTextFragmentCriterion('Autosave is on, draft created'))->any(); } public function verifyAutosaveIsOffNotificationIsDisplayed(): void From dac3b08850d62f67cb2d59ded0fda3ad7b28cf32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grabowski?= Date: Tue, 31 Oct 2023 15:13:10 +0100 Subject: [PATCH 4/5] corrected texts --- .../public/js/scripts/admin.content.edit.js | 2 +- .../Resources/public/scss/_autosave.scss | 8 ----- .../Resources/public/scss/_context-menu.scss | 1 + .../Resources/public/scss/_edit-header.scss | 7 ++--- .../translations/ibexa_content.en.xliff | 29 +++++++++++++++++-- .../Resources/translations/messages.en.xliff | 25 ---------------- .../ui/component/autosave/autosave.html.twig | 6 ++-- .../themes/admin/ui/edit_header.html.twig | 2 +- src/lib/Behat/Page/ContentUpdateItemPage.php | 2 +- 9 files changed, 37 insertions(+), 45 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.content.edit.js b/src/bundle/Resources/public/js/scripts/admin.content.edit.js index b02ba13322..665ab83a19 100644 --- a/src/bundle/Resources/public/js/scripts/admin.content.edit.js +++ b/src/bundle/Resources/public/js/scripts/admin.content.edit.js @@ -159,7 +159,7 @@ const saveDate = ibexa.helpers.timezone.convertDateToTimezone(new Date(), userPreferredTimezone); const saveTime = moment(saveDate).formatICU('HH:mm'); const saveMessage = Translator.trans( - /*@Desc("Autosave is on, draft created %time%")*/ 'content_edit.autosave.status_saved.message.full', + /*@Desc("Autosave is on, draft saved %time%")*/ 'content_edit.autosave.status_saved.message.full', { time: saveTime }, 'ibexa_content', ); diff --git a/src/bundle/Resources/public/scss/_autosave.scss b/src/bundle/Resources/public/scss/_autosave.scss index 5c43560b54..2094ebf03b 100644 --- a/src/bundle/Resources/public/scss/_autosave.scss +++ b/src/bundle/Resources/public/scss/_autosave.scss @@ -39,14 +39,6 @@ } } - &--saved { - color: $ibexa-color-success; - - .ibexa-autosave__icon-saved { - fill: $ibexa-color-success; - } - } - &--error { color: $ibexa-color-danger; diff --git a/src/bundle/Resources/public/scss/_context-menu.scss b/src/bundle/Resources/public/scss/_context-menu.scss index 2da8333898..d265da20bc 100644 --- a/src/bundle/Resources/public/scss/_context-menu.scss +++ b/src/bundle/Resources/public/scss/_context-menu.scss @@ -1,5 +1,6 @@ .ibexa-context-menu-wrapper { display: flex; + width: 100%; } .ibexa-context-menu { diff --git a/src/bundle/Resources/public/scss/_edit-header.scss b/src/bundle/Resources/public/scss/_edit-header.scss index 47e8d5a20b..80ba342cc2 100644 --- a/src/bundle/Resources/public/scss/_edit-header.scss +++ b/src/bundle/Resources/public/scss/_edit-header.scss @@ -61,6 +61,7 @@ display: flex; flex-direction: column; justify-content: center; + white-space: nowrap; padding-left: 0; margin-top: calculateRem(20px); height: calculateRem(48px); @@ -83,10 +84,8 @@ &__context-actions { display: flex; - position: absolute; - top: calculateRem(36px); - right: calculateRem(64px); - width: 55%; + margin-top: calculateRem(20px); + width: 100%; } &__tooltip { diff --git a/src/bundle/Resources/translations/ibexa_content.en.xliff b/src/bundle/Resources/translations/ibexa_content.en.xliff index 23ce8b9df2..602535d1a6 100644 --- a/src/bundle/Resources/translations/ibexa_content.en.xliff +++ b/src/bundle/Resources/translations/ibexa_content.en.xliff @@ -6,6 +6,11 @@ The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. + + You can turn autosave off in your user settings + You can turn autosave off in your user settings + key: content.autosave.turn_off.message + Created a new draft for '%name%'. Created a new draft for '%name%'. @@ -51,11 +56,31 @@ Content item '%name%' revealed. key: content.reveal.success + + Saving error + Saving error + key: content_edit.autosave.status_error.message + + + Autosave is off, draft not created + Autosave is off, draft not created + key: content_edit.autosave.status_off.message + + + Autosave is on, draft created + Autosave is on, draft created + key: content_edit.autosave.status_on.message + - Autosave is on, draft created %time% - Autosave is on, draft created %time% + Autosave is on, draft saved %time% + Autosave is on, draft saved %time% key: content_edit.autosave.status_saved.message.full + + Saving + Saving + key: content_edit.autosave.status_saving.message + Location: %location% Location: %location% diff --git a/src/bundle/Resources/translations/messages.en.xliff b/src/bundle/Resources/translations/messages.en.xliff index ec5660463a..57d5e3c56b 100644 --- a/src/bundle/Resources/translations/messages.en.xliff +++ b/src/bundle/Resources/translations/messages.en.xliff @@ -121,11 +121,6 @@ words key: character_counter.words - - You can turn autosave off in your user settings - You can turn autosave off in your user settings - key: content.autosave.turn_off.message - Content ID: %contentId% Content ID: %contentId% @@ -181,26 +176,6 @@ In Trash key: content.in_trash - - Saving error - Saving error - key: content_edit.autosave.status_error.message - - - Autosave is off, draft not created - Autosave is off, draft not created - key: content_edit.autosave.status_off.message - - - Autosave is on, draft created %time% - Autosave is on, draft created %time% - key: content_edit.autosave.status_on.message - - - Saving - Saving - key: content_edit.autosave.status_saving.message - Do you want to delete the Content Type? Do you want to delete the Content Type? diff --git a/src/bundle/Resources/views/themes/admin/ui/component/autosave/autosave.html.twig b/src/bundle/Resources/views/themes/admin/ui/component/autosave/autosave.html.twig index 701fc2155b..9c277595ea 100644 --- a/src/bundle/Resources/views/themes/admin/ui/component/autosave/autosave.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/component/autosave/autosave.html.twig @@ -1,3 +1,5 @@ +{% trans_default_domain 'ibexa_content' %} +
- {% set current_time = 'now'|date('H:i', ibexa_user_settings.timezone) %} - - {{ 'content_edit.autosave.status_on.message'|trans({ '%time%': current_time })|desc('Autosave is on, draft created %time%') }} + {{ 'content_edit.autosave.status_on.message'|trans|desc('Autosave is on, draft created') }}
diff --git a/src/bundle/Resources/views/themes/admin/ui/edit_header.html.twig b/src/bundle/Resources/views/themes/admin/ui/edit_header.html.twig index 06e0850bcf..6d714730ed 100644 --- a/src/bundle/Resources/views/themes/admin/ui/edit_header.html.twig +++ b/src/bundle/Resources/views/themes/admin/ui/edit_header.html.twig @@ -21,7 +21,7 @@ {% endif %}
-
+
{{ context_actions|default('')|raw }}
diff --git a/src/lib/Behat/Page/ContentUpdateItemPage.php b/src/lib/Behat/Page/ContentUpdateItemPage.php index fe0027b439..7ccc65a2f9 100644 --- a/src/lib/Behat/Page/ContentUpdateItemPage.php +++ b/src/lib/Behat/Page/ContentUpdateItemPage.php @@ -277,7 +277,7 @@ public function isAutosaveDraftSavedNotificationVisible(): bool return $this->getHTMLPage() ->setTimeout(0) ->findAll($this->getLocator('autosaveSavedInfo')) - ->filterBy(new ElementTextFragmentCriterion('Autosave is on, draft created'))->any(); + ->filterBy(new ElementTextFragmentCriterion('Autosave is on, draft saved'))->any(); } public function verifyAutosaveIsOffNotificationIsDisplayed(): void From 91730dee902f5e8091276e515a8b9bc8820cd1c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grabowski?= Date: Thu, 2 Nov 2023 16:09:38 +0100 Subject: [PATCH 5/5] changed icon for edit --- .../Resources/views/themes/admin/content/edit/edit.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig b/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig index ff16c286ba..47b81284a3 100644 --- a/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig +++ b/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig @@ -19,7 +19,7 @@ action_name: 'editing'|trans|desc('Editing'), content_type_name: content_type.name, title: content.name, - icon_name: 'content-type', + icon_name: 'edit', show_autosave_status: true, description: content_type.description, subtitle: 'editing_details'|trans({