Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions app/assets/stylesheets/components/_personal-key.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
.key-badge {
position: relative;
.personal-key-block {
@include u-padding-y(2);
background-image: url('personal-key/pkey-block.svg');
background-position: center;
background-repeat: no-repeat;

@include at-media('tablet') {
@include u-padding-x(1);
}
}

.separator-text__code {
.personal-key-block__code {
@include u-font-family('mono');
font-size: 1.5rem;

Expand All @@ -17,21 +24,6 @@
}
}

@include at-media('tablet') {
.separator-text > div {
&::after {
color: #000;
padding: 0 0.5rem;
}
}
}
Comment on lines -20 to -27
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As can be seen in the actual implementation, there are no <div> elements inside this element, so these styles were not doing anything and can be removed.


.bg-pk-box {
background-image: url('personal-key/pkey-block.svg');
background-position: center;
background-repeat: no-repeat;
}

.bg-personal-key {
height: 145px;
background-image: url('personal-key/shield.svg');
Expand Down
4 changes: 2 additions & 2 deletions app/views/partials/personal_key/_key.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<%= t('users.personal_key.header') %>
</h2>
<div class="bg-personal-key padding-top-4 margin-y-2">
<div class="padding-x-0 tablet:padding-x-1 padding-y-2 separator-text bg-pk-box">
<div class="personal-key-block">
<% code.split('-').each do |word| %>
<% concat(content_tag(:strong, word, class: 'separator-text__code', data: { personal_key: '' })) %>
<% concat(content_tag(:strong, word, class: 'personal-key-block__code', data: { personal_key: '' })) %>
<% end %>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion spec/support/features/personal_key_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ def trigger_reset_password_and_click_email_link(email)
end

def scrape_personal_key
page.all('.separator-text__code').map(&:text).join('-')
page.all('.personal-key-block__code').map(&:text).join('-')
end
end
4 changes: 2 additions & 2 deletions spec/support/shared_examples/sign_in.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def user_with_broken_personal_key(protocol, scenario)
fill_in_credentials_and_submit(user.email, user.password)

expect(page).to have_content(t('account.personal_key.needs_new'))
code = page.all('.separator-text__code').map(&:text).join(' ')
code = page.all('.personal-key-block__code').map(&:text).join(' ')
acknowledge_and_confirm_personal_key

expect(user.reload.valid_personal_key?(code)).to eq(true)
Expand All @@ -265,7 +265,7 @@ def user_with_broken_personal_key(protocol, scenario)
click_button t('forms.buttons.submit.default')

expect(page).to have_content(t('account.personal_key.needs_new'))
code = page.all('.separator-text__code').map(&:text).join(' ')
code = page.all('.personal-key-block__code').map(&:text).join(' ')
acknowledge_and_confirm_personal_key

expect(user.reload.valid_personal_key?(code)).to eq(true)
Expand Down