From b119d6a22bc6901b85606d4787900340fb36fe45 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Thu, 14 Jan 2021 12:39:36 +0100 Subject: [PATCH] F #3951: Fix provision UI (#639) --- src/fireedge/package-lock.json | 5 ++ src/fireedge/package.json | 1 + .../client/components/Cards/ProvisionCard.js | 4 +- .../components/Cards/SelectCard/index.js | 2 +- .../components/Dialogs/DialogConfirmation.js | 17 ++++-- .../src/client/components/Footer/styles.js | 4 +- .../components/FormControl/TextController.js | 5 +- .../client/components/Forms/FormWithSchema.js | 2 + .../src/client/constants/translates.js | 8 ++- .../Create/Steps/BasicConfiguration/index.js | 23 ++++++++ .../Create/Steps/BasicConfiguration/schema.js | 35 +++++++++++ .../Form/Create/Steps/Connection/index.js | 2 +- .../Form/Create/Steps/Inputs/index.js | 59 ------------------- .../Form/Create/Steps/Inputs/schema.js | 31 ---------- .../Form/Create/Steps/Template/index.js | 35 +++++++++-- .../Providers/Form/Create/Steps/index.js | 10 ++-- .../containers/Providers/Form/Create/index.js | 36 ++++++----- .../containers/Providers/Sections/info.js | 5 ++ .../containers/Provisions/DialogInfo/info.js | 2 +- .../Create/Steps/BasicConfiguration/index.js | 23 ++++++++ .../Create/Steps/BasicConfiguration/schema.js | 32 ++++++++++ .../Form/Create/Steps/Inputs/index.js | 2 - .../Form/Create/Steps/Template/index.js | 38 ++++++++++-- .../Provisions/Form/Create/Steps/index.js | 5 +- .../Provisions/Form/Create/index.js | 6 +- src/fireedge/src/client/utils/helpers.js | 9 +++ 26 files changed, 258 insertions(+), 143 deletions(-) create mode 100644 src/fireedge/src/client/containers/Providers/Form/Create/Steps/BasicConfiguration/index.js create mode 100644 src/fireedge/src/client/containers/Providers/Form/Create/Steps/BasicConfiguration/schema.js delete mode 100644 src/fireedge/src/client/containers/Providers/Form/Create/Steps/Inputs/index.js delete mode 100644 src/fireedge/src/client/containers/Providers/Form/Create/Steps/Inputs/schema.js create mode 100644 src/fireedge/src/client/containers/Provisions/Form/Create/Steps/BasicConfiguration/index.js create mode 100644 src/fireedge/src/client/containers/Provisions/Form/Create/Steps/BasicConfiguration/schema.js diff --git a/src/fireedge/package-lock.json b/src/fireedge/package-lock.json index 6b5ebf1e14..7a01f25bbf 100644 --- a/src/fireedge/package-lock.json +++ b/src/fireedge/package-lock.json @@ -3703,6 +3703,11 @@ "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==" }, + "dompurify": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.6.tgz", + "integrity": "sha512-7b7ZArhhH0SP6W2R9cqK6RjaU82FZ2UPM7RO8qN1b1wyvC/NY1FNWcX1Pu00fFOAnzEORtwXe4bPaClg6pUybQ==" + }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", diff --git a/src/fireedge/package.json b/src/fireedge/package.json index 8000bf9695..1aada67076 100644 --- a/src/fireedge/package.json +++ b/src/fireedge/package.json @@ -76,6 +76,7 @@ "cors": "^2.8.5", "cross-env": "^7.0.2", "dagre": "^0.8.5", + "dompurify": "^2.2.6", "express": "^4.14.0", "fs-extra": "^9.0.1", "fuse.js": "^6.4.1", diff --git a/src/fireedge/src/client/components/Cards/ProvisionCard.js b/src/fireedge/src/client/components/Cards/ProvisionCard.js index 8a69c9b28c..cb00db5a44 100644 --- a/src/fireedge/src/client/components/Cards/ProvisionCard.js +++ b/src/fireedge/src/client/components/Cards/ProvisionCard.js @@ -20,7 +20,7 @@ const ProvisionCard = memo( const [{ image, ...body }, setBody] = useState({}) const IMAGES_URL = isProvider ? PROVIDER_IMAGES_URL : PROVISION_IMAGES_URL - const { NAME, TEMPLATE: { PLAIN = {}, BODY = {} } } = value + const { ID, NAME, TEMPLATE: { PLAIN = {}, BODY = {} } } = value const stateInfo = PROVISIONS_STATES[body?.state] useEffect(() => { @@ -36,7 +36,7 @@ const ProvisionCard = memo( return ( )} diff --git a/src/fireedge/src/client/components/Cards/SelectCard/index.js b/src/fireedge/src/client/components/Cards/SelectCard/index.js index 5aa883d8ae..25b4dc8d42 100644 --- a/src/fireedge/src/client/components/Cards/SelectCard/index.js +++ b/src/fireedge/src/client/components/Cards/SelectCard/index.js @@ -68,7 +68,7 @@ const SelectCard = memo(({ }} title={title} titleTypographyProps={{ - variant: 'body2', + variant: 'body1', noWrap: true, className: classes.header, title diff --git a/src/fireedge/src/client/components/Dialogs/DialogConfirmation.js b/src/fireedge/src/client/components/Dialogs/DialogConfirmation.js index 1b36185ae3..1b24b20c3a 100644 --- a/src/fireedge/src/client/components/Dialogs/DialogConfirmation.js +++ b/src/fireedge/src/client/components/Dialogs/DialogConfirmation.js @@ -7,7 +7,8 @@ import { Dialog, DialogTitle, DialogContent, - DialogActions + DialogActions, + Typography } from '@material-ui/core' import SubmitButton from 'client/components/FormControl/SubmitButton' @@ -18,6 +19,7 @@ const DialogConfirmation = memo( ({ open, title, + subheader, contentProps, handleAccept, acceptButtonProps, @@ -34,7 +36,7 @@ const DialogConfirmation = memo( onEntering={handleEntering} open={open} onClose={handleCancel} - maxWidth="lg" + maxWidth='lg' scroll="paper" PaperProps={{ style: { @@ -43,7 +45,10 @@ const DialogConfirmation = memo( } }} > - {title} + + {title} + {subheader && {subheader}} + {children} @@ -52,7 +57,7 @@ const DialogConfirmation = memo( {handleCancel && (