From f256a4e0f3669595e92319f8ca48d6336d1183cf Mon Sep 17 00:00:00 2001 From: Lucio Maranta Date: Wed, 11 Sep 2019 11:03:04 +0200 Subject: [PATCH] Added horizontal scroll to user softkey for long texts --- Step.Core/ThreadsHandler.cs | 2 +- Step.Model/Constants.cs | 1 + Step/Controllers/WebApi/UserController.cs | 2 +- .../assets/styles/base/plc-softkeys.less | 20 +++++++++++++++++ Step/wwwroot/assets/styles/style.css | 17 ++++++++++++++ .../under-the-hood/components/soft-key2.vue | 22 ++++++++++++++++--- 6 files changed, 59 insertions(+), 5 deletions(-) diff --git a/Step.Core/ThreadsHandler.cs b/Step.Core/ThreadsHandler.cs index 6fbf69f1..f3c4d5e9 100644 --- a/Step.Core/ThreadsHandler.cs +++ b/Step.Core/ThreadsHandler.cs @@ -24,7 +24,7 @@ namespace Step.Core ThreadsFunctions.ReadActiveProgramData, ThreadsFunctions.UpdateToolsData, ThreadsFunctions.ReadNcMagazineActive, - ThreadsFunctions.ReadPartProgramQueueData, + //ThreadsFunctions.ReadPartProgramQueueData, ThreadsFunctions.ReadScadaData, ThreadsFunctions.ReadM154Data // ThreadsFunctions.ReadNcSoftKeysData, diff --git a/Step.Model/Constants.cs b/Step.Model/Constants.cs index 537142d5..9a893f95 100644 --- a/Step.Model/Constants.cs +++ b/Step.Model/Constants.cs @@ -270,6 +270,7 @@ namespace Step.Model public const string ID_ALREADY_EXIST = "error_id_already_exist"; public const string PASSWORD_IS_INVALID = "error_password_is_invalid"; public const string IMPORT_FILE_NOT_VALID = "error_import_file_not_valid"; + public const string DUPLICATED_USERNAME = "error_duplicated_username"; } // File paths diff --git a/Step/Controllers/WebApi/UserController.cs b/Step/Controllers/WebApi/UserController.cs index d671f9d5..06eb4868 100644 --- a/Step/Controllers/WebApi/UserController.cs +++ b/Step/Controllers/WebApi/UserController.cs @@ -162,7 +162,7 @@ namespace Step.Controllers.WebApi using (UsersController usersController = new UsersController()) { if (usersController.FindByUsername(model.Username) != null) - return BadRequest(); + return BadRequest(API_ERROR_KEYS.DUPLICATED_USERNAME); DTOUserModel user = usersController.Create(model.Username, model.Password, model.FirstName, model.LastName, model.Language); diff --git a/Step/wwwroot/assets/styles/base/plc-softkeys.less b/Step/wwwroot/assets/styles/base/plc-softkeys.less index 3b83ba28..d820544d 100644 --- a/Step/wwwroot/assets/styles/base/plc-softkeys.less +++ b/Step/wwwroot/assets/styles/base/plc-softkeys.less @@ -459,6 +459,26 @@ } } } + + .horizontal-scroll { + margin: 0 auto; + white-space: nowrap; + overflow: hidden; + + span { + display: inline-block; + animation: marquee 3s linear infinite; + } + + @keyframes marquee { + 0% { + transform: translate(0%, 0); + } + 100% { + transform: translate(-100%, 0); + } + } + } } #nc-softkeys-container { diff --git a/Step/wwwroot/assets/styles/style.css b/Step/wwwroot/assets/styles/style.css index 5138d237..30b19be3 100644 --- a/Step/wwwroot/assets/styles/style.css +++ b/Step/wwwroot/assets/styles/style.css @@ -6243,6 +6243,23 @@ footer .container button.big:before { .soft-key .detail section.multiple span.empty { background: transparent; } +.soft-key .horizontal-scroll { + margin: 0 auto; + white-space: nowrap; + overflow: hidden; +} +.soft-key .horizontal-scroll span { + display: inline-block; + animation: marquee 3s linear infinite; +} +@keyframes marquee { + 0% { + transform: translate(0%, 0); + } + 100% { + transform: translate(-100%, 0); + } +} #nc-softkeys-container { width: 312px; height: 216px; diff --git a/Step/wwwroot/src/app_modules/under-the-hood/components/soft-key2.vue b/Step/wwwroot/src/app_modules/under-the-hood/components/soft-key2.vue index 0f1c6e0e..65c6a9e7 100644 --- a/Step/wwwroot/src/app_modules/under-the-hood/components/soft-key2.vue +++ b/Step/wwwroot/src/app_modules/under-the-hood/components/soft-key2.vue @@ -1,10 +1,14 @@