Repository navigation
Add optional organization association to workshops and workshop ideas… #2747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
1steve78
wants to merge
8
commits into
rubyforgood:main
Choose a base branch
from
1steve78:add-organization-to-workshop-and-ideas
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3cc3aea
Add optional organization association to workshops and workshop ideas…
1steve78 b1f32ee
Safely handle nil @organizations in workshop and workshop idea forms
1steve78 e8bc410
Merge branch 'main' into add-organization-to-workshop-and-ideas
1steve78 72bcf38
Merge branch 'main' into add-organization-to-workshop-and-ideas
1steve78 8d067a9
Update schema version to include organization migrations
1steve78 7bb639b
Address workshop organization review feedback
1steve78 11e98b3
Fix workshop idea title collision in organization spec
1steve78 98f19ec
Merge upstream/main and resolve conflict in workshop_ideas_spec.rb
1steve78 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
|
|
||
| <% promoted_to_workshop = f.object.workshops.any? %> | ||
| <% if promoted_to_workshop %> | ||
| <%= f.hidden_field :organization_id, value: f.object.organization_id %> | ||
| <div class="admin-only m-3 bg-yellow-100 p-3"> | ||
| This workshops idea has been promoted to a | ||
| <% f.object.workshops.each do |workshop| %> | ||
|
|
@@ -62,6 +63,31 @@ | |
| </div> | ||
| </div> | ||
|
|
||
| <!-- Organization --> | ||
| <div class="mb-6 grid grid-cols-1 gap-6 md:grid-cols-2"> | ||
| <div> | ||
| <% organizations = @organizations || [] %> | ||
| <% if organizations.size == 1 %> | ||
| <%= f.hidden_field :organization_id, | ||
| value: f.object.organization_id || organizations.first.id %> | ||
| <% else %> | ||
| <%= f.input :organization_id, | ||
| as: :select, | ||
| collection: organizations, | ||
| label_method: :type_name, | ||
| value_method: :id, | ||
| label: "Organization", | ||
| required: false, | ||
| disabled: promoted_to_workshop, | ||
| include_blank: "Select organization", | ||
| selected: (params[:organization_id].presence || f.object.organization_id), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need |
||
| hint: "Please contact AWBW if your organization is not listed.", | ||
| input_html: { class: "block w-full rounded-md border-gray-300 shadow-sm focus:ring-blue-500 focus:border-blue-500 sm:text-sm #{"readonly" if promoted_to_workshop}" }, | ||
| label_html: { class: "block text-sm font-medium text-gray-700 mb-1" } %> | ||
| <% end %> | ||
| </div> | ||
| </div> | ||
|
|
||
| <% if allowed_to?(:manage?, WorkshopIdea) %> | ||
| <div class="rounded bg-white pb-6"> | ||
| <div class="admin-only flex items-center gap-x-2 bg-blue-100 p-3"> | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
5 changes: 5 additions & 0 deletions
5
db/migrate/20261018123639_add_organization_to_workshop_ideas.rb
This file contains hidden or 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,5 @@ | ||
| class AddOrganizationToWorkshopIdeas < ActiveRecord::Migration[8.1] | ||
| def change | ||
| add_reference :workshop_ideas, :organization, type: :integer, null: true, foreign_key: true | ||
| end | ||
| end |
This file contains hidden or 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,5 @@ | ||
| class AddOrganizationToWorkshops < ActiveRecord::Migration[8.1] | ||
| def change | ||
| add_reference :workshops, :organization, type: :integer, null: true, foreign_key: true | ||
| end | ||
| end |
This file contains hidden or 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
8 changes: 8 additions & 0 deletions
8
db/seeds/features/2026-10-22-organization-workshops-and-ideas.yml
This file contains hidden or 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,8 @@ | ||
| name: "Workshops and ideas on organization profiles" | ||
| area: content | ||
| display_status: user_facing | ||
| released_on: 2026-10-22 | ||
| action_path: "/organizations" | ||
| summary: >- | ||
| Workshops and workshop ideas now link to organizations directly and display on | ||
| organization profiles, including content authored by affiliated facilitators. |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this wasn't in the spec, but on org profile we should put both workshops/ideas that are directly connected to the organization, and, also pull through the Affiliation > Person > Workshops/ideas authored (not user_id). would you be ok to add that this this pr so the list that shows on Org profile shows directly and indirectly associated workshops and ideas?