forked from fixin.me/fixin.me
Compare commits
2 Commits
16af631fae
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 376640cfd7 | |||
| 65edb866d0 |
@@ -231,12 +231,17 @@ textarea:invalid {
|
|||||||
text-decoration: underline 1px var(--color-border-gray);
|
text-decoration: underline 1px var(--color-border-gray);
|
||||||
text-underline-offset: 0.25em;
|
text-underline-offset: 0.25em;
|
||||||
}
|
}
|
||||||
[name=cancel],
|
|
||||||
.auxiliary {
|
.auxiliary {
|
||||||
border-color: var(--color-border-gray);
|
border-color: var(--color-nav-gray);
|
||||||
color: var(--color-nav-gray);
|
color: var(--color-nav-gray);
|
||||||
fill: var(--color-nav-gray);
|
fill: var(--color-nav-gray);
|
||||||
}
|
}
|
||||||
|
table .button {
|
||||||
|
border-color: var(--color-border-gray);
|
||||||
|
font-weight: normal;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0.4em;
|
||||||
|
}
|
||||||
.button:focus-visible,
|
.button:focus-visible,
|
||||||
.tab:focus-visible,
|
.tab:focus-visible,
|
||||||
.tab:hover {
|
.tab:hover {
|
||||||
@@ -259,13 +264,6 @@ textarea:invalid {
|
|||||||
color: var(--color-blue);
|
color: var(--color-blue);
|
||||||
text-decoration-color: var(--color-blue);
|
text-decoration-color: var(--color-blue);
|
||||||
}
|
}
|
||||||
table .button {
|
|
||||||
border-color: var(--color-border-gray);
|
|
||||||
color: var(--color-table-gray);
|
|
||||||
font-weight: normal;
|
|
||||||
height: 100%;
|
|
||||||
padding: 0.4em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* NOTE: collapse gaps around empty rows (`topside`) once possible with
|
/* NOTE: collapse gaps around empty rows (`topside`) once possible with
|
||||||
@@ -360,20 +358,20 @@ header {
|
|||||||
line-height: 2.2em;
|
line-height: 2.2em;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
.flash:before {
|
.flash::before {
|
||||||
filter: invert();
|
filter: invert(1);
|
||||||
height: 1.4em;
|
height: 1.4em;
|
||||||
margin: 0 0.5em;
|
margin: 0 0.5em;
|
||||||
width: 1.4em;
|
width: 1.4em;
|
||||||
}
|
}
|
||||||
.flash.alert:before {
|
.flash.alert::before {
|
||||||
content: url('pictograms/alert-outline.svg');
|
content: url('pictograms/alert-outline.svg');
|
||||||
}
|
}
|
||||||
.flash.alert {
|
.flash.alert {
|
||||||
border-color: var(--color-red);
|
border-color: var(--color-red);
|
||||||
background-color: var(--color-red);
|
background-color: var(--color-red);
|
||||||
}
|
}
|
||||||
.flash.notice:before {
|
.flash.notice::before {
|
||||||
content: url('pictograms/check-circle-outline.svg');
|
content: url('pictograms/check-circle-outline.svg');
|
||||||
}
|
}
|
||||||
.flash.notice {
|
.flash.notice {
|
||||||
@@ -437,15 +435,18 @@ header {
|
|||||||
|
|
||||||
.tabular-form table {
|
.tabular-form table {
|
||||||
border: none;
|
border: none;
|
||||||
border-spacing: 0.4em 0;
|
border-spacing: 0;
|
||||||
margin-inline: -0.4em;
|
|
||||||
}
|
}
|
||||||
.tabular-form table td {
|
.tabular-form table td {
|
||||||
border: none;
|
border: none;
|
||||||
|
padding-inline-start: 0.4em;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.tabular-form table td {
|
.tabular-form table td:first-child {
|
||||||
padding-inline: 0;
|
padding-inline-start: 0;
|
||||||
|
}
|
||||||
|
.tabular-form table td:last-child {
|
||||||
|
padding-inline-end: 0;
|
||||||
}
|
}
|
||||||
.tabular-form table :is(form, input, select, textarea):only-child {
|
.tabular-form table :is(form, input, select, textarea):only-child {
|
||||||
margin-inline-start: 0;
|
margin-inline-start: 0;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
<div class="flex reverse">
|
<div class="flex reverse">
|
||||||
<%= form.button id: :create_measurement_button, disabled: true -%>
|
<%= form.button id: :create_measurement_button, disabled: true -%>
|
||||||
<%= image_link_to t(:cancel), "close-outline", measurements_path, name: :cancel,
|
<%= image_link_to t(:cancel), "close-outline", measurements_path, name: :cancel,
|
||||||
class: 'dangerous', onclick: render_turbo_stream('form_close') %>
|
class: 'auxiliary dangerous', onclick: render_turbo_stream('form_close') %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,4 @@ Rails.application.configure do
|
|||||||
# config.action_view.annotate_rendered_view_with_filenames = true
|
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||||
|
|
||||||
config.log_level = :info
|
config.log_level = :info
|
||||||
|
|
||||||
# Allow Capybara's dynamic test server host (127.0.0.1:<random_port>)
|
|
||||||
config.hosts << '127.0.0.1'
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -25,9 +25,10 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
|||||||
user
|
user
|
||||||
end
|
end
|
||||||
|
|
||||||
def inject_button_to(after, *button_options)
|
def inject_button_to(inside, *button_options)
|
||||||
button = button_to *button_options
|
button = button_to *button_options
|
||||||
evaluate_script("arguments[0].insertAdjacentHTML('beforeend', '#{button.html_safe}');", after)
|
inside.evaluate_script("this.insertAdjacentHTML('beforeend', arguments[0]);",
|
||||||
|
button.html_safe)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Allow skipping interpolations when translating for testing purposes
|
# Allow skipping interpolations when translating for testing purposes
|
||||||
|
|||||||
@@ -227,9 +227,10 @@ class UsersTest < ApplicationSystemTestCase
|
|||||||
|
|
||||||
within all(:xpath, "//tbody//tr[not(descendant::select)]").sample do |tr|
|
within all(:xpath, "//tbody//tr[not(descendant::select)]").sample do |tr|
|
||||||
user = User.find_by_email!(first(:link).text)
|
user = User.find_by_email!(first(:link).text)
|
||||||
inject_button_to first('td:not(.link)'), "update status", user_path(user), method: :patch,
|
inject_button_to find('td', exact_text: user.status), "update status",
|
||||||
|
user_path(user), method: :patch,
|
||||||
params: {user: {status: User.statuses.keys.sample}}, data: {turbo: false}
|
params: {user: {status: User.statuses.keys.sample}}, data: {turbo: false}
|
||||||
execute_script("arguments[0].click()", find_button("update status"))
|
click_on "update status"
|
||||||
end
|
end
|
||||||
assert_title 'The change you wanted was rejected (422)'
|
assert_title 'The change you wanted was rejected (422)'
|
||||||
end
|
end
|
||||||
@@ -237,8 +238,8 @@ class UsersTest < ApplicationSystemTestCase
|
|||||||
test 'update status forbidden for non admin' do
|
test 'update status forbidden for non admin' do
|
||||||
sign_in user: users.reject(&:admin?).select(&:confirmed?).sample
|
sign_in user: users.reject(&:admin?).select(&:confirmed?).sample
|
||||||
visit units_path
|
visit units_path
|
||||||
inject_button_to find('body'), "update status", user_path(User.all.sample), method: :patch,
|
inject_button_to find('body'), "update status", user_path(User.all.sample),
|
||||||
params: {user: {status: User.statuses.keys.sample}}
|
method: :patch, params: {user: {status: User.statuses.keys.sample}}
|
||||||
click_on "update status"
|
click_on "update status"
|
||||||
assert_text t('actioncontroller.exceptions.status.forbidden')
|
assert_text t('actioncontroller.exceptions.status.forbidden')
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user