mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-07 20:40:26 +08:00
Merge pull request #4935 from G-Chubinidze/gc_SCI_7848
user_my_modules_controller#index_old action updates [SCI-7848]
This commit is contained in:
commit
397e4aeebe
5 changed files with 7 additions and 7 deletions
|
@ -7,14 +7,14 @@ class UserMyModulesController < ApplicationController
|
||||||
before_action :check_view_permissions, except: %i(create destroy)
|
before_action :check_view_permissions, except: %i(create destroy)
|
||||||
before_action :check_manage_permissions, only: %i(create destroy)
|
before_action :check_manage_permissions, only: %i(create destroy)
|
||||||
|
|
||||||
def index_old
|
def designated_users
|
||||||
@user_my_modules = @my_module.user_my_modules
|
@user_my_modules = @my_module.user_my_modules
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json do
|
format.json do
|
||||||
render json: {
|
render json: {
|
||||||
html: render_to_string(
|
html: render_to_string(
|
||||||
partial: 'index_old.html.erb'
|
partial: 'designated_users.html.erb'
|
||||||
),
|
),
|
||||||
my_module_id: @my_module.id,
|
my_module_id: @my_module.id,
|
||||||
counter: @my_module.designated_users.count # Used for counter badge
|
counter: @my_module.designated_users.count # Used for counter badge
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
data-module-x="<%= my_module.x %>"
|
data-module-x="<%= my_module.x %>"
|
||||||
data-module-y="<%= my_module.y %>"
|
data-module-y="<%= my_module.y %>"
|
||||||
data-module-conns="<%= construct_module_connections(my_module) %>"
|
data-module-conns="<%= construct_module_connections(my_module) %>"
|
||||||
data-module-users-tab-url="<%= index_old_my_module_user_my_modules_url(my_module_id: my_module.id, format: :json) %>"
|
data-module-users-tab-url="<%= designated_users_my_module_user_my_modules_url(my_module_id: my_module.id, format: :json) %>"
|
||||||
data-module-tags-url="<%= my_module_tags_experiment_path(my_module.experiment, format: :json) %>">
|
data-module-tags-url="<%= my_module_tags_experiment_path(my_module.experiment, format: :json) %>">
|
||||||
|
|
||||||
<div data-view-mode="active">
|
<div data-view-mode="active">
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
<div class="panel-footer panel-footer-scinote buttons-container">
|
<div class="panel-footer panel-footer-scinote buttons-container">
|
||||||
<ul class="nav nav-tabs nav-tabs-less" role="tablist">
|
<ul class="nav nav-tabs nav-tabs-less" role="tablist">
|
||||||
<li role="presentation">
|
<li role="presentation">
|
||||||
<a class="btn btn-link task-card-view-users" href="<%= index_old_my_module_user_my_modules_url(my_module_id: my_module.id, format: :json) %>" aria-controls="<%= my_module.id %>_users" role="tab" data-remote="true">
|
<a class="btn btn-link task-card-view-users" href="<%= designated_users_my_module_user_my_modules_url(my_module_id: my_module.id, format: :json) %>" aria-controls="<%= my_module.id %>_users" role="tab" data-remote="true">
|
||||||
<span class="fas fa-users" aria-hidden="true"></span>
|
<span class="fas fa-users" aria-hidden="true"></span>
|
||||||
<span class="badge badge-indicator users-badge-indicator <%= 'hidden' unless my_module.designated_users_count.positive? %>"
|
<span class="badge badge-indicator users-badge-indicator <%= 'hidden' unless my_module.designated_users_count.positive? %>"
|
||||||
data-linked-id="<%= my_module.id %>">
|
data-linked-id="<%= my_module.id %>">
|
||||||
|
|
|
@ -414,7 +414,7 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
resources :user_my_modules, path: '/users', only: %i(index create destroy) do
|
resources :user_my_modules, path: '/users', only: %i(index create destroy) do
|
||||||
collection do
|
collection do
|
||||||
get :index_old
|
get :designated_users
|
||||||
end
|
end
|
||||||
member do
|
member do
|
||||||
get :search
|
get :search
|
||||||
|
|
|
@ -6,7 +6,7 @@ describe UserMyModulesController, type: :controller do
|
||||||
include PermissionExtends
|
include PermissionExtends
|
||||||
|
|
||||||
it_behaves_like "a controller with authentication", {
|
it_behaves_like "a controller with authentication", {
|
||||||
index_old: { my_module_id: 1 },
|
designated_users: { my_module_id: 1 },
|
||||||
index: { my_module_id: 1 },
|
index: { my_module_id: 1 },
|
||||||
index_edit: { my_module_id: 1 },
|
index_edit: { my_module_id: 1 },
|
||||||
search: { my_module_id: 1, id: 1 },
|
search: { my_module_id: 1, id: 1 },
|
||||||
|
@ -21,7 +21,7 @@ describe UserMyModulesController, type: :controller do
|
||||||
team_role: :normal_user
|
team_role: :normal_user
|
||||||
}
|
}
|
||||||
|
|
||||||
it_behaves_like "a controller action with permissions checking", :get, :index_old do
|
it_behaves_like "a controller action with permissions checking", :get, :designated_users do
|
||||||
let(:testable) { my_module }
|
let(:testable) { my_module }
|
||||||
let(:permissions) { [MyModulePermissions::READ] }
|
let(:permissions) { [MyModulePermissions::READ] }
|
||||||
let(:action_params) { { my_module_id: my_module.id } }
|
let(:action_params) { { my_module_id: my_module.id } }
|
||||||
|
|
Loading…
Add table
Reference in a new issue