From c8a4a7b9ac03ae128cd876476ef36dfa328600de Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 20 Nov 2024 18:15:44 +0530 Subject: [PATCH] Improved: page name in side menu from catalog to audit, renamed components and updated route entries(#265) --- src/authorization/Rules.ts | 4 ++-- src/components/Menu.vue | 8 ++++---- src/i18n/locales/en.json | 2 +- src/router/index.ts | 20 +++++++++---------- ...-details.vue => audit-product-details.vue} | 4 ++-- src/views/{catalog.vue => audit.vue} | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) rename src/views/{catalog-product-details.vue => audit-product-details.vue} (99%) rename src/views/{catalog.vue => audit.vue} (98%) diff --git a/src/authorization/Rules.ts b/src/authorization/Rules.ts index 6d91d6f9..85cf368f 100644 --- a/src/authorization/Rules.ts +++ b/src/authorization/Rules.ts @@ -1,9 +1,9 @@ export default { "APP_ORDERS_VIEW": "", "APP_PRODUCTS_VIEW": "", - "APP_CATALOG_VIEW": "", + "APP_AUDIT_VIEW": "", "APP_PRDT_DTLS_VIEW": "", - "APP_CTLG_PRDT_DTLS_VIEW": "", + "APP_AUDIT_PRDT_DTLS_VIEW": "", "APP_COMMERCE_VIEW": "COMMERCEUSER_VIEW", "MERCHANDISING_ADMIN": "MERCHANDISING_ADMIN", "PREORDER_APP_VIEW": "PREORDER_APP_VIEW", diff --git a/src/components/Menu.vue b/src/components/Menu.vue index 214da3f3..f12e56bc 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -94,13 +94,13 @@ export default defineComponent({ } }, { - title: "Catalog", - url: "/catalog", - childRoutes: ["/catalog-product-details/"], + title: "Audit", + url: "/audit", + childRoutes: ["/audit-product-details/"], iosIcon: albums, mdIcon: albums, meta: { - permissionId: "APP_CATALOG_VIEW" + permissionId: "APP_AUDIT_VIEW" } }, { diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 75002fa3..0f4809ce 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -10,6 +10,7 @@ "Are you sure you want to update the promise date for these orders?": "Are you sure you want to update the promise date for these orders?", "Are you sure you want to change the time zone to?": "Are you sure you want to change the time zone to {timeZoneId}?", "ATP": "ATP", + "Audit": "Audit", "Auto": "Auto", "Auto releasing": "Auto releasing", "Authenticating": "Authenticating", @@ -29,7 +30,6 @@ "Cancel item": "Cancel item", "Cancel job": "Cancel job", "Cancel orders": "Cancel orders", - "Catalog": "Catalog", "Category": "Category", "Change": "Change", "Change time zone": "Change time zone", diff --git a/src/router/index.ts b/src/router/index.ts index 62d4a0b5..37dca2e7 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -2,9 +2,9 @@ import { createRouter, createWebHistory } from '@ionic/vue-router'; import { RouteRecordRaw } from 'vue-router'; import Products from '../views/products.vue' import ProductDetails from '../views/product-details.vue' -import CatalogProductDetails from '../views/catalog-product-details.vue' +import AuditProductDetails from '../views/audit-product-details.vue' import Orders from '../views/orders.vue' -import Catalog from '../views/catalog.vue' +import Audit from '../views/audit.vue' import Settings from '../views/settings.vue' import store from '@/store'; import { DxpLogin, useAuthStore } from '@hotwax/dxp-components'; @@ -79,21 +79,21 @@ const routes: Array = [ } }, { - path: '/catalog', - name: 'Catalog', - component: Catalog, + path: '/audit', + name: 'Audit', + component: Audit, beforeEnter: authGuard, meta: { - permissionId: "APP_CATALOG_VIEW" + permissionId: "APP_AUDIT_VIEW" } }, { - path: '/catalog-product-details/:productId/', - name: 'Catalog-product-details', - component: CatalogProductDetails, + path: '/audit-product-details/:productId/', + name: 'AuditProductDetails', + component: AuditProductDetails, beforeEnter: authGuard, meta: { - permissionId: "APP_CTLG_PRDT_DTLS_VIEW" + permissionId: "APP_AUDIT_PRDT_DTLS_VIEW" } }, { diff --git a/src/views/catalog-product-details.vue b/src/views/audit-product-details.vue similarity index 99% rename from src/views/catalog-product-details.vue rename to src/views/audit-product-details.vue index 9df1c07b..4a02c230 100644 --- a/src/views/catalog-product-details.vue +++ b/src/views/audit-product-details.vue @@ -3,7 +3,7 @@ - + {{ $t("Product audit") }} @@ -412,7 +412,7 @@ import { Plugins } from "@capacitor/core"; import { Actions, hasPermission } from '@/authorization' export default defineComponent({ - name: "catalog-product-details", + name: "AuditProductDetails", components: { DxpShopifyImg, IonButtons, diff --git a/src/views/catalog.vue b/src/views/audit.vue similarity index 98% rename from src/views/catalog.vue rename to src/views/audit.vue index dd258407..5184e5ca 100644 --- a/src/views/catalog.vue +++ b/src/views/audit.vue @@ -5,7 +5,7 @@ - {{ $t("Catalog") }} + {{ $t("Audit") }} @@ -116,7 +116,7 @@ import { JobService } from '@/services/JobService'; import { hasError } from '@/utils'; export default defineComponent({ - name: 'Catalog', + name: 'Audit', components: { DxpShopifyImg, IonButtons, @@ -232,7 +232,7 @@ export default defineComponent({ } }, viewProduct(product: any) { - this.router.push({ path: `/catalog-product-details/${product.groupId}`, query: { variantId: product.productId } }); + this.router.push({ path: `/audit-product-details/${product.groupId}`, query: { variantId: product.productId } }); }, async preparePreordBckordComputationJob() { try {