@ -23,7 +23,7 @@ export function RemovePriorityButton({ _id, reload }) {
const setModal = useSetModal ( ) ;
const dispatchToastMessage = useToastMessageDispatch ( ) ;
const t = useTranslation ( ) ;
const prioritiesRoute = useRoute ( 'omnichannel-priorities' ) ;
const handleRemoveClick = useMutableCallback ( async ( ) => {
try {
@ -40,6 +40,7 @@ export function RemovePriorityButton({ _id, reload }) {
try {
await handleRemoveClick ( ) ;
dispatchToastMessage ( { type : 'success' , message : t ( 'Priority_removed' ) } ) ;
prioritiesRoute . push ( { } ) ;
} catch ( error ) {
dispatchToastMessage ( { type : 'error' , message : error } ) ;
}
@ -98,10 +99,10 @@ function PrioritiesRoute() {
const { data , reload } = useEndpointDataExperimental ( 'livechat/priorities.list' , query ) || { } ;
const header = useMemo ( ( ) => [
< GenericTable . HeaderCell key = { 'name' } direction = { sort [ 1 ] } active = { sort [ 0 ] === 'name' } onClick = { onHeaderClick } sort = 'name' w = 'x120' > { t ( 'Name' ) } < / G e n e r i c T a b l e . H e a d e r C e l l > ,
< GenericTable . HeaderCell key = { 'description' } direction = { sort [ 1 ] } active = { sort [ 0 ] === 'description' } onClick = { onHeaderClick } sort = 'description' w = 'x200' > { t ( 'Description' ) } < / G e n e r i c T a b l e . H e a d e r C e l l > ,
< GenericTable . HeaderCell key = { 'dueTimeInMinutes' } direction = { sort [ 1 ] } active = { sort [ 0 ] === 'dueTimeInMinutes' } onClick = { onHeaderClick } sort = 'dueTimeInMinutes' w = 'x120' > { t ( 'Estimated_due_time' ) } < / G e n e r i c T a b l e . H e a d e r C e l l > ,
< GenericTable . HeaderCell key = { 'remove' } w = 'x4 0' > { t ( 'Remove' ) } < / G e n e r i c T a b l e . H e a d e r C e l l > ,
< GenericTable . HeaderCell key = { 'name' } direction = { sort [ 1 ] } active = { sort [ 0 ] === 'name' } onClick = { onHeaderClick } sort = 'name' > { t ( 'Name' ) } < / G e n e r i c T a b l e . H e a d e r C e l l > ,
< GenericTable . HeaderCell key = { 'description' } direction = { sort [ 1 ] } active = { sort [ 0 ] === 'description' } onClick = { onHeaderClick } sort = 'description' > { t ( 'Description' ) } < / G e n e r i c T a b l e . H e a d e r C e l l > ,
< GenericTable . HeaderCell key = { 'dueTimeInMinutes' } direction = { sort [ 1 ] } active = { sort [ 0 ] === 'dueTimeInMinutes' } onClick = { onHeaderClick } sort = 'dueTimeInMinutes' > { t ( 'Estimated_due_time' ) } < / G e n e r i c T a b l e . H e a d e r C e l l > ,
< GenericTable . HeaderCell key = { 'remove' } w = 'x6 0' > { t ( 'Remove' ) } < / G e n e r i c T a b l e . H e a d e r C e l l > ,
] . filter ( Boolean ) , [ sort , onHeaderClick , t ] ) ;
const renderRow = useCallback ( ( { _id , name , description , dueTimeInMinutes } ) => < Table . Row key = { _id } tabIndex = { 0 } role = 'link' onClick = { onRowClick ( _id ) } action qa - user - id = { _id } >
@ -146,7 +147,7 @@ function PrioritiesRoute() {
reload = { reload }
header = { header }
renderRow = { renderRow }
title = { 'Priorities'} >
title = { t ( 'Priorities') } >
< EditPrioritiesTab / >
< / P r i o r i t i e s P a g e > ;
}