From 41d7aa5406da149653d780124b7a016496f00580 Mon Sep 17 00:00:00 2001 From: Guillermo Giuliana Date: Mon, 25 Apr 2022 18:16:07 -0300 Subject: [PATCH] [DEV-302] Fix custom filed error message padding (#1190) * add en translation * add margin * add i18n to error * add minor changes * add en translations --- .../app/admin/panel/users/admin-panel-custom-field-form.js | 2 +- .../app/admin/panel/users/admin-panel-custom-field-form.scss | 1 + client/src/data/languages/en.js | 5 ++++- server/controllers/staff/get-new-tickets.php | 3 ++- server/controllers/staff/get-tickets.php | 5 +++-- server/controllers/ticket/search.php | 2 +- server/data/ERRORS.php | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/client/src/app/admin/panel/users/admin-panel-custom-field-form.js b/client/src/app/admin/panel/users/admin-panel-custom-field-form.js index 1da37eeb..a22c2f2c 100644 --- a/client/src/app/admin/panel/users/admin-panel-custom-field-form.js +++ b/client/src/app/admin/panel/users/admin-panel-custom-field-form.js @@ -63,7 +63,7 @@ class AdminPanelCustomFieldForm extends React.Component { return ( - {error} + {i18n(error)} ); } diff --git a/client/src/app/admin/panel/users/admin-panel-custom-field-form.scss b/client/src/app/admin/panel/users/admin-panel-custom-field-form.scss index b3d2916d..ca2a9757 100644 --- a/client/src/app/admin/panel/users/admin-panel-custom-field-form.scss +++ b/client/src/app/admin/panel/users/admin-panel-custom-field-form.scss @@ -26,5 +26,6 @@ &__buttons { display: flex; justify-content: space-between; + margin-top: 20px; } } diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index 3e2f1b4c..560010cb 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -412,7 +412,10 @@ export default { 'INVALID_SUPERVISED_USERS': 'Invalid supervised users', 'SUPERVISOR_CAN_NOT_SUPERVISE_HIMSELF': 'Supervisor can not supervise himself', 'NAME_ALREADY_USED': 'Name already used', - 'PAGESIZE_ERROR': 'Invalid page size', + 'INVALID_PAGE_SIZE': 'Invalid page size', + 'INVALID_CUSTOM_FIELD_TYPE': 'Invalid custom field type', + 'INVALID_CUSTOM_FIELD_OPTIONS': 'Invalid custom field options', + 'CUSTOM_FIELD_ALREADY_EXISTS': 'Custom field already exists', //MESSAGES 'SIGNUP_SUCCESS': 'You have registered successfully in our support system.', diff --git a/server/controllers/staff/get-new-tickets.php b/server/controllers/staff/get-new-tickets.php index c6cedaf3..8c85f000 100755 --- a/server/controllers/staff/get-new-tickets.php +++ b/server/controllers/staff/get-new-tickets.php @@ -19,6 +19,7 @@ use Respect\Validation\Validator as DataValidator; * * @apiUse NO_PERMISSION * @apiUse INVALID_PAGE + * @apiUse INVALID_PAGE_SIZE * * @apiSuccess {Object} data Information about a tickets and quantity of pages. * @apiSuccess {[Ticket](#api-Data_Structures-ObjectTicket)[]} data.tickets Array of new tickets of the current page. @@ -41,7 +42,7 @@ class GetNewTicketsStaffController extends Controller { ], 'pageSize' => [ 'validation' => DataValidator::oneOf(DataValidator::intVal()->between(5, 50),DataValidator::nullType()), - 'error' => ERRORS::PAGESIZE_ERROR + 'error' => ERRORS::INVALID_PAGE_SIZE ] ] ]; diff --git a/server/controllers/staff/get-tickets.php b/server/controllers/staff/get-tickets.php index 6044036b..deeacdde 100755 --- a/server/controllers/staff/get-tickets.php +++ b/server/controllers/staff/get-tickets.php @@ -19,6 +19,7 @@ use Respect\Validation\Validator as DataValidator; * * @apiUse NO_PERMISSION * @apiUse INVALID_PAGE + * @apiUse INVALID_PAGE_SIZE * * @apiSuccess {Object} data Information about a tickets and quantity of pages. * @apiSuccess {[Ticket](#api-Data_Structures-ObjectTicket)[]} data.tickets Array of tickets assigned to the staff of the current page. @@ -40,8 +41,8 @@ class GetTicketStaffController extends Controller { 'error' => ERRORS::INVALID_PAGE ], 'pageSize' => [ - 'validation' => DataValidator::oneOf(DataValidator::intVal()->between(5, 50),DataValidator::nullType()), - 'error' => ERRORS::PAGESIZE_ERROR + 'validation' => DataValidator::oneOf(DataValidator::intVal()->between(5, 50),DataValidator::nullType()), + 'error' => ERRORS::INVALID_PAGE_SIZE ] ] ]; diff --git a/server/controllers/ticket/search.php b/server/controllers/ticket/search.php index 47fc25c2..78f03eaa 100644 --- a/server/controllers/ticket/search.php +++ b/server/controllers/ticket/search.php @@ -101,7 +101,7 @@ class SearchController extends Controller { ], 'pageSize' => [ 'validation' => DataValidator::oneOf(DataValidator::intVal()->between(5, 50),DataValidator::nullType()), - 'error' => ERRORS::PAGESIZE_ERROR + 'error' => ERRORS::INVALID_PAGE_SIZE ] ] ]; diff --git a/server/data/ERRORS.php b/server/data/ERRORS.php index 0c952f1b..62455730 100755 --- a/server/data/ERRORS.php +++ b/server/data/ERRORS.php @@ -410,5 +410,5 @@ class ERRORS { const INVALID_SUPERVISED_USERS = 'INVALID_SUPERVISED_USERS'; const INVALID_USER_SEARCH_OPTION = 'INVALID_USER_SEARCH_OPTION'; const TICKET_CONTENT_CANNOT_BE_EDITED = 'TICKET_CONTENT_CANNOT_BE_EDITED'; - const PAGESIZE_ERROR = 'PAGESIZE_ERROR'; + const INVALID_PAGE_SIZE = 'INVALID_PAGE_SIZE'; }