From c392b5114faaa72819f97f901789677caf1dad68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Vra=C5=BEi=C4=8D?= Date: Fri, 20 Oct 2023 10:05:42 +0200 Subject: [PATCH 1/2] Modified and added new tags mostly for inventories section. --- app/assets/javascripts/dashboard/recent_work.js | 1 + app/assets/javascripts/repositories/index.js | 4 ++-- .../javascripts/repositories/repository_datatable.js | 2 +- app/helpers/repositories_datatable_helper.rb | 3 ++- app/helpers/repository_datatable_helper.rb | 2 +- app/views/dashboards/_quick_start.html.erb | 2 +- app/views/dashboards/_recent_work.html.erb | 2 +- app/views/dashboards/show.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/projects/index/_toolbar.html.erb | 4 ++-- .../repositories/_create_repository_modal.html.erb | 10 +++++----- .../repositories/_repository_row_info_modal.html.erb | 8 ++++---- app/views/repositories/_repository_table.html.erb | 2 +- app/views/shared/_inline_editing.html.erb | 1 + app/views/shared/navigation/_left.html.erb | 4 ++-- app/views/users/sessions/new.html.erb | 2 +- 16 files changed, 27 insertions(+), 24 deletions(-) diff --git a/app/assets/javascripts/dashboard/recent_work.js b/app/assets/javascripts/dashboard/recent_work.js index 3403b487b..0e792c5c6 100644 --- a/app/assets/javascripts/dashboard/recent_work.js +++ b/app/assets/javascripts/dashboard/recent_work.js @@ -17,6 +17,7 @@ var DasboardRecentWorkWidget = (function() { recentWorkItemType.attr('title', `${item.type} ID: ${item.code}`); recentWorkItemType.tooltip(); } + recentWorkItemType.attr('data-e2e', `e2e-TL-dashRecentWork-${item.name}`); }); } diff --git a/app/assets/javascripts/repositories/index.js b/app/assets/javascripts/repositories/index.js index 354dd74ea..fdbd6bc93 100644 --- a/app/assets/javascripts/repositories/index.js +++ b/app/assets/javascripts/repositories/index.js @@ -67,7 +67,7 @@ orderable: false, render: function() { return `
- +
`; } @@ -75,7 +75,7 @@ targets: 1, className: 'item-name', render: function(value, type, row) { - return `${value}`; + return `${value}`; } }, { targets: 5, diff --git a/app/assets/javascripts/repositories/repository_datatable.js b/app/assets/javascripts/repositories/repository_datatable.js index 9c5ce079e..7e4f2ecf5 100644 --- a/app/assets/javascripts/repositories/repository_datatable.js +++ b/app/assets/javascripts/repositories/repository_datatable.js @@ -671,7 +671,7 @@ var RepositoryDatatable = (function(global) { visible: true, render: function(data, type, row) { return "" + data + ''; + + "class='record-info-link' data-e2e='e2e-TL-invInventory-" + data + "'>" + data + ''; } }, { // Added on column diff --git a/app/helpers/repositories_datatable_helper.rb b/app/helpers/repositories_datatable_helper.rb index b699ee462..ea05d2ff2 100644 --- a/app/helpers/repositories_datatable_helper.rb +++ b/app/helpers/repositories_datatable_helper.rb @@ -29,7 +29,8 @@ module RepositoriesDatatableHelper 'data-copy-modal-url': team_repository_copy_modal_path(team, repository_id: repository), 'data-rename-modal-url': team_repository_rename_modal_path(team, repository_id: repository), 'data-shared': repository.shared_with?(team), - 'data-i-shared': repository.i_shared?(team) + 'data-i-shared': repository.i_shared?(team), + 'data-e2e': "e2e-RT-inventories-tableItemRow-#{repository.id}" } ) end diff --git a/app/helpers/repository_datatable_helper.rb b/app/helpers/repository_datatable_helper.rb index 3c92261bd..f85eca88b 100644 --- a/app/helpers/repository_datatable_helper.rb +++ b/app/helpers/repository_datatable_helper.rb @@ -16,7 +16,7 @@ module RepositoryDatatableHelper row = public_send("#{repository.class.name.underscore}_default_columns", record) row.merge!( DT_RowId: record.id, - DT_RowAttr: { 'data-state': row_style(record) }, + DT_RowAttr: { 'data-state': row_style(record), 'data-e2e': "e2e-RT-invInventory-row-#{record.id}" }, recordInfoUrl: Rails.application.routes.url_helpers.repository_repository_row_path(repository, record), rowRemindersUrl: Rails.application.routes.url_helpers diff --git a/app/views/dashboards/_quick_start.html.erb b/app/views/dashboards/_quick_start.html.erb index 0d52ea50e..04aaf2588 100644 --- a/app/views/dashboards/_quick_start.html.erb +++ b/app/views/dashboards/_quick_start.html.erb @@ -1,4 +1,4 @@ -
+
<%= t("dashboard.quick_start.new_task") %>
<% if can_create_protocols_in_repository?(current_team) %>
-
+
diff --git a/app/views/dashboards/show.html.erb b/app/views/dashboards/show.html.erb index b46a22b58..a32c99655 100644 --- a/app/views/dashboards/show.html.erb +++ b/app/views/dashboards/show.html.erb @@ -1,7 +1,7 @@ <% provide :head_title, t('nav.label.dashboard') %> <% if current_team %> -
+
<%= render partial: 'quick_start' %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f6727870f..616d7e1e8 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -80,7 +80,7 @@
<%= render "shared/navigation/left" if user_signed_in? %>
-
+
<%= render "shared/navigation/navigator" %>
diff --git a/app/views/projects/index/_toolbar.html.erb b/app/views/projects/index/_toolbar.html.erb index 63362f7c8..61db2df17 100644 --- a/app/views/projects/index/_toolbar.html.erb +++ b/app/views/projects/index/_toolbar.html.erb @@ -1,13 +1,13 @@
-
+
<% if current_team && can_create_projects?(current_team) %> <%= link_to new_project_path(project_folder_id: current_folder), class: 'btn btn-primary new-project-btn', title: t('projects.index.new_tooltip'), - data: { view_mode: 'active', e2e: 'e2e-new-project-button' }, + data: { view_mode: 'active', e2e: 'e2e-BT-project-newProject' }, remote: true do %> diff --git a/app/views/repositories/_create_repository_modal.html.erb b/app/views/repositories/_create_repository_modal.html.erb index 1444430d1..d0e07c942 100644 --- a/app/views/repositories/_create_repository_modal.html.erb +++ b/app/views/repositories/_create_repository_modal.html.erb @@ -1,16 +1,16 @@