Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: empty state in add product modal in Shipment and PO page. (#272) #329

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"Close purchase order items": "Close purchase order items",
"eCom Store": "eCom Store",
"Enter a custom date time format that you want to use when uploading documents to HotWax Commerce.": "Enter a custom date time format that you want to use when uploading documents to HotWax Commerce.",
"Enter a SKU, or product name to search a product": "Enter a SKU, or product name to search a product",
"External ID": "External ID",
"Facility": "Facility",
"Location": "Location",
Expand Down
40 changes: 23 additions & 17 deletions src/views/AddProductModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,30 @@
<ion-content>
<ion-searchbar @ionFocus="selectSearchBarText($event)" v-model="queryString" :placeholder="translate('Search SKU or product name')" v-on:keyup.enter="queryString = $event.target.value; getProducts()" />

<ion-list v-for="product in products" :key="product.productId">
<ion-item lines="none">
<ion-thumbnail slot="start">
<ShopifyImg :src="product.mainImageUrl" />
</ion-thumbnail>
<ion-label>
<!-- Honouring the identifications set by the user on the settings page -->
<h2>{{ product[productIdentificationPref.primaryId] }}</h2>
<p>{{ product[productIdentificationPref.secondaryId] }}</p>
</ion-label>
<ion-icon v-if="isProductAvailableInShipment(product.productId)" color="success" :icon="checkmarkCircle" />
<ion-button v-else fill="outline" @click="addtoShipment(product)">{{ translate("Add to Shipment") }}</ion-button>
</ion-item>
</ion-list>
<template v-if="products.length">
<ion-list v-for="product in products" :key="product.productId">
<ion-item lines="none">
<ion-thumbnail slot="start">
<ShopifyImg :src="product.mainImageUrl" />
</ion-thumbnail>
<ion-label>
<!-- Honouring the identifications set by the user on the settings page -->
<h2>{{ product[productIdentificationPref.primaryId] }}</h2>
<p>{{ product[productIdentificationPref.secondaryId] }}</p>
</ion-label>
<ion-icon v-if="isProductAvailableInShipment(product.productId)" color="success" :icon="checkmarkCircle" />
<ion-button v-else fill="outline" @click="addtoShipment(product)">{{ translate("Add to Shipment") }}</ion-button>
</ion-item>
</ion-list>

<ion-infinite-scroll @ionInfinite="loadMoreProducts($event)" threshold="100px" :disabled="!isScrollable">
<ion-infinite-scroll-content loading-spinner="crescent" :loading-text="translate('Loading')" />
</ion-infinite-scroll>
<ion-infinite-scroll @ionInfinite="loadMoreProducts($event)" threshold="100px" :disabled="!isScrollable">
<ion-infinite-scroll-content loading-spinner="crescent" :loading-text="translate('Loading')" />
</ion-infinite-scroll>
</template>
<div v-else class="empty-state">
<img src="../assets/images/empty-state-add-product-modal.png" alt="empty-state" />
ymaheshwari1 marked this conversation as resolved.
Show resolved Hide resolved
<p>{{ translate("Enter a SKU, or product name to search a product") }}</p>
</div>
</ion-content>
</template>

Expand Down
41 changes: 23 additions & 18 deletions src/views/AddProductToPOModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,30 @@
</ion-header>
<ion-content>
<ion-searchbar @ionFocus="selectSearchBarText($event)" v-model="queryString" :placeholder="translate('Search SKU or product name')" v-on:keyup.enter="queryString = $event.target.value; getProducts()" />

<ion-list v-for="product in products" :key="product.productId">
<ion-item lines="none">
<ion-thumbnail slot="start">
<ShopifyImg :src="product.mainImageUrl" />
</ion-thumbnail>
<ion-label>
<!-- Honouring the identifications set by the user on the settings page -->
<h2>{{ product[productIdentificationPref.primaryId] }}</h2>
<p>{{ product[productIdentificationPref.secondaryId] }}</p>
</ion-label>
<ion-icon v-if="isProductAvailableInOrder(product.productId)" color="success" :icon="checkmarkCircle" />
<ion-button v-else fill="outline" @click="addtoOrder(product)">{{ translate("Add to Purchase Order") }}</ion-button>
</ion-item>
</ion-list>
<template v-if="products.length">
<ion-list v-for="product in products" :key="product.productId">
<ion-item lines="none">
<ion-thumbnail slot="start">
<ShopifyImg :src="product.mainImageUrl" />
</ion-thumbnail>
<ion-label>
<!-- Honouring the identifications set by the user on the settings page -->
<h2>{{ product[productIdentificationPref.primaryId] }}</h2>
<p>{{ product[productIdentificationPref.secondaryId] }}</p>
</ion-label>
<ion-icon v-if="isProductAvailableInOrder(product.productId)" color="success" :icon="checkmarkCircle" />
<ion-button v-else fill="outline" @click="addtoOrder(product)">{{ translate("Add to Purchase Order") }}</ion-button>
</ion-item>
</ion-list>

<ion-infinite-scroll @ionInfinite="loadMoreProducts($event)" threshold="100px" :disabled="!isScrollable">
<ion-infinite-scroll-content loading-spinner="crescent" :loading-text="translate('Loading')" />
</ion-infinite-scroll>
<ion-infinite-scroll @ionInfinite="loadMoreProducts($event)" threshold="100px" :disabled="!isScrollable">
<ion-infinite-scroll-content loading-spinner="crescent" :loading-text="translate('Loading')" />
</ion-infinite-scroll>
</template>
<div v-else class="empty-state">
<img src="../assets/images/empty-state-add-product-modal.png" alt="empty-state" />
<p>{{ translate("Enter a SKU, or product name to search a product") }}</p>
</div>
</ion-content>
</template>

Expand Down
Loading