From df4654189baef4c69cdd5448d745e4aa459d365c Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Tue, 6 Dec 2022 12:43:30 +0100 Subject: [PATCH] Revert "Revert "Add task IDs to canvas view [SCI-7177][SCI-7178]"" This reverts commit 50e7531ffa741938428b94a5e4194b636adfe199. --- app/assets/stylesheets/my_modules.scss | 8 ++++++++ app/assets/stylesheets/my_modules/protocols/index.scss | 5 +++++ app/models/my_module.rb | 3 +++ app/views/canvas/full_zoom/_my_module.html.erb | 4 ++-- app/views/my_modules/protocols.html.erb | 3 +++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/my_modules.scss b/app/assets/stylesheets/my_modules.scss index 9bef9d6d4..2f78fd3d2 100644 --- a/app/assets/stylesheets/my_modules.scss +++ b/app/assets/stylesheets/my_modules.scss @@ -61,6 +61,14 @@ word-break: break-all; word-wrap: break-word; } + + .task-card-code { + bottom: 5px; + color: $color-volcano; + font-weight: 400; + position: absolute; + right: 5px; + } } .archived-task-card-code { diff --git a/app/assets/stylesheets/my_modules/protocols/index.scss b/app/assets/stylesheets/my_modules/protocols/index.scss index e013248fe..f4297591b 100644 --- a/app/assets/stylesheets/my_modules/protocols/index.scss +++ b/app/assets/stylesheets/my_modules/protocols/index.scss @@ -677,3 +677,8 @@ } } } + +.task-details-code { + display: inline-block; + margin-left: 4px; +} diff --git a/app/models/my_module.rb b/app/models/my_module.rb index 8c9923409..829043157 100644 --- a/app/models/my_module.rb +++ b/app/models/my_module.rb @@ -12,6 +12,9 @@ class MyModule < ApplicationRecord include PermissionCheckableModel include Assignable + ID_PREFIX = 'TA' + include PrefixedIdModel + attr_accessor :transition_error_rollback enum state: Extends::TASKS_STATES diff --git a/app/views/canvas/full_zoom/_my_module.html.erb b/app/views/canvas/full_zoom/_my_module.html.erb index e1ce4137c..5896a0bc1 100644 --- a/app/views/canvas/full_zoom/_my_module.html.erb +++ b/app/views/canvas/full_zoom/_my_module.html.erb @@ -114,8 +114,8 @@
-
- <%= t('my_modules.details.code') %><%= my_module.code %> +
+ ID: <%= my_module.code %>
diff --git a/app/views/my_modules/protocols.html.erb b/app/views/my_modules/protocols.html.erb index e057ec67c..aff367e80 100644 --- a/app/views/my_modules/protocols.html.erb +++ b/app/views/my_modules/protocols.html.erb @@ -67,6 +67,9 @@ <%= render partial: "module_header_details_popover.html.erb" %> + + <%= @my_module.code %> +