-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SHIBUI-1031 Integrated with backend endpoints
- Loading branch information
Showing
10 changed files
with
102 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Action } from '@ngrx/store'; | ||
|
||
export enum ConfigurationActionTypes { | ||
LOAD_ROLE_REQUEST = '[Config] Load User Role Request', | ||
LOAD_ROLE_SUCCESS = '[Config] Load User Role Success', | ||
LOAD_ROLE_FAIL = '[Config] Load User Role Fail' | ||
} | ||
|
||
export class LoadRoleRequest implements Action { | ||
readonly type = ConfigurationActionTypes.LOAD_ROLE_REQUEST; | ||
|
||
constructor() {} | ||
} | ||
export class LoadRoleSuccess implements Action { | ||
readonly type = ConfigurationActionTypes.LOAD_ROLE_SUCCESS; | ||
|
||
constructor(public payload: string[]) { } | ||
} | ||
export class LoadRoleFail implements Action { | ||
readonly type = ConfigurationActionTypes.LOAD_ROLE_FAIL; | ||
|
||
constructor() { } | ||
} | ||
|
||
export type ConfigurationActionUnion = | ||
| LoadRoleRequest | ||
| LoadRoleSuccess | ||
| LoadRoleFail | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ConfigurationActionUnion, ConfigurationActionTypes } from '../action/configuration.action'; | ||
|
||
export interface ConfigState { | ||
roles: string[]; | ||
} | ||
|
||
export const initialState: ConfigState = { | ||
roles: [] | ||
}; | ||
|
||
export function reducer(state = initialState, action: ConfigurationActionUnion): ConfigState { | ||
switch (action.type) { | ||
case ConfigurationActionTypes.LOAD_ROLE_SUCCESS: { | ||
return { | ||
roles: [...action.payload] | ||
}; | ||
} | ||
default: { | ||
return state; | ||
} | ||
} | ||
} | ||
|
||
|
||
export const getRoles = (state: ConfigState) => state.roles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
import { User } from '../../../core/model/user'; | ||
|
||
export interface Admin { | ||
createdDate?: string; | ||
updatedDate?: string; | ||
username: string; | ||
firstName: string; | ||
lastName: string; | ||
|
||
roles: Role[]; | ||
|
||
role: Role; | ||
role: string; | ||
|
||
emailAddress: string; | ||
} | ||
|
||
export interface Role { | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters