Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#104546 - Added item-id-key for cms-block #312

Merged
merged 4 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions view/adminhtml/layout/snowmenu_menu_create.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"
>
<head>
<css src="Snowdog_Menu::css/lib/v-select.css"/>
</head>
<update handle="snowmenu_menu_edit"/>
</page>
3 changes: 3 additions & 0 deletions view/adminhtml/layout/snowmenu_menu_edit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"
>
<head>
<css src="Snowdog_Menu::css/lib/v-select.css"/>
</head>
<body>
<referenceContainer name="content">
<uiComponent name="snowmenu_menu_form"/>
Expand Down
1 change: 1 addition & 0 deletions view/adminhtml/web/css/lib/v-select.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion view/adminhtml/web/css/source/_module.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import './lib/_v-select.less';
@import './lib/_vue-treeselect.less';

@import './blocks/_image-upload';
Expand Down
1 change: 0 additions & 1 deletion view/adminhtml/web/css/source/lib/_v-select.less

This file was deleted.

2 changes: 1 addition & 1 deletion view/adminhtml/web/js/lib/vue-select.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions view/adminhtml/web/vue/field-type/autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
:clearable="false"
:required="required"
>
<template v-slot:value-label="{ node }">

Check warning on line 23 in view/adminhtml/web/vue/field-type/autocomplete.vue

View workflow job for this annotation

GitHub Actions / Code Lint Analysis

Expected '#value-label' instead of 'v-slot:value-label'
{{ node.raw.full_label }}
</template>
</treeselect>
Expand All @@ -34,7 +34,7 @@
:disabled="isDisabled"
:required="required"
>
<template v-slot:option="option">

Check warning on line 37 in view/adminhtml/web/vue/field-type/autocomplete.vue

View workflow job for this annotation

GitHub Actions / Code Lint Analysis

Expected '#option' instead of 'v-slot:option'
{{ option.label }}

<template v-if="option.store && option.store.length">
Expand All @@ -50,8 +50,8 @@

<script>
define(['Vue'], function(Vue) {
Vue.component('autocomplete', {

Check warning on line 53 in view/adminhtml/web/vue/field-type/autocomplete.vue

View workflow job for this annotation

GitHub Actions / Code Lint Analysis

Component name "autocomplete" should always be multi-word

Check warning on line 53 in view/adminhtml/web/vue/field-type/autocomplete.vue

View workflow job for this annotation

GitHub Actions / Code Lint Analysis

Component name "autocomplete" should always be multi-word
name: 'autocomplete',

Check warning on line 54 in view/adminhtml/web/vue/field-type/autocomplete.vue

View workflow job for this annotation

GitHub Actions / Code Lint Analysis

Component name "autocomplete" should always be multi-word

Check warning on line 54 in view/adminhtml/web/vue/field-type/autocomplete.vue

View workflow job for this annotation

GitHub Actions / Code Lint Analysis

Component name "autocomplete" should always be multi-word
props: {
label: {
type: String,
Expand Down Expand Up @@ -129,14 +129,14 @@
},
set(option) {
if (option && typeof option === 'object') {
this.item[this.itemKey] = option.value.toString();
this.item[this.itemIdKey] = option.id.toString();
this.$set(this.item, this.itemKey, option.value.toString());
this.$set(this.item, this.itemIdKey, option.id.toString());
}
else if (option && typeof option === 'string') {
this.item[this.itemKey] = option;
this.$set(this.item, this.itemKey, option);
}
else {
this.item[this.itemKey] = this.defaultSelectedOption ? this.defaultSelectedOption.value.toString() : '';
this.$set(this.item, this.itemKey, this.defaultSelectedOption ? this.defaultSelectedOption.value.toString() : '');
}
}
},
Expand Down
1 change: 1 addition & 0 deletions view/adminhtml/web/vue/menu-type/cms-block.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:description="config.translation.blockId"
:item="item"
item-key="content"
item-id-key="selected_item_id"
:options="config.fieldData.cms_block.snowMenuAutoCompleteField.options"
:config="config"
/>
Expand Down
Loading