From 351b8dc2234c6c0932809f3d1ac4ca1895997dc4 Mon Sep 17 00:00:00 2001 From: aminecherif Date: Thu, 27 Jul 2023 15:44:05 +0100 Subject: [PATCH 1/4] Fix size name from edit preset (in backend and frontend). --- bbbeasy-backend/app/src/Actions/Presets/Edit.php | 1 + bbbeasy-frontend/src/components/Presets.tsx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/bbbeasy-backend/app/src/Actions/Presets/Edit.php b/bbbeasy-backend/app/src/Actions/Presets/Edit.php index 10b2cd8d..e2efd5b9 100644 --- a/bbbeasy-backend/app/src/Actions/Presets/Edit.php +++ b/bbbeasy-backend/app/src/Actions/Presets/Edit.php @@ -45,6 +45,7 @@ public function rename($f3, $params): void $dataChecker = new DataChecker(); $dataChecker->verify($form['name'], Validator::notEmpty()->setName('name')); + $dataChecker->verify($form['name'], Validator::length(1, 64)->setName('name')); $dataChecker->verify($id, Validator::notEmpty()->setName('id')); $errorMessage = 'Preset could not be updated'; diff --git a/bbbeasy-frontend/src/components/Presets.tsx b/bbbeasy-frontend/src/components/Presets.tsx index 558c0b2f..d6562865 100644 --- a/bbbeasy-frontend/src/components/Presets.tsx +++ b/bbbeasy-frontend/src/components/Presets.tsx @@ -301,6 +301,10 @@ const PresetsCol: React.FC = ({ required: true, message: , }, + { + max: 64, + message: , + }, ]} > Date: Fri, 28 Jul 2023 13:17:22 +0100 Subject: [PATCH 2/4] Fix text box movement when edit the preset name --- bbbeasy-frontend/src/App-webapp.css | 3 + bbbeasy-frontend/src/components/Presets.tsx | 99 +++++++++++---------- 2 files changed, 55 insertions(+), 47 deletions(-) diff --git a/bbbeasy-frontend/src/App-webapp.css b/bbbeasy-frontend/src/App-webapp.css index 8433669f..4c037785 100644 --- a/bbbeasy-frontend/src/App-webapp.css +++ b/bbbeasy-frontend/src/App-webapp.css @@ -1565,3 +1565,6 @@ fieldset { .edit-room-form { display: block !important; } +div.edit-preset-name{ + margin-top: 10px; +} diff --git a/bbbeasy-frontend/src/components/Presets.tsx b/bbbeasy-frontend/src/components/Presets.tsx index d6562865..43cfb69b 100644 --- a/bbbeasy-frontend/src/components/Presets.tsx +++ b/bbbeasy-frontend/src/components/Presets.tsx @@ -282,57 +282,62 @@ const PresetsCol: React.FC = ({ )} ) : ( -
- EN_US[elem] == errorsEdit['name'] - )} - /> - ), - validateStatus: 'error', - })} - rules={[ - { - required: true, - message: , - }, - { - max: 64, - message: , - }, - ]} +
+ - - cancelEdit()} - > + EN_US[elem] == errorsEdit['name'] + )} + /> + ), + validateStatus: 'error', + })} + rules={[ + { + required: true, + message: , + }, + { + max: 64, + message: , + }, + ]} + > + + cancelEdit()} + > +
)} From 295d966edecba60272899ec7cecbc94bcaae9eda Mon Sep 17 00:00:00 2001 From: aminecherif Date: Fri, 28 Jul 2023 15:08:30 +0100 Subject: [PATCH 3/4] Fix text box when edit the preset name --- bbbeasy-frontend/src/App-webapp.css | 1 + 1 file changed, 1 insertion(+) diff --git a/bbbeasy-frontend/src/App-webapp.css b/bbbeasy-frontend/src/App-webapp.css index 4c037785..3d686f23 100644 --- a/bbbeasy-frontend/src/App-webapp.css +++ b/bbbeasy-frontend/src/App-webapp.css @@ -1567,4 +1567,5 @@ fieldset { } div.edit-preset-name{ margin-top: 10px; + width: 250px; } From 6f177ec7944c848999db6bff4598dbd819300bce Mon Sep 17 00:00:00 2001 From: aminecherif Date: Fri, 28 Jul 2023 16:54:24 +0100 Subject: [PATCH 4/4] Fix display error message --- bbbeasy-frontend/src/App-webapp.css | 1 + 1 file changed, 1 insertion(+) diff --git a/bbbeasy-frontend/src/App-webapp.css b/bbbeasy-frontend/src/App-webapp.css index 3d686f23..cbe1a1ec 100644 --- a/bbbeasy-frontend/src/App-webapp.css +++ b/bbbeasy-frontend/src/App-webapp.css @@ -1568,4 +1568,5 @@ fieldset { div.edit-preset-name{ margin-top: 10px; width: 250px; + white-space: pre-line; }