Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into #196-block-login
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sourabh committed Apr 24, 2024
2 parents 953ec74 + 1e3236a commit 6dc83e2
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "users",
"version": "1.8.0",
"version": "1.9.1",
"private": true,
"description": "Users",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/authorization/Actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export default {
'APP_SUPER_USER': 'APP_SUPER_USER',
'APP_SECURITY_GROUP_CREATE': 'APP_SECURITY_GROUP_CREATE',
'APP_PERMISSION_UPDATE': 'APP_PERMISSION_UPDATE',
'APP_PERMISSION_VIEW': 'APP_PERMISSION_VIEW',
'APP_USER_CREATE': 'APP_USER_CREATE'
}
1 change: 1 addition & 0 deletions src/authorization/Rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default {
'APP_UPDT_PRODUCT_STORE_CONFG': 'SECURITY_CREATE OR SECURITY_ADMIN',
'APP_SECURITY_GROUP_CREATE': 'SECURITY_CREATE OR SECURITY_ADMIN',
'APP_PERMISSION_UPDATE': 'SECURITY_CREATE OR SECURITY_ADMIN',
'APP_PERMISSION_VIEW': 'SECURITY_VIEW OR SECURITY_ADMIN',
'APP_SUPER_USER': 'WEBTOOLS_VIEW',
'USERS_APP_VIEW': 'USERS_APP_VIEW'
} as any
8 changes: 6 additions & 2 deletions src/components/PermissionItems.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<template>
<div class="search-permissions">
<ion-searchbar :placeholder="translate('Search permissions')" v-model="query.queryString" @ionInput="updateQuery()" />
<ion-item lines="none">
<ion-item lines="full">
<ion-icon :icon="shieldCheckmarkOutline" slot="start" />
<ion-toggle v-model="query.showSelected" @ionChange="updateQuery()">
{{ translate("Only selected permissions") }}
</ion-toggle>
</ion-item>
<ion-item lines="none">
<ion-item lines="full">
<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-option value="OTHERS">{{ translate("Others") }}</ion-select-option>
</ion-select>
</ion-item>
</div>
Expand All @@ -24,6 +25,7 @@
<ion-label>
{{ group.groupName || group.groupId }}
</ion-label>
<ion-note slot="end">{{ group.permissions.length }}</ion-note>
</ion-item-divider>

<section v-if="group.groupId !== 'SGC_HIDDEN'">
Expand Down Expand Up @@ -57,6 +59,7 @@ import {
IonItem,
IonItemDivider,
IonLabel,
IonNote,
IonSearchbar,
IonSelect,
IonSelectOption,
Expand Down Expand Up @@ -85,6 +88,7 @@ export default defineComponent({
IonItem,
IonItemDivider,
IonLabel,
IonNote,
IonSearchbar,
IonSelect,
IonSelectOption,
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"OMS": "OMS",
"OMS instance": "OMS instance",
"Only selected permissions": "Only selected permissions",
"Others": "Others",
"Password": "Password",
"Password reset successful.": "Password reset successful.",
"Password reset email sent successfully.": "Password reset email sent successfully.",
Expand Down
5 changes: 4 additions & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ const routes: Array<RouteRecordRaw> = [
component: () => import('@/views/Settings.vue')
},{
path: 'permissions',
component: () => import('@/views/Permissions.vue')
component: () => import('@/views/Permissions.vue'),
meta: {
permissionId: "APP_PERMISSION_VIEW"
}
},
],
beforeEnter: authGuard,
Expand Down
3 changes: 3 additions & 0 deletions src/views/UserConfirmation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
mailOutline
} from 'ionicons/icons';
import { translate } from "@hotwax/dxp-components";
import emitter from "@/event-bus";
export default defineComponent({
name: "UserConfirmation",
Expand All @@ -95,7 +96,9 @@
},
props: ['partyId'],
async ionViewWillEnter() {
emitter.emit('presentLoader')
await this.store.dispatch("user/getSelectedUserDetails", { partyId: this.partyId });
emitter.emit('dismissLoader')
},
methods: {
async quickSetup() {
Expand Down
8 changes: 4 additions & 4 deletions src/views/UserDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
<ion-label>{{ translate('Username') }}</ion-label>
<ion-label slot="end">{{ selectedUser.userLoginId }}</ion-label>
</ion-item>
<ion-item>
<ion-toggle :disabled="!hasPermission(Actions.APP_UPDT_BLOCK_LOGIN)" @click.prevent="updateUserLoginStatus($event)" :checked="selectedUser.enabled == 'N'">
<ion-item :disabled="!hasPermission(Actions.APP_UPDT_BLOCK_LOGIN)" >
<ion-toggle @click.prevent="updateUserLoginStatus($event)" :checked="selectedUser.enabled == 'N'">
{{ translate("Block login") }}
</ion-toggle>
</ion-item>
Expand Down Expand Up @@ -317,8 +317,8 @@
</ion-card-title>
</ion-card-header>
<ion-list>
<ion-item>
<ion-toggle :disabled="!hasPermission(Actions.APP_UPDT_PICKER_CONFG)" @click.prevent="updatePickerRoleStatus($event)" :checked="selectedUser.isWarehousePicker === true">
<ion-item :disabled="!hasPermission(Actions.APP_UPDT_PICKER_CONFG)">
<ion-toggle @click.prevent="updatePickerRoleStatus($event)" :checked="selectedUser.isWarehousePicker === true">
{{ translate("Show as picker") }}
</ion-toggle>
</ion-item>
Expand Down
6 changes: 5 additions & 1 deletion src/views/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</div>
<ion-fab vertical="bottom" horizontal="end" slot="fixed">
<ion-fab-button :disabled="!hasPermission(Actions.APP_USER_CREATE)" @click="router.push('/create-user')">
<ion-fab-button :disabled="!hasPermission(Actions.APP_USER_CREATE)" @click="createUser()">
<ion-icon :icon="addOutline" />
</ion-fab-button>
</ion-fab>
Expand Down Expand Up @@ -236,6 +236,10 @@ export default defineComponent({
await this.store.dispatch('util/getSecurityGroups')
},
methods: {
createUser(){
this.store.dispatch('user/clearSelectedUser');
this.router.push('/create-user');
},
enableScrolling() {
const parentElement = (this as any).$refs.contentRef.$el
const scrollEl = parentElement.shadowRoot.querySelector("main[part='scroll']")
Expand Down

0 comments on commit 6dc83e2

Please sign in to comment.