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..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("Draft saved %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 71ad2675a6..80ba342cc2 100644 --- a/src/bundle/Resources/public/scss/_edit-header.scss +++ b/src/bundle/Resources/public/scss/_edit-header.scss @@ -61,7 +61,10 @@ display: flex; flex-direction: column; justify-content: center; + white-space: nowrap; padding-left: 0; + margin-top: calculateRem(20px); + height: calculateRem(48px); .ibexa-icon { margin-right: calculateRem(8px); @@ -77,22 +80,12 @@ color: $ibexa-color-dark-400; } } - - &--right { - .ibexa-autosave { - position: absolute; - top: calculateRem(96px); - right: calculateRem(64px); - } - } } &__context-actions { display: flex; - position: absolute; - top: calculateRem(36px); - right: calculateRem(64px); - width: 55%; + margin-top: calculateRem(20px); + width: 100%; } &__tooltip { @@ -110,6 +103,7 @@ color: $ibexa-color-dark-400; opacity: 1; transition: all $ibexa-admin-transition-duration $ibexa-admin-transition; + margin: 0; } &__subtitle { @@ -137,8 +131,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 +189,5 @@ } } } - - .ibexa-autosave { - opacity: 0; - height: 0; - } } } diff --git a/src/bundle/Resources/translations/ibexa_content.en.xliff b/src/bundle/Resources/translations/ibexa_content.en.xliff index 5cac0dfa24..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 + - Draft saved %time% - Draft saved %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 e4274df093..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 - Autosave is off - key: content_edit.autosave.status_off.message - - - Autosave is on - Autosave is on - 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/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({ 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..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' %} +
- {{ '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') }} + {{ '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 a760bcc257..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 @@ -16,9 +16,12 @@ {{ action_object|default('') }} {{ content_type_name|default('') }} + {% if show_autosave_status|default(false) %} + {% include '@ibexadesign/ui/autosave.html.twig' %} + {% endif %}
-
+
{{ context_actions|default('')|raw }}
@@ -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') }} 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..7ccc65a2f9 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 @@ -277,13 +277,13 @@ 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 saved'))->any(); } public function verifyAutosaveIsOffNotificationIsDisplayed(): void { $this->getHTMLPage() ->find($this->getLocator('autosaveIsOffInfo')) - ->assert()->textContains('Autosave is off'); + ->assert()->textContains('Autosave is off, draft not created'); } }