Skip to content

Commit

Permalink
JNG-5990 link readonly by (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
noherczeg authored Oct 29, 2024
1 parent 45340c2 commit 1fa3690
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ export default function ViewGalaxyForm(props: ViewGalaxyFormProps) {
<Grid item xs={12} sm={12}>
<ViewGalaxyFormAstronomerComponent
disabled={false || isLoading}
readOnly={false || !isFormUpdateable()}
readOnly={
false ||
!isFormUpdateable() ||
(actions?.isAstronomerReadonly ? actions.isAstronomerReadonly!(data, editMode, isLoading) : false)
}
ownerData={data}
dataPath={dataPath ? dataPath + '.astronomer' : 'astronomer'}
editMode={editMode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,13 @@ export default function ViewGalaxyView(props: ViewGalaxyViewProps) {
<Grid item xs={12} sm={12} md={4.0}>
<ViewGalaxyViewAstronomerComponent
disabled={false || isLoading}
readOnly={false || !isFormUpdateable()}
readOnly={
false ||
!isFormUpdateable() ||
(actions?.isAstronomerReadonly
? actions.isAstronomerReadonly!(data, editMode, isLoading)
: false)
}
ownerData={data}
dataPath={dataPath ? dataPath + '.astronomer' : 'astronomer'}
editMode={editMode}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ownerData={data}
data={ data?.{{ child.dataElement.name }} }
disabled={ {{# if child.enabledBy }}!data.{{ child.enabledBy.name }} ||{{/ if }} {{ boolValue child.relationType.isReadOnly }} }
readOnly={ {{ boolValue child.relationType.isReadOnly }} || !isFormUpdateable() }
readOnly={ {{ boolValue child.relationType.isReadOnly }} || !isFormUpdateable() || (actions?.is{{ firstToUpper child.dataElement.name }}Readonly ? actions.is{{ firstToUpper child.dataElement.name }}Readonly!(data, editMode, isLoading) : false) }
editMode={editMode}
validation={validation}
actions={actions}
Expand All @@ -16,7 +16,7 @@
{{/ if }}
<{{ componentName child }}
disabled={ {{# if child.enabledBy }}!data.{{ child.enabledBy.name }} ||{{/ if }} false || isLoading }
readOnly={ {{ boolValue child.relationType.isReadOnly }} || !isFormUpdateable() }
readOnly={ {{ boolValue child.relationType.isReadOnly }} || !isFormUpdateable() || (actions?.is{{ firstToUpper child.dataElement.name }}Readonly ? actions.is{{ firstToUpper child.dataElement.name }}Readonly!(data, editMode, isLoading) : false) }
ownerData={data}
dataPath={dataPath ? (dataPath + '.{{ child.dataElement.name }}') : '{{ child.dataElement.name }}'}
editMode={editMode}
Expand Down

0 comments on commit 1fa3690

Please sign in to comment.