diff --git a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.create.js b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.create.js
index ef143e4d81..075e9eae51 100644
--- a/src/bundle/Resources/public/js/scripts/sidebar/btn/location.create.js
+++ b/src/bundle/Resources/public/js/scripts/sidebar/btn/location.create.js
@@ -7,8 +7,31 @@
createActions.forEach((container) => {
const radioInputs = container.querySelectorAll('.form-check [type="radio"]');
- const form = container.querySelector('form');
+ const submitBtn = container.querySelector('.ibexa-extra-actions__btn--confirm');
+ const cancelBtn = container.querySelector('.ibexa-extra-actions__btn--cancel');
+ const closeBtn = container.querySelector('.ibexa-extra-actions__header .ibexa-btn--close');
- radioInputs.forEach((radioInput) => radioInput.addEventListener('change', () => form.submit(), false));
+ cancelBtn.addEventListener(
+ 'click',
+ () => {
+ closeBtn.click();
+ },
+ false,
+ );
+ radioInputs.forEach((radioInput) =>
+ radioInput.addEventListener(
+ 'change',
+ (event) => {
+ const selectedItems = container.querySelectorAll('.ibexa-instant-filter__group-item--selected');
+ const itemToSelect = event.currentTarget.closest('.ibexa-instant-filter__group-item');
+
+ selectedItems.forEach((selectedItem) => selectedItem.classList.remove('ibexa-instant-filter__group-item--selected'));
+ itemToSelect.classList.add('ibexa-instant-filter__group-item--selected');
+
+ submitBtn.removeAttribute('disabled');
+ },
+ false,
+ ),
+ );
});
})(window, window.document);
diff --git a/src/bundle/Resources/public/scss/_extra-actions.scss b/src/bundle/Resources/public/scss/_extra-actions.scss
index 997759424a..fee3821daa 100644
--- a/src/bundle/Resources/public/scss/_extra-actions.scss
+++ b/src/bundle/Resources/public/scss/_extra-actions.scss
@@ -82,6 +82,13 @@
}
}
+ &__confirm-wrapper {
+ margin-top: calculateRem(4px);
+ padding: calculateRem(16px) calculateRem(32px);
+ display: flex;
+ gap: calculateRem(16px);
+ }
+
&--edit-user,
&--edit {
.form-check {
@@ -126,7 +133,7 @@
&--create {
.ibexa-extra-actions {
&__content {
- max-height: calc(100% - #{calculateRem(89px)});
+ max-height: calc(100% - #{calculateRem(157px)});
overflow: auto;
}
diff --git a/src/bundle/Resources/translations/ibexa_locationview.en.xliff b/src/bundle/Resources/translations/ibexa_locationview.en.xliff
index 8da59b53c9..5772b85116 100644
--- a/src/bundle/Resources/translations/ibexa_locationview.en.xliff
+++ b/src/bundle/Resources/translations/ibexa_locationview.en.xliff
@@ -16,6 +16,11 @@
Content Type
key: bulk_action.failed.modal.content_type_name
+
+ Discard
+ Discard
+ key: content.create.cancel_btn.label
+
Create content
Create content
diff --git a/src/bundle/Resources/translations/ibexa_universal_discovery_widget.en.xliff b/src/bundle/Resources/translations/ibexa_universal_discovery_widget.en.xliff
index 0e9ef0e0cb..13c18c6c9b 100644
--- a/src/bundle/Resources/translations/ibexa_universal_discovery_widget.en.xliff
+++ b/src/bundle/Resources/translations/ibexa_universal_discovery_widget.en.xliff
@@ -57,8 +57,8 @@
key: content.create.filters.desc
- Cancel
- Cancel
+ Discard
+ Discard
key: content_create.cancel.label
diff --git a/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig b/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig
index 4f7a4e3b97..5541b35c6d 100644
--- a/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig
+++ b/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig
@@ -1,27 +1,30 @@
{% trans_default_domain 'ibexa_locationview' %}
{% set data_actions = data_actions|default('create') %}
+{% set action = action is defined ? action : path('ibexa.content.create') %}
-
+{{ form_end(form) }}
diff --git a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js
index 2cab8cd3cb..39bbc825db 100644
--- a/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js
+++ b/src/bundle/ui-dev/src/modules/universal-discovery/components/content-create-widget/content.create.widget.js
@@ -79,7 +79,7 @@ const ContentCreateWidget = () => {
);
const createLabel = Translator.trans(/*@Desc("Create")*/ 'create_content.create', {}, 'ibexa_universal_discovery_widget');
const closeLabel = Translator.trans(/*@Desc("Close")*/ 'popup.close.label', {}, 'ibexa_universal_discovery_widget');
- const cancelLabel = Translator.trans(/*@Desc("Cancel")*/ 'content_create.cancel.label', {}, 'ibexa_universal_discovery_widget');
+ const cancelLabel = Translator.trans(/*@Desc("Discard")*/ 'content_create.cancel.label', {}, 'ibexa_universal_discovery_widget');
const placeholder = Translator.trans(
/*@Desc("Search by Content Type")*/ 'content_create.placeholder',
{},
diff --git a/src/lib/Behat/Component/ContentTypePicker.php b/src/lib/Behat/Component/ContentTypePicker.php
index f36c8514cd..f222136690 100644
--- a/src/lib/Behat/Component/ContentTypePicker.php
+++ b/src/lib/Behat/Component/ContentTypePicker.php
@@ -55,7 +55,7 @@ public function verifyIsLoaded(): void
public function confirm(): void
{
- $this->getHTMLPage()->find($this->getLocator('createNewButtonInUDW'))->click();
+ $this->getHTMLPage()->find($this->getLocator('createButton'))->click();
}
protected function specifyLocators(): array
@@ -65,7 +65,7 @@ protected function specifyLocators(): array
new VisibleCSSLocator('filteredItem', '.ibexa-content-menu-wrapper .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label, .c-udw-tab .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label'),
new VisibleCSSLocator('header', '.ibexa-content-menu-wrapper .ibexa-extra-actions--create .ibexa-extra-actions__header h2'),
new VisibleCSSLocator('languageDropdown', '.ibexa-content-menu-wrapper .ibexa-dropdown__selection-info'),
- new VisibleCSSLocator('createNewButtonInUDW', '.c-content-create__confirm-button'),
+ new VisibleCSSLocator('createButton', '.c-content-create__confirm-button, [id="content_create_create"]'),
];
}
}
diff --git a/src/lib/Behat/Page/ContentViewPage.php b/src/lib/Behat/Page/ContentViewPage.php
index 1bfb3badec..49cf253ddb 100644
--- a/src/lib/Behat/Page/ContentViewPage.php
+++ b/src/lib/Behat/Page/ContentViewPage.php
@@ -132,6 +132,7 @@ public function startCreatingContent(string $contentTypeName, string $language =
$this->contentTypePicker->selectLanguage($language);
}
$this->contentTypePicker->select($contentTypeName);
+ $this->contentTypePicker->confirm();
}
public function startCreatingUser(string $contentTypeName)
@@ -139,6 +140,7 @@ public function startCreatingUser(string $contentTypeName)
$this->contentActionsMenu->clickButton('Create content');
$this->contentTypePicker->verifyIsLoaded();
$this->contentTypePicker->select($contentTypeName);
+ $this->contentTypePicker->confirm();
}
public function switchToTab(string $tabName): void