Add task IDs to canvas view [SCI-7177]

This commit is contained in:
Martin Artnik 2022-09-13 12:42:12 +02:00
parent f62e4e8509
commit b836b9a12b
5 changed files with 42 additions and 5 deletions

View file

@ -61,6 +61,14 @@
word-break: break-all; word-break: break-all;
word-wrap: break-word; word-wrap: break-word;
} }
.task-card-code {
bottom: 5px;
color: $color-volcano;
font-weight: 400;
position: absolute;
right: 5px;
}
} }
// Create wopi file // Create wopi file

View file

@ -10,6 +10,9 @@ class MyModule < ApplicationRecord
include PermissionCheckableModel include PermissionCheckableModel
include Assignable include Assignable
ID_PREFIX = 'TA'
include PrefixedIdModel
attr_accessor :transition_error_rollback attr_accessor :transition_error_rollback
enum state: Extends::TASKS_STATES enum state: Extends::TASKS_STATES

View file

@ -114,5 +114,9 @@
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_activities" data-contents="activities"></div> <div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_activities" data-contents="activities"></div>
<div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_comments" data-contents="comments"></div> <div role="tabpanel" class="tab-pane" id="<%= my_module.id %>_comments" data-contents="comments"></div>
</div> </div>
<div class="task-card-code">
ID: <%= my_module.code %>
</div>
</div> </div>
</div> </div>

View file

@ -0,0 +1,14 @@
# frozen_string_literal: true
class AddMyModuleCodeIndex < ActiveRecord::Migration[6.1]
def up
ActiveRecord::Base.connection.execute(
"CREATE INDEX index_my_modules_on_my_module_code ON "\
"my_modules using gin (('TA'::text || id) gin_trgm_ops);"
)
end
def down
remove_index :my_modules, name: 'index_my_modules_on_my_module_code'
end
end

View file

@ -5304,6 +5304,13 @@ CREATE INDEX index_my_modules_on_experiment_id ON public.my_modules USING btree
CREATE INDEX index_my_modules_on_last_modified_by_id ON public.my_modules USING btree (last_modified_by_id); CREATE INDEX index_my_modules_on_last_modified_by_id ON public.my_modules USING btree (last_modified_by_id);
--
-- Name: index_my_modules_on_my_module_code; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_my_modules_on_my_module_code ON public.my_modules USING gin ((('TA'::text || id)) public.gin_trgm_ops);
-- --
-- Name: index_my_modules_on_my_module_group_id; Type: INDEX; Schema: public; Owner: - -- Name: index_my_modules_on_my_module_group_id; Type: INDEX; Schema: public; Owner: -
-- --
@ -5816,10 +5823,10 @@ CREATE INDEX index_repository_cells_on_repository_row_id ON public.repository_ce
-- --
-- Name: index_repository_cells_on_value; Type: INDEX; Schema: public; Owner: - -- Name: index_repository_cells_on_value_type_and_value_id; Type: INDEX; Schema: public; Owner: -
-- --
CREATE INDEX index_repository_cells_on_value ON public.repository_cells USING btree (value_type, value_id); CREATE INDEX index_repository_cells_on_value_type_and_value_id ON public.repository_cells USING btree (value_type, value_id);
-- --
@ -6845,10 +6852,10 @@ CREATE INDEX index_view_states_on_user_id ON public.view_states USING btree (use
-- --
-- Name: index_view_states_on_viewable; Type: INDEX; Schema: public; Owner: - -- Name: index_view_states_on_viewable_type_and_viewable_id; Type: INDEX; Schema: public; Owner: -
-- --
CREATE INDEX index_view_states_on_viewable ON public.view_states USING btree (viewable_type, viewable_id); CREATE INDEX index_view_states_on_viewable_type_and_viewable_id ON public.view_states USING btree (viewable_type, viewable_id);
-- --
@ -8517,6 +8524,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20220530144300'), ('20220530144300'),
('20220602120714'), ('20220602120714'),
('20220705091621'), ('20220705091621'),
('20220818094636'); ('20220818094636'),
('20220913095453');