@@ -34,6 +34,7 @@ export interface AttributeModalProps extends React.Props<any> {
3434 attributeInfo : AttributeInfo ;
3535 onSave ?: ( attribute : AttributeInfo ) => void ;
3636 onClose ?: ( ) => void ;
37+ onRemove ?: ( ) => void ;
3738 mode ?: 'create' | 'edit' ;
3839}
3940
@@ -95,7 +96,7 @@ export class AttributeModal extends React.Component<AttributeModalProps, Attribu
9596 }
9697
9798 render ( ) {
98- const { attributeInfo, onClose, mode } = this . props ;
99+ const { attributeInfo, onClose, mode, onRemove } = this . props ;
99100 const { newInstance, canSave, errors } = this . state ;
100101 const saveButtonDisabled = ! canSave || attributeInfo . equals ( newInstance ) ;
101102 if ( ! newInstance ) return null ;
@@ -142,9 +143,17 @@ export class AttributeModal extends React.Component<AttributeModalProps, Attribu
142143 />
143144 </ div >
144145 </ form >
145- < div className = "button-bar" >
146- < Button type = "primary" title = { okText } onClick = { this . save . bind ( this ) } disabled = { saveButtonDisabled } />
147- < Button className = "cancel" title = { STRINGS . cancel } type = "secondary" onClick = { onClose } />
146+ < div className = "grid-row button-bar" >
147+ < div className = "grid-col-50" >
148+ < Button type = "primary" title = { okText } onClick = { this . save . bind ( this ) } disabled = { saveButtonDisabled } />
149+ < Button className = "cancel" title = { STRINGS . cancel } type = "secondary" onClick = { onClose } />
150+ </ div >
151+ < div className = "grid-col-50 right" >
152+ { onRemove
153+ ? < Button className = "warn" title = { STRINGS . removeAttribute } type = "warn" onClick = { onRemove } />
154+ : null
155+ }
156+ </ div >
148157 </ div >
149158 </ Modal > ;
150159 }
0 commit comments