[IMPROVEMENT] Allow discussions to be edited (#3137)

* Refactored the filter to work the edit for channel and discussion

* Removed the filter which type of room can be edit

Co-authored-by: Diego Mello <diegolmello@gmail.com>

* Fix tests

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Reinaldo Neto 2021-05-27 17:44:35 -03:00 committed by GitHub
parent 5697a136c2
commit b833a2f8aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -214,7 +214,7 @@ class RoomInfoView extends React.Component {
}
const permissions = await RocketChat.hasPermission([editRoomPermission], room.rid);
if (permissions[0] && !room.prid) {
if (permissions[0]) {
this.setState({ showEdit: true }, () => this.setHeader());
}
}

View File

@ -131,8 +131,8 @@ describe('Discussion', () => {
await expect(element(by.id('room-info-view'))).toExist();
});
it('should not have edit button', async() => {
await expect(element(by.id('room-info-view-edit-button'))).toBeNotVisible();
it('should have edit button', async() => {
await expect(element(by.id('room-info-view-edit-button'))).toBeVisible();
});
});
});