-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from iceljc/features/refine-chat-window
Features/refine chat window
- Loading branch information
Showing
21 changed files
with
1,006 additions
and
220 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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* @typedef {Object} RoleModel | ||
* @property {string} id - The user id. | ||
* @property {string} [name] - Role name | ||
* @property {string[]} permissions - Permissions. | ||
* @property {RoleAgentAction[]} agent_actions - Agent actions | ||
* @property {string} [create_date] - The user create date. | ||
* @property {string} [update_date] - The user update date. | ||
* @property {boolean} [open_detail] | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} RoleAgentAction | ||
* @property {string?} [id] - The id | ||
* @property {string} agent_id - The agent id | ||
* @property {import('$agentTypes').AgentModel} [agent] - The agent details | ||
* @property {string[]} actions - The actions | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} RoleAgentInnerAction | ||
* @property {string?} [id] - The id | ||
* @property {string} agent_id - The agent id | ||
* @property {string} [agent_name] - The agent name | ||
* @property {import('$agentTypes').AgentModel} [agent] - The agent details | ||
* @property {{ key: string, value: string, checked: boolean }[]} actions - The actions | ||
*/ | ||
|
||
/** | ||
* @typedef {Object} RoleFilter | ||
* @property {string[]} [names] - The role names. | ||
*/ | ||
|
||
export default {}; |
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 |
---|---|---|
@@ -0,0 +1,120 @@ | ||
.roles-table { | ||
.role-plain-col { | ||
width: 10%; | ||
max-width: 100px; | ||
} | ||
|
||
.role-permission-col { | ||
width: 40%; | ||
max-width: 300px; | ||
} | ||
|
||
.role-detail { | ||
padding: 2px 5px; | ||
border-radius: 3px; | ||
border-color: var(--#{$prefix}light) !important; | ||
background-color: var(--#{$prefix}light) !important; | ||
position: relative; | ||
|
||
ul { | ||
li { | ||
margin: 2px 0px; | ||
} | ||
} | ||
|
||
.wrappable { | ||
white-space: wrap !important; | ||
} | ||
|
||
.basic-info { | ||
margin: 15px 0px 0px 0px; | ||
display: flex; | ||
flex-wrap: wrap; | ||
|
||
li { | ||
flex: 0 0 50%; | ||
|
||
.inline-edit { | ||
display: flex; | ||
gap: 3px; | ||
} | ||
} | ||
} | ||
|
||
.role-permission-container { | ||
display: flex; | ||
gap: 5px; | ||
|
||
.permission-wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 3px; | ||
|
||
.edit-wrapper { | ||
display: flex; | ||
gap: 3px; | ||
} | ||
|
||
input[type="text"] { | ||
height: 30px; | ||
font-size: 12px; | ||
} | ||
} | ||
|
||
|
||
.list-add { | ||
font-size: 18px; | ||
} | ||
} | ||
|
||
.role-agent-container { | ||
margin: 20px 0px; | ||
padding: 0px 2rem; | ||
|
||
.action-row-wrapper { | ||
overflow-y: auto; | ||
scrollbar-width: thin; | ||
height: fit-content; | ||
max-height: 300px; | ||
} | ||
|
||
.action-row { | ||
display: flex; | ||
} | ||
|
||
.action-col { | ||
padding: 3px 0px; | ||
border-bottom: 1px dotted var(--bs-primary); | ||
|
||
input[type='checkbox'] { | ||
outline: none !important; | ||
box-shadow: none !important; | ||
} | ||
} | ||
|
||
.action-title { | ||
.action-title-wrapper { | ||
display: flex; | ||
gap: 3px; | ||
justify-content: center; | ||
text-transform: capitalize; | ||
text-align: center; | ||
border-bottom: 2px solid var(--bs-primary); | ||
} | ||
} | ||
|
||
.action-center { | ||
display: flex; | ||
justify-content: center; | ||
} | ||
} | ||
|
||
.edit-btn { | ||
display: flex; | ||
justify-content: flex-end; | ||
font-size: 16px; | ||
margin-top: 3px; | ||
margin-right: 5px; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { endpoints } from './api-endpoints.js'; | ||
import axios from 'axios'; | ||
|
||
/** | ||
* Get role options | ||
* @returns {Promise<string[]>} | ||
*/ | ||
export async function getRoleOptions() { | ||
const response = await axios.get(endpoints.roleOptionsUrl); | ||
return response.data; | ||
} | ||
|
||
|
||
/** | ||
* Get role list | ||
* @param {import('$roleTypes').RoleFilter?} [filter] | ||
* @returns {Promise<import('$roleTypes').RoleModel[]>} | ||
*/ | ||
export async function getRoles(filter = null) { | ||
const response = await axios.post(endpoints.rolesUrl, filter); | ||
return response.data; | ||
} | ||
|
||
|
||
/** | ||
* Get user detail | ||
* @param {string} id | ||
* @returns {Promise<import('$roleTypes').RoleModel>} | ||
*/ | ||
export async function getRoleDetails(id) { | ||
const url = endpoints.roleDetailUrl.replace("{id}", id); | ||
const response = await axios.get(url); | ||
return response.data; | ||
} | ||
|
||
|
||
/** | ||
* Update role | ||
* @param {import('$roleTypes').RoleModel} model | ||
* @returns {Promise<boolean>} | ||
*/ | ||
export async function updateRole(model) { | ||
const response = await axios.put(endpoints.roleUpdateUrl, { ...model }); | ||
return response.data; | ||
} |
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
Oops, something went wrong.