disable remaining fields in readonlt

This commit is contained in:
1ilit
2025-08-24 21:28:04 +04:00
parent dc29d9b0ad
commit b3e3cc55b6
2 changed files with 7 additions and 4 deletions

View File

@@ -1436,6 +1436,7 @@ export default function ControlPanel({
},
table_width: {
function: () => setModal(MODAL.TABLE_WIDTH),
disabled: layout.readOnly,
},
language: {
function: () => setModal(MODAL.LANGUAGE),
@@ -1639,7 +1640,7 @@ export default function ControlPanel({
<Tooltip content={t("undo")} position="bottom">
<button
className="py-1 px-2 hover-2 rounded-sm flex items-center disabled:opacity-50"
disabled={undoStack.length === 0}
disabled={undoStack.length === 0 || layout.readOnly}
onClick={undo}
>
<IconUndo size="large" />
@@ -1648,7 +1649,7 @@ export default function ControlPanel({
<Tooltip content={t("redo")} position="bottom">
<button
className="py-1 px-2 hover-2 rounded-sm flex items-center disabled:opacity-50"
disabled={redoStack.length === 0}
disabled={redoStack.length === 0 || layout.readOnly}
onClick={redo}
>
<IconRedo size="large" />
@@ -1807,7 +1808,9 @@ export default function ControlPanel({
</Tag>
)}
</div>
{(showEditName || modal === MODAL.RENAME) && !layout.readOnly && <IconEdit />}
{(showEditName || modal === MODAL.RENAME) && !layout.readOnly && (
<IconEdit />
)}
</div>
<div className="flex items-center">
<div className="flex justify-start text-md select-none me-2">

View File

@@ -241,7 +241,7 @@ export default function RelationshipInfo({ data }) {
placeholder={t("label")}
onChange={(value) => updateRelationship(data.id, { manyLabel: value })}
onFocus={(e) => setEditField({ manyLabel: e.target.value })}
defaultValue="n"
readonly={layout.readOnly}
onBlur={(e) => {
if (e.target.value === editField.manyLabel) return;
setUndoStack((prev) => [