-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add Provider partnerships to training partners #4842
Add Provider partnerships to training partners #4842
Conversation
67c7509
to
c07bc99
Compare
c07bc99
to
d1ecd43
Compare
84c8a43
to
1e75af8
Compare
incomplete_sections_hash.keys.select { |section| send(section) }.map do |section| | ||
Section.new(name: "add #{incomplete_section_article(section)} #{incomplete_section_label_suffix(section)}", path: incomplete_sections_hash[section]) | ||
end | ||
end |
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.
Can we simplify by going direct on the view?
<li>
<%= govuk_link_to(add_school_text, school_path) %>
<%= govuk_link_to(add_accredited_partner, add_accredited_partner_path) %>
</li>
Then the component will be more simple to read and understand.
Or another alternative to use functional?
def incomplete_sections
conditions = {
school: -> { provider.sites.empty? },
accredited_partner: -> { !(provider.accredited_provider? || provider.accredited_partners.any?) }
}
conditions
.select { |_key, predicate| predicate.call }
.map { |key, _| build_section(key) }
end
private
def build_section(key)
Section.new(
name: I18n.t("incomplete_sections.#{key}.name"),
path: send("#{key}_path")
)
end
def school_path
...
end
def accredited_partner_path
....
end
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.
@tomas-stefano I've made a change to the AddCourseButton. Tell me if you're happy enough to proceed
I Changed the partnerships version to AddCourseButton
from AddCourseButtonPartnerships
. And changed the one we'll delete later from AddCourseButton
to AddCourseButtonEnrichments
.
I've also simplified the logic in the component dramatically, I think.
44cc9fe
to
a3d0787
Compare
def accredited_provider_present? | ||
return true if accredited_provider? | ||
|
||
provider.accredited_providers.any? |
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.
provider.accredited_providers.any? | |
accredited_provider? || provider.accredited_providers.any? |
def accredited_provider_not_present? | ||
return false if provider.accredited? | ||
|
||
!accredited_provider_present? |
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.
Can this simplified by the same idea? https://github.com/DFE-Digital/publish-teacher-training/pull/4842/files#r1926738703
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 is getting deleted after the switch to provider partnerships
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.
Minor non blocking comments but all good to me
a3d0787
to
ce5c77a
Compare
1daed7d
to
b8d8eca
Compare
Context
Accredited provider users can inspect their training partners in the Publish UI.
The list of Training providers is populated via the accredited providers ratifying of courses.
Changes proposed in this pull request
/training-providers
to/training-partners
Guidance to review
Course ratification has not been implemented yet so we cannot set an accredited partner to be the ratifying provider for a course yet.
The review app has provider partnerships enabled.
Training partners
Training partners courses
Trello
https://trello.com/c/kA22cSN0/393-add-providerpartnerships-to-training-partners