simple_teams 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 567aba40fd5afd3451c19e11fe6eeea9bfe7759a880e44f08de06cf408163d69
4
- data.tar.gz: 8998c1d483358d8eae9177d2e2f7511fc0548838140943424732fa2188450b84
3
+ metadata.gz: c7269707d1cb9ecf7ebc402e57e9c0575d859ae09423b37679fd952a6542e02a
4
+ data.tar.gz: d91aa3498e0dbf574afdf1280ffa87e4614da9e45a5c6aaf4e263cb23929df36
5
5
  SHA512:
6
- metadata.gz: 26b0d136ea943750ca8e1db97bba98cdaa182d9eaba09f7c2d3b5d7688b5cac0395bb757b8984e17a3f3a422cf6f71558fa4ac3688d3824c80d8a12eec801a53
7
- data.tar.gz: 4377afe7493f8a876c52657587f489d16a22aeac639ed46bdd0136a286bf3e836a51b550e77fa2f16da32d2e174a37ef30806497cdf8470fca057a21f3754fb0
6
+ metadata.gz: 22d4b9d0f0b45b10b6636ae23d2d5f6f48af925dfb494394c9c6db51c1cfc59b69cf02d75890f96f7cf8f168ee63081ce4d36284aa6d9729d6157ec70b87ad48
7
+ data.tar.gz: 1b0fd8305e5140e901b4849c676acd8b07331dfff4d487ff490b794e47fd1eb9a4c78aa55febc008a913d45eef9c7b5cd56be362bf03e2450d9d60c9d8e78dc5
data/README.md CHANGED
@@ -2,27 +2,32 @@
2
2
  SimpleTeams is an all-in-one solution for implementing teams quickly in a Ruby on Rails (RoR) application. It follows best practices, using the Rails Engine design pattern for easy configurability, CanCan for authorization, and polymorphic association (like ActiveStorage) to avoid dictating model names.
3
3
 
4
4
  ## STATUS
5
- SimpleTeams is actually in use within several client-facing applications. However, the gem is still under development, and notably lacks standalone testing.
5
+ SimpleTeams is in use within several client-facing applications. However, the gem is still under development, and notably lacks standalone testing.
6
6
 
7
7
  That said, feel free to try it out, and let us know if you have any comments/questions. Just make sure to test things thoroughly, and be patient with the (sparse) documentation.
8
8
 
9
9
  ## Installation
10
- 1. Add simple\_teams to your Gemfile and run bundle install
10
+ 1. Add simple_teams to your Gemfile and run bundle install
11
11
 
12
12
  2. Add the necessary initializers to your config directory (NEED TO ADD DETAILS)
13
- a. devise.rb (see devise gem for further details)
14
- b. simple\_form.rb (see simple\_form gem for further details)
15
- c. simple\_teams.rb (NEED TO MAKE THIS AN INSTALL SCRIPT)
13
+
14
+ - devise.rb (see devise gem for further details)
15
+
16
+ - simple\_form.rb (see simple_form gem for further details)
17
+
18
+ - simple\_teams.rb (NEED TO MAKE THIS AN INSTALL SCRIPT)
16
19
 
17
20
  3. Install the necessary migrations for simple\_teams and it's dependencies
18
- `
21
+
22
+ ```
19
23
  devise generate User
20
24
  rails noticed:install:migrations
21
- rails simple\_teams:install:migrations
22
- `
25
+ rails simple_teams:install:migrations
26
+ ```
23
27
 
24
28
  4. Add the SimpleTeams concerns to the desired models. E.g.
25
- `
29
+
30
+ ```
26
31
  #app/models/user.rb
27
32
  class User
28
33
  include SimpleTeams::MemberObject
@@ -32,11 +37,11 @@ class User
32
37
  class Organization
33
38
  include SimpleTeams::TeamObject
34
39
  ...
35
- `
40
+ ```
36
41
 
37
42
  5. Make sure to initialize the TeamObject properly via the InitializeTeamService to specify the owner of the team. E.g.
38
43
 
39
- `
44
+ ```
40
45
  #within the create action of app/controllers/organizations_controller.rb
41
46
 
42
47
  def create
@@ -44,17 +49,17 @@ def create
44
49
  SimpleTeams::InitializeTeamService.new(current_user, @organization.team).perform
45
50
  redirect_to @organization, ...
46
51
  ...
47
- `
52
+ ```
48
53
 
49
54
  ## Usage
50
55
  1. SimpleTeams comes pre-packaged with all of the necessary controllers and views for adding/updating/removing team members. For the default functionality, you can simply link from the teamable object (e.g. the "Organization") to the team for users to view/manage these permissions. E.g.
51
56
 
52
- `
57
+ ```
53
58
  #app/views/organizations/show.html.erb
54
- ...
59
+
55
60
  link_to "Organization Roles", simple_teams.team_path(@organization.team)
56
- ...
57
- `
61
+
62
+ ```
58
63
 
59
64
  2. The breadcrumbs in these views will reference the default routes for the teamable resource automatically. E.g.
60
65
  Organizations / Test Organization / Team Members
@@ -3,10 +3,11 @@
3
3
  Actions
4
4
  </button>
5
5
  <ul class="dropdown-menu" aria-labelledby="<%= @team.id %>-dropdown-menu">
6
- <%= link_to "Invite Users", new_team_invitation_path(@team), :class => "dropdown-item" %>
6
+ <% if can? :create, @team.invitations.new %>
7
+ <%= link_to "Invite Users", new_team_invitation_path(@team), :class => "dropdown-item" %>
8
+ <% end %>
7
9
 
8
10
  <% if current_user.membership_for_team(@team).present? %>
9
- <li><hr class="dropdown-divider"></li>
10
11
  <%= button_to "Leave", team_leave_team_path(@team), :method => :delete, :class => "btn btn-link dropdown-item", :form => { :data => { "turbo-confirm" => "Are you sure you want to leave this #{ @team.teamable.class.model_name.human }?" } } %>
11
12
  <% end %>
12
13
  </ul>
@@ -8,4 +8,6 @@
8
8
 
9
9
  <%= render "members_table" %>
10
10
 
11
- <%= render "add_member_link" %>
11
+ <% if can? :create, @team.invitations.new %>
12
+ <%= render "add_member_link" %>
13
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module SimpleTeams
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_teams
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Laney Stroup
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-04 00:00:00.000000000 Z
11
+ date: 2025-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails