[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:
parent
5697a136c2
commit
b833a2f8aa
|
@ -214,7 +214,7 @@ class RoomInfoView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
const permissions = await RocketChat.hasPermission([editRoomPermission], room.rid);
|
const permissions = await RocketChat.hasPermission([editRoomPermission], room.rid);
|
||||||
if (permissions[0] && !room.prid) {
|
if (permissions[0]) {
|
||||||
this.setState({ showEdit: true }, () => this.setHeader());
|
this.setState({ showEdit: true }, () => this.setHeader());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,8 +131,8 @@ describe('Discussion', () => {
|
||||||
await expect(element(by.id('room-info-view'))).toExist();
|
await expect(element(by.id('room-info-view'))).toExist();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not have edit button', async() => {
|
it('should have edit button', async() => {
|
||||||
await expect(element(by.id('room-info-view-edit-button'))).toBeNotVisible();
|
await expect(element(by.id('room-info-view-edit-button'))).toBeVisible();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue