-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update delivery options to radio tile * remove forms permissions invite form in favor of /admin/invite
- Loading branch information
1 parent
4645022
commit 7576376
Showing
7 changed files
with
34 additions
and
62 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
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 |
---|---|---|
|
@@ -129,37 +129,20 @@ | |
</div> | ||
|
||
<div class="well"> | ||
<%= form_with(model: current_user, url: "invite", local: true) do |f| %> | ||
<div class="grid-row grid-gap-md"> | ||
<div class="tablet:grid-col-12"> | ||
<p> | ||
Don't see a user in the dropdown? | ||
</p> | ||
<div class="grid-row grid-gap-md"> | ||
<div class="tablet:grid-col-12 usa-prose"> | ||
<p class="text-bold"> | ||
Don't see a user in the User dropdown? | ||
</p> | ||
|
||
<div class="field"> | ||
<%= label_tag :refer_user, "Invite a colleague to Touchpoints", class: "usa-label" %> | ||
<%= f.email_field :refer_user, class: "usa-input", placeholder: "[email protected]" %> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<br> | ||
<%= f.submit "Invite User", class: "usa-button", id: "invite-button", disabled: true %> | ||
<br> | ||
<%= link_to "Invite a User to Touchpoints", admin_invite_path, class: "usa-button usa-button--outline full-width" %> | ||
|
||
<p> | ||
After the user signs into Touchpoints, they will be available to select in the user dropdown. | ||
</p> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
$(function(){ | ||
$("#user_refer_user").on("keyup", function(event) { | ||
if(event.target.value != '' && event.target.value.length > 5) { | ||
$("#invite-button").attr('disabled', false); | ||
} else { | ||
$("#invite-button").attr('disabled', true); | ||
} | ||
}); | ||
}); | ||
</script> | ||
</div> | ||
</div> |
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 |
---|---|---|
|
@@ -143,7 +143,7 @@ | |
find('label', text: 'Display square (80px wide by 80px tall) logo?').click | ||
click_on 'Update logo' | ||
click_on 'Delivery' | ||
find('label', text: 'Hosted only on the touchpoints site').click | ||
find('label', text: 'Hosted on touchpoints').click | ||
click_on 'Update Form' | ||
expect(page).to have_content('Form was successfully updated.') | ||
visit example_admin_form_path(Form.last) | ||
|
@@ -166,7 +166,7 @@ | |
find('label', text: 'Display square (80px wide by 80px tall) logo?').click | ||
click_on 'Update logo' | ||
click_on 'Delivery' | ||
find('label', text: 'Embedded inline on your site').click | ||
find('label', text: 'Embedded inline on your website').click | ||
fill_in('form_element_selector', with: 'test_selector') | ||
click_on 'Update Form' | ||
expect(page).to have_content('Form was successfully updated.') | ||
|
@@ -1551,20 +1551,20 @@ | |
|
||
context 'with a valid email' do | ||
before do | ||
visit permissions_admin_form_path(form) | ||
visit admin_invite_path(form) | ||
end | ||
|
||
it 'sends an invite to the designated user' do | ||
fill_in('user[refer_user]', with: '[email protected]') | ||
click_on 'Invite User' | ||
expect(page).to have_content('Invite sent to [email protected]') | ||
expect(page.current_path).to eq(permissions_admin_form_path(form)) | ||
expect(page.current_path).to eq(admin_invite_path) | ||
end | ||
end | ||
|
||
context 'with an invalid email' do | ||
before do | ||
visit permissions_admin_form_path(form) | ||
visit admin_invite_path | ||
end | ||
|
||
it 'initially disabled button shows an alert when at least 6 characters of an invalid email address is provided' do | ||
|
@@ -1577,14 +1577,14 @@ | |
expect(find("#invite-button").disabled?).to be(false) | ||
click_on 'Invite User' | ||
expect(page).to have_content('Please enter a valid .gov or .mil email address') | ||
expect(page.current_path).to eq(permissions_admin_form_path(form)) | ||
expect(page.current_path).to eq(admin_invite_path) | ||
end | ||
|
||
it 'shows a gov-specific user alert when the email address is not a valid email' do | ||
fill_in('user[refer_user]', with: '[email protected]') | ||
click_on 'Invite User' | ||
expect(page).to have_content('Please enter a valid .gov or .mil email address') | ||
expect(page.current_path).to eq(permissions_admin_form_path(form)) | ||
expect(page.current_path).to eq(admin_invite_path) | ||
end | ||
|
||
context 'when using GitHub for oAuth' do | ||
|
@@ -1609,7 +1609,7 @@ | |
fill_in('user[refer_user]', with: user.email) | ||
click_on 'Invite User' | ||
expect(page).to have_content("User with email #{user.email} already exists") | ||
expect(page.current_path).to eq(permissions_admin_form_path(form)) | ||
expect(page.current_path).to eq(admin_invite_path) | ||
end | ||
end | ||
end | ||
|