From 83dcdf9cc1ca148f87d0f6ec43e0a1021f99fd2e Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:00:24 +0200 Subject: [PATCH 01/13] [ci] Remove idNames lint exclusion --- src/api/.haml-lint_todo.yml | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/api/.haml-lint_todo.yml b/src/api/.haml-lint_todo.yml index 4e41f70ce18..c7158f35a5a 100644 --- a/src/api/.haml-lint_todo.yml +++ b/src/api/.haml-lint_todo.yml @@ -7,37 +7,6 @@ # versions of Haml-Lint, may require this file to be generated again. linters: - # Offense count: 63 - IdNames: - exclude: - - "app/views/shared/_requests.html.haml" - - "app/views/webui/attribute/_form.html.haml" - - "app/views/webui/configuration/_tabs.html.haml" - - "app/views/webui/groups/index.html.haml" - - "app/views/webui/groups/show.html.haml" - - "app/views/webui/main/_add_news_dialog.html.haml" - - "app/views/webui/main/_delete_message_dialog.html.haml" - - "app/views/webui/main/index.html.haml" - - "app/views/webui/monitor/_building.html.haml" - - "app/views/webui/monitor/_building_table.html.haml" - - "app/views/webui/monitor/_events.html.haml" - - "app/views/webui/monitor/_workers_table.html.haml" - - "app/views/webui/package/_submit_request_dialog.html.haml" - - "app/views/webui/patchinfo/_delete_dialog.html.haml" - - "app/views/webui/patchinfo/_form.html.haml" - - "app/views/webui/project/subprojects.html.haml" - - "app/views/webui/search/_owners.html.haml" - - "app/views/webui/search/_results.html.haml" - - "app/views/webui/search/_tabs.html.haml" - - "app/views/webui/search/index.html.haml" - - "app/views/webui/search/owner.html.haml" - - "app/views/webui/theme/bratwurst/webui/package/_files.html.haml" - - "app/views/webui/user/_login_form.html.haml" - - "app/views/webui/user/_password_dialog.html.haml" - - "app/views/webui/user/_save_dialog.html.haml" - - "app/views/webui/user/index.html.haml" - - "app/views/webui/user/show.html.haml" - # Offense count: 309 RuboCop: exclude: @@ -305,4 +274,4 @@ linters: HtmlAttributes: exclude: - "app/views/webui/user/_dropdown_menu.html.haml" - - "app/views/webui/user/index.html.haml" \ No newline at end of file + - "app/views/webui/user/index.html.haml" From 0bb309ca502b6fac55da44d68901682e41925252 Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:19:35 +0200 Subject: [PATCH 02/13] [webui] Apply Haml-Lint idNames in user --- .../javascripts/webui/application/project.js | 4 +- .../app/views/shared/_involved_users.html.erb | 4 +- .../views/webui/user/_login_form.html.haml | 8 ++-- src/api/app/views/webui/user/index.html.haml | 4 +- src/api/app/views/webui/user/show.html.haml | 38 +++++++++---------- .../features/features_authentification.rb | 4 +- .../shared_examples/features/user_tab.rb | 4 +- .../webui/request_controller_test.rb | 2 +- .../functional/webui/user_controller_test.rb | 2 +- src/api/test/functional/webui/users_test.rb | 4 +- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/api/app/assets/javascripts/webui/application/project.js b/src/api/app/assets/javascripts/webui/application/project.js index 05e63e3e43c..bcbfc03c3c5 100644 --- a/src/api/app/assets/javascripts/webui/application/project.js +++ b/src/api/app/assets/javascripts/webui/application/project.js @@ -39,8 +39,8 @@ function renderProjectsTable(length) { var projects = main_projects; if (!$('#excludefilter').is(":checked")) projects = projects.concat(excl_projects); - var projecturl = $("#projects_table_wrapper").data("url"); - $("#projects_table_wrapper").html('
'); + var projecturl = $("#projects-table-wrapper").data("url"); + $("#projects-table-wrapper").html('
'); $("#projects_table").dataTable({ "data": projects, "paging": true, diff --git a/src/api/app/views/shared/_involved_users.html.erb b/src/api/app/views/shared/_involved_users.html.erb index 392ea810bad..8687904e64b 100644 --- a/src/api/app/views/shared/_involved_users.html.erb +++ b/src/api/app/views/shared/_involved_users.html.erb @@ -10,7 +10,7 @@ <%= content_tag(:div, id: 'involved_users', data: data) do %> <% if @users.present? %>

User Roles <%= image_tag 'ajax-loader.gif', :id => 'user_spinner', :class => 'hidden' %>

- +
@@ -109,7 +109,7 @@ <%= content_for :ready_function do %> <% if @users && @users.length > 0 %> - $('#user_table').dataTable({ + $('#user-table').dataTable({ 'columns': [ null, <% @roles.length.times do %>null, diff --git a/src/api/app/views/webui/user/_login_form.html.haml b/src/api/app/views/webui/user/_login_form.html.haml index 00492bb8f7a..6263d1cc985 100644 --- a/src/api/app/views/webui/user/_login_form.html.haml +++ b/src/api/app/views/webui/user/_login_form.html.haml @@ -1,12 +1,12 @@ .form#loginform{title: "Account login"} %h1= @pagetitle %p - %label{for: "user_login"} Username: - %input#user_login{name: "username", size: "30", type: "text", value: ""}/ + %label{for: "user-login"} Username: + %input#user-login{name: "username", size: "30", type: "text", value: ""}/ %br/ %br/ - %label{for: "user_password"} Password: - %input#user_password{name: "password", size: "30", type: "password"}/ + %label{for: "user-password"} Password: + %input#user-password{name: "password", size: "30", type: "password"}/ %p %input.primary#log-in-button{name: "login", type: "submit", value: "Log In »"}/ %p diff --git a/src/api/app/views/webui/user/index.html.haml b/src/api/app/views/webui/user/index.html.haml index d5b1d7c89b8..7de12ded097 100644 --- a/src/api/app/views/webui/user/index.html.haml +++ b/src/api/app/views/webui/user/index.html.haml @@ -10,7 +10,7 @@ = link_to(sprited_text('user_add', ' Create new user'), :controller => :user, :action => :register_user) - unless @users.empty? - %table.compact#user_table + %table.compact#user-table %thead %tr %td @@ -37,5 +37,5 @@ $(function() { // We use count(:all) because of a bug: https://github.com/rails/rails/pull/27561 if ("#{@users.count(:all)}" !== "0") - $('#user_table').dataTable(); + $('#user-table').dataTable(); }); diff --git a/src/api/app/views/webui/user/show.html.haml b/src/api/app/views/webui/user/show.html.haml index c517d6c9243..c5ad59f2cfb 100644 --- a/src/api/app/views/webui/user/show.html.haml +++ b/src/api/app/views/webui/user/show.html.haml @@ -58,10 +58,10 @@ %a{href: "#iowned", title: "Projects/Packages where you are responsible for the maintenance"} Owned Project/Packages .tab#ipackages - if @ipackages.length > 0 - #ipackages_wrapper{ "data-url": url_for(controller: 'package', action: 'show', project: 'REPLACEPRJ', package: 'REPLACEPKG') } + #ipackages-wrapper{ "data-url": url_for(controller: 'package', action: 'show', project: 'REPLACEPRJ', package: 'REPLACEPKG') } - content_for :ready_function do var ipackages = [ #{escape_nested_list(@ipackages)}]; - renderPackagesProjectsTable({packages: ipackages, length: 10, name: 'ipackages_wrapper'}); + renderPackagesProjectsTable({packages: ipackages, length: 10, name: 'ipackages-wrapper'}); - else %p %i @@ -74,7 +74,7 @@ = @displayed_user.login is not involved in any projects - else - #projects_table_wrapper{"data-url" => "#{url_for(controller: 'project', action: 'show', project: 'REPLACEIT')}"} + #projects-table-wrapper{"data-url" => "#{url_for(controller: 'project', action: 'show', project: 'REPLACEIT')}"} - content_for :head_javascript do var main_projects = [ #{escape_nested_list(@iprojects)} ]; var excl_projects = []; @@ -88,10 +88,10 @@ = @displayed_user.login is not involved in any projects - else - #iowned_wrapper{ "data-url": url_for(controller: 'package', action: 'show', project: 'REPLACEPRJ', package: 'REPLACEPKG') } + #iowned-wrapper{ "data-url": url_for(controller: 'package', action: 'show', project: 'REPLACEPRJ', package: 'REPLACEPKG') } - content_for :ready_function do var iowned = [ #{escape_nested_list(@owned)} ]; - renderPackagesProjectsTable({packages: iowned, length: 15, name: 'iowned_wrapper'}); + renderPackagesProjectsTable({packages: iowned, length: 15, name: 'iowned-wrapper'}); .clear - if @is_displayed_user @@ -100,10 +100,10 @@ .box-header.header-tabs %ul %li - %a{href: "#reviews_in", title: "Requests that #{@displayed_user.login} has to review"} Incoming Reviews + %a{href: "#reviews-in", title: "Requests that #{@displayed_user.login} has to review"} Incoming Reviews = sprite_tag('reload', title: 'Reload', class: 'result_reload', data: { table: 'reviews_in_table' }) = image_tag('ajax-loader.gif', class: 'result_spinner hidden') - .tab#reviews_in + .tab#reviews-in = render(partial: 'requests', locals: { id: 'reviews_in_table' }) .grid_16.alpha.omega.box.box-shadow @@ -111,28 +111,28 @@ .box-header.header-tabs %ul %li - %a#requests_in_tab{href: "#requests_in", title: "Requests that #{@displayed_user.login} has to merge"} Incoming Requests + %a#requests-in-tab{href: "#requests-in", title: "Requests that #{@displayed_user.login} has to merge"} Incoming Requests = sprite_tag('reload', title: 'Reload', class: 'result_reload', data: { table: 'requests_in_table' }) = image_tag('ajax-loader.gif', class: 'result_spinner hidden') %li - %a#requests_out_tab{href: "#requests_out", title: "Requests that #{@displayed_user.login} has sent"} Outgoing Requests + %a#requests-out-tab{href: "#requests-out", title: "Requests that #{@displayed_user.login} has sent"} Outgoing Requests = sprite_tag('reload', title: 'Reload', class: 'result_reload hidden', data: { table: 'requests_out_table' }) = image_tag('ajax-loader.gif', class: 'result_spinner hidden') %li - %a#requests_declined_tab{href: "#requests_declined", title: "Requests from #{@displayed_user.login} that are declined"} Declined Requests + %a#requests-declined-tab{href: "#requests-declined", title: "Requests from #{@displayed_user.login} that are declined"} Declined Requests = sprite_tag('reload', title: 'Reload', class: 'result_reload hidden', data: { table: 'requests_declined_table' }) = image_tag('ajax-loader.gif', class: 'result_spinner hidden') %li - %a#all_requests_tab{href: "#all_requests", title: "All Requests from #{@displayed_user.login}"} All Requests + %a#all-requests-tab{href: "#all-requests", title: "All Requests from #{@displayed_user.login}"} All Requests = sprite_tag('reload', title: 'Reload', class: 'result_reload hidden', data: { table: 'all_requests_table' }) = image_tag('ajax-loader.gif', class: 'result_spinner hidden') - .tab#requests_in + .tab#requests-in = render(partial: 'requests', locals: { id: 'requests_in_table' }) - .tab#requests_out + .tab#requests-out = render(partial: 'requests', locals: { id: 'requests_out_table' }) - .tab#requests_declined + .tab#requests-declined = render(partial: 'requests', locals: { id: 'requests_declined_table' }) - .tab#all_requests + .tab#all-requests = render(partial: 'requests', locals: { id: 'all_requests_table' }) - if @patchinfos.present? @@ -141,9 +141,9 @@ .box-header.header-tabs %ul %li - %a{href: "#patchinfos_in", title: "Requests that #{@displayed_user.login} has to merge"} Maintenance Requests - .tab#patchinfos_in - %table.compact#open_patchinfos-table{title: "Running Maintenance Updates"} + %a{href: "#patchinfos-in", title: "Requests that #{@displayed_user.login} has to merge"} Maintenance Requests + .tab#patchinfos-in + %table.compact#open-patchinfos-table{title: "Running Maintenance Updates"} %thead %tr %th Project @@ -165,7 +165,7 @@ = javascript_tag do :plain $(function() { - $('#open_patchinfos-table').dataTable(); + $('#open-patchinfos-table').dataTable(); }); - content_for :ready_function do $( "#involved" ).tabs(); diff --git a/src/api/spec/support/features/features_authentification.rb b/src/api/spec/support/features/features_authentification.rb index 4352d267c77..127f68e0d86 100644 --- a/src/api/spec/support/features/features_authentification.rb +++ b/src/api/spec/support/features/features_authentification.rb @@ -2,8 +2,8 @@ module FeaturesAuthentification def login(user, password = 'buildservice') visit user_login_path expect(page).to have_text "Please Log In" - fill_in 'user_login', with: user.login - fill_in 'user_password', with: password + fill_in 'user-login', with: user.login + fill_in 'user-password', with: password click_button 'Log In »' expect(page).to have_link 'link-to-user-home' User.current = user diff --git a/src/api/spec/support/shared_examples/features/user_tab.rb b/src/api/spec/support/shared_examples/features/user_tab.rb index d6f0f89bca9..4ecbee62e2a 100644 --- a/src/api/spec/support/shared_examples/features/user_tab.rb +++ b/src/api/spec/support/shared_examples/features/user_tab.rb @@ -40,7 +40,7 @@ fill_in("User:", with: other_user.login) click_button("Add user") expect(page).to have_text("Added user #{other_user.login} with role maintainer") - within("#user_table") do + within("#user-table") do # package / project owner plus other user expect(find_all("tbody tr").count).to eq 2 end @@ -51,7 +51,7 @@ click_button("Add user") expect(page).to have_text("Relationship already exists") click_link("Users") - within("#user_table") do + within("#user-table") do expect(find_all("tbody tr").count).to eq 2 end end diff --git a/src/api/test/functional/webui/request_controller_test.rb b/src/api/test/functional/webui/request_controller_test.rb index ec6a64264bd..3cd232dbf87 100644 --- a/src/api/test/functional/webui/request_controller_test.rb +++ b/src/api/test/functional/webui/request_controller_test.rb @@ -269,7 +269,7 @@ def test_add_submitter_as_maintainer # spec/features/webui/requests_spec.rb find('#flash-messages').must_have_text 'Request 4 accepted' # Iggy should be a maintainer now visit package_users_path(project: 'Apache', package: 'BranchPack') - find('#user_table').must_have_text '(Iggy)' + find('#user-table').must_have_text '(Iggy)' end def visit_requests diff --git a/src/api/test/functional/webui/user_controller_test.rb b/src/api/test/functional/webui/user_controller_test.rb index e876af88870..163c01f3ee5 100644 --- a/src/api/test/functional/webui/user_controller_test.rb +++ b/src/api/test/functional/webui/user_controller_test.rb @@ -54,7 +54,7 @@ def test_show_user_tables # spec/models/users_spec.rb use_js visit user_show_path(user: 'fred') - within "table#ipackages_wrapper_table" do + within "table#ipackages-wrapper-table" do assert_equal "TestPack", find(:xpath, './/tr[1]/td[1]').text assert_equal "home:Iggy", find(:xpath, './/tr[1]/td[2]').text diff --git a/src/api/test/functional/webui/users_test.rb b/src/api/test/functional/webui/users_test.rb index 0498e7704a6..6c29228bddb 100644 --- a/src/api/test/functional/webui/users_test.rb +++ b/src/api/test/functional/webui/users_test.rb @@ -48,7 +48,7 @@ def test_add_and_edit_package_people # spec/support/shared_examples/features/use reader: true delete_user :user4 - page.wont_have_selector 'table#user_table tr#user-user4' + page.wont_have_selector 'table#user-table tr#user-user4' end def test_add_and_edit_project_users # spec/support/shared_examples/features/user_tab.rb @@ -152,7 +152,7 @@ def add_user(user, role, options = {}) def delete_user(user) # overwrite confirm function to avoid the dialog - they are very racy with selenium page.evaluate_script('window.confirm = function() { return true; }') - find(:css, "table#user_table tr#user-#{user} a.remove-user").click + find(:css, "table#user-table tr#user-#{user} a.remove-user").click flash_message_type.must_equal :info flash_message.must_equal "Removed user #{user}" end From 68d750425b259e5c3e65138410d71239809876d7 Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:29:15 +0200 Subject: [PATCH 03/13] [webui] Apply Haml-Lint idNames in shared --- src/api/app/views/shared/_requests.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/app/views/shared/_requests.html.haml b/src/api/app/views/shared/_requests.html.haml index dbc92d92201..61c10317563 100644 --- a/src/api/app/views/shared/_requests.html.haml +++ b/src/api/app/views/shared/_requests.html.haml @@ -1,7 +1,7 @@ - if requests.blank? %p No requests. - else - %table.compact#request_table{:width => '100%'} + %table.compact#request-table{:width => '100%'} %thead %tr %th Created @@ -15,7 +15,7 @@ - requests.each do |req| = render partial: 'shared/single_request', locals: { req: req } :javascript - $('#request_table').dataTable({ + $('#request-table').dataTable({ 'order': [[0,'desc']], 'columns': [ null, null, null, null, null, null, null ], 'info': false, From 846c5cd94dc64cd130d6e26b1ed12342a747d8d5 Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:30:52 +0200 Subject: [PATCH 04/13] [webui] Apply Haml-Lint idNames in main --- src/api/app/assets/stylesheets/webui/application/style.scss | 2 +- src/api/app/views/webui/main/index.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/app/assets/stylesheets/webui/application/style.scss b/src/api/app/assets/stylesheets/webui/application/style.scss index 87882b6edb6..dc1e567ec44 100644 --- a/src/api/app/assets/stylesheets/webui/application/style.scss +++ b/src/api/app/assets/stylesheets/webui/application/style.scss @@ -166,7 +166,7 @@ div#log_space_wrapper { /* main page (/) */ -#proceed_list { +#proceed-list { height: 2em; margin-bottom: 40px; li { diff --git a/src/api/app/views/webui/main/index.html.haml b/src/api/app/views/webui/main/index.html.haml index 48b4e045f12..332b7470bce 100644 --- a/src/api/app/views/webui/main/index.html.haml +++ b/src/api/app/views/webui/main/index.html.haml @@ -6,7 +6,7 @@ Welcome to #{@configuration['title']} = raw @configuration['description'] %br/ - %ul#proceed_list + %ul#proceed-list - if User.current.is_admin? = proceed_link 'configure', 'Configuration', controller: 'configuration', action: 'index' = proceed_link 'list', 'All Projects', controller: 'project' From 6c3fa614c35eabbbb343431ff63a87b7ab204a0f Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:32:08 +0200 Subject: [PATCH 05/13] [webui] Apply Haml-Lint idNames in attribute --- src/api/app/views/webui/attribute/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/app/views/webui/attribute/_form.html.haml b/src/api/app/views/webui/attribute/_form.html.haml index ff4448acf27..3886a5a318a 100644 --- a/src/api/app/views/webui/attribute/_form.html.haml +++ b/src/api/app/views/webui/attribute/_form.html.haml @@ -1,6 +1,6 @@ = form_for(@attribute) do |attribute_form| - if @attribute.errors.any? - #error_explanation + #error-explanation %h2 = pluralize(@attribute.errors.count, "error") prohibited this attribute from being saved: From c4820d0e230a310bfcd388fabbff53162a21a4db Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:33:24 +0200 Subject: [PATCH 06/13] [webui] Apply Haml-Lint idNames in configuration --- src/api/app/views/webui/configuration/_tabs.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/app/views/webui/configuration/_tabs.html.haml b/src/api/app/views/webui/configuration/_tabs.html.haml index 7979f678ce0..22822b40e71 100644 --- a/src/api/app/views/webui/configuration/_tabs.html.haml +++ b/src/api/app/views/webui/configuration/_tabs.html.haml @@ -1,4 +1,4 @@ -.box-header.header-tabs#configuration_tabs +.box-header.header-tabs#configuration-tabs %ul = tab 'configuration', 'Configuration', controller: :configuration, action: :index = tab 'architectures', 'Architectures', controller: :architectures, action: :index From 44cab431706d5973e52c12148a94c668eabea289 Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:35:06 +0200 Subject: [PATCH 07/13] [webui] Apply Haml-Lint idNames in group --- src/api/app/views/webui/groups/index.html.haml | 4 ++-- src/api/app/views/webui/groups/show.html.haml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/app/views/webui/groups/index.html.haml b/src/api/app/views/webui/groups/index.html.haml index 52fc61ebc88..7c6f5c11e27 100644 --- a/src/api/app/views/webui/groups/index.html.haml +++ b/src/api/app/views/webui/groups/index.html.haml @@ -6,7 +6,7 @@ %p Manage groups. - unless @groups.empty? - %table.compact#group_table + %table.compact#group-table %thead %tr %th Group name @@ -28,5 +28,5 @@ - if @groups.length > 0 :javascript $(function() { - $('#group_table').dataTable(); + $('#group-table').dataTable(); }); diff --git a/src/api/app/views/webui/groups/show.html.haml b/src/api/app/views/webui/groups/show.html.haml index 5ac462feed3..e80de709ce9 100644 --- a/src/api/app/views/webui/groups/show.html.haml +++ b/src/api/app/views/webui/groups/show.html.haml @@ -1,7 +1,7 @@ - @pagetitle = "Group #{@group.title}" %h2= @pagetitle - unless @group.users.empty? - %table#group_members_table + %table#group-members-table %thead %tr %th Group members @@ -13,4 +13,4 @@ %p %i This group does not contain users - content_for :ready_function do - $('#group_members_table').dataTable(); + $('#group-members-table').dataTable(); From 97e117834e2d623c3aea942ae8fee6f07f3ed789 Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:42:13 +0200 Subject: [PATCH 08/13] [webui] Apply Haml-Lint idNames in package --- .../javascripts/webui/application/request.js | 22 +++++++++---------- .../package/_submit_request_dialog.html.haml | 10 ++++----- .../project/_release_request_dialog.html.erb | 6 ++--- .../webui/package_controller_test.rb | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/api/app/assets/javascripts/webui/application/request.js b/src/api/app/assets/javascripts/webui/application/request.js index 265a6898c8b..59320756f4f 100644 --- a/src/api/app/assets/javascripts/webui/application/request.js +++ b/src/api/app/assets/javascripts/webui/application/request.js @@ -1,10 +1,10 @@ function updateSupersedeAndDevelPackageDisplay() { if ($('#targetproject').length > 0 && $('#targetproject')[0].value.length > 2) { if ($('#targetproject')[0].value == $('#sourceproject')[0].value) { - $('#sourceupdate_display').hide(); + $('#sourceupdate-display').hide(); $('#sourceupdate').prop('disabled', true); // hide 'sourceupdate' from Ruby } else { - $('#sourceupdate_display').show(); + $('#sourceupdate-display').show(); $('#sourceupdate').prop('disabled', false); } $.ajax({ @@ -18,11 +18,11 @@ function updateSupersedeAndDevelPackageDisplay() { }, success: function (data) { if (data.indexOf('No requests') == -1) { - $('#supersede_display').show(); - $('#supersede_requests').html(data); + $('#supersede-display').show(); + $('#supersede-requests').html(data); } else { - $('#supersede_display').hide(); - $('#supersede_requests').html(''); + $('#supersede-display').hide(); + $('#supersede-requests').html(''); } } }); @@ -34,10 +34,10 @@ function updateSupersedeAndDevelPackageDisplay() { }, success: function (data) { if (data.length > 0) { - $('#devel_project_warning').show(); - $('#devel_project_name').html(data); + $('#devel-project-warning').show(); + $('#devel-project-name').html(data); } else { - $('#devel_project_warning').hide(); + $('#devel-project-warning').hide(); } } }); @@ -45,8 +45,8 @@ function updateSupersedeAndDevelPackageDisplay() { } function setup_request_dialog() { - $('#devel_project_name').click(function () { - $('#targetproject').attr('value', $('#devel_project_name').html()); + $('#devel-project-name').click(function () { + $('#targetproject').attr('value', $('#devel-project-name').html()); }); $('#targetproject').autocomplete({ diff --git a/src/api/app/views/webui/package/_submit_request_dialog.html.haml b/src/api/app/views/webui/package/_submit_request_dialog.html.haml index 0f000305b45..4511f292894 100644 --- a/src/api/app/views/webui/package/_submit_request_dialog.html.haml +++ b/src/api/app/views/webui/package/_submit_request_dialog.html.haml @@ -37,18 +37,18 @@ ~ text_area_tag(:description, '', size: '40x3') %br/ - %span.hidden#supersede_display + %span.hidden#supersede-display = label_tag(:supersede_requests, 'Supersede requests:') %br/ - %span#supersede_requests + %span#supersede-requests - %span#sourceupdate_display + %span#sourceupdate-display = check_box_tag(:sourceupdate, 'cleanup', @cleanup_source) = label_tag(:sourceupdate, 'Remove local package if request is accepted') - %p.hidden#devel_project_warning + %p.hidden#devel-project-warning You are about to bypass the devel project, please submit to - %b#devel_project_name + %b#devel-project-name instead. .buttons diff --git a/src/api/app/views/webui/project/_release_request_dialog.html.erb b/src/api/app/views/webui/project/_release_request_dialog.html.erb index f0c1bace161..31ccb28b019 100644 --- a/src/api/app/views/webui/project/_release_request_dialog.html.erb +++ b/src/api/app/views/webui/project/_release_request_dialog.html.erb @@ -3,7 +3,7 @@

Create Maintenance Release Request

Do you want to release <%= project_or_package_link project: @project.name %> as a maintenance update?

- + <%= form_tag({:controller => 'project', :action => 'new_release_request'}) do -%> <%= hidden_field_tag(:project, @project.name) %>

@@ -11,9 +11,9 @@ <%= text_field_tag(:sourceproject, elide(@project.name, 40), :size => 40, :disabled => true) %>
<%= label_tag(:description, 'Description:') %>
<%= text_area_tag(:description, '', :size => '40x3') %>
-

diff --git a/src/api/test/functional/webui/package_controller_test.rb b/src/api/test/functional/webui/package_controller_test.rb index 4d434908af3..25a52ea61e9 100644 --- a/src/api/test/functional/webui/package_controller_test.rb +++ b/src/api/test/functional/webui/package_controller_test.rb @@ -388,7 +388,7 @@ def test_submit_package page.must_have_field('targetproject', with: 'home:dmayr') page.must_have_field('targetpackage', with: 'x11vnc') - within '#supersede_display' do + within '#supersede-display' do page.must_have_text "#{requestid} by adrian" end From 13e60484fcece2d6f3bd84c2f7cc75c2767bd9c1 Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:48:08 +0200 Subject: [PATCH 09/13] [webui] Apply Haml-Lint idNames in project --- .../assets/javascripts/webui/application/project.js | 8 ++++---- src/api/app/views/webui/project/list.html.erb | 2 +- src/api/app/views/webui/project/subprojects.html.haml | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/api/app/assets/javascripts/webui/application/project.js b/src/api/app/assets/javascripts/webui/application/project.js index bcbfc03c3c5..90465ead0f4 100644 --- a/src/api/app/assets/javascripts/webui/application/project.js +++ b/src/api/app/assets/javascripts/webui/application/project.js @@ -143,14 +143,14 @@ function repositories_setup_autocomplete() { } function setup_subprojects_tables() { - $('#parentprojects_table').dataTable({ + $('#parentprojects-table').dataTable({ 'paging': false, 'searching': false, 'info': false, "autoWidth": false }); - if ($('#siblingprojects_table').length) { - $('#siblingprojects_table').dataTable({ + if ($('#siblingprojects-table').length) { + $('#siblingprojects-table').dataTable({ 'paging': false, 'searching': false, 'info': false, @@ -160,7 +160,7 @@ function setup_subprojects_tables() { ] }); } - $('#subprojects_table').dataTable({ + $('#subprojects-table').dataTable({ 'paging': false, 'searching': false, 'info': false, diff --git a/src/api/app/views/webui/project/list.html.erb b/src/api/app/views/webui/project/list.html.erb index 1b5a2a29055..78712fa49eb 100644 --- a/src/api/app/views/webui/project/list.html.erb +++ b/src/api/app/views/webui/project/list.html.erb @@ -37,7 +37,7 @@ <% if @projects.blank? %>

No projects found

<% else %> -
+
<% content_for :head_javascript do %> <% cache ['list_public_arrays', cachekey] do %> diff --git a/src/api/app/views/webui/project/subprojects.html.haml b/src/api/app/views/webui/project/subprojects.html.haml index b5ce09af5d4..fbc70fc8737 100644 --- a/src/api/app/views/webui/project/subprojects.html.haml +++ b/src/api/app/views/webui/project/subprojects.html.haml @@ -6,7 +6,7 @@ - if @parentprojects.present? %h3 Parent projects of #{@project} - %table.compact.fit.stripe.no-footer#parentprojects_table + %table.compact.fit.stripe.no-footer#parentprojects-table %thead %tr %th Parent project @@ -19,7 +19,7 @@ %h3= @pagetitle - if @subprojects.present? - %table.compact.fit.stripe.no-footer#subprojects_table + %table.compact.fit.stripe.no-footer#subprojects-table %thead %tr %th Subproject @@ -35,7 +35,7 @@ - if @siblings.present? %h3 Sibling projects of #{@project} - %table.compact.fit.stripe.no-footer#siblingprojects_table + %table.compact.fit.stripe.no-footer#siblingprojects-table %thead %tr %th Sibling project @@ -49,11 +49,11 @@ - if User.current.can_modify_project?(@project) %p = link_to sprite_tag('brick_add', title: 'New subproject') + ' New subproject', '#', id: 'create_subproject_link' - .hidden#create_subproject + .hidden#create-subproject = render partial: 'form', locals: { project: Project.new, configuration: @configuration, ns: @project.name } - if @subprojects.present? || @parentprojects.present? - content_for :ready_function do setup_subprojects_tables(); - content_for :ready_function do - $("#create_subproject_link").click(function() { $('#create_subproject').show(); $('#create_subproject_link').hide() }); + $("#create_subproject_link").click(function() { $('#create-subproject').show(); $('#create_subproject_link').hide() }); From 165bbc7b75a7429553e6a4864f3b94013c7e0bc4 Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 17:58:10 +0200 Subject: [PATCH 10/13] [webui] Apply Haml-Lint idNames in monitor --- .../stylesheets/webui/application/style.scss | 2 +- .../app/views/webui/monitor/_building.html.haml | 2 +- .../webui/monitor/_building_table.html.haml | 6 +++--- .../app/views/webui/monitor/_events.html.haml | 12 ++++++------ .../views/webui/monitor/_workers_table.html.haml | 16 ++++++++-------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/api/app/assets/stylesheets/webui/application/style.scss b/src/api/app/assets/stylesheets/webui/application/style.scss index dc1e567ec44..ebf5c5f1eee 100644 --- a/src/api/app/assets/stylesheets/webui/application/style.scss +++ b/src/api/app/assets/stylesheets/webui/application/style.scss @@ -400,7 +400,7 @@ div.dataTables_wrapper:after { } // Indentation for the old monitoring page -#schedulerstatus, #building_all, #idlehosts { +#schedulerstatus, #building-all, #idlehosts { padding-top: 1em; } diff --git a/src/api/app/views/webui/monitor/_building.html.haml b/src/api/app/views/webui/monitor/_building.html.haml index d0898b12cdf..ad24b2623aa 100644 --- a/src/api/app/views/webui/monitor/_building.html.haml +++ b/src/api/app/views/webui/monitor/_building.html.haml @@ -1,6 +1,6 @@ - max_clients = @workerstatus['clients'] - build_count = @workerstatus.elements('building').length -#building_all +#building-all %h2 Building - if build_count > 0 %p.info Hover the job time field to see the start time. diff --git a/src/api/app/views/webui/monitor/_building_table.html.haml b/src/api/app/views/webui/monitor/_building_table.html.haml index 23329e3d4d0..c3ee7a7433d 100644 --- a/src/api/app/views/webui/monitor/_building_table.html.haml +++ b/src/api/app/views/webui/monitor/_building_table.html.haml @@ -1,6 +1,6 @@ -#building_list +#building-list - if @workerstatus.has_key? 'building' - %table.building#building_table + %table.building#building-table %thead %tr %th Project @@ -47,7 +47,7 @@ = content_for :ready_function do :plain - $('#building_table').dataTable({ + $('#building-table').dataTable({ 'aaSorting': [[3, 'desc']], 'bInfo': false, 'bPaginate': false, diff --git a/src/api/app/views/webui/monitor/_events.html.haml b/src/api/app/views/webui/monitor/_events.html.haml index cdbe66f857b..56628e73d8e 100644 --- a/src/api/app/views/webui/monitor/_events.html.haml +++ b/src/api/app/views/webui/monitor/_events.html.haml @@ -14,20 +14,20 @@ #building{ style: "height:250px; margin-right: 20px" } .centered Workers - %span.flot_legend#legend_building + %span.flot_legend#legend-building .plotspinner= image_tag('ajax-loader.gif') .clear .grid_8.alpha #events{ style: "height:250px; margin-left: 20px; margin-right: 20px" } .centered Repositories to recalculate - %span.flot_legend#legend_events + %span.flot_legend#legend-events .plotspinner= image_tag('ajax-loader.gif') .grid_8.omega #jobs{ style: "height:250px; margin-right: 20px" } .centered Packages scheduled for building - %span.flot_legend#legend_jobs + %span.flot_legend#legend-jobs .plotspinner= image_tag('ajax-loader.gif') .clear @@ -46,7 +46,7 @@ lines: { show: true, fill: true }, stack: true }, - legend: { noColumns: 3, position: "ne", container: "#legend_events" }, + legend: { noColumns: 3, position: "ne", container: "#legend-events" }, xaxis: { mode: 'time' }, yaxis: { min: 0, max: data['events_max'], position: "left", labelWidth: 25 } }); @@ -63,7 +63,7 @@ }, xaxis: { mode: 'time' }, yaxis: { min: 0, position: "left", labelWidth: 25 }, - legend: { noColumns: 3, position: "ne", container: "#legend_building" } + legend: { noColumns: 3, position: "ne", container: "#legend-building" } }); $.plot($("#jobs"), [ { data: data['waiting'], label: "Ready to build", color: 5}, @@ -75,7 +75,7 @@ }, xaxis: { mode: 'time' }, yaxis: { max: data['jobs_max'], position: "left", labelWidth: 25 }, - legend: { noColumns: 3, position: "ne", container: "#legend_jobs" } + legend: { noColumns: 3, position: "ne", container: "#legend-jobs" } }); } diff --git a/src/api/app/views/webui/monitor/_workers_table.html.haml b/src/api/app/views/webui/monitor/_workers_table.html.haml index b89c4e01bbf..c31eac8dcf9 100644 --- a/src/api/app/views/webui/monitor/_workers_table.html.haml +++ b/src/api/app/views/webui/monitor/_workers_table.html.haml @@ -46,19 +46,19 @@ function update() { - $("#workers_updating").fadeIn(1200); + $("#workers-updating").fadeIn(1200); // resizeMonitorBoxes(); $.getJSON("#{url_for(controller: :monitor, action: :update_building)}", function(json) { $.each(json, function(i,item) { processCtrl(i, item); }); - $("#workers_updating").fadeOut(1200); + $("#workers-updating").fadeOut(1200); }); } = content_for :ready_function do :plain - $("#worker_display option:selected").each(function() { logfileinfo=$(this).attr("value"); }); + $("#worker-display option:selected").each(function() { logfileinfo=$(this).attr("value"); }); // Resize is not implemented right now. Hint: flot resize plugin could handle this. // resizeMonitorBoxes(); @@ -66,8 +66,8 @@ update(); setInterval("update()", 100000 ); - $("#worker_display").change(function() { - $("#worker_display option:selected").each(function() { logfileinfo=$(this).attr("value"); }); + $("#worker-display").change(function() { + $("#worker-display option:selected").each(function() { logfileinfo=$(this).attr("value"); }); update(); }); @@ -76,14 +76,14 @@ %p %span{ style: "float: right" } %span.strong Show: - %select#worker_display + %select#worker-display %option{ selected: "selected", value: "package" } Package name %option{ value: "project" } Project %option{ value: "repository" } Repository %option{ value: "arch" } Architecture -%h2.nowrap#workers_title +%h2.nowrap#workers-title Workers - %span.hidden#workers_updating (updating...) + %span.hidden#workers-updating (updating...) %div %p This shows the single workers and their jobs. The From 1f03308e8a9c1a9fdbd46e7ccb8999e6e27f45fc Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 18:04:34 +0200 Subject: [PATCH 11/13] [webui] Apply Haml-Lint idNames in patchinfo --- .../javascripts/webui/application/patchinfo.js.erb | 4 ++-- .../app/views/webui/patchinfo/_delete_dialog.html.haml | 2 +- src/api/app/views/webui/patchinfo/_form.html.haml | 10 +++++----- .../test/functional/webui/patchinfo_controller_test.rb | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/api/app/assets/javascripts/webui/application/patchinfo.js.erb b/src/api/app/assets/javascripts/webui/application/patchinfo.js.erb index 5bc80404bad..068f729753d 100644 --- a/src/api/app/assets/javascripts/webui/application/patchinfo.js.erb +++ b/src/api/app/assets/javascripts/webui/application/patchinfo.js.erb @@ -124,7 +124,7 @@ function patchinfoReady() { $("#selected_binaries option[value='']").remove(); moveSelectedItems('#available_binaries', '#selected_binaries'); }); - $('#addAll').click(function () { + $('#add-all').click(function () { $("#selected_binaries option[value='']").remove(); $('#available_binaries option').attr('selected', 'true'); moveSelectedItems('#available_binaries', '#selected_binaries'); @@ -132,7 +132,7 @@ function patchinfoReady() { $('#remove').click(function () { moveSelectedItems('#selected_binaries', '#available_binaries'); }); - $('#removeAll').click(function () { + $('#remove-all').click(function () { $('#selected_binaries option').attr('selected', 'true'); moveSelectedItems('#selected_binaries', '#available_binaries'); }); diff --git a/src/api/app/views/webui/patchinfo/_delete_dialog.html.haml b/src/api/app/views/webui/patchinfo/_delete_dialog.html.haml index d83fc0889b9..efc0073dc44 100644 --- a/src/api/app/views/webui/patchinfo/_delete_dialog.html.haml +++ b/src/api/app/views/webui/patchinfo/_delete_dialog.html.haml @@ -1,4 +1,4 @@ -.darkgrey_box.dialog#del_dialog +.darkgrey_box.dialog#del-dialog .box.box-shadow %h2.box-header Delete Confirmation .dialog-content diff --git a/src/api/app/views/webui/patchinfo/_form.html.haml b/src/api/app/views/webui/patchinfo/_form.html.haml index 66cd7c60386..36e9aa73be5 100644 --- a/src/api/app/views/webui/patchinfo/_form.html.haml +++ b/src/api/app/views/webui/patchinfo/_form.html.haml @@ -93,18 +93,18 @@ - @binarylist.each { |d| available_bin << "#{d.to_s}" } - selected_bin = Array.new - @binaries.each { |bin| selected_bin << "#{bin.to_s}" } - #avail_bin{style: "float:left; width:44%; margin-left:5px;"} + #avail-bin{style: "float:left; width:44%; margin-left:5px;"} = select_tag 'available_binaries', options_for_select(available_bin), :multiple => true, :size => 6, :style => 'width:100%;' - #bin_options{style: "float:left; width:28px;"} + #bin-options{style: "float:left; width:28px;"} %input#add{style: "width:28px;", type: "button", value: ">"}/ %br/ - %input#addAll{style: "width:28px;", type: "button", value: ">>"}/ + %input#add-all{style: "width:28px;", type: "button", value: ">>"}/ %br/ - %input#removeAll{style: "width:28px;", type: "button", value: "<<"}/ + %input#remove-all{style: "width:28px;", type: "button", value: "<<"}/ %br/ %input#remove{style: "width:28px;", type: "button", value: "<"}/ %br/ - #sele_bin{style: "width:44%; float:left;"} + #sele-bin{style: "width:44%; float:left;"} - if !selected_bin.blank? = select_tag 'selected_binaries', options_for_select(selected_bin), :multiple => true, :size => 6, :style => 'width:100%;' - else diff --git a/src/api/test/functional/webui/patchinfo_controller_test.rb b/src/api/test/functional/webui/patchinfo_controller_test.rb index 1a6e49b57fe..d85c0753825 100644 --- a/src/api/test/functional/webui/patchinfo_controller_test.rb +++ b/src/api/test/functional/webui/patchinfo_controller_test.rb @@ -189,7 +189,7 @@ def delete_patchinfo(project) # /src/api/spec/controllers/webui/patchinfo_contro return unless page.has_link?('delete-patchinfo') find(:id, 'delete-patchinfo').click - find(:id, 'del_dialog').must_have_text 'Delete Confirmation' + find(:id, 'del-dialog').must_have_text 'Delete Confirmation' find_button("Ok").click assert_equal page.current_path, project_show_path(project) @@ -249,7 +249,7 @@ def test_remove # /src/api/spec/controllers/webui/patchinfo_controller_spec.rb visit patchinfo_show_path(package: 'patchinfo', project: "home:tom") find(:id, "delete-patchinfo").click - find(:id, "del_dialog").must_have_text "Delete Confirmation" + find(:id, "del-dialog").must_have_text "Delete Confirmation" find_button("Ok").click assert_equal page.current_path, project_show_path("home:tom") @@ -274,7 +274,7 @@ def test_remove_that_fails # /src/api/spec/controllers/webui/patchinfo_controlle # the actual test... visit patchinfo_show_path(package: 'patchinfo', project: project.name) find(:id, "delete-patchinfo").click - find(:id, "del_dialog").must_have_text "Delete Confirmation" + find(:id, "del-dialog").must_have_text "Delete Confirmation" find_button("Ok").click assert_equal page.current_path, patchinfo_show_path(package: 'patchinfo', project: project.name) From f4c9e82b55342141d8b6a7d50b7ea19ba6717e4e Mon Sep 17 00:00:00 2001 From: David Kang Date: Tue, 18 Apr 2017 18:12:06 +0200 Subject: [PATCH 12/13] [webui] Apply Haml-Lint idNames in search --- .../stylesheets/webui/application/search.scss | 8 +++---- .../app/views/webui/search/_owners.html.haml | 2 +- .../app/views/webui/search/_results.html.haml | 2 +- .../app/views/webui/search/_tabs.html.haml | 2 +- .../app/views/webui/search/index.html.haml | 15 ++++++------- .../app/views/webui/search/owner.html.haml | 12 +++++----- .../bratwurst/webui/package/_files.html.haml | 2 +- src/api/spec/features/webui/search_spec.rb | 22 +++++++++---------- .../functional/webui/owner_search_test.rb | 2 +- .../webui/search_controller_test.rb | 4 ++-- 10 files changed, 35 insertions(+), 36 deletions(-) diff --git a/src/api/app/assets/stylesheets/webui/application/search.scss b/src/api/app/assets/stylesheets/webui/application/search.scss index daa734b01b9..5210d78a5cb 100644 --- a/src/api/app/assets/stylesheets/webui/application/search.scss +++ b/src/api/app/assets/stylesheets/webui/application/search.scss @@ -1,4 +1,4 @@ -#search_form { +#search-form { width: 600px; margin-left: auto ; margin-right: auto ; @@ -13,7 +13,7 @@ text-indent:10px; font-family:arial, sans-serif; font-size:1em; - color:#333; + color:#333; background: #fff; border:solid 1px #d9d9d9; border-top:solid 1px #c0c0c0; @@ -21,7 +21,7 @@ } #search_button { - cursor:pointer; + cursor:pointer; width:70px; height: 33px; line-height: 33px; @@ -34,7 +34,7 @@ -webkit-border-radius: 0px; } -#advanced_link { +#advanced-link { float: right; background-color: transparent; } diff --git a/src/api/app/views/webui/search/_owners.html.haml b/src/api/app/views/webui/search/_owners.html.haml index 813e8ea8a15..c798b398205 100644 --- a/src/api/app/views/webui/search/_owners.html.haml +++ b/src/api/app/views/webui/search/_owners.html.haml @@ -1,4 +1,4 @@ -#search_results +#search-results - @results.each do |result| .search_result %h6 diff --git a/src/api/app/views/webui/search/_results.html.haml b/src/api/app/views/webui/search/_results.html.haml index 5cd8056499a..997c1ad6c13 100644 --- a/src/api/app/views/webui/search/_results.html.haml +++ b/src/api/app/views/webui/search/_results.html.haml @@ -1,4 +1,4 @@ -#search_results +#search-results - @results.each do |result| - if result.kind_of? Project - project = result.name diff --git a/src/api/app/views/webui/search/_tabs.html.haml b/src/api/app/views/webui/search/_tabs.html.haml index 152a8f9a970..cb2fba31e58 100644 --- a/src/api/app/views/webui/search/_tabs.html.haml +++ b/src/api/app/views/webui/search/_tabs.html.haml @@ -1,4 +1,4 @@ -.box-header.header-tabs#search_tabs +.box-header.header-tabs#search-tabs %ul = tab 'index', 'Packages/Projects', controller: 'search', action: 'index' = tab 'owner', 'Owners', controller: 'search', action: 'owner' diff --git a/src/api/app/views/webui/search/index.html.haml b/src/api/app/views/webui/search/index.html.haml index d97f678c234..4b4636076e0 100644 --- a/src/api/app/views/webui/search/index.html.haml +++ b/src/api/app/views/webui/search/index.html.haml @@ -4,23 +4,23 @@ - @layouttype = 'custom' = content_for :ready_function do :plain - $('#search_text').focus(); - $('#advanced_link' ).click(function() { - $('#advanced_container').toggle("drop"); + $('#search-text').focus(); + $('#advanced-link' ).click(function() { + $('#advanced-container').toggle("drop"); return false; }); .grid_16.alpha.omega.box.box-shadow = render partial: 'tabs' %h3 Search for packages or projects: - #search_form + #search-form = form_tag({ controller: 'search', action: 'index' }, { method: :get }) do %p = text_field_tag('search_text', params[:search_text], placeholder: 'Search', id: 'search_input') = submit_tag(nil, id: 'search_button', title: 'Search') = select_tag(:issue_tracker, options_for_select(@issue_tracker_list, params[:issue_tracker] || @default_tracker)) = text_field_tag('issue', params[:issue], size: 10) - %button#advanced_link{ type: "button" } Advanced - #advanced_container{ style: "display: none;" } + %button#advanced-link{ type: "button" } Advanced + #advanced-container{ style: "display: none;" } %h4 Search for: %p = hidden_field_tag('project', 0) @@ -43,7 +43,6 @@ %h4 Require attribute: %p = select_tag(:attrib_type_id, options_for_select(@attrib_type_list, params[:attrib_type_id]), id: 'attribute_list') - / end advanced_container - / end search_form + - unless @results.nil? || @results.empty? = render(partial: 'results') diff --git a/src/api/app/views/webui/search/owner.html.haml b/src/api/app/views/webui/search/owner.html.haml index a2e651612c8..d67fa641573 100644 --- a/src/api/app/views/webui/search/owner.html.haml +++ b/src/api/app/views/webui/search/owner.html.haml @@ -3,15 +3,15 @@ - @layouttype = 'custom' = content_for :ready_function do :plain - $('#search_text').focus(); - $('#advanced_link' ).click(function() { - $('#advanced_container').toggle("drop"); + $('#search-text').focus(); + $('#advanced-link' ).click(function() { + $('#advanced-container').toggle("drop"); return false; }); .grid_16.alpha.omega.box.box-shadow = render partial: 'tabs' %h3 Search for people responsible for package: - #search_form + #search-form = form_tag({ controller: 'search', action: 'owner' }, { method: :get }) do %p = text_field_tag 'search_text', params[:search_text], placeholder: 'Search', id: 'search_input' @@ -19,8 +19,8 @@ %input{ name: "package", type: "hidden", value: "0" }/ %input{ name: "project", type: "hidden", value: "0" }/ = submit_tag(nil, id: 'search_button', title: 'Search') - %button#advanced_link{ type: "button" } Advanced - #advanced_container{ style: "display: none;" } + %button#advanced-link{ type: "button" } Advanced + #advanced-container{ style: "display: none;" } %h4 Advanced: %p - if params[:devel] == "off" diff --git a/src/api/app/views/webui/theme/bratwurst/webui/package/_files.html.haml b/src/api/app/views/webui/theme/bratwurst/webui/package/_files.html.haml index 7b38a3d1dfd..41ad6812e23 100644 --- a/src/api/app/views/webui/theme/bratwurst/webui/package/_files.html.haml +++ b/src/api/app/views/webui/theme/bratwurst/webui/package/_files.html.haml @@ -8,7 +8,7 @@ .row .col-md-12 - unless @files.blank? - %table.table#files_table + %table.table#files-table %thead %tr %th Filename diff --git a/src/api/spec/features/webui/search_spec.rb b/src/api/spec/features/webui/search_spec.rb index 2fce5cefa92..943487312f8 100644 --- a/src/api/spec/features/webui/search_spec.rb +++ b/src/api/spec/features/webui/search_spec.rb @@ -29,7 +29,7 @@ fill_in 'search_input', with: package.name click_button 'search_button' - within '#search_results' do + within '#search-results' do expect(page).to have_link(user.home_project_name) expect(page).to have_link(package.name) end @@ -48,7 +48,7 @@ uncheck 'package' click_button 'search_button' - within '#search_results' do + within '#search-results' do expect(page).to have_link(apache2.name) expect(page).to have_link(apache2_subproject.name) expect(page).to have_selector('.search_result', count: 2) @@ -70,7 +70,7 @@ check 'title' click_button 'search_button' - within '#search_results' do + within '#search-results' do expect(page).to have_link(user.home_project_name) expect(page).to have_link(package.name) expect(page).to have_link(another_package.name) @@ -92,7 +92,7 @@ uncheck 'description' click_button 'search_button' - within '#search_results' do + within '#search-results' do expect(page).to have_link(apache.name) expect(page).to have_link(apache2.name) expect(page).to have_selector('.search_result', count: 2) @@ -113,7 +113,7 @@ check 'description' click_button 'search_button' - within '#search_results' do + within '#search-results' do expect(page).to have_link(apache.name) expect(page).to have_link(apache2.name) expect(page).to have_selector('.search_result', count: 2) @@ -131,7 +131,7 @@ click_button 'search_button' expect(find('#flash-messages')).to have_text("Your search did not return any results.") - expect(page).to have_selector('#search_results', count: 0) + expect(page).to have_selector('#search-results', count: 0) end scenario "search in no types" do @@ -148,7 +148,7 @@ click_button 'search_button' expect(find('#flash-messages')).to have_text("Your search did not return any results.") - expect(page).to have_selector('#search_results', count: 0) + expect(page).to have_selector('#search-results', count: 0) end scenario "search in no fields" do @@ -166,7 +166,7 @@ click_button 'search_button' expect(find('#flash-messages')).to have_text("You have to search for awesome in something. Click the advanced button...") - expect(page).to have_selector('#search_results', count: 0) + expect(page).to have_selector('#search-results', count: 0) end scenario "search Russian project in UTF-8" do @@ -182,7 +182,7 @@ check 'title' click_button 'search_button' - within '#search_results' do + within '#search-results' do expect(page).to have_link(russian_project.name) expect(page).to have_selector('.search_result', count: 1) end @@ -203,7 +203,7 @@ click_button 'search_button' expect(find('#flash-messages')).to have_text("Your search did not return any results.") - expect(page).to have_selector('#search_results', count: 0) + expect(page).to have_selector('#search-results', count: 0) end scenario "as admin user" do @@ -221,7 +221,7 @@ check 'title' click_button 'search_button' - within '#search_results' do + within '#search-results' do expect(page).to have_link(hidden_package.name) expect(page).to have_selector('.search_result', count: 1) end diff --git a/src/api/test/functional/webui/owner_search_test.rb b/src/api/test/functional/webui/owner_search_test.rb index 894f92d0b93..deace48ad13 100644 --- a/src/api/test/functional/webui/owner_search_test.rb +++ b/src/api/test/functional/webui/owner_search_test.rb @@ -18,7 +18,7 @@ def visit_owner_search def search(options) validate_search_page - find("#advanced_link").click + find("#advanced-link").click options[:flags] ||= [] options[:expect] ||= :success diff --git a/src/api/test/functional/webui/search_controller_test.rb b/src/api/test/functional/webui/search_controller_test.rb index f2eb93f174f..bb5b6b69b48 100644 --- a/src/api/test/functional/webui/search_controller_test.rb +++ b/src/api/test/functional/webui/search_controller_test.rb @@ -17,8 +17,8 @@ def validate_search_page def search(options) validate_search_page # avoid the animation that happens when you press the button - page.execute_script('$("#advanced_container").show()') - # click_button("advanced_link") # yes, that's the id of the button :) + page.execute_script('$("#advanced-container").show()') + # click_button("advanced-link") # yes, that's the id of the button :) options[:for] ||= [:projects, :packages] options[:in] ||= [:name] From 681c7a320c20d10bfb4c81be41e59cf85c5c7bfa Mon Sep 17 00:00:00 2001 From: David Kang Date: Wed, 19 Apr 2017 10:59:58 +0200 Subject: [PATCH 13/13] [ci] Adapt test --- src/api/test/functional/webui/group_controller_test.rb | 4 ++-- src/api/test/functional/webui/patchinfo_controller_test.rb | 2 +- src/api/test/functional/webui/user_controller_test.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/test/functional/webui/group_controller_test.rb b/src/api/test/functional/webui/group_controller_test.rb index aef36aa262d..4be112ac0ec 100644 --- a/src/api/test/functional/webui/group_controller_test.rb +++ b/src/api/test/functional/webui/group_controller_test.rb @@ -8,13 +8,13 @@ def test_list_all_groups # spec/features/webui/groups_spec.rb login_king to: groups_path - find(:id, 'group_table_wrapper').must_have_text 'Showing 1 to 5 of 5 entries' + find(:id, 'group-table_wrapper').must_have_text 'Showing 1 to 5 of 5 entries' find(:id, 'test_group_empty').click find(:id, 'content').must_have_text 'This group does not contain users' visit groups_path find(:id, 'test_group').click - find(:id, 'group_members_table_wrapper').must_have_text 'Showing 1 to 2 of 2 entries' + find(:id, 'group-members-table_wrapper').must_have_text 'Showing 1 to 2 of 2 entries' find(:link, 'adrian').click assert page.current_url.end_with? user_show_path(user: 'adrian') end diff --git a/src/api/test/functional/webui/patchinfo_controller_test.rb b/src/api/test/functional/webui/patchinfo_controller_test.rb index d85c0753825..7817a1dc36c 100644 --- a/src/api/test/functional/webui/patchinfo_controller_test.rb +++ b/src/api/test/functional/webui/patchinfo_controller_test.rb @@ -180,7 +180,7 @@ def test_create_patchinfo_with_issues find(:css, "img[alt=\"Add Bug\"]").click page.evaluate_script('window.confirm = function() { return true; }') page.wont_have_content("121212") - find_link("bnc#700501") + find('a', text: "bnc#700501") click_button("Save Patchinfo") # FIXME: This doesn't have any effect here end diff --git a/src/api/test/functional/webui/user_controller_test.rb b/src/api/test/functional/webui/user_controller_test.rb index 163c01f3ee5..0ca87a3c8d7 100644 --- a/src/api/test/functional/webui/user_controller_test.rb +++ b/src/api/test/functional/webui/user_controller_test.rb @@ -54,7 +54,7 @@ def test_show_user_tables # spec/models/users_spec.rb use_js visit user_show_path(user: 'fred') - within "table#ipackages-wrapper-table" do + within "table#ipackages-wrapper_table" do assert_equal "TestPack", find(:xpath, './/tr[1]/td[1]').text assert_equal "home:Iggy", find(:xpath, './/tr[1]/td[2]').text @@ -80,7 +80,7 @@ def test_show_user_tables # spec/models/users_spec.rb click_link("Owned Project/Packages") - within "table#iowned_wrapper_table" do + within "table#iowned-wrapper_table" do assert_equal "Apache", find(:xpath, './/tr[1]/td[2]').text assert_equal "apache2", find(:xpath, './/tr[2]/td[1]').text
Username