Skip to content

Commit aed879f

Browse files
authored
CORE-986: Fix color contrast of signup heading (#1645)
* CORE-986: Fix color contrast of signup heading [CORE-986] New color contrast ratio is 5. Also moved the disabled-submit styling to CSS Also added some JS to control the disabled state of the Continue button on login. * CORE-1047 Because this is so tiny, I'm rolling it in here. Fixes contrast of Show/Hide label (which is a problem when the input is in an error state - pink) * Remove test for blank email; submit is disabled if email is blank
1 parent 66fbaf9 commit aed879f

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

app/assets/javascripts/newflow/newflow_ui.js.coffee

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@ NewflowUi = do () ->
22
disableButton: (selector) ->
33
$(selector).attr('disabled', 'disabled')
44
$(selector).addClass('ui-state-disabled ui-button-disabled')
5-
$(selector).css({
6-
'background': '#ccc',
7-
'box-shadow': 'none',
8-
'color': '#666'
9-
})
105

116
enableButton: (selector) ->
127
$(selector).removeAttr('disabled')
138
$(selector).removeClass('ui-state-disabled ui-button-disabled')
149
$(selector).button()
15-
$(selector).css({ 'background': '', 'box-shadow': '', 'color': '' })
1610

1711
renderAndOpenDialog: (html_id, content, modal_options = {}) ->
1812
if $('#' + html_id).exists() then $('#' + html_id).remove()

app/assets/stylesheets/newflow.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ label.required::after {
223223
top: 3.7rem;
224224
right: 1.8rem;
225225

226-
color: #027EB5;
226+
color: #0070af;
227227
font-weight: bold;
228228
cursor: pointer;
229229

@@ -674,7 +674,7 @@ $very-narrow: 37rem * $scale-factor;
674674
padding-right: 0;
675675

676676
background-color: #f1f1f1;
677-
color: #c1c1c1;
677+
color: #666666;
678678

679679
@include title-font(2.4rem);
680680
text-align: center;
@@ -774,10 +774,12 @@ $very-narrow: 37rem * $scale-factor;
774774

775775
input[type=submit] {
776776
&:disabled {
777+
background-color: #ccc;
778+
box-shadow: none;
779+
color: #666;
777780
opacity: 0.85;
778781
}
779782

780-
-webkit-appearance: none;
781783
border-radius: 0;
782784
}
783785
}

app/views/newflow/login/login_form.html.erb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
<%= f.submit I18n.t(:"login_signup_form.continue_button"),
9494
disable_with: I18n.t(:"login_signup_form.continue_button"),
9595
class: 'primary',
96-
data: { ga_category: 'Login', ga_action: 'Click', ga_label: 'Email' }
96+
data: { ga_category: 'Login', ga_action: 'Click', ga_label: 'Email' },
97+
disabled: 'disabled'
9798
%>
9899
</div>
99100

@@ -118,5 +119,18 @@
118119

119120
<script type="text/javascript">
120121
NewflowUi.focusOnFirstErrorItem();
122+
const $requiredInputs = $('form input[aria-required="true"]');
123+
const handleDisable = () => {
124+
const disableSubmit = $requiredInputs.toArray().some((i) => i.value.length == 0);
125+
126+
if (disableSubmit) {
127+
NewflowUi.disableButton('form [type="submit"]');
128+
} else {
129+
NewflowUi.enableButton('form [type="submit"]');
130+
}
131+
}
132+
133+
$requiredInputs.on('input', handleDisable);
134+
handleDisable();
121135
</script>
122136

spec/features/newflow/user_cant_sign_in_spec.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@
1717
screenshot!
1818
end
1919

20-
scenario "email blank" do
21-
newflow_log_in_user('', 'password')
22-
expect(page).to have_content(error_msg Newflow::LogInUser, :email, :blank)
23-
screenshot!
24-
end
20+
# Removed test for blank email; blank email is not allowed
2521

2622
scenario "multiple accounts match email but no usernames" do
2723
# For a brief window in 2017 users could sign up with [email protected] and [email protected]

0 commit comments

Comments
 (0)