@isoftdata/svelte-ecommerce 1.0.0-beta.0 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -58
- package/dist/EcommerceCategoryMapConfiguration.svelte +251 -266
- package/dist/EcommerceCategoryMapConfiguration.svelte.d.ts +6 -4
- package/dist/EcommerceConditionMapConfiguration.svelte +192 -214
- package/dist/EcommerceConditionMapConfiguration.svelte.d.ts +3 -3
- package/dist/EcommerceConfiguration.svelte +199 -195
- package/dist/EcommerceConfiguration.svelte.d.ts +16 -16
- package/dist/EcommerceDefaults.svelte +333 -357
- package/dist/EcommerceDefaults.svelte.d.ts +4 -4
- package/dist/EcommerceListingDetails.svelte +852 -986
- package/dist/EcommerceListingDetails.svelte.d.ts +10 -10
- package/dist/EcommercePartTypeConfig.svelte +277 -305
- package/dist/EcommercePartTypeConfig.svelte.d.ts +7 -8
- package/dist/EcommerceStoreConfiguration.svelte +248 -263
- package/dist/EcommerceStoreConfiguration.svelte.d.ts +5 -5
- package/dist/PolicyList.svelte +54 -66
- package/dist/PolicyList.svelte.d.ts +3 -3
- package/dist/data/ebay.d.ts +4 -4
- package/dist/data/htp.d.ts +3 -3
- package/dist/data/htp.js +1 -1
- package/dist/helpers/listing.js +23 -25
- package/dist/helpers/template.d.ts +2 -2
- package/dist/helpers/template.js +35 -37
- package/dist/helpers/validation.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/utils.d.ts +47 -61
- package/package.json +31 -13
package/README.md
CHANGED
|
@@ -1,58 +1,56 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
npm publish
|
|
58
|
-
```
|
|
1
|
+
# @isoftdata/svelte-ecommerce
|
|
2
|
+
|
|
3
|
+
A Svelte 5 component library for e-commerce configuration and management.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @isoftdata/svelte-ecommerce
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```svelte
|
|
14
|
+
<script>
|
|
15
|
+
import { EcommerceConfiguration } from '@isoftdata/svelte-ecommerce'
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<EcommerceConfiguration />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Available Components
|
|
22
|
+
|
|
23
|
+
- `EcommerceConfiguration` - Main configuration component
|
|
24
|
+
- `EcommerceCategoryMapConfiguration` - Category mapping configuration
|
|
25
|
+
- `EcommerceConditionMapConfiguration` - Condition mapping configuration
|
|
26
|
+
- `EcommerceDefaults` - Default settings configuration
|
|
27
|
+
- `EcommerceListingDetails` - Listing details management
|
|
28
|
+
- `EcommercePartTypeConfig` - Part type configuration
|
|
29
|
+
- `EcommerceStoreConfiguration` - Store configuration
|
|
30
|
+
- `PolicyList` - Policy list management
|
|
31
|
+
|
|
32
|
+
## Development
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Install dependencies
|
|
36
|
+
pnpm install
|
|
37
|
+
|
|
38
|
+
# Start dev server
|
|
39
|
+
pnpm dev
|
|
40
|
+
|
|
41
|
+
# Preview
|
|
42
|
+
pnpm preview
|
|
43
|
+
|
|
44
|
+
# Build library
|
|
45
|
+
pnpm build
|
|
46
|
+
|
|
47
|
+
# Run linter
|
|
48
|
+
pnpm lint
|
|
49
|
+
|
|
50
|
+
# Format code
|
|
51
|
+
pnpm format
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## License
|
|
55
|
+
|
|
56
|
+
MIT
|
|
@@ -1,266 +1,251 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { i18n } from 'i18next'
|
|
3
|
-
|
|
4
|
-
import { getContext } from 'svelte'
|
|
5
|
-
import Select from '@isoftdata/svelte-select'
|
|
6
|
-
import Table from '@isoftdata/svelte-table'
|
|
7
|
-
import Button from '@isoftdata/svelte-button'
|
|
8
|
-
import Modal from '@isoftdata/svelte-modal'
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
let
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
//
|
|
105
|
-
selectedPartType =
|
|
106
|
-
selectedEcommerceCategoryId =
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
let
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
<
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
{
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
>
|
|
253
|
-
{#each filteredEbayCategoriesByType as category}
|
|
254
|
-
<option value={category.ebayCategoryId}>{category.name}</option>
|
|
255
|
-
{/each}
|
|
256
|
-
{#if selectedEcommerceCategoryMappingRow && selectedEcommerceCategoryMappingRow.ebayCategoryId && !ebayCategoryList.find(t => t.ebayCategoryId === selectedEcommerceCategoryMappingRow?.ebayCategoryId)}
|
|
257
|
-
<option
|
|
258
|
-
value={selectedEcommerceCategoryMappingRow.ebayCategoryId}
|
|
259
|
-
selected
|
|
260
|
-
>
|
|
261
|
-
{selectedEcommerceCategoryMappingRow.ebayCategoryName}
|
|
262
|
-
</option>
|
|
263
|
-
{/if}
|
|
264
|
-
</Select>
|
|
265
|
-
</div>
|
|
266
|
-
</Modal>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { i18n } from 'i18next'
|
|
3
|
+
|
|
4
|
+
import { getContext } from 'svelte'
|
|
5
|
+
import Select from '@isoftdata/svelte-select'
|
|
6
|
+
import Table from '@isoftdata/svelte-table'
|
|
7
|
+
import Button from '@isoftdata/svelte-button'
|
|
8
|
+
import Modal from '@isoftdata/svelte-modal'
|
|
9
|
+
import type { EbayCategory, EbayCategoryMap, ExtendedEbayCategoryMap, InventoryType } from './utils.js'
|
|
10
|
+
import type { IndexedRowProps } from '@isoftdata/svelte-table'
|
|
11
|
+
import { klona } from 'klona'
|
|
12
|
+
|
|
13
|
+
import { translate as defaultTranslate } from '@isoftdata/utility-string'
|
|
14
|
+
|
|
15
|
+
const { t: translate } = getContext<i18n>('i18next') || { t: defaultTranslate }
|
|
16
|
+
|
|
17
|
+
type SelectedEbayCategoryMapRow = ExtendedEbayCategoryMap & IndexedRowProps
|
|
18
|
+
|
|
19
|
+
// Just ebay category map table columns
|
|
20
|
+
interface Props {
|
|
21
|
+
// Props
|
|
22
|
+
ebayCategoryList: Array<EbayCategory> // ebay categories for mapping
|
|
23
|
+
ebayCategoryMapList: Array<ExtendedEbayCategoryMap> // ebay category mappings for itrack categories
|
|
24
|
+
inventoryTypeList?: Array<InventoryType> // inventory types for mapping
|
|
25
|
+
selectedPartType?: number | null
|
|
26
|
+
categoryMapChanged: (data: EbayCategoryMap) => Promise<void>
|
|
27
|
+
selectedEcommerceCategoryMappingRow?: ExtendedEbayCategoryMap | SelectedEbayCategoryMapRow | null
|
|
28
|
+
selectedEcommerceCategoryId?: number | null
|
|
29
|
+
selectedEbayCategoryType?: string | null
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let {
|
|
33
|
+
ebayCategoryList = [],
|
|
34
|
+
ebayCategoryMapList = $bindable([]),
|
|
35
|
+
inventoryTypeList = [],
|
|
36
|
+
categoryMapChanged = async (_: EbayCategoryMap) => {},
|
|
37
|
+
}: Props = $props()
|
|
38
|
+
|
|
39
|
+
// Local state
|
|
40
|
+
let editITrackCategoryDisabled = $state(false) // for category mapping, if needed in future
|
|
41
|
+
let show = $state(false)
|
|
42
|
+
let selectedEbayCategoryType: string | null = $state(null)
|
|
43
|
+
let selectedEcommerceCategoryId: number | null = $state(null)
|
|
44
|
+
let selectedEcommerceCategoryMappingRow: ExtendedEbayCategoryMap | SelectedEbayCategoryMapRow | null = $state(null)
|
|
45
|
+
let selectedPartType: number | null = $state(null) // used in category map config component
|
|
46
|
+
|
|
47
|
+
// New empty items
|
|
48
|
+
let newCategoryMapping = {
|
|
49
|
+
ebayCategoryId: null,
|
|
50
|
+
ebayCategoryName: '',
|
|
51
|
+
inventoryTypeName: null,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// TODO: saved inventory type doesn't get removed from dropdown after upsert/save
|
|
55
|
+
async function confirm() {
|
|
56
|
+
if (!selectedEcommerceCategoryMappingRow) return
|
|
57
|
+
|
|
58
|
+
const mappingToSave = convertCategoryToSavableFormat(selectedEcommerceCategoryMappingRow)
|
|
59
|
+
await categoryMapChanged(mappingToSave)
|
|
60
|
+
close()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function close() {
|
|
64
|
+
selectedEbayCategoryType = null
|
|
65
|
+
selectedEcommerceCategoryId = null
|
|
66
|
+
selectedEcommerceCategoryMappingRow = null
|
|
67
|
+
selectedPartType = null
|
|
68
|
+
show = false
|
|
69
|
+
}
|
|
70
|
+
function convertCategoryToSavableFormat(row: EbayCategoryMap | SelectedEbayCategoryMapRow): EbayCategoryMap {
|
|
71
|
+
const mapping = {
|
|
72
|
+
ebayCategoryId: selectedEcommerceCategoryId || row.ebayCategoryId,
|
|
73
|
+
vehicleType: 'Car', // Set a default so I stop getting TS warnings
|
|
74
|
+
typeNum: selectedPartType || row.typeNum,
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const matchingEbayCategoryName = ebayCategoryList.find(row => row.ebayCategoryId === mapping.ebayCategoryId)?.name
|
|
78
|
+
if (matchingEbayCategoryName) {
|
|
79
|
+
if (matchingEbayCategoryName.includes('Car')) {
|
|
80
|
+
mapping.vehicleType = 'Car'
|
|
81
|
+
} else if (matchingEbayCategoryName.includes('HeavyTruck')) {
|
|
82
|
+
mapping.vehicleType = 'HeavyTruck'
|
|
83
|
+
} else if (matchingEbayCategoryName.includes('MotorCycle')) {
|
|
84
|
+
mapping.vehicleType = 'MotorCycle'
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return mapping
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Called on add/edit button click
|
|
92
|
+
function editCategoryMapRow(row?: any) {
|
|
93
|
+
// Set selected row
|
|
94
|
+
selectedEcommerceCategoryMappingRow = klona(row || newCategoryMapping)
|
|
95
|
+
|
|
96
|
+
// Update the selected values based on the row being edited
|
|
97
|
+
if (row) {
|
|
98
|
+
// Set the selectedITrackPartType to match the row's value
|
|
99
|
+
selectedPartType = row.typeNum || ''
|
|
100
|
+
selectedEcommerceCategoryId = row.ebayCategoryid
|
|
101
|
+
// When editing an existing condition, you might want to disable editing the condition
|
|
102
|
+
editITrackCategoryDisabled = true
|
|
103
|
+
} else {
|
|
104
|
+
// For new mappings, reset the selected values
|
|
105
|
+
selectedPartType = null
|
|
106
|
+
selectedEcommerceCategoryId = null
|
|
107
|
+
editITrackCategoryDisabled = false
|
|
108
|
+
}
|
|
109
|
+
show = true // Show the category mapping edit form
|
|
110
|
+
}
|
|
111
|
+
// Function to extract unique middle segments from eBay category names
|
|
112
|
+
function extractUniqueCategoryTypes(categories: Array<EbayCategory>): Array<string> {
|
|
113
|
+
// Set to store unique segments
|
|
114
|
+
const uniqueSegments = new Set<string>()
|
|
115
|
+
|
|
116
|
+
// Process each category
|
|
117
|
+
categories.forEach(category => {
|
|
118
|
+
if (!category.name) return
|
|
119
|
+
const parts = category.name.split('>')
|
|
120
|
+
// Check if there are at least 3 parts (to have a middle segment)
|
|
121
|
+
if (parts.length >= 3) {
|
|
122
|
+
// Extract the middle segment (index 1) and trim whitespace
|
|
123
|
+
const middleSegment = parts[1].trim()
|
|
124
|
+
uniqueSegments.add(middleSegment)
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
// Convert Set to Array and sort alphabetically
|
|
129
|
+
return Array.from(uniqueSegments).sort()
|
|
130
|
+
}
|
|
131
|
+
// Inputs
|
|
132
|
+
|
|
133
|
+
let filteredEbayCategoriesByType = $derived(
|
|
134
|
+
ebayCategoryList.filter(
|
|
135
|
+
category => category.name && (selectedEbayCategoryType ? category.name.includes(selectedEbayCategoryType) : true),
|
|
136
|
+
),
|
|
137
|
+
)
|
|
138
|
+
let uniqueCategoryTypes = $derived(extractUniqueCategoryTypes(ebayCategoryList))
|
|
139
|
+
let unmappedPartTypes = $derived(
|
|
140
|
+
inventoryTypeList.filter(
|
|
141
|
+
partType =>
|
|
142
|
+
// Include the part type if it's the one being edited or if it's not already mapped
|
|
143
|
+
selectedEcommerceCategoryMappingRow?.inventoryTypeName === partType.name ||
|
|
144
|
+
!ebayCategoryMapList.some(mapping => mapping.inventoryTypeName === partType.name),
|
|
145
|
+
),
|
|
146
|
+
)
|
|
147
|
+
</script>
|
|
148
|
+
|
|
149
|
+
<div class="card">
|
|
150
|
+
<div class="card-header">
|
|
151
|
+
<h4 class="mb-0">{translate('configuration.ecommerce.categoryMappings', 'Category Mappings')}</h4>
|
|
152
|
+
<p class="text-muted mb-0">
|
|
153
|
+
{translate('configuration.ecommerce.categoryMappingsHint', 'Map part types to eBay Categories')}
|
|
154
|
+
</p>
|
|
155
|
+
</div>
|
|
156
|
+
<div class="card-body">
|
|
157
|
+
<Table
|
|
158
|
+
responsive
|
|
159
|
+
stickyHeader
|
|
160
|
+
rows={ebayCategoryMapList}
|
|
161
|
+
parentClass="overflow-y-auto mh-500"
|
|
162
|
+
columns={[
|
|
163
|
+
{
|
|
164
|
+
property: 'inventoryTypeName',
|
|
165
|
+
name: translate('configuration.ecommerce.itrackInventoryType', '{{product}} Inventory Type', {
|
|
166
|
+
product: 'ITrack',
|
|
167
|
+
}),
|
|
168
|
+
defaultSortColumn: true,
|
|
169
|
+
},
|
|
170
|
+
{ property: 'ebayCategoryName', name: translate('configuration.ecommerce.ebayCategory', 'Ebay Category') },
|
|
171
|
+
]}
|
|
172
|
+
>
|
|
173
|
+
{#snippet children({ row })}
|
|
174
|
+
<tr
|
|
175
|
+
onclick={() => editCategoryMapRow(row)}
|
|
176
|
+
style="cursor: pointer;"
|
|
177
|
+
>
|
|
178
|
+
<td>{row.inventoryTypeName}</td>
|
|
179
|
+
<td>{row.ebayCategoryName}</td>
|
|
180
|
+
</tr>
|
|
181
|
+
{/snippet}
|
|
182
|
+
</Table>
|
|
183
|
+
</div>
|
|
184
|
+
<div class="card-footer">
|
|
185
|
+
<Button
|
|
186
|
+
outline
|
|
187
|
+
color="success"
|
|
188
|
+
size="sm"
|
|
189
|
+
iconClass="plus"
|
|
190
|
+
onclick={() => editCategoryMapRow()}
|
|
191
|
+
>
|
|
192
|
+
{translate('configuration.ecommerce.add', 'Add')}...
|
|
193
|
+
</Button>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<Modal
|
|
198
|
+
bind:show
|
|
199
|
+
title={translate('configuration.ecommerce.addEditCategoryMapping', 'Add/Edit New Category Mapping')}
|
|
200
|
+
modalSize="lg"
|
|
201
|
+
confirmButtonText={translate('configuration.ecommerce.save', 'save')}
|
|
202
|
+
cancelShown
|
|
203
|
+
{confirm}
|
|
204
|
+
{close}
|
|
205
|
+
>
|
|
206
|
+
<Select
|
|
207
|
+
label={translate('configuration.ecommerce.partType', 'Part Type')}
|
|
208
|
+
emptyText="-- {translate('configuration.ecommerce.selectType', 'Select Type')} --"
|
|
209
|
+
disabled={editITrackCategoryDisabled}
|
|
210
|
+
bind:value={selectedPartType}
|
|
211
|
+
>
|
|
212
|
+
{#each unmappedPartTypes as type}
|
|
213
|
+
<option value={type.inventoryTypeId}>{type.inventoryTypeId} - {type.name}</option>
|
|
214
|
+
{/each}
|
|
215
|
+
{#if selectedEcommerceCategoryMappingRow && selectedEcommerceCategoryMappingRow.typeNum && !unmappedPartTypes.find(t => t.inventoryTypeId === selectedEcommerceCategoryMappingRow?.typeNum)}
|
|
216
|
+
<option
|
|
217
|
+
value={selectedEcommerceCategoryMappingRow.typeNum}
|
|
218
|
+
selected
|
|
219
|
+
>
|
|
220
|
+
{selectedEcommerceCategoryMappingRow.typeNum} - {selectedEcommerceCategoryMappingRow.inventoryTypeName}
|
|
221
|
+
</option>
|
|
222
|
+
{/if}
|
|
223
|
+
</Select>
|
|
224
|
+
<!-- Dropdown for unique category segments -->
|
|
225
|
+
<Select
|
|
226
|
+
label={translate('ecommerce.configuration.categoryTypeFilter', 'Category Type Filter')}
|
|
227
|
+
emptyText="-- {translate('configuration.ecommerce.selectType', 'Select Type')} --"
|
|
228
|
+
bind:value={selectedEbayCategoryType}
|
|
229
|
+
>
|
|
230
|
+
{#each uniqueCategoryTypes as type}
|
|
231
|
+
<option value={type}>{type}</option>
|
|
232
|
+
{/each}
|
|
233
|
+
</Select>
|
|
234
|
+
<Select
|
|
235
|
+
label={translate('ecommerce.configuration.ebayCategory', 'Ebay Category')}
|
|
236
|
+
emptyText="-- {translate('configuration.ecommerce.selectCategory', 'Select Category')} --"
|
|
237
|
+
bind:value={selectedEcommerceCategoryId}
|
|
238
|
+
>
|
|
239
|
+
{#each filteredEbayCategoriesByType as category}
|
|
240
|
+
<option value={category.ebayCategoryId}>{category.name}</option>
|
|
241
|
+
{/each}
|
|
242
|
+
{#if selectedEcommerceCategoryMappingRow && selectedEcommerceCategoryMappingRow.ebayCategoryId && !ebayCategoryList.find(t => t.ebayCategoryId === selectedEcommerceCategoryMappingRow?.ebayCategoryId)}
|
|
243
|
+
<option
|
|
244
|
+
value={selectedEcommerceCategoryMappingRow.ebayCategoryId}
|
|
245
|
+
selected
|
|
246
|
+
>
|
|
247
|
+
{selectedEcommerceCategoryMappingRow.ebayCategoryName}
|
|
248
|
+
</option>
|
|
249
|
+
{/if}
|
|
250
|
+
</Select>
|
|
251
|
+
</Modal>
|