Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into hotwax#214-delay-user
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sourabh committed Apr 19, 2024
2 parents 5b29e92 + d652ec8 commit 28fc9b1
Show file tree
Hide file tree
Showing 31 changed files with 221 additions and 138 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HotWax Commerce Import",
"short_name": "User Management",
"short_name": "Users",
"theme_color": "#FFFFFF",
"icons": [{
"src": "public/img/icons/favicon-16x16.png",
Expand Down
72 changes: 29 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "users",
"version": "1.7.0",
"version": "1.8.0",
"private": true,
"description": "User Management App",
"description": "Users",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
Expand All @@ -17,8 +17,8 @@
"@casl/ability": "^6.0.0",
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/apps-theme": "^1.2.6",
"@hotwax/dxp-components": "^1.12.2",
"@hotwax/oms-api": "^1.13.0",
"@hotwax/dxp-components": "1.13.0",
"@hotwax/oms-api": "1.14.0",
"@ionic/core": "^7.6.0",
"@ionic/vue": "^7.6.0",
"@ionic/vue-router": "^7.6.0",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User Management - HotWax Commerce</title>
<title>Users - HotWax Commerce</title>

<base href="/" />

Expand Down
8 changes: 6 additions & 2 deletions src/adapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
resetConfig,
setUserLocale,
updateToken,
updateInstanceUrl
updateInstanceUrl,
setUserTimeZone,
getAvailableTimeZones
} from '@hotwax/oms-api'

export {
Expand All @@ -21,5 +23,7 @@ export {
resetConfig,
setUserLocale,
updateToken,
updateInstanceUrl
updateInstanceUrl,
setUserTimeZone,
getAvailableTimeZones
}
2 changes: 1 addition & 1 deletion src/components/FilterMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ion-icon :icon="idCardOutline" slot="start" />
<ion-select :label="translate('Clearance')" interface="popover" v-model="query.securityGroup" @ionChange="closeMenu">
<ion-select-option value="">{{ translate("All") }}</ion-select-option>
<ion-select-option :value="securityGroup.groupId" :key="index" v-for="(securityGroup, index) in securityGroups">{{ securityGroup.groupName }}</ion-select-option>
<ion-select-option :value="securityGroup.groupId" :key="index" v-for="(securityGroup, index) in securityGroups">{{ securityGroup.groupName || securityGroup.groupId }}</ion-select-option>
</ion-select>
</ion-item>
<ion-item lines="none">
Expand Down
25 changes: 20 additions & 5 deletions src/components/PermissionItems.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,26 @@
{{ translate("Only selected permissions") }}
</ion-toggle>
</ion-item>
<ion-item lines="none">
<ion-icon :icon="optionsOutline" slot="start" />
<ion-select :label="translate('Filters')" interface="popover" v-model="query.classificationSecurityGroupId" @ionChange="updateQuery()">
<ion-select-option value="">{{ translate("All") }}</ion-select-option>
<ion-select-option :value="classificationSecurityGroup.groupId" :key="classificationSecurityGroup.groupId" v-for="classificationSecurityGroup in classificationSecurityGroups">
{{ classificationSecurityGroup.groupName }}
</ion-select-option>
</ion-select>
</ion-item>
</div>

<template v-if="arePermissionsAvailable()">
<div v-for="(group, groupId) in filteredPermissions" :key="groupId">
<ion-item-divider v-if="group.permissions.length" class="ion-margin-vertical" color="light">
<ion-item-divider v-if="group.groupId !== 'SGC_HIDDEN' && group.permissions.length" class="ion-margin-vertical" color="light">
<ion-label>
{{ group.groupName }}
{{ group.groupName || group.groupId }}
</ion-label>
</ion-item-divider>

<section>
<section v-if="group.groupId !== 'SGC_HIDDEN'">
<ion-card v-for="permission in group.permissions" :key="permission.permissionId">
<ion-card-header>
<div>
Expand Down Expand Up @@ -49,11 +58,13 @@ import {
IonItemDivider,
IonLabel,
IonSearchbar,
IonSelect,
IonSelectOption,
IonToggle
} from '@ionic/vue';
import { defineComponent } from 'vue';
import { translate } from '@hotwax/dxp-components';
import { shieldCheckmarkOutline } from 'ionicons/icons';
import { optionsOutline, shieldCheckmarkOutline } from 'ionicons/icons';
import { mapGetters, useStore } from 'vuex';
import { PermissionService } from '@/services/PermissionService';
import { showToast } from '@/utils';
Expand All @@ -75,14 +86,17 @@ export default defineComponent({
IonItemDivider,
IonLabel,
IonSearchbar,
IonSelect,
IonSelectOption,
IonToggle,
},
computed: {
...mapGetters({
query: 'permission/getQuery',
currentGroupPermissions: 'permission/getCurrentGroupPermissions',
currentGroup: "permission/getCurrentGroup",
filteredPermissions: "permission/getFilteredPermissions"
filteredPermissions: "permission/getFilteredPermissions",
classificationSecurityGroups: 'util/getClassificationSecurityGroups'
})
},
methods: {
Expand Down Expand Up @@ -154,6 +168,7 @@ export default defineComponent({
return {
Actions,
hasPermission,
optionsOutline,
shieldCheckmarkOutline,
store,
translate
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductStoreActionsPopover.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ion-content>
<ion-list>
<ion-list-header>{{ productStore.storeName }}</ion-list-header>
<ion-list-header>{{ productStore.storeName || productStore.productStoreId }}</ion-list-header>
<ion-item button @click="selectProductStoreRole()">
{{ translate("Edit") }}
</ion-item>
Expand Down
3 changes: 2 additions & 1 deletion src/components/ResetPasswordModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
v-model="newPassword"
id="newPassword"
:type="showNewPassword ? 'text' : 'password'"
:error-text="translate('Password requirements not fulfilled.')"/>
:error-text="translate('Password requirements not fulfilled.')"
autocomplete="new-password"/>
<!-- <ion-button fill="clear" @click="showNewPassword = !showNewPassword">
<ion-icon :icon="showNewPassword ? eyeOutline : eyeOffOutline"/>
</ion-button> -->
Expand Down
4 changes: 2 additions & 2 deletions src/components/SelectFacilityModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ion-item v-for="facility in facilities" :key="facility.facilityId">
<ion-checkbox :checked="isSelected(facility.facilityId)" @ionChange="toggleFacilitySelection(facility)">
<ion-label>
{{ facility.facilityName }}
{{ facility.facilityName || facility.facilityId }}
<p>{{ facility.facilityId }}</p>
</ion-label>
</ion-checkbox>
Expand All @@ -27,7 +27,7 @@
<ion-item v-for="facility in facilities" :key="facility.facilityId">
<ion-radio :value="facility.facilityId">
<ion-label>
{{ facility.facilityName }}
{{ facility.facilityName || facility.facilityId }}
<p>{{ facility.facilityId }}</p>
</ion-label>
</ion-radio>
Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectProductStoreModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ion-item v-for="productStore in productStores" :key="productStore.productStoreId">
<ion-checkbox :checked="isSelected(productStore.productStoreId)" @ionChange="toggleProductStoreSelection(productStore)">
<ion-label>
{{ productStore.storeName }}
{{ productStore.storeName || productStore.productStoreId }}
<p>{{ productStore.productStoreId }}</p>
</ion-label>
</ion-checkbox>
Expand Down
5 changes: 5 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"Block login": "Block login",
"Block user login": "Block user login",
"Block this user from logging into HotWax Commerce. Login can be re-enabled by disabling this setting": "Block this user from logging into HotWax Commerce. Login can be re-enabled by disabling this setting",
"Browser TimeZone": "Browser TimeZone",
"Browser time zone": "Browser time zone",
"Cancel": "Cancel",
"Change": "Change",
"Clearance": "Clearance",
Expand Down Expand Up @@ -181,7 +183,9 @@
"Select template": "Select template",
"Select your favorites to preselect them across all applications": "Select your favorites to preselect them across all applications",
"Select your preferred language.": "Select your preferred language.",
"Selected TimeZone": "Selected TimeZone",
"Select time zone": "Select time zone",
"Select a different time zone": "Select a different time zone",
"selected": "{storeCount} selected",
"Send reset password email instead": "Send reset password email instead",
"Settings": "Settings",
Expand All @@ -207,6 +211,7 @@
"Update user facilities": "Update user facilities",
"Update Security Group": "Update Security Group",
"Upload": "Upload",
"User created successfully": "User created successfully",
"User details": "User details",
"User disabled": "User disabled",
"User login status updated successfully.": "User login status updated successfully.",
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import permissionActions from '@/authorization/Actions';
import { dxpComponents } from '@hotwax/dxp-components'
import { login, logout, loader } from '@/utils/user';
import localeMessages from '@/locales';
import { getConfig, initialise, setUserLocale } from '@/adapter';
import { getConfig, initialise, setUserLocale, setUserTimeZone, getAvailableTimeZones } from '@/adapter';


const app = createApp(App)
Expand All @@ -60,6 +60,8 @@ const app = createApp(App)
logout,
localeMessages,
setUserLocale,
setUserTimeZone,
getAvailableTimeZones
});

router.isReady().then(() => {
Expand Down
3 changes: 2 additions & 1 deletion src/store/modules/permission/PermissionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ export default interface PermissionState {
permissionsByClassificationGroups: any;
query: {
queryString: string,
showSelected: boolean
showSelected: boolean,
classificationSecurityGroupId: string
};
currentGroup: any;
permissionsByGroup: any;
Expand Down
Loading

0 comments on commit 28fc9b1

Please sign in to comment.