fix: no clone action for non-admin

clone room only for admins
pull/281/head
Sebastien Marinier 2024-08-19 12:26:23 +02:00
parent bcf33e99e9
commit f57c25eab2
1 changed files with 3 additions and 1 deletions

View File

@ -194,7 +194,7 @@ const RoomRow: React.FC<Props> = (props) => {
return <span></span>; return <span></span>;
} }
function edit(field: string, type: 'text' | 'number' = 'text', canEdit: boolean = true, options?) { function edit(field: string, type: 'text' | 'number' = 'text', canEdit = true, options?) {
return canEdit ? return canEdit ?
<EditableValue field={field} value={room[field]} setValue={updateRoom} type={type} options={options} /> <EditableValue field={field} value={room[field]} setValue={updateRoom} type={type} options={options} />
: :
@ -261,12 +261,14 @@ const RoomRow: React.FC<Props> = (props) => {
{<RecordingsNumber recordings={recordings} showRecordings={showRecordings} setShowRecordings={setShowRecordings} />} {<RecordingsNumber recordings={recordings} showRecordings={showRecordings} setShowRecordings={setShowRecordings} />}
</td> </td>
<td className="clone icon-col"> <td className="clone icon-col">
{adminRoom &&
<button <button
className="action-item" className="action-item"
onClick={cloneRow} onClick={cloneRow}
title={t('bbb', 'Clone room')}> title={t('bbb', 'Clone room')}>
<span className="icon icon-template-add icon-visible"></span> <span className="icon icon-template-add icon-visible"></span>
</button> </button>
}
</td> </td>
<td className="edit icon-col"> <td className="edit icon-col">
{adminRoom && {adminRoom &&