-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regression: Permissions missing on new Room Edit and Contact Edit form (
#21315) * Allow editing rooms in chat room * Allow editing contact in chat room * Fix default value error * Move chats and contacts file out of omnichannel directory * Show edit option for room info only if the user has permission * Refactor + display room tags within edit only if user has permission * Add permissions for editing omnichannel contact * Re-add permission * fix auto room-info panel routing issue * Fix Permissions. * Fix indentation. Co-authored-by: Renato Becker <[email protected]> Co-authored-by: Rafael Ferreira <[email protected]>
- Loading branch information
1 parent
9066ba8
commit f06fd76
Showing
15 changed files
with
174 additions
and
130 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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import { Icon, Box } from '@rocket.chat/fuselage'; | ||
|
||
import VerticalBar from '../../../components/VerticalBar'; | ||
import { useRoute, useRouteParameter } from '../../../contexts/RouterContext'; | ||
import { useTranslation } from '../../../contexts/TranslationContext'; | ||
import { useRoom } from '../../../views/room/providers/RoomProvider'; | ||
import { ContactInfo } from './ContactInfo'; | ||
import { ContactEditWithData } from './ContactForm'; | ||
|
||
const PATH = 'live'; | ||
const ContactsContextualBar = ({ id }) => { | ||
const t = useTranslation(); | ||
|
||
const directoryRoute = useRoute(PATH); | ||
|
||
const context = useRouteParameter('context'); | ||
|
||
const closeContextualBar = () => { | ||
directoryRoute.push({ id }); | ||
}; | ||
|
||
const handleContactEditBarCloseButtonClick = () => { | ||
directoryRoute.push({ id, tab: 'contact-profile' }); | ||
}; | ||
|
||
const room = useRoom(); | ||
|
||
const { v: { _id } } = room; | ||
|
||
return <> | ||
<VerticalBar.Header> | ||
<Box flexShrink={1} flexGrow={1} withTruncatedText mi='x8'><Icon name='user' size='x20' /> {t('Contact_Info')}</Box> | ||
<VerticalBar.Close onClick={closeContextualBar} /> | ||
</VerticalBar.Header> | ||
{context === 'edit' ? <ContactEditWithData id={_id} close={handleContactEditBarCloseButtonClick} /> : <ContactInfo id={_id} rid={id} route={PATH} />} | ||
</>; | ||
}; | ||
|
||
export default ({ rid }) => <ContactsContextualBar id={rid} />; |
Oops, something went wrong.