-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dm 4266 fix partner practices imgs (#726)
* add practice_partners and practice_partner_practices factories update spec to use factories * spacing * add utilities js for practice_parnter_practices * remove extra js include tag * add js include tags for practice_partners show * invoke `replaceImagePlaceholders` function for paginated partner practices * spacing * spacing * spacing
- Loading branch information
1 parent
989a8c4
commit 85c01ec
Showing
8 changed files
with
74 additions
and
38 deletions.
There are no files selected for viewing
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
9 changes: 9 additions & 0 deletions
9
app/assets/javascripts/_practice_partner_practices_utilities.es6
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,9 @@ | ||
(($) => { | ||
const $document = $(document); | ||
|
||
function execPageBuilderFunctions() { | ||
replaceImagePlaceholders(); | ||
} | ||
|
||
$document.on('turbolinks:load', execPageBuilderFunctions); | ||
})(window.jQuery); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FactoryBot.define do | ||
factory :practice_partner_practice do | ||
association :practice_partner | ||
association :practice | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FactoryBot.define do | ||
factory :practice_partner do | ||
name { Faker::Company.unique.name } | ||
short_name { Faker::Company.unique.name } # Generates a 3-letter initials | ||
description { Faker::Lorem.paragraph } | ||
position { Faker::Number.non_zero_digit } | ||
color { Faker::Color.hex_color } | ||
icon { Faker::Lorem.word } | ||
|
||
trait :not_major_partner do | ||
is_major { false } | ||
end | ||
|
||
is_major { true } | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
require 'rails_helper' | ||
describe 'Practice partners pages', type: :feature do | ||
before do | ||
@pp = PracticePartner.create!(name: 'Diffusion of Excellence', short_name: '', description: 'The Diffusion of Excellence Initiative helps to identify and disseminate clinical and administrative best innovations through a learning environment that empowers its top performers to apply their innovative ideas throughout the system — further establishing VA as a leader in health care while promoting positive outcomes for Veterans.', icon: 'fas fa-heart', color: '#E4A002', is_major: true) | ||
@pp_2 = PracticePartner.create!(name: 'Awesome Practice Partner', short_name: 'APP', description: 'Hello world') | ||
@user = User.create!(email: '[email protected]', password: 'Password123', password_confirmation: 'Password123', skip_va_validation: true, confirmed_at: Time.now, accepted_terms: true) | ||
@user2 = User.create!(email: '[email protected]', password: 'Password123', password_confirmation: 'Password123', skip_va_validation: true, confirmed_at: Time.now, accepted_terms: true) | ||
@admin = User.create!(email: '[email protected]', password: 'Password123', password_confirmation: 'Password123', skip_va_validation: true, confirmed_at: Time.now, accepted_terms: true) | ||
@approver = User.create!(email: '[email protected]', password: 'Password123', password_confirmation: 'Password123', skip_va_validation: true, confirmed_at: Time.now, accepted_terms: true) | ||
@pp = create(:practice_partner, name: 'Diffusion of Excellence', short_name: '', description: 'The Diffusion of Excellence Initiative helps to identify and disseminate clinical and administrative best innovations through a learning environment that empowers its top performers to apply their innovative ideas throughout the system — further establishing VA as a leader in health care while promoting positive outcomes for Veterans.', icon: 'fas fa-heart', color: '#E4A002') | ||
@pp_2 = create(:practice_partner, :not_major_partner, name: 'Awesome Practice Partner', short_name: 'APP', description: 'Hello world') | ||
@user = create(:user, email: '[email protected]', password: 'Password123', password_confirmation: 'Password123', skip_va_validation: true, confirmed_at: Time.now, accepted_terms: true) | ||
@user2 = create(:user, email: '[email protected]', password: 'Password123', password_confirmation: 'Password123', skip_va_validation: true, confirmed_at: Time.now, accepted_terms: true) | ||
@admin = create(:user, email: '[email protected]', password: 'Password123', password_confirmation: 'Password123', skip_va_validation: true, confirmed_at: Time.now, accepted_terms: true) | ||
@approver = create(:user, email: '[email protected]', password: 'Password123', password_confirmation: 'Password123', skip_va_validation: true, confirmed_at: Time.now, accepted_terms: true) | ||
@admin.add_role(User::USER_ROLES[1].to_sym) | ||
@approver.add_role(User::USER_ROLES[0].to_sym) | ||
@pr_1 = Practice.create!(name: 'A public practice', approved: true, published: true, enabled: true, is_public: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_2 = Practice.create!(name: 'practice two', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_3 = Practice.create!(name: 'practice three', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_4 = Practice.create!(name: 'practice four', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_5 = Practice.create!(name: 'practice five', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_6 = Practice.create!(name: 'practice six', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_7 = Practice.create!(name: 'practice seven', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_8 = Practice.create!(name: 'practice eight', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_9 = Practice.create!(name: 'practice nine', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_10 = Practice.create!(name: 'practice ten', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_11 = Practice.create!(name: 'practice eleven', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_12 = Practice.create!(name: 'practice twelve', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_13 = Practice.create!(name: 'practice thirteen', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
Practice.create!(name: 'random practice', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_1) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_2) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_3) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_4) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_5) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_6) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_7) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_8) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_9) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_10) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_11) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_12) | ||
PracticePartnerPractice.create!(practice_partner: @pp, practice: @pr_13) | ||
@pr_1 = create(:practice, name: 'A public practice', approved: true, published: true, enabled: true, is_public: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_2 = create(:practice, name: 'practice two', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_3 = create(:practice, name: 'practice three', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_4 = create(:practice, name: 'practice four', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_5 = create(:practice, name: 'practice five', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_6 = create(:practice, name: 'practice six', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_7 = create(:practice, name: 'practice seven', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_8 = create(:practice, name: 'practice eight', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_9 = create(:practice, name: 'practice nine', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_10 = create(:practice, name: 'practice ten', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_11 = create(:practice, name: 'practice eleven', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_12 = create(:practice, name: 'practice twelve', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
@pr_13 = create(:practice, name: 'practice thirteen', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
create(:practice, name: 'random practice', approved: true, published: true, enabled: true, initiating_facility_type: 'other', user: @user2) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_1) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_2) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_3) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_4) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_5) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_6) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_7) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_8) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_9) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_10) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_11) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_12) | ||
create(:practice_partner_practice, practice_partner: @pp, practice: @pr_13) | ||
end | ||
|
||
context 'for a logged in user' do | ||
|