From 5889441f66bf953332a1d519815a6c1536adc2d1 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Tue, 22 Sep 2020 12:28:48 +0200 Subject: [PATCH] F #3951: Add dockerfile editor in tier form (#237) --- .../Steps/Tiers/Steps/Template/List/Docker.js | 58 +++++++++++++++---- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/src/fireedge/src/public/containers/Application/Create/Steps/Tiers/Steps/Template/List/Docker.js b/src/fireedge/src/public/containers/Application/Create/Steps/Tiers/Steps/Template/List/Docker.js index d118176045..54fb3bcf3c 100644 --- a/src/fireedge/src/public/containers/Application/Create/Steps/Tiers/Steps/Template/List/Docker.js +++ b/src/fireedge/src/public/containers/Application/Create/Steps/Tiers/Steps/Template/List/Docker.js @@ -1,19 +1,55 @@ import React from 'react'; import PropTypes from 'prop-types'; -const ImportDockerFile = ({ backButton }) => ( -
- {backButton} -

Docker file

-
-); +import AceEditor from 'react-ace'; +import 'ace-builds/src-noconflict/mode-dockerfile'; +import 'ace-builds/src-noconflict/theme-github'; -ImportDockerFile.propTypes = { - backButton: PropTypes.node +const DockerFile = ({ backButton, handleSetData, currentValue, ...props }) => { + const handleChange = newValue => { + handleSetData(newValue); + }; + + return ( + <> +
+ {backButton} +

Docker file

+
+ + + ); }; -ImportDockerFile.defaultProps = { - backButton: null +DockerFile.propTypes = { + backButton: PropTypes.node, + currentValue: PropTypes.string, + handleSetData: PropTypes.func }; -export default ImportDockerFile; +DockerFile.defaultProps = { + backButton: null, + currentValue: undefined, + handleSetData: PropTypes.func +}; + +export default DockerFile;