-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added activity to groups which tracks group create/update, projects transferred in/out, members added/removed, shared groups share/unshare * Updated group activity to turn link to a project into non clickable text if the project has been removed * Removed policy method not required, fixed rubocop warnings, updated translation * Added activities for transferring groups, update group create/destroy to add activities to parent if exists * Fixed formatting, added test for group activity * Fixed rubocop warning * Fixed duplicate transfer entry for group that is transferred * Fixed rubocop errors * Refactored track_activity to remove excessive rubocop disables, updated activity setting for group and subgroup deletion, updated translations. Also removed system arguments from activity components as the variable is never used
- Loading branch information
1 parent
622a807
commit b92a2b4
Showing
30 changed files
with
522 additions
and
64 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
app/components/activities/group_activity_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<% if transfer_out %> | ||
<%= t( | ||
"#{@activity[:key]}", | ||
user: @activity[:user], | ||
project_puid: @activity[:project_puid], | ||
old_namespace: @activity[:old_namespace], | ||
new_namespace: @activity[:new_namespace], | ||
group_puid: @activity[:group].puid, | ||
) %> | ||
<% elsif group_link %> | ||
<% grp = | ||
( | ||
if @activity[:transferred_group].nil? | ||
@activity[:created_group] | ||
else | ||
@activity[:transferred_group] | ||
end | ||
) %> | ||
<%= t( | ||
"#{@activity[:key]}", | ||
user: @activity[:user], | ||
href: | ||
link_to( | ||
grp.puid, | ||
group_path(grp), | ||
class: "text-slate-800 dark:text-slate-300 font-medium hover:underline", | ||
), | ||
old_namespace: @activity[:old_namespace], | ||
new_namespace: @activity[:new_namespace], | ||
) %> | ||
<% elsif project_link %> | ||
<%= t( | ||
"#{@activity[:key]}", | ||
user: @activity[:user], | ||
href: | ||
link_to( | ||
@activity[:project].puid, | ||
namespace_project_samples_path(@activity[:group], @activity[:project]), | ||
class: "text-slate-800 dark:text-slate-300 font-medium hover:underline", | ||
), | ||
old_namespace: @activity[:old_namespace], | ||
new_namespace: @activity[:new_namespace], | ||
) %> | ||
<% else %> | ||
<%= t( | ||
"#{@activity[:key]}", | ||
user: @activity[:user], | ||
name: @activity[:name], | ||
href: @activity[:project_puid], | ||
project_puid: @activity[:project_puid], | ||
removed_group_puid: @activity[:removed_group_puid], | ||
old_namespace: @activity[:old_namespace], | ||
new_namespace: @activity[:new_namespace], | ||
group_puid: @activity[:group].puid, | ||
) %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
module Activities | ||
# Component for rendering an activity of type Namespace for Projects | ||
class GroupActivityComponent < Component | ||
def initialize(activity: nil) | ||
@activity = activity | ||
end | ||
|
||
def project_link | ||
@activity[:group] && @activity[:project] && !@activity[:project].namespace.nil? | ||
end | ||
|
||
def group_link | ||
(@activity[:transferred_group] && @activity[:action] == 'group_namespace_transfer') || | ||
(@activity[:created_group] && @activity[:action] == 'group_subgroup_create') | ||
end | ||
|
||
def transfer_out | ||
@activity[:key].include?('transfer_out') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.