Skip to content

Commit b7c2109

Browse files
authored
14.1.0: fix property value extractor does not work; add a toggle to include tax to price (#13)
* move product feeds menu to the bottom of store settings menu * Remove appsettings-schemas * Fix property value extractor dropdown does not work * Remove more schema.json * add a toggle in the settings to add tax into the feed price; fix exception in multi media picker value extractor * bump version number * Remove dependency on commerce rc
1 parent 550a8e5 commit b7c2109

File tree

43 files changed

+197
-52056
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+197
-52056
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,3 +477,5 @@ $RECYCLE.BIN/
477477
**/wwwroot/**
478478
src/**/packages.lock.json
479479
tests/**/packages.lock.json
480+
**/appsettings-schema.**
481+
**/umbraco-package-schema.json

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<PackageVersion Include="Umbraco.Cms" Version="[14.0.0, 15)" />
2121
<PackageVersion Include="Umbraco.Cms.Web.Website" Version="[14.0.0, 15)" />
2222
<PackageVersion Include="Umbraco.Cms.Web.BackOffice" Version="[14.0.0, 15)" />
23-
<PackageVersion Include="Umbraco.Commerce" Version="[14.0.0-rc3, 15)" />
23+
<PackageVersion Include="Umbraco.Commerce" Version="[14.0.0, 15)" />
2424
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
2525
<PackageVersion Include="xunit" Version="2.6.6" />
2626
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ With the Umbraco.Commerce.ProductFeeds installed you will be able to configure p
1313

1414

1515
## Migrate from v13 and v0.5.5 to v14
16+
- Migrate directly to v14.1.0 instead of v14.0.0. There's a bug that prevents you from changing property value extractor in the feed settings.
1617
- Due to the change in schema of Product Document Type and Product Child Variant Types, you will need to manually edit your feed settings. Please go the the feed settings and find the [obsolete] properties and migrate them to the newer one
1718
![image](https://github.com/user-attachments/assets/36d48973-11dc-49f2-b744-432152458419)
1819

src/Umbraco.Commerce.ProductFeeds.Client/frontend/openapi-ts.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default defineConfig({
44
client: '@hey-api/client-axios',
55
// client: '@hey-api/client-fetch',
66
// client: 'legacy/fetch',
7-
input: 'http://localhost:43252/umbraco/swagger/ucproductfeeds/swagger.json',
7+
input: 'http://localhost:44321/umbraco/swagger/ucproductfeeds/swagger.json',
88
output: {
99
path: 'src/generated/apis',
1010
lint: 'eslint',

src/Umbraco.Commerce.ProductFeeds.Client/frontend/src/generated/apis/types.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export type ProductFeedSettingReadModel = {
3333
productChildVariantTypeIds: Array<(string)>;
3434
feedRelativePath: string;
3535
propertyNameMappings: Array<(PropertyAndNodeMapItem)>;
36+
includeTaxInPrice: boolean;
3637
};
3738

3839
export type ProductFeedSettingWriteModel = {
@@ -54,6 +55,7 @@ export type ProductFeedSettingWriteModel = {
5455
propertyNameMappings: Array<(PropertyAndNodeMapItem)>;
5556
productChildVariantTypeIds: Array<(string)>;
5657
productDocumentTypeIds: Array<(string)>;
58+
includeTaxInPrice: boolean;
5759
};
5860

5961
export type ProductFeedType = 'GoogleMerchantCenter';

src/Umbraco.Commerce.ProductFeeds.Client/frontend/src/lang/en.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export default {
2323
'propProductRootIdLabel': 'Product Root',
2424
'propProductRootIdDescription': 'Select the root for products. Only products under this root will be included in the feed.',
2525

26+
'propIncludeTaxInPriceLabel': 'Include Tax In Price',
27+
'propIncludeTaxInPriceDescription': 'For countries like US and Canada, you need to show price without tax, for most other countries, you should show price with tax.',
28+
2629
'propPropNodeMappingLabel': 'Product Property And Feed Node Mapping',
2730
'propPropNodeMappingDescription': 'Map between product property alias and the feed node under \\<item\\>.',
2831

src/Umbraco.Commerce.ProductFeeds.Client/frontend/src/uc-menu-manifest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ export const storeMenuManifests: UcManifestStoreMenuItem = {
1111
entityType: listingWorkspaceManifest.meta.entityType,
1212
icon: 'icon-rss',
1313
},
14-
weight: 9999,
14+
weight: -1000,
1515
};

src/Umbraco.Commerce.ProductFeeds.Client/frontend/src/workspaces/details/components/ucpf-property-node-mapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ export class UcpfPropNodeMapper extends UmbLitElement {
128128
selected: mapItem.valueExtractorName === extractor.value,
129129
};
130130
})}
131-
.title=${mapItem.valueExtractorName ?? ''}
132-
@change = ${(e: CustomEvent) => this.#onMapItemChange(e, mapItem.uiId)}>
131+
@change=${(e: CustomEvent) => this.#onMapItemChange(e, mapItem.uiId)}
132+
title=${mapItem.valueExtractorName ?? ''}>
133133
</uui-select>
134134
<uui-button
135135
@click=${() => this.#onRemoveItemClick(mapItem.uiId)}

src/Umbraco.Commerce.ProductFeeds.Client/frontend/src/workspaces/details/views/details.element.ts

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { UmbWorkspaceViewElement } from '@umbraco-cms/backoffice/extension-registry';
2-
import type { UUIEvent, UUIInputElement, UUISelectElement } from '@umbraco-cms/backoffice/external/uui';
2+
import type { UUIBooleanInputElement, UUIEvent, UUIInputElement, UUISelectElement } from '@umbraco-cms/backoffice/external/uui';
33
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
44
import {
55
customElement,
@@ -89,6 +89,16 @@ export class UcpfDetailsWorkspaceViewElement
8989
}
9090
}
9191

92+
#onCheckboxChange(evt: UUIEvent) {
93+
const checkboxEl = evt.target as UUIBooleanInputElement;
94+
if (checkboxEl) {
95+
this.#workspaceContext?.setModel({
96+
...this._model!,
97+
[checkboxEl.name]: checkboxEl.checked,
98+
});
99+
}
100+
}
101+
92102
#onSelectElementChange(evt: UUIEvent) {
93103
const selectEl = evt.target as UUISelectElement;
94104
if (selectEl) {
@@ -103,15 +113,15 @@ export class UcpfDetailsWorkspaceViewElement
103113
const selections = event.target.selection ?? [];
104114
this.#workspaceContext?.setModel({
105115
...this._model!,
106-
productRootId: selections.join(','),
116+
productRootId: selections.join(',') || undefined,
107117
});
108118

109119
// this.#validateForm(); // TODO Dinh
110120
}
111121

112122
#onProductDocumentTypeIdsChange(event: Event) {
113123
const element = event.target as UmbInputDocumentTypeElement;
114-
if (element.value) {
124+
if (element) {
115125
this.#workspaceContext?.setModel({
116126
...this._model!,
117127
productDocumentTypeIds: element.selection,
@@ -121,7 +131,7 @@ export class UcpfDetailsWorkspaceViewElement
121131

122132
#onProductChildVariantTypeIdsChange(event: Event) {
123133
const element = event.target as UmbInputDocumentTypeElement;
124-
if (element.value) {
134+
if (element) {
125135
this.#workspaceContext?.setModel({
126136
...this._model!,
127137
productChildVariantTypeIds: element.selection,
@@ -133,7 +143,7 @@ export class UcpfDetailsWorkspaceViewElement
133143
return () => {
134144
this.#workspaceContext?.setModel({
135145
...this._model!,
136-
[propName]: '',
146+
[propName]: undefined,
137147
});
138148
};
139149
}
@@ -212,6 +222,7 @@ export class UcpfDetailsWorkspaceViewElement
212222
name='productDocumentTypeIds'
213223
slot='editor'
214224
@change=${this.#onProductDocumentTypeIdsChange}
225+
?documentTypesOnly=${true}
215226
.selection=${this._model?.productDocumentTypeIds ?? []}
216227
></umb-input-document-type>
217228
</umb-property-layout>
@@ -259,19 +270,30 @@ export class UcpfDetailsWorkspaceViewElement
259270
${this._model?.productRootId && html`<uui-button class='ucpf-clearPropButton' slot='editor' look='secondary' @click=${this.#onClearInputClick('productRootId')} label=${this.localize.term('general_remove')}></uui-button>`}
260271
</umb-property-layout>
261272
273+
<umb-property-layout
274+
label=${this.localize.term('ucProductFeeds_propIncludeTaxInPriceLabel')}
275+
description=${this.localize.term('ucProductFeeds_propIncludeTaxInPriceDescription')}
276+
>
277+
<uui-toggle
278+
slot="editor"
279+
label=""
280+
name="includeTaxInPrice"
281+
@change=${this.#onCheckboxChange}
282+
?checked=${!!this._model?.includeTaxInPrice}
283+
></uui-toggle>
284+
</umb-property-layout>
285+
262286
<umb-property-layout
263287
label=${this.localize.term('ucProductFeeds_propPropNodeMappingLabel')}
264288
description=${this.localize.term('ucProductFeeds_propPropNodeMappingDescription')}
265289
?mandatory=${true}
266290
>
267-
268291
<ucpf-property-node-mapper
269292
slot='editor'
270293
.mapItems=${this._model?.propertyNameMappings ?? []}
271294
.propertyValueExtractorOptions=${this._propertyValueExtractorOptions}
272295
@change=${this.#onPropNodeMapperChange}
273296
></ucpf-property-node-mapper>
274-
275297
</umb-property-layout>
276298
</uc-stack>
277299
</uui-box>

src/Umbraco.Commerce.ProductFeeds.Client/frontend/src/workspaces/list/collections/views/table.element.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export class UcpfListCollectionViewTableElement extends UmbLitElement {
6666
this.observe(
6767
this.#collectionContext.items,
6868
(collectionItems) => {
69-
console.log('collectionItems', collectionItems);
7069
this.#createTableItems(collectionItems);
7170
},
7271
'umbCollectionItemsObserver',

0 commit comments

Comments
 (0)