From c513e6bca7ba6c910177e3f8ab8f27b67345a823 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 6 Jan 2023 12:02:35 +0100 Subject: [PATCH] Experiment table - fix comments view mode [SCI-7695] --- app/assets/javascripts/experiments/table.js | 1 + app/assets/stylesheets/experiment/table.scss | 4 ++++ app/services/experiments/table_view_service.rb | 1 + 3 files changed, 6 insertions(+) diff --git a/app/assets/javascripts/experiments/table.js b/app/assets/javascripts/experiments/table.js index 67585495a..086a8372c 100644 --- a/app/assets/javascripts/experiments/table.js +++ b/app/assets/javascripts/experiments/table.js @@ -635,6 +635,7 @@ ExperimnetTable.render.tags = function(data) { }; ExperimnetTable.render.comments = function(data) { + if (data.count === 0 && !data.can_create) return '0'; return ` diff --git a/app/assets/stylesheets/experiment/table.scss b/app/assets/stylesheets/experiment/table.scss index 6ff758a1e..aa7e0a86b 100644 --- a/app/assets/stylesheets/experiment/table.scss +++ b/app/assets/stylesheets/experiment/table.scss @@ -153,6 +153,10 @@ display: none; } + .comments-column .disabled { + color: $color-silver-chalice; + } + .table-row { display: contents; diff --git a/app/services/experiments/table_view_service.rb b/app/services/experiments/table_view_service.rb index 5617d705a..e439225ec 100644 --- a/app/services/experiments/table_view_service.rb +++ b/app/services/experiments/table_view_service.rb @@ -168,6 +168,7 @@ module Experiments { id: my_module.id, count: my_module.comments.count, + can_create: can_create_my_module_comments?(@user, my_module), count_unseen: count_unseen_comments(my_module, @user) } end