Skip to content

Commit

Permalink
Adding Elasticsuite icon to the related fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
romainruaud committed Jul 26, 2022
1 parent 66a082e commit b007d9e
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ private function createFieldset(Form $form, Front $subject)
'front_fieldset'
);

$fieldset->addClass('es-esfeature__logo');

return $fieldset;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<additionalClasses>
<class name="smile-elasticsuite-filterable-attributes">true</class>
<class name="admin__field-wide">true</class>
<class name="es-esfeature__logo">true</class>
</additionalClasses>
<scopeLabel>[GLOBAL]</scopeLabel>
<componentType>dynamicRows</componentType>
Expand Down Expand Up @@ -214,6 +215,7 @@
<item name="required-entry" xsi:type="boolean">false</item>
</item>
<item name="default" xsi:type="string">1</item>
<item name="additionalClasses" xsi:type="string">es-esfeature__logo</item>
</item>
</argument>
</field>
Expand All @@ -234,6 +236,7 @@
<item name="required-entry" xsi:type="boolean">false</item>
</item>
<item name="default" xsi:type="string">1</item>
<item name="additionalClasses" xsi:type="string">es-esfeature__logo</item>
</item>
</argument>
</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="styles"/>

This comment has been minimized.

Copy link
@sheepfy

sheepfy Aug 10, 2022

This line breaks the css in admin. For example compare blank magento vs blank magento + smile es modules in admin product attribute edit page/new page -> select dropdown type for attribute -> add new option for dropdown -> notice the different input styling.

<head>
<css src="Smile_ElasticsuiteCore::css/es-logo.css" />
</head>
<body>
<referenceContainer name="footer">
<referenceContainer name="legal">
Expand Down
42 changes: 42 additions & 0 deletions src/module-elasticsuite-core/view/adminhtml/web/css/es-logo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* Logo to the right */
.admin__collapsible-block-wrapper.es-esfeature__logo .admin__collapsible-title > span:first-child { /* Collapsible block title */
position: relative;
padding-right: 35px;
}

/* Logo to the left */
.admin__field.es-esfeature__logo > .admin__field-label > label > span:first-child, /* Category fields */
fieldset.es-esfeature__logo legend span:first-child, /* Legacy form fields */
label.es-esfeature__logo span:first-child { /* Store view config */
position: relative;
padding-left: 35px;
}

/* Logo image - default position to the left */
.admin__collapsible-block-wrapper.es-esfeature__logo .admin__collapsible-title > span:first-child:after, /* Collapsible block title */
.admin__field.es-esfeature__logo > .admin__field-label > label > span:first-child:after, /* Category fields */
label.es-esfeature__logo span:first-child:after, /* Store view config */
fieldset.es-esfeature__logo legend span:first-child:after, /* Legacy form fields */
.section-config.es-esfeature__logo > .admin__collapsible-block > a:after { /* Section config title */
position: absolute;
top: 25%;
left: 0;
transform: translateY( -50% );
content: "";
width: 30px;
height: 30px;
background: url('../images/es-logo.svg') no-repeat 0 0;
background-size: contain;
}

/* Logo image - position to the right */
.admin__collapsible-block-wrapper.es-esfeature__logo .admin__collapsible-title > span:first-child:after, /* Collapsible block title */
.section-config.es-esfeature__logo > .admin__collapsible-block > a:after { /* Section config title */
left: unset;
margin-left: 10px;
top: 50%;
}

fieldset.es-esfeature__logo legend span:first-child:after { /* Legacy form fields */
top: 50%
}
10 changes: 10 additions & 0 deletions src/module-elasticsuite-core/view/adminhtml/web/images/es-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="opened" xsi:type="boolean">true</item>
<item name="additionalClasses" xsi:type="string">es-esfeature__logo</item>
</item>
</argument>

Expand All @@ -47,6 +48,7 @@
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">!${ $.provider }:data.use_default.is_virtual_category</item>
</item>
<item name="additionalClasses" xsi:type="string">es-esfeature__logo</item>
</item>
</argument>
</field>
Expand Down Expand Up @@ -104,6 +106,7 @@
<item name="listens" xsi:type="array">
<item name="${ $.namespace }.${ $.namespace }:responseData" xsi:type="string">setParsed</item>
</item>
<item name="additionalClasses" xsi:type="string">es-esfeature__logo</item>
</item>
</argument>
</field>
Expand All @@ -129,6 +132,7 @@
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">category_form.category_form.assign_products.is_virtual_category:checked</item>
</item>
<item name="additionalClasses" xsi:type="string">es-esfeature__logo</item>
</item>
</argument>
</field>
Expand All @@ -143,6 +147,7 @@
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">category_form.category_form.assign_products.is_virtual_category:checked</item>
</item>
<item name="additionalClasses" xsi:type="string">es-esfeature__logo</item>
</item>
</argument>
</htmlContent>
Expand All @@ -154,6 +159,7 @@
<item name="config" xsi:type="array">
<item name="sortOrder" xsi:type="number">30</item>
<item name="label" xsi:type="string" translate="true">Products List Preview and Sorting</item>
<item name="additionalClasses" xsi:type="string">es-esfeature__logo</item>
</item>
</argument>

Expand Down

0 comments on commit b007d9e

Please sign in to comment.