Work in progress on confirmation dialogs displayed when one navigates from a page with unsaved changes.

Optimized imports.
This commit is contained in:
Tomas Bures 2019-05-12 00:00:09 +02:00
parent 3921a6b2cb
commit 008fd21b51
30 changed files with 324 additions and 231 deletions

View file

@ -4,7 +4,18 @@ import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {withTranslation} from '../lib/i18n';
import {LinkButton, requiresAuthenticatedUser, Title, withPageHelpers} from '../lib/page';
import {Button, ButtonRow, Form, FormSendMethod, InputField, TextArea, TreeTableSelect, withForm} from '../lib/form';
import {
Button,
ButtonRow,
filterData,
Form,
FormSendMethod,
InputField,
TextArea,
TreeTableSelect,
withForm,
withFormErrorHandlers
} from '../lib/form';
import axios from '../lib/axios';
import {withAsyncErrorHandler, withErrorHandling} from '../lib/error-handling';
import interoperableErrors from '../../../shared/interoperable-errors';
@ -35,6 +46,10 @@ export default class CUD extends Component {
entity: PropTypes.object
}
submitFormValuesMutator(data) {
return filterData(data, ['name', 'description', 'namespace']);
}
isEditGlobal() {
return this.props.entity && this.props.entity.id === getGlobalNamespaceId();
}
@ -106,6 +121,7 @@ export default class CUD extends Component {
}
}
@withFormErrorHandlers
async submitHandler(submitAndLeave) {
const t = this.props.t;