Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bangn committed Jul 5, 2021
1 parent 9402336 commit 8c7ab8a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
18 changes: 14 additions & 4 deletions lib/pact_broker/ui/views/index/show-with-tags.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
%form{action: "#{base_url}"}
.field
%label{for: 'pacticipant_name'}
Pacticipant name
%input{name: 'pacticipant_name', id: 'pacticipant_name', class: 'pacticipant_name', value: pacticipant_name}
%div.top-of-group
%input{type: 'button', class: 'submit-search', value: 'Search'}
Search
%input{name: 'pacticipant_name', id: 'pacticipant_name', class: 'pacticipant-name', value: pacticipant_name}
%input{type: 'button', class: 'submit-search', value: 'Submit'}
%input{type: 'button', class: 'reset-search', value: 'Reset' }

%table.table.table-bordered.table-striped{ id: 'relationships' }
Expand Down Expand Up @@ -143,3 +142,14 @@
pacticipant_name = $("#pacticipant_name").val();
window.location.replace("#{base_url}/?tags=#{tags}" + `&pacticipant_name=${pacticipant_name}`);
})

$(".pacticipant-name").keypress(function(event) {
const enterKeyCode = 13;

const key = event.which;
if (key === enterKeyCode) {
event.preventDefault();
pacticipant_name = $("#pacticipant_name").val();
window.location.replace("#{base_url}/?tags=#{tags}" + `&pacticipant_name=${pacticipant_name}`);
}
})
5 changes: 2 additions & 3 deletions lib/pact_broker/ui/views/index/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
%form{action: "#{base_url}", onsubmit:'return onSubmit()'}
.field
%label{for: 'pacticipant_name'}
Pacticipant name
Search
%input{name: 'pacticipant_name', id: 'pacticipant_name', class: 'pacticipant_name', value: pacticipant_name}
%div.top-of-group
%input{type: 'submit', value: 'Search'}
%input{type: 'submit', value: 'Submit'}
%input{type: 'button', class: 'reset-search', value: 'Reset' }

%table.table.table-bordered.table-striped{ id: 'relationships' }
Expand Down
8 changes: 2 additions & 6 deletions public/stylesheets/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,9 @@ span.copy-success-icon {
height: 16px;
}

.field label {
width: 10em;
.field {
margin-top: 15px;
}

.field .pacticipant_name {
width: 20em;
margin-bottom: 15px;
}

div.top-of-group {
Expand Down

0 comments on commit 8c7ab8a

Please sign in to comment.