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: new message if user searches for a keyword that not matches with any result in completed, open and progress view #217

Merged
merged 8 commits into from
Aug 1, 2023
9 changes: 6 additions & 3 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
" doesn't have any completed orders right now.": " doesn't have any completed orders right now.",
" doesn't have any orders in progress right now.": " doesn't have any orders in progress right now.",
" doesn't have any outstanding orders right now.": " doesn't have any outstanding orders right now.",
"doesn't have any completed orders right now.": "{facilityName} doesn't have any completed orders right now.",
"doesn't have any orders in progress right now.": "{facilityName} doesn't have any orders in progress right now.",
"doesn't have any outstanding orders right now.": "{facilityName} doesn't have any outstanding orders right now.",
"Add Box": "Add Box",
"Add custom field": "Add custom field",
"Address 1": "Address 1",
Expand Down Expand Up @@ -98,6 +98,9 @@
"No": "No",
"No new file upload. Please try again": "No new file upload. Please try again",
"No reason": "No reason",
"No results found for . Try searching Open or Completed tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching Open or Completed tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No results found for . Try searching In Progress or Open tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching In Progress or Open tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No results found for . Try searching In Progress or Completed tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching In Progress or Completed tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No time zone found": "No time zone found",
"Not in Stock": "Not in Stock",
"order": "order",
Expand Down
9 changes: 6 additions & 3 deletions src/locales/es.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
" doesn't have any completed orders right now.": " no tiene ningún pedido completado en este moment.",
" doesn't have any orders in progress right now.": " no tiene ningún pedido en curso en este moment.",
" doesn't have any outstanding orders right now.": " no tiene ningún pedido pendiente en este momento.",
"doesn't have any completed orders right now.": "{facilityName} no tiene ningún pedido completado en este moment.",
"doesn't have any orders in progress right now.": "{facilityName} no tiene ningún pedido en curso en este moment.",
"doesn't have any outstanding orders right now.": "{facilityName} no tiene ningún pedido pendiente en este momento.",
"Add Box": "Agregar Caja",
"Add custom field": "Agregar campo personalizado",
"Address 1": "Address 1",
Expand Down Expand Up @@ -98,6 +98,9 @@
"No": "No",
"No new file upload. Please try again": "No se cargó ningún archivo nuevo. Por favor, inténtalo nuevamente.",
"No reason": "Sin motivo",
"No results found for . Try searching Open or Completed tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching Open or Completed tab instead.{ lineBreak }If you still can't find what you're looking for, try switching stores.",
"No results found for . Try searching In Progress or Open tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching In Progress or Open tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No results found for . Try searching In Progress or Completed tab instead. If you still can't find what you're looking for, try switching stores.": "No results found for { searchedQuery }. Try searching In Progress or Completed tab instead.{ lineBreak } If you still can't find what you're looking for, try switching stores.",
"No time zone found": "No se encontró zona horaria",
"Not in Stock": "No en Stock",
"order": "pedido",
Expand Down
9 changes: 7 additions & 2 deletions src/views/Completed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
</ion-fab-button>
</ion-fab>
<div class="empty-state" v-else>
{{ currentFacility.name }}{{ $t(" doesn't have any completed orders right now.") }}
<p v-html="getErrorMessage()"></p>
</div>
</ion-content>
</ion-page>
Expand Down Expand Up @@ -201,7 +201,8 @@ export default defineComponent({
data() {
return {
shipmentMethods: [] as Array<any>,
carrierPartyIds: [] as Array<any>
carrierPartyIds: [] as Array<any>,
searchedQuery: ''
}
},
computed: {
Expand All @@ -223,6 +224,9 @@ export default defineComponent({
emitter.off('updateOrderQuery', this.updateOrderQuery)
},
methods: {
getErrorMessage() {
return this.searchedQuery === '' ? this.$t("doesn't have any completed orders right now.", { facilityName: this.currentFacility.name }) : this.$t( "No results found for . Try searching In Progress or Open tab instead. If you still can't find what you're looking for, try switching stores.", { searchedQuery: this.searchedQuery, lineBreak: '<br />' })
},
hasAnyPackedShipment(): boolean {
return this.completedOrders.list.some((order: any) => {
return order.shipments && order.shipments.some((shipment: any) => shipment.statusId === "SHIPMENT_PACKED");
Expand Down Expand Up @@ -454,6 +458,7 @@ export default defineComponent({
completedOrdersQuery.viewSize = process.env.VUE_APP_VIEW_SIZE
completedOrdersQuery.queryString = queryString
await this.store.dispatch('order/updateCompletedQuery', { ...completedOrdersQuery })
this.searchedQuery = queryString;
},
async updateSelectedShipmentMethods (method: string) {
const completedOrdersQuery = JSON.parse(JSON.stringify(this.completedOrders.query))
Expand Down
10 changes: 9 additions & 1 deletion src/views/InProgress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@
<ion-icon :icon="checkmarkDoneOutline" />
</ion-fab-button>
</ion-fab>
<div class="empty-state" v-else>{{ currentFacility.name }} {{ $t(" doesn't have any orders in progress right now.") }} </div>
<div class="empty-state" v-else>
<p v-html="getErrorMessage()"></p>
</div>
</ion-content>
</ion-page>
</template>
Expand Down Expand Up @@ -255,10 +257,15 @@ export default defineComponent({
picklists: [] as any,
defaultShipmentBoxType: '',
itemsIssueSegmentSelected: [] as any,
orderBoxes: [] as any,
searchedQuery: '',
addingBoxForOrderIds: [] as any
}
},
methods: {
getErrorMessage() {
return this.searchedQuery === '' ? this.$t("doesn't have any orders in progress right now.", { facilityName: this.currentFacility.name }) : this.$t( "No results found for . Try searching Open or Completed tab instead. If you still can't find what you're looking for, try switching stores.", { searchedQuery: this.searchedQuery, lineBreak: '<br />' })
},
getInProgressOrders() {
return JSON.parse(JSON.stringify(this.inProgressOrders.list)).splice(0, (this.inProgressOrders.query.viewIndex + 1) * (process.env.VUE_APP_VIEW_SIZE as any) );
},
Expand Down Expand Up @@ -770,6 +777,7 @@ export default defineComponent({
inProgressOrdersQuery.viewSize = process.env.VUE_APP_VIEW_SIZE
inProgressOrdersQuery.queryString = queryString
await this.store.dispatch('order/updateInProgressQuery', { ...inProgressOrdersQuery })
this.searchedQuery = queryString;
},
async updateOrderQuery(size?: any, queryString?: any) {
const inProgressOrdersQuery = JSON.parse(JSON.stringify(this.inProgressOrders.query))
Expand Down
9 changes: 7 additions & 2 deletions src/views/OpenOrders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
</ion-fab-button>
</ion-fab>
<div class="empty-state" v-else>
{{ currentFacility.name }}{{ $t(" doesn't have any outstanding orders right now.") }}
<p v-html="getErrorMessage()"></p>
</div>
</ion-content>
</ion-page>
Expand Down Expand Up @@ -174,10 +174,14 @@ export default defineComponent({
},
data () {
return {
shipmentMethods: [] as Array<any>
shipmentMethods: [] as Array<any>,
searchedQuery: ''
}
},
methods: {
getErrorMessage() {
return this.searchedQuery === '' ? this.$t("doesn't have any outstanding orders right now.", { facilityName: this.currentFacility.name }) : this.$t( "No results found for . Try searching In Progress or Completed tab instead. If you still can't find what you're looking for, try switching stores.", { searchedQuery: this.searchedQuery, lineBreak: '<br />' })
},
getOpenOrders() {
return this.openOrders.list.slice(0, (this.openOrders.query.viewIndex + 1) * (process.env.VUE_APP_VIEW_SIZE as any) );
},
Expand Down Expand Up @@ -262,6 +266,7 @@ export default defineComponent({
openOrdersQuery.viewSize = process.env.VUE_APP_VIEW_SIZE
openOrdersQuery.queryString = queryString
await this.store.dispatch('order/updateOpenQuery', { ...openOrdersQuery })
this.searchedQuery = queryString;
},
async updateOrderQuery(size: any) {
const openOrdersQuery = JSON.parse(JSON.stringify(this.openOrders.query))
Expand Down
Loading