Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/dashboard/Data/Browser/Browser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ class Browser extends DashboardView {
const msg = `${objectSaved.className} with id '${objectSaved.id}' created`;
this.showNote(msg, false);

const state = { data: this.state.data };
const state = { data: this.state.data, showEditRowDialog: false };
const relation = this.state.relation;
if (relation) {
const parent = relation.parent;
Expand Down Expand Up @@ -3386,6 +3386,8 @@ class Browser extends DashboardView {
setRelation={this.setRelation}
handleShowAcl={this.handleShowAcl}
onClose={this.closeEditRowDialog}
onSaveNewRow={this.saveNewRow}
onAbortAddRow={this.abortAddRow}
updateRow={this.updateRow}
confirmAttachSelectedRows={this.confirmAttachSelectedRows}
schema={this.props.schema}
Expand Down
26 changes: 23 additions & 3 deletions src/dashboard/Data/Browser/EditRowDialog.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,25 @@ export default class EditRowDialog extends React.Component {
}

render() {
const { selectedObject, className, columns, onClose, schema, useMasterKey } = this.props;
const {
selectedObject,
className,
columns,
onClose,
schema,
useMasterKey,
onSaveNewRow,
onAbortAddRow,
} = this.props;
const { currentObject, openObjectPickers, expandedTextAreas } = this.state;
const isNewObject = !selectedObject.id;

const handleCancel = () => {
if (isNewObject) {
onAbortAddRow();
}
onClose();
};

const fields = columns.map(column => {
const { name, type, targetClass } = column;
Expand Down Expand Up @@ -495,10 +512,13 @@ export default class EditRowDialog extends React.Component {
)}
</div>
}
onCancel={onClose}
onCancel={handleCancel}
cancelText={isNewObject ? 'Cancel' : 'Close'}
showContinue={isNewObject}
continueText="Add"
onContinue={onSaveNewRow}
onConfirm={this.openAcl}
confirmText="Edit ACL"
cancelText="Close"
>
<div className={[styles.objectPickerContent]}>{fields}</div>
</Modal>
Expand Down
Loading