Skip to content

Commit b3e3cc5

Browse files
committed
disable remaining fields in readonlt
1 parent dc29d9b commit b3e3cc5

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/components/EditorHeader/ControlPanel.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,6 +1436,7 @@ export default function ControlPanel({
14361436
},
14371437
table_width: {
14381438
function: () => setModal(MODAL.TABLE_WIDTH),
1439+
disabled: layout.readOnly,
14391440
},
14401441
language: {
14411442
function: () => setModal(MODAL.LANGUAGE),
@@ -1639,7 +1640,7 @@ export default function ControlPanel({
16391640
<Tooltip content={t("undo")} position="bottom">
16401641
<button
16411642
className="py-1 px-2 hover-2 rounded-sm flex items-center disabled:opacity-50"
1642-
disabled={undoStack.length === 0}
1643+
disabled={undoStack.length === 0 || layout.readOnly}
16431644
onClick={undo}
16441645
>
16451646
<IconUndo size="large" />
@@ -1648,7 +1649,7 @@ export default function ControlPanel({
16481649
<Tooltip content={t("redo")} position="bottom">
16491650
<button
16501651
className="py-1 px-2 hover-2 rounded-sm flex items-center disabled:opacity-50"
1651-
disabled={redoStack.length === 0}
1652+
disabled={redoStack.length === 0 || layout.readOnly}
16521653
onClick={redo}
16531654
>
16541655
<IconRedo size="large" />
@@ -1807,7 +1808,9 @@ export default function ControlPanel({
18071808
</Tag>
18081809
)}
18091810
</div>
1810-
{(showEditName || modal === MODAL.RENAME) && !layout.readOnly && <IconEdit />}
1811+
{(showEditName || modal === MODAL.RENAME) && !layout.readOnly && (
1812+
<IconEdit />
1813+
)}
18111814
</div>
18121815
<div className="flex items-center">
18131816
<div className="flex justify-start text-md select-none me-2">

src/components/EditorSidePanel/RelationshipsTab/RelationshipInfo.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export default function RelationshipInfo({ data }) {
241241
placeholder={t("label")}
242242
onChange={(value) => updateRelationship(data.id, { manyLabel: value })}
243243
onFocus={(e) => setEditField({ manyLabel: e.target.value })}
244-
defaultValue="n"
244+
readonly={layout.readOnly}
245245
onBlur={(e) => {
246246
if (e.target.value === editField.manyLabel) return;
247247
setUndoStack((prev) => [

0 commit comments

Comments
 (0)