From e4e824c169ad1ef4e789812ef29c67b599f6244d Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Mon, 23 Jul 2018 23:27:37 +0300 Subject: Replace author_link snake case in stylesheets, specs, and helpers --- app/assets/stylesheets/framework/lists.scss | 2 +- app/assets/stylesheets/pages/issuable.scss | 6 +++--- app/helpers/projects_helper.rb | 4 ++-- app/views/shared/notes/_notes_with_form.html.haml | 2 +- changelogs/unreleased/replace-snake-case-css-classes.yml | 5 +++++ spec/features/issues/update_issues_spec.rb | 2 +- spec/features/merge_requests/user_mass_updates_spec.rb | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 changelogs/unreleased/replace-snake-case-css-classes.yml diff --git a/app/assets/stylesheets/framework/lists.scss b/app/assets/stylesheets/framework/lists.scss index efd61081253..4b67eab05b3 100644 --- a/app/assets/stylesheets/framework/lists.scss +++ b/app/assets/stylesheets/framework/lists.scss @@ -270,7 +270,7 @@ ul.controls { .issuable-pipeline-broken a, .issuable-pipeline-status a, - .author_link { + .author-link { display: flex; } } diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index 24bba626e5a..e6aa41d5201 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -486,7 +486,7 @@ padding-bottom: 0; margin-bottom: 10px; - .author_link { + .author-link { padding-left: 0; .avatar { @@ -595,7 +595,7 @@ margin: 16px 0 0; font-size: 85%; - .author_link { + .author-link { color: $gray-darkest; } } @@ -620,7 +620,7 @@ padding-right: 0; } - .author_link { + .author-link { display: block; } diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 221f1aa9dd8..aaf9dff43ee 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -63,10 +63,10 @@ module ProjectsHelper author_html = author_html.html_safe if opts[:name] - link_to(author_html, user_path(author), class: "author_link #{"#{opts[:extra_class]}" if opts[:extra_class]} #{"#{opts[:mobile_classes]}" if opts[:mobile_classes]}").html_safe + link_to(author_html, user_path(author), class: "author-link #{"#{opts[:extra_class]}" if opts[:extra_class]} #{"#{opts[:mobile_classes]}" if opts[:mobile_classes]}").html_safe else title = opts[:title].sub(":name", sanitize(author.name)) - link_to(author_html, user_path(author), class: "author_link has-tooltip", title: title, data: { container: 'body' }).html_safe + link_to(author_html, user_path(author), class: "author-link has-tooltip", title: title, data: { container: 'body' }).html_safe end end diff --git a/app/views/shared/notes/_notes_with_form.html.haml b/app/views/shared/notes/_notes_with_form.html.haml index e0832fd9136..9dd1c24fdfa 100644 --- a/app/views/shared/notes/_notes_with_form.html.haml +++ b/app/views/shared/notes/_notes_with_form.html.haml @@ -13,7 +13,7 @@ .flash-container.timeline-content .timeline-icon.d-none.d-sm-none.d-md-block - %a.author_link{ href: user_path(current_user) } + %a.author-link{ href: user_path(current_user) } = image_tag avatar_icon_for_user(current_user), alt: current_user.to_reference, class: 'avatar s40' .timeline-content.timeline-content-form = render "shared/notes/form", view: diff_view, supports_autocomplete: autocomplete diff --git a/changelogs/unreleased/replace-snake-case-css-classes.yml b/changelogs/unreleased/replace-snake-case-css-classes.yml new file mode 100644 index 00000000000..28ec5ee097f --- /dev/null +++ b/changelogs/unreleased/replace-snake-case-css-classes.yml @@ -0,0 +1,5 @@ +--- +title: Replace author_link snake case in stylesheets, specs, and helpers +merge_request: 20797 +author: George Tsiolis +type: other diff --git a/spec/features/issues/update_issues_spec.rb b/spec/features/issues/update_issues_spec.rb index e2419d15f88..fd8629ae504 100644 --- a/spec/features/issues/update_issues_spec.rb +++ b/spec/features/issues/update_issues_spec.rb @@ -63,7 +63,7 @@ describe 'Multiple issue updating from issues#index', :js do click_link 'Unassigned' click_update_issues_button - expect(find('.issue:first-child .controls')).not_to have_css('.author_link') + expect(find('.issue:first-child .controls')).not_to have_css('.author-link') end end diff --git a/spec/features/merge_requests/user_mass_updates_spec.rb b/spec/features/merge_requests/user_mass_updates_spec.rb index 13d2cca0537..cb6603d3f50 100644 --- a/spec/features/merge_requests/user_mass_updates_spec.rb +++ b/spec/features/merge_requests/user_mass_updates_spec.rb @@ -62,7 +62,7 @@ describe 'Merge requests > User mass updates', :js do it 'removes assignee from the merge request' do change_assignee('Unassigned') - expect(find('.merge-request .controls')).not_to have_css('.author_link') + expect(find('.merge-request .controls')).not_to have_css('.author-link') end end end -- cgit v1.2.1