From bc1acaca821d66ba6399094a579161b03454e23d Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 20 Sep 2023 14:37:10 +0530 Subject: [PATCH 1/2] Improved: code to display disconnected shop config on the shopListing tab (#155) --- src/i18n/locales/en.json | 1 + src/views/catalog-product-details.vue | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 52d98db0..035bea02 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -40,6 +40,7 @@ "Copied to clipboard": "Copied to clipboard", "Corresponding sales orders": "Corresponding sales orders", "Custom": "Custom", + "Disconnected": "Disconnected", "Delisting at": "Delisting at {listingTime}", "Delisting failed at": "Delisting failed at {listingTime}", "Delisted at": "Delisted at {listingTime}", diff --git a/src/views/catalog-product-details.vue b/src/views/catalog-product-details.vue index 2b157eda..95576119 100644 --- a/src/views/catalog-product-details.vue +++ b/src/views/catalog-product-details.vue @@ -346,7 +346,10 @@

{{ listData.listingTimeAndStatus }}

- + +
{{ $t('Disconnected') }}
+
+
{{ $t(listData.listingStatus) }}
@@ -964,13 +967,11 @@ export default defineComponent({ try { let payload = { "inputFields": { - "productStoreId": this.currentEComStore.productStoreId, - "accessScopeEnumId": "SHOP_NO_ACCESS", - 'accessScopeEnumId_op': 'notEqual' + "productStoreId": this.currentEComStore.productStoreId }, "orderBy": "name ASC", "entityName": "ShopifyShopAndConfig", - "fieldList": ["shopifyConfigId", "shopId", "name"], + "fieldList": ["accessScopeEnumId", "shopifyConfigId", "shopId", "name"], "viewSize": 20 } as any @@ -1060,10 +1061,12 @@ export default defineComponent({ promiseDate: metafieldValue["promise_date"] } let listingTime = '' - if(listData.listingTime) { + if (listData.listingTime) { listingTime = DateTime.fromFormat(listData.listingTime, "MMM dd,yyyy HH:mm:ss").toLocaleString(DateTime.DATETIME_MED); } - if (!listData.containsError) { + if (listData.accessScopeEnumId === 'SHOP_NO_ACCESS') { + listData.status = 'disconnected' + } else if (!listData.containsError) { if (listData.status === 'inactive') { // showing the job's runTime as listing time, and not showing listing time if not present listingTime && (listData.listingTimeAndStatus = this.$t("Delisted at", { listingTime })) From c7a650d8e05ca1f437ee38ecb8537f19e0bcd2e4 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 20 Sep 2023 18:41:14 +0530 Subject: [PATCH 2/2] Improved: logic for rendering disconnected, used listingStatus (#155) --- src/views/catalog-product-details.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/views/catalog-product-details.vue b/src/views/catalog-product-details.vue index 95576119..07ba0aa2 100644 --- a/src/views/catalog-product-details.vue +++ b/src/views/catalog-product-details.vue @@ -346,10 +346,7 @@

{{ listData.listingTimeAndStatus }}

- -
{{ $t('Disconnected') }}
-
- +
{{ $t(listData.listingStatus) }}
@@ -1066,6 +1063,7 @@ export default defineComponent({ } if (listData.accessScopeEnumId === 'SHOP_NO_ACCESS') { listData.status = 'disconnected' + listData.listingStatus = 'Disconnected' } else if (!listData.containsError) { if (listData.status === 'inactive') { // showing the job's runTime as listing time, and not showing listing time if not present