diff --git a/src/app/modules/users/components/users-list/users-list.component.html b/src/app/modules/users/components/users-list/users-list.component.html
index b13c0206f..bab11ae27 100644
--- a/src/app/modules/users/components/users-list/users-list.component.html
+++ b/src/app/modules/users/components/users-list/users-list.component.html
@@ -1,38 +1,40 @@
-
-
-
- | User Email |
- Names |
- Roles |
-
-
-
-
-
- | {{ user.email }} |
- {{ user.name }} |
-
-
-
- admin
-
- test
-
- |
-
-
-
+
+
+
+
+ | User Email |
+ Names |
+ Roles |
+
+
+
+
+
+ | {{ user.email }} |
+ {{ user.name }} |
+
+
+
+ admin
+
+ test
+
+ |
+
+
+
+
diff --git a/src/app/modules/users/components/users-list/users-list.component.spec.ts b/src/app/modules/users/components/users-list/users-list.component.spec.ts
index b95e9e4ad..1eff7f73a 100644
--- a/src/app/modules/users/components/users-list/users-list.component.spec.ts
+++ b/src/app/modules/users/components/users-list/users-list.component.spec.ts
@@ -18,7 +18,6 @@ describe('UsersListComponent', () => {
{
name: 'name',
email: 'email',
- role: null,
roles: ['admin', 'test'],
id: 'id',
tenant_id: 'tenant id',
@@ -111,7 +110,7 @@ describe('UsersListComponent', () => {
});
});
- it('on success load users, the data of roles should be an array and role null', () => {
+ it('on success load users, the data of roles should be an array', () => {
const actionSubject = TestBed.inject(ActionsSubject) as ActionsSubject;
const action = {
type: UserActionTypes.LOAD_USERS_SUCCESS,
@@ -121,41 +120,10 @@ describe('UsersListComponent', () => {
actionSubject.next(action);
component.users.map((user) => {
- expect(user.role).toEqual(null);
expect(user.roles).toEqual(['admin', 'test']);
});
});
- it('on success load users, the data of roles should be null and role a string', () => {
- const actionSubject = TestBed.inject(ActionsSubject) as ActionsSubject;
- const mockState: UserState = {
- data: [
- {
- name: 'name',
- email: 'email',
- role: 'admin',
- roles: null,
- id: 'id',
- tenant_id: 'tenant id',
- deleted: 'delete',
- },
- ],
- isLoading: false,
- message: '',
- };
- const action = {
- type: UserActionTypes.LOAD_USERS_SUCCESS,
- payload: mockState.data,
- };
-
- actionSubject.next(action);
-
- component.users.map((user) => {
- expect(user.role).toEqual('admin');
- expect(user.roles).toEqual(null);
- });
- });
-
it('on success load users, the datatable should be reloaded', async () => {
const actionSubject = TestBed.inject(ActionsSubject);
const action = {
diff --git a/src/app/modules/users/models/users.ts b/src/app/modules/users/models/users.ts
index 481fe3d5d..74c8d33df 100644
--- a/src/app/modules/users/models/users.ts
+++ b/src/app/modules/users/models/users.ts
@@ -1,7 +1,6 @@
export interface User {
name: string;
email: string;
- role?: string;
roles?: string[];
id: string;
tenant_id?: string;
diff --git a/src/app/modules/users/store/user.reducer.spec.ts b/src/app/modules/users/store/user.reducer.spec.ts
index 4f89e5d4e..7c9f39c67 100644
--- a/src/app/modules/users/store/user.reducer.spec.ts
+++ b/src/app/modules/users/store/user.reducer.spec.ts
@@ -38,13 +38,13 @@ describe('userReducer', () => {
expect(state.isLoading).toEqual(true);
});
- it('on GrantRoleUserSuccess, user role should change', () => {
+ it('on GrantRoleUserSuccess, user roles should change', () => {
const currentState: UserState = {
- data: [{ id: 'id', name: 'name', email: 'email', role: null }],
+ data: [{ id: 'id', name: 'name', email: 'email', roles: null }],
isLoading: false,
message: '',
};
- const userGranted: User = { id: 'id', name: 'name', email: 'email', role: 'admin' };
+ const userGranted: User = { id: 'id', name: 'name', email: 'email', roles: ['admin'] };
const action = new actions.GrantRoleUserSuccess(userGranted);
const state = userReducer(currentState, action);
@@ -70,13 +70,13 @@ describe('userReducer', () => {
expect(state.isLoading).toEqual(true);
});
- it('on RevokeRoleUserSuccess, user role should change', () => {
+ it('on RevokeRoleUserSuccess, user roles should change', () => {
const currentState: UserState = {
- data: [{ id: 'id', name: 'name', email: 'email', role: 'admin' }],
+ data: [{ id: 'id', name: 'name', email: 'email', roles: ['admin'] }],
isLoading: false,
message: '',
};
- const userRevoked: User = { id: 'id', name: 'name', email: 'email', role: null };
+ const userRevoked: User = { id: 'id', name: 'name', email: 'email', roles: null };
const action = new actions.RevokeRoleUserSuccess(userRevoked);
const state = userReducer(currentState, action);