mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-09-01 10:25:13 +00:00
disable remaining fields in readonlt
This commit is contained in:
@@ -1436,6 +1436,7 @@ export default function ControlPanel({
|
|||||||
},
|
},
|
||||||
table_width: {
|
table_width: {
|
||||||
function: () => setModal(MODAL.TABLE_WIDTH),
|
function: () => setModal(MODAL.TABLE_WIDTH),
|
||||||
|
disabled: layout.readOnly,
|
||||||
},
|
},
|
||||||
language: {
|
language: {
|
||||||
function: () => setModal(MODAL.LANGUAGE),
|
function: () => setModal(MODAL.LANGUAGE),
|
||||||
@@ -1639,7 +1640,7 @@ export default function ControlPanel({
|
|||||||
<Tooltip content={t("undo")} position="bottom">
|
<Tooltip content={t("undo")} position="bottom">
|
||||||
<button
|
<button
|
||||||
className="py-1 px-2 hover-2 rounded-sm flex items-center disabled:opacity-50"
|
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}
|
onClick={undo}
|
||||||
>
|
>
|
||||||
<IconUndo size="large" />
|
<IconUndo size="large" />
|
||||||
@@ -1648,7 +1649,7 @@ export default function ControlPanel({
|
|||||||
<Tooltip content={t("redo")} position="bottom">
|
<Tooltip content={t("redo")} position="bottom">
|
||||||
<button
|
<button
|
||||||
className="py-1 px-2 hover-2 rounded-sm flex items-center disabled:opacity-50"
|
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}
|
onClick={redo}
|
||||||
>
|
>
|
||||||
<IconRedo size="large" />
|
<IconRedo size="large" />
|
||||||
@@ -1807,7 +1808,9 @@ export default function ControlPanel({
|
|||||||
</Tag>
|
</Tag>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{(showEditName || modal === MODAL.RENAME) && !layout.readOnly && <IconEdit />}
|
{(showEditName || modal === MODAL.RENAME) && !layout.readOnly && (
|
||||||
|
<IconEdit />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<div className="flex justify-start text-md select-none me-2">
|
<div className="flex justify-start text-md select-none me-2">
|
||||||
|
@@ -241,7 +241,7 @@ export default function RelationshipInfo({ data }) {
|
|||||||
placeholder={t("label")}
|
placeholder={t("label")}
|
||||||
onChange={(value) => updateRelationship(data.id, { manyLabel: value })}
|
onChange={(value) => updateRelationship(data.id, { manyLabel: value })}
|
||||||
onFocus={(e) => setEditField({ manyLabel: e.target.value })}
|
onFocus={(e) => setEditField({ manyLabel: e.target.value })}
|
||||||
defaultValue="n"
|
readonly={layout.readOnly}
|
||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
if (e.target.value === editField.manyLabel) return;
|
if (e.target.value === editField.manyLabel) return;
|
||||||
setUndoStack((prev) => [
|
setUndoStack((prev) => [
|
||||||
|
Reference in New Issue
Block a user