Skip to content

Commit 85df958

Browse files
authored
Merge pull request #430 from Ecwid/ECWID-138159_V2
ECWID-147482: Custom URL slugs for catalog pages: Product and categories export/import in CSV: Custom slugs for categories is not filled after import: set up missing 'customSlug' property
2 parents 6651408 + fcbc099 commit 85df958

6 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/kotlin/com/ecwid/apiclient/v3/converter/FetchedCategory.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ fun FetchedCategory.toUpdated(): UpdatedCategory {
1919
seoDescription = seoDescription,
2020
seoDescriptionTranslated = seoDescriptionTranslated,
2121
alt = alt?.toUpdated(),
22+
customSlug = customSlug,
2223
)
2324
}

src/main/kotlin/com/ecwid/apiclient/v3/dto/category/request/UpdatedCategory.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ data class UpdatedCategory(
2020
val seoTitleTranslated: LocalizedValueMap? = null,
2121
val seoDescription: String? = null,
2222
val seoDescriptionTranslated: LocalizedValueMap? = null,
23-
val alt: UpdatedAlt? = null
23+
val alt: UpdatedAlt? = null,
24+
val customSlug: String? = null,
2425
) : ApiUpdatedDTO {
2526

2627
override fun getModifyKind() = ModifyKind.ReadWrite(FetchedCategory::class)

src/main/kotlin/com/ecwid/apiclient/v3/dto/category/result/FetchedCategory.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ data class FetchedCategory(
2626
val originalImageUrl: String? = null,
2727
val originalImage: PictureInfo? = null,
2828
val url: String? = null,
29+
val customSlug: String? = null,
2930
val productCount: Int? = null,
3031
val productCountWithoutSubcategories: Int? = null,
3132
val enabledProductCount: Int? = null,

src/test/kotlin/com/ecwid/apiclient/v3/entity/CategoriesTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class CategoriesTest : BaseEntityTest() {
179179
// Searching categories with different combinations of baseUrl and cleanUrls parameters
180180
assertCategoryUrlMatchesRegex(
181181
categorySearchRequest = CategoriesSearchRequest(),
182-
urlPattern = "https://.*.company.site.*/Category-.*-c.*"
182+
urlPattern = "https://.*.company.site.*/products#!/Category-.*c.*"
183183
)
184184
assertCategoryUrlMatchesRegex(
185185
categorySearchRequest = CategoriesSearchRequest(
@@ -601,7 +601,8 @@ private fun generateTestCategory(
601601
seoDescriptionTranslated = LocalizedValueMap(
602602
"ru" to "",
603603
"en" to ""
604-
)
604+
),
605+
customSlug = ""
605606
)
606607
}
607608

src/test/kotlin/com/ecwid/apiclient/v3/entity/ProductsTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class ProductsTest : BaseEntityTest() {
242242
// Searching products with different combinations of baseUrl and cleanUrls parameters
243243
assertProductUrlMatchesRegex(
244244
productSearchRequest = ByFilters(keyword = productCreateRequest.newProduct.sku),
245-
urlPattern = "https://.*.company.site.*/Product-.*-p.*"
245+
urlPattern = "https://.*.company.site.*/products#!/Product-.*p.*"
246246
)
247247
assertProductUrlMatchesRegex(
248248
productSearchRequest = ByFilters(

src/test/kotlin/com/ecwid/apiclient/v3/rule/nullablepropertyrules/FetchedCategoryRules.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ val fetchedCategoryNullablePropertyRules: List<NullablePropertyRule<*, *>> = lis
2626
AllowNullable(FetchedCategory::seoTitle),
2727
AllowNullable(FetchedCategory::seoTitleTranslated),
2828
AllowNullable(FetchedCategory::seoDescription),
29+
AllowNullable(FetchedCategory::customSlug),
2930
AllowNullable(FetchedCategory::seoDescriptionTranslated),
3031
AllowNullable(FetchedCategory::alt),
3132
AllowNullable(FetchedAlt::main),

0 commit comments

Comments
 (0)