@@ -48,6 +48,7 @@ interface Props {
4848 headerText ?: string ;
4949 helpTopic ?: string ;
5050 initModel ?: DataClassModel ;
51+ isUpdate ?: boolean ;
5152 isValidParentOptionsFn ?: ( row : any , isDataClass : boolean ) => boolean ;
5253 // loadNameExpressionOptions is a prop for testing purposes only, see default implementation below
5354 loadNameExpressionOptions ?: (
@@ -61,11 +62,11 @@ interface Props {
6162 onChange ?: ( model : DataClassModel ) => void ;
6263 onComplete : ( model : DataClassModel ) => void ;
6364 saveBtnText ?: string ;
64- showGenIdBanner ?: boolean ;
6565 validateNameExpressions ?: boolean ;
6666}
6767
6868interface State {
69+ auditUserComment ?: string ;
6970 model : DataClassModel ;
7071 nameExpressionWarnings : string [ ] ;
7172 namePreviews : string [ ] ;
@@ -156,12 +157,12 @@ export class DataClassDesignerImpl extends PureComponent<DataClassDesignerProps,
156157 return name ;
157158 } ;
158159
159- onFinish = ( ) : void => {
160+ onFinish = ( auditUserComment ?: string ) : void => {
160161 const { defaultNameFieldConfig, setSubmitting, nounSingular } = this . props ;
161162 const { model } = this . state ;
162163 const isValid = model . isValid ( defaultNameFieldConfig ) ;
163164
164- this . props . onFinish ( isValid , this . saveDomain ) ;
165+ this . props . onFinish ( isValid , ( ) => this . saveDomain ( false , auditUserComment ) ) ;
165166
166167 if ( ! isValid ) {
167168 let exception : string ;
@@ -207,7 +208,7 @@ export class DataClassDesignerImpl extends PureComponent<DataClassDesignerProps,
207208 return aliases ;
208209 }
209210
210- saveDomain = async ( hasConfirmedNameExpression ?: boolean ) : Promise < void > => {
211+ saveDomain = async ( hasConfirmedNameExpression ?: boolean , auditUserComment ?: string ) : Promise < void > => {
211212 const { api, beforeFinish, onComplete, setSubmitting, validateNameExpressions } = this . props ;
212213 const { model } = this . state ;
213214 const { name, domain } = model ;
@@ -239,6 +240,7 @@ export class DataClassDesignerImpl extends PureComponent<DataClassDesignerProps,
239240 this . setState ( {
240241 nameExpressionWarnings : response . warnings ,
241242 namePreviews : response . previews ,
243+ auditUserComment,
242244 } ) ;
243245 } ) ;
244246 return ;
@@ -261,6 +263,7 @@ export class DataClassDesignerImpl extends PureComponent<DataClassDesignerProps,
261263 domain : domainDesign ,
262264 kind : Domain . KINDS . DATA_CLASS ,
263265 name : model . name ,
266+ auditUserComment,
264267 options,
265268 } ) ;
266269
@@ -340,6 +343,7 @@ export class DataClassDesignerImpl extends PureComponent<DataClassDesignerProps,
340343 setSubmitting ( false , ( ) => {
341344 this . setState ( {
342345 nameExpressionWarnings : undefined ,
346+ auditUserComment : undefined ,
343347 } ) ;
344348 } ) ;
345349 } ;
@@ -349,7 +353,7 @@ export class DataClassDesignerImpl extends PureComponent<DataClassDesignerProps,
349353 ( ) => ( {
350354 nameExpressionWarnings : undefined ,
351355 } ) ,
352- ( ) => this . saveDomain ( true )
356+ ( ) => this . saveDomain ( true , this . state . auditUserComment )
353357 ) ;
354358 } ;
355359
@@ -461,7 +465,7 @@ export class DataClassDesignerImpl extends PureComponent<DataClassDesignerProps,
461465 firstState,
462466 helpTopic,
463467 domainFormDisplayOptions,
464- showGenIdBanner ,
468+ isUpdate ,
465469 allowParentAlias,
466470 allowFolderExclusion,
467471 } = this . props ;
@@ -480,6 +484,7 @@ export class DataClassDesignerImpl extends PureComponent<DataClassDesignerProps,
480484 onCancel = { onCancel }
481485 onFinish = { this . onFinish }
482486 saveBtnText = { saveBtnText }
487+ showUserComment = { isUpdate && appPropertiesOnly }
483488 >
484489 < DataClassPropertiesPanel
485490 nounSingular = { nounSingular }
@@ -504,7 +509,7 @@ export class DataClassDesignerImpl extends PureComponent<DataClassDesignerProps,
504509 previewName = { namePreviews ?. [ 0 ] }
505510 onNameFieldHover = { this . onNameFieldHover }
506511 nameExpressionGenIdProps = {
507- showGenIdBanner && hasGenIdInExpression
512+ isUpdate && hasGenIdInExpression
508513 ? {
509514 containerPath : model . containerPath ,
510515 dataTypeName : model . name ,
0 commit comments