fix: renamed invite members to invite agent
This commit is contained in:
parent
346849631e
commit
5c7f835e4c
2
frontend/components.d.ts
vendored
2
frontend/components.d.ts
vendored
@ -136,8 +136,8 @@ declare module 'vue' {
|
||||
InboundCallIcon: typeof import('./src/components/Icons/InboundCallIcon.vue')['default']
|
||||
InboxIcon: typeof import('./src/components/Icons/InboxIcon.vue')['default']
|
||||
IndicatorIcon: typeof import('./src/components/Icons/IndicatorIcon.vue')['default']
|
||||
InviteAgentPage: typeof import('./src/components/Settings/InviteAgentPage.vue')['default']
|
||||
InviteIcon: typeof import('./src/components/Icons/InviteIcon.vue')['default']
|
||||
InviteMemberPage: typeof import('./src/components/Settings/InviteMemberPage.vue')['default']
|
||||
KanbanIcon: typeof import('./src/components/Icons/KanbanIcon.vue')['default']
|
||||
KanbanSettings: typeof import('./src/components/Kanban/KanbanSettings.vue')['default']
|
||||
KanbanView: typeof import('./src/components/Kanban/KanbanView.vue')['default']
|
||||
|
||||
@ -351,7 +351,7 @@ const steps = reactive([
|
||||
onClick: () => {
|
||||
minimize.value = true
|
||||
showSettings.value = true
|
||||
activeSettingsPage.value = 'Invite Members'
|
||||
activeSettingsPage.value = 'Invite Agent'
|
||||
},
|
||||
condition: () => isManager(),
|
||||
},
|
||||
@ -529,7 +529,7 @@ const articles = ref([
|
||||
{ name: 'profile', title: __('Profile') },
|
||||
{ name: 'custom-branding', title: __('Custom branding') },
|
||||
{ name: 'home-actions', title: __('Home actions') },
|
||||
{ name: 'invite-members', title: __('Invite members') },
|
||||
{ name: 'invite-agent', title: __('Invite agent') },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@ -61,7 +61,7 @@
|
||||
<Dropdown
|
||||
:options="getDropdownOptions(agent)"
|
||||
:button="{
|
||||
label: __(getUserRole(agent.name)),
|
||||
label: roleMap[getUserRole(agent.name)],
|
||||
iconRight: 'chevron-down',
|
||||
variant: 'ghost',
|
||||
}"
|
||||
@ -102,27 +102,32 @@ const agents = createListResource({
|
||||
orderBy: 'creation desc',
|
||||
})
|
||||
|
||||
function getDropdownOptions(user) {
|
||||
const agentRole = getUserRole(user.name)
|
||||
const roleMap = {
|
||||
'Sales Manager': __('Manager Access'),
|
||||
'Sales User': __('Regular Access'),
|
||||
}
|
||||
|
||||
function getDropdownOptions(agent) {
|
||||
const agentRole = getUserRole(agent.name)
|
||||
return [
|
||||
{
|
||||
label: 'Sales Manager',
|
||||
label: __('Manager Access'),
|
||||
component: (props) =>
|
||||
RoleOption({
|
||||
role: 'Sales Manager',
|
||||
role: __('Manager Access'),
|
||||
active: props.active,
|
||||
selected: agentRole === 'Sales Manager',
|
||||
onClick: () => updateRole(user.name, 'Sales Manager'),
|
||||
onClick: () => updateRole(agent, 'Sales Manager'),
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: 'Sales Agent',
|
||||
label: __('Regular Access'),
|
||||
component: (props) =>
|
||||
RoleOption({
|
||||
role: 'Sales Agent',
|
||||
role: __('Regular Access'),
|
||||
active: props.active,
|
||||
selected: agentRole === 'Sales User',
|
||||
onClick: () => updateRole(user.name, 'Sales User'),
|
||||
onClick: () => updateRole(agent, 'Sales User'),
|
||||
}),
|
||||
},
|
||||
]
|
||||
@ -151,14 +156,16 @@ function RoleOption({ active, role, onClick, selected }) {
|
||||
}
|
||||
|
||||
function updateRole(agent, newRole) {
|
||||
const currentRole = getUserRole(agent)
|
||||
const currentRole = getUserRole(agent.name)
|
||||
if (currentRole === newRole) return
|
||||
|
||||
call('crm.fcrm.doctype.crm_agent.crm_agent.update_agent_role', {
|
||||
user: agent,
|
||||
user: agent.name,
|
||||
new_role: newRole,
|
||||
}).then(() => {
|
||||
toast.success(__('{0} role updated to {1}', [agent, newRole]))
|
||||
toast.success(
|
||||
__('{0} has been granted {1}', [agent.agent_name, roleMap[newRole]]),
|
||||
)
|
||||
users.reload()
|
||||
agents.reload()
|
||||
})
|
||||
|
||||
@ -109,7 +109,7 @@ const error = ref(null)
|
||||
const description = computed(() => {
|
||||
return {
|
||||
'Sales Manager':
|
||||
'Can manage and invite new members, and create public & private views (reports).',
|
||||
'Can manage and invite new agents, and create public & private views (reports).',
|
||||
'Sales User':
|
||||
'Can work with leads and deals and create private views (reports).',
|
||||
}[role.value]
|
||||
@ -48,7 +48,7 @@ import InviteIcon from '@/components/Icons/InviteIcon.vue'
|
||||
import Email2Icon from '@/components/Icons/Email2Icon.vue'
|
||||
import Agents from '@/components/Settings/Agents.vue'
|
||||
import GeneralSettings from '@/components/Settings/GeneralSettings.vue'
|
||||
import InviteMemberPage from '@/components/Settings/InviteMemberPage.vue'
|
||||
import InviteAgentPage from '@/components/Settings/InviteAgentPage.vue'
|
||||
import ProfileSettings from '@/components/Settings/ProfileSettings.vue'
|
||||
import WhatsAppSettings from '@/components/Settings/WhatsAppSettings.vue'
|
||||
import ERPNextSettings from '@/components/Settings/ERPNextSettings.vue'
|
||||
@ -96,9 +96,9 @@ const tabs = computed(() => {
|
||||
condition: () => isManager(),
|
||||
},
|
||||
{
|
||||
label: __('Invite Members'),
|
||||
label: __('Invite Agent'),
|
||||
icon: InviteIcon,
|
||||
component: markRaw(InviteMemberPage),
|
||||
component: markRaw(InviteAgentPage),
|
||||
condition: () => isManager(),
|
||||
},
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user