diff --git a/app/assets/javascripts/repositories/index.js b/app/assets/javascripts/repositories/index.js index ce1db1a96..8bfeb2e1c 100644 --- a/app/assets/javascripts/repositories/index.js +++ b/app/assets/javascripts/repositories/index.js @@ -145,6 +145,7 @@ if (data.warnings) { alert(data.warnings); } + $('.repository-share-status').toggleClass('hidden', !data.status); $('.share-repo-modal').modal('hide'); }, error: function(data) { diff --git a/app/assets/stylesheets/partials/_tree_view.scss b/app/assets/stylesheets/partials/_tree_view.scss index 6bf210d54..62b5da4d2 100644 --- a/app/assets/stylesheets/partials/_tree_view.scss +++ b/app/assets/stylesheets/partials/_tree_view.scss @@ -111,6 +111,7 @@ #repo-tree { .fas-custom { float: right; + top: 2px; } .active { diff --git a/app/assets/stylesheets/repositories.scss b/app/assets/stylesheets/repositories.scss index 794899989..2f5e0a2b1 100644 --- a/app/assets/stylesheets/repositories.scss +++ b/app/assets/stylesheets/repositories.scss @@ -22,6 +22,13 @@ } } +.repository-share-status { + display: contents !important; + + &.hidden { + display: none !important; + } +} .repository-table { margin-top: 20px; diff --git a/app/controllers/team_repositories_controller.rb b/app/controllers/team_repositories_controller.rb index 12de39340..9606d9e80 100644 --- a/app/controllers/team_repositories_controller.rb +++ b/app/controllers/team_repositories_controller.rb @@ -43,7 +43,7 @@ class TeamRepositoriesController < ApplicationController team_ids_for_update: teams_to_update, **share_all_params) if service_call.succeed? - render json: { warnings: service_call.warnings.join(', ') }, status: :ok + render json: { warnings: service_call.warnings.join(', '), status: @repository.i_shared?(current_team) }, status: :ok else render json: { errors: service_call.errors.map { |_, v| v }.join(', ') }, status: :unprocessable_entity end diff --git a/app/views/repositories/_sidebar.html.erb b/app/views/repositories/_sidebar.html.erb index d7ed10e94..8dc69351a 100644 --- a/app/views/repositories/_sidebar.html.erb +++ b/app/views/repositories/_sidebar.html.erb @@ -30,8 +30,10 @@ <% else %> <%= draw_custom_icon('shared-read') %> <% end %> - <% elsif repository.i_shared?(current_team) %> - <%= draw_custom_icon('i-shared') %> + <% else %> +
<% end %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 59fd797ef..4e3c4b2d9 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -18,8 +18,10 @@ <% else %> <%= draw_custom_icon('shared-read') %> <% end %> - <% elsif @repository.i_shared?(current_team) %> - <%= draw_custom_icon('i-shared') %> + <% else %> + <% end %>