Skip to content

Commit

Permalink
Improved: code to display disconnected shop config on the shopListing…
Browse files Browse the repository at this point in the history
… tab (hotwax#155)
  • Loading branch information
amansinghbais committed Sep 20, 2023
1 parent befbe3e commit bc1acac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down
17 changes: 10 additions & 7 deletions src/views/catalog-product-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@
<!-- internationalized while preparation -->
<p>{{ listData.listingTimeAndStatus }}</p>
</ion-label>
<ion-label v-if="listData.shopifyShopProductId && listData.status" :color="listData.containsError ? 'danger' : (listData.status === 'inactive' ? 'warning' : 'success')" slot="end">
<ion-label v-if="listData.shopifyShopProductId && listData.status === 'disconnected'" color="medium" slot="end">
<h5>{{ $t('Disconnected') }}</h5>
</ion-label>
<ion-label v-else-if="listData.shopifyShopProductId && listData.status" :color="listData.containsError ? 'danger' : (listData.status === 'inactive' ? 'warning' : 'success')" slot="end">
<h5>{{ $t(listData.listingStatus) }}</h5>
</ion-label>
<ion-label v-else-if="listData.shopifyShopProductId" color="medium" slot="end">
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }))
Expand Down

0 comments on commit bc1acac

Please sign in to comment.