From dff6f352a4ab3249868798c53b3769c13e2077b8 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Thu, 15 Feb 2024 15:26:54 +0530 Subject: [PATCH 1/5] Implemented: support to display searchbar and product store filters on the groups page and added support to filter groups on the basis of product store(#99) --- src/locales/en.json | 1 + src/services/RoutingService.ts | 2 +- src/store/modules/orderRouting/actions.ts | 5 +- src/theme/variables.css | 52 ++++++++++++ src/views/BrokeringRuns.vue | 96 +++++++++++++++-------- 5 files changed, 122 insertions(+), 34 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index 5980a8c..4f38fd9 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -120,6 +120,7 @@ "Schedule": "Schedule", "Schedule disabled": "Schedule disabled", "Scheduler": "Scheduler", + "Search groups": "Search groups", "Search time zones": "Search time zones", "Select": "Select", "Select filter to apply": "Select filter to apply", diff --git a/src/services/RoutingService.ts b/src/services/RoutingService.ts index 6fb7be9..e8ac61e 100644 --- a/src/services/RoutingService.ts +++ b/src/services/RoutingService.ts @@ -4,7 +4,7 @@ const fetchRoutingGroups = async (payload: any): Promise => { return api({ url: "groups", method: "GET", - query: payload + params: payload }); } diff --git a/src/store/modules/orderRouting/actions.ts b/src/store/modules/orderRouting/actions.ts index 2f134f0..50631e1 100644 --- a/src/store/modules/orderRouting/actions.ts +++ b/src/store/modules/orderRouting/actions.ts @@ -8,12 +8,15 @@ import logger from "@/logger" import { DateTime } from "luxon" import emitter from "@/event-bus" import { translate } from "@/i18n" +import store from "@/store" const actions: ActionTree = { async fetchOrderRoutingGroups({ commit }) { let routingGroups = [] as any; // filter groups on the basis of productStoreId - const payload = {} + const payload = { + productStoreId: store.state.user.currentEComStore.productStoreId + } try { const resp = await OrderRoutingService.fetchRoutingGroups(payload); diff --git a/src/theme/variables.css b/src/theme/variables.css index 7b79dcc..d5920af 100644 --- a/src/theme/variables.css +++ b/src/theme/variables.css @@ -266,6 +266,58 @@ http://ionicframework.com/docs/theming/ */ cursor: pointer; } +.desktop-only { + display: none; +} + +.mobile-only { + display: unset; +} + +.find { + display: grid; + grid-template-areas: "search" + "main"; +} + +.find > .filters{ + display: none; +} + +.find > main { + grid-area: main; +} + +.filters { + grid-area: filters; +} + +.search { + grid-area: search; +} + +@media (min-width: 991px) { + .find { + grid: "search main" min-content + "filters main" 1fr + / 375px; + column-gap: var(--spacer-2xl); + margin: var(--spacer-lg); + } + + .filters { + margin-top: var(--spacer-lg); + } + + .filters { + margin-top: var(--spacer-lg); + } + + .find > .filters{ + display: unset; + } +} + @media (prefers-color-scheme: dark) { ion-chip > ion-icon { color: var(--ion-color-dark); diff --git a/src/views/BrokeringRuns.vue b/src/views/BrokeringRuns.vue index 6bcd2bb..15c285e 100644 --- a/src/views/BrokeringRuns.vue +++ b/src/views/BrokeringRuns.vue @@ -14,48 +14,66 @@ -
- - - {{ translate("Fetching groups") }} - -
-
-
- - - - {{ group.groupName }} - - - - {{ group.description }} - - - {{ group.frequency ? group.frequency : "-" }} - {{ group.runTime ? group.runTime : "-" }} - - - {{ getDateAndTime(group.createdDate) }} - +
+ + +
-
-
- {{ translate("No runs scheduled") }} -
+ + + +
+ + + {{ translate("Fetching groups") }} + +
+
+
+ + + + {{ group.groupName }} + + + + {{ group.description }} + + + {{ group.frequency ? group.frequency : "-" }} + {{ group.runTime ? group.runTime : "-" }} + + + {{ getDateAndTime(group.createdDate) }} + + + {{ getDateAndTime(group.lastUpdatedStamp) }} + + +
+
+
+ {{ translate("No runs scheduled") }} +
+