diff --git a/ui/cap-react/src/components/cms/components/SchemaWizard/PropertyEditor/DeletePropertyModal.js b/ui/cap-react/src/components/cms/components/SchemaWizard/PropertyEditor/DeletePropertyModal.js
new file mode 100644
index 0000000000..99901941d3
--- /dev/null
+++ b/ui/cap-react/src/components/cms/components/SchemaWizard/PropertyEditor/DeletePropertyModal.js
@@ -0,0 +1,35 @@
+import React from "react";
+import PropTypes from "prop-types";
+import Modal from "../../../../partials/Modal";
+import Button from "../../../../partials/Button";
+import Box from "grommet/components/Box";
+import Paragraph from "grommet/components/Paragraph";
+
+const DeletePropertyModal = ({ show, text, onClose, onDelete }) => {
+ return (
+ show && (
+
+
+
+ Are you sure you want to delete
+ {text}
+
+
+
+
+
+
+
+
+ )
+ );
+};
+
+DeletePropertyModal.propTypes = {
+ show: PropTypes.bool,
+ text: PropTypes.string,
+ onClose: PropTypes.func,
+ onDelete: PropTypes.func
+};
+
+export default DeletePropertyModal;
diff --git a/ui/cap-react/src/components/cms/components/SchemaWizard/PropertyEditor/customizeField.js b/ui/cap-react/src/components/cms/components/SchemaWizard/PropertyEditor/customizeField.js
index 0f9bcd1c69..69a61e8d8f 100644
--- a/ui/cap-react/src/components/cms/components/SchemaWizard/PropertyEditor/customizeField.js
+++ b/ui/cap-react/src/components/cms/components/SchemaWizard/PropertyEditor/customizeField.js
@@ -1,12 +1,10 @@
import React from "react";
import Box from "grommet/components/Box";
-import Paragraph from "grommet/components/Paragraph";
import Form from "../../../../drafts/form/GrommetForm";
import { PropTypes } from "prop-types";
import Button from "../../../../partials/Button";
-import Modal from "../../../../partials/Modal";
import Image1 from "./svg/AccordionField";
import Image2 from "./svg/TabObjectField";
@@ -19,6 +17,8 @@ import Image7 from "./svg/SidebarTwoColLayout";
import { schemaSchema } from "../../utils/schemas";
import { Label } from "grommet";
+import DeleteModal from "./DeletePropertyModal";
+
const GRID_COLUMNS_OPTIONS = [
"1/1",
"1/2",
@@ -147,46 +147,20 @@ class CustomizeField extends React.Component {
render() {
return (
- {this.state.showDeleteLayer && (
- this.setState({ showDeleteLayer: false })}
- >
-
-
-
- Are you sure you want to delete
-
-
- {this.props.path
- .toJS()
- .path.filter(
- item => item != "properties" && item != "items"
- )
- .map(item => item)
- .join(" > ")}
-
-
-
-
-
-
-
- )}
+ item != "properties" && item != "items")
+ .map(item => item)
+ .join(" > ")}
+ onClose={() => this.setState({ showDeleteLayer: false })}
+ onDelete={() => {
+ this.props.deleteByPath(this.props.path.toJS());
+ this.setState({ showDeleteLayer: false });
+ }}
+ />
+