Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes AgileVentures/MetPlus_tracker#411 #452

Merged

Conversation

patmbolger
Copy link
Contributor

Story:

As a Company Contact
I want to search for Job Seekers that match a specific Job Opportunity from my company

Implementation:

  • Added action #match_job_seekers to jobs_controller.rb
  • Added method to JobSeeker model
  • Added to job_policy.rb
  • Added view
  • Added route
  • Added scenario
  • Adjusted controller and model rspec tests
  • Added functions to Pusher.js.erb to start/stop spinner (for using spinner from server action)

|
= link_to "Return To Jobs", jobs_path
|
= link_to 'Match Job Seekers', match_job_seekers_job_path(@job), |

Choose a reason for hiding this comment

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

Don't use the | character to split up lines. Wrap on commas or extract code into helper.

#{job_match[1]} / 5.0
%td
- if job_match[2] && (job_developer = job_match[0].job_developer)
= mail_to(job_developer.email, |

Choose a reason for hiding this comment

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

Don't use the | character to split up lines. Wrap on commas or extract code into helper.

end

def self.job_seekers_without_case_manager
where.not(id: AgencyRelation.in_role_of(:CM).pluck(:job_seeker_id)).
includes(:job_seeker_status, :job_applications).
order("users.last_name")

Choose a reason for hiding this comment

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

Extra empty line detected at method body end.

@@ -60,14 +64,14 @@ def self.job_seekers_without_job_developer
where.not(id: AgencyRelation.in_role_of(:JD).pluck(:job_seeker_id)).
includes(:job_seeker_status, :job_applications).
order("users.last_name")

Choose a reason for hiding this comment

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

Extra empty line detected at method body end.

def self.with_ap_in_role(role_key, agency_person)
AgencyRelation.in_role_of(role_key).
where(:agency_person => agency_person).
pluck(:job_seeker_id)

Choose a reason for hiding this comment

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

Extra empty line detected at method body end.

@job_matches = result.collect do |item|
job_seeker = Resume.find(item[0]).job_seeker
raise RuntimeError,
"Couldn't find JobSeeker for Resume with 'id' = #{item[0]}" \

Choose a reason for hiding this comment

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

Align the parameters of a method call if they span more than one line.

begin
@job_matches = result.collect do |item|
job_seeker = Resume.find(item[0]).job_seeker
raise RuntimeError,

Choose a reason for hiding this comment

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

Redundant RuntimeError argument can be removed.

# Create an array with each element consisting of an array:
# [job_seeker, job_match_score, has_applied_to_this_job]
begin
@job_matches = result.collect do |item|

Choose a reason for hiding this comment

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

Prefer map over collect.

@@ -26,7 +26,7 @@ $state-danger-text: #a94442;
}

.pull-right#job-show-links-id{
margin-top: 80px;
margin-top: 20px;

Choose a reason for hiding this comment

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

Line should be indented with spaces, not tabs

@@ -126,5 +126,5 @@ $state-danger-text: #a94442;
}

.recent-jobs {
background: rgba(255,255,0,0.4);
background: rgba(255,255,0,0.4);

Choose a reason for hiding this comment

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

Color literals like rgba(255, 255, 0, 0.4) should only be used in variable declarations; they should be referred to via variable everywhere else.
Commas in function arguments should be followed by one space

@@ -126,5 +126,5 @@ $state-danger-text: #a94442;
}

.recent-jobs {
background: rgba(255,255,0,0.4);
background: rgba(255,255,0,0.4);

Choose a reason for hiding this comment

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

Color literals like rgba(255, 255, 0, 0.4) should only be used in variable declarations; they should be referred to via variable everywhere else.
Commas in function arguments should be followed by one space

padding-top: 10px;
padding-bottom: 10px;
margin-top: 5px;
min-height:0px !important;

Choose a reason for hiding this comment

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

!important should not be used
Colon after property should be followed by one space
0px should be written without units as 0

padding-top: 10px;
padding-bottom: 10px;
margin-top: 5px;
min-height:0px !important;

Choose a reason for hiding this comment

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

!important should not be used
Colon after property should be followed by one space
0px should be written without units as 0

height: 78px;
background: $light-blue;
color: $white;
padding-top: 10px;

Choose a reason for hiding this comment

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

Properties should be ordered background, color, height, margin-bottom, margin-top, min-height, padding-bottom, padding-top

height: 78px;
background: $light-blue;
color: $white;
padding-top: 10px;

Choose a reason for hiding this comment

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

Properties should be ordered background, color, height, margin-bottom, margin-top, min-height, padding-bottom, padding-top

}

.btn.btn-primary.btn-xs.jobs-revoke-button{
margin-left: 7px;
background: $light-blue;
margin-left: 7px;

Choose a reason for hiding this comment

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

Properties should be ordered background, margin-left

}

.btn.btn-primary.btn-xs.jobs-revoke-button{
margin-left: 7px;
background: $light-blue;
margin-left: 7px;

Choose a reason for hiding this comment

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

Properties should be ordered background, margin-left

}
color: $white;
margin-top: 20px;
a{

Choose a reason for hiding this comment

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

Rule declaration should be preceded by an empty line
Opening curly brace { should be preceded by one space

}
color: $white;
margin-top: 20px;
a{

Choose a reason for hiding this comment

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

Rule declaration should be preceded by an empty line
Opening curly brace { should be preceded by one space

text-decoration: underline;
}
margin-top: 20px;
a{

Choose a reason for hiding this comment

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

Rule declaration should be preceded by an empty line
Line should be indented 2 spaces, but was indented 4 spaces
Opening curly brace { should be preceded by one space

text-decoration: underline;
}
margin-top: 20px;
a{

Choose a reason for hiding this comment

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

Rule declaration should be preceded by an empty line
Line should be indented 2 spaces, but was indented 4 spaces
Opening curly brace { should be preceded by one space

a{
text-decoration: underline;
}
margin-top: 20px;

Choose a reason for hiding this comment

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

Line should be indented 2 spaces, but was indented 4 spaces

a{
text-decoration: underline;
}
margin-top: 20px;

Choose a reason for hiding this comment

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

Line should be indented 2 spaces, but was indented 4 spaces

}
#hire-header {
margin: 25px 0 12px 0;
a {

Choose a reason for hiding this comment

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

Rule declaration should be preceded by an empty line

color: $white;
}
#hire-header {
margin: 25px 0 12px 0;

Choose a reason for hiding this comment

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

Shorthands of length 4 are not allowed. Value was 25px 0 12px 0
Shorthand form for property margin should be written more concisely as 25px 0 12px instead of 25px 0 12px 0

a{
color: $white;
}
#hire-header {

Choose a reason for hiding this comment

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

Avoid using id selectors

margin-bottom: 12px;
font-weight: 300;
#list-header {
margin-top: 25px;

Choose a reason for hiding this comment

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

Properties should be ordered font-weight, margin-bottom, margin-top

margin-top: 25px;
margin-bottom: 12px;
font-weight: 300;
#list-header {

Choose a reason for hiding this comment

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

Avoid using id selectors

min-height:0px !important;
margin-bottom: 10px;
height: 78px;
.well#jobs-well-lg {

Choose a reason for hiding this comment

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

Avoid using id selectors


.page-header#new-job-header {

Choose a reason for hiding this comment

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

Avoid using id selectors

.btn.btn-primary.btn-block#new-job-submit{
background: $light-blue;

.btn.btn-primary.btn-block#new-job-submit {

Choose a reason for hiding this comment

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

Avoid using id selectors

}
.btn.btn-primary.btn-block#edit-job-submit{
background: $light-blue;
.btn.btn-primary.btn-block#edit-job-submit {

Choose a reason for hiding this comment

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

Avoid using id selectors

}
.btn.btn-primary.btn-xs#jobs-edit-link{
background: $light-blue;
.btn.btn-primary.btn-xs#jobs-edit-link {

Choose a reason for hiding this comment

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

Avoid using id selectors

color: $white;
text-decoration: underline;
}
.row.text-center#footer-text-color {

Choose a reason for hiding this comment

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

Avoid using id selectors

background-color: $light-blue;
height: 78px;
margin-bottom: 0;
background-color: $light-blue;

Choose a reason for hiding this comment

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

Property background-color already defined on line 52

margin-bottom: 0px;

}
.panel-footer{

Choose a reason for hiding this comment

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

Opening curly brace { should be preceded by one space

.panel.panel-default#panel-default-id {
margin-bottom: 0px;
height: 78px;
border:0px;

Choose a reason for hiding this comment

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

Colon after property should be followed by one space
0px should be written without units as 0

height: 78px;
border:0px;
.panel.panel-default#panel-default-id {
margin-bottom: 0px;

Choose a reason for hiding this comment

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

Properties should be ordered border, height, margin-bottom
0px should be written without units as 0

margin-bottom: 0px;
height: 78px;
border:0px;
.panel.panel-default#panel-default-id {

Choose a reason for hiding this comment

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

Avoid using id selectors


.panel-heading#panel-heading-show-id {

Choose a reason for hiding this comment

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

Avoid using id selectors

background: $light-blue;
color: $white;
}
.panel.panel-default#show-panel-id {

Choose a reason for hiding this comment

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

Avoid using id selectors


}
.pull-right#application-show-links{
margin-top: 80px;
.pull-right#application-show-links {

Choose a reason for hiding this comment

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

Avoid using id selectors

Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

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

Looks good

@joaopapereira joaopapereira merged commit 8240916 into AgileVentures:development Dec 6, 2016
patmbolger pushed a commit that referenced this pull request Feb 17, 2017
* Closes AgileVentures/MetPlus_tracker#476 (#448)

* non-agency person redirected if trying to access agency admin home page

* adjustments on non-agency person redirected if trying to access agency admin home page

* correct AgencyPolicy#update? method

* Closes AgileVentures/MetPlus_tracker#441 (#446)

* remove company_person's hidden_tag when create job

* combine _compact_list,_list_all to _list_jobs & update jobs_controller & jobs_viewer

* improve jobs_controller readability

* initial change to spec files

* initial commit on authorize job

* update authorize job policy & spec files

* add pending test

* update address factory

* initial clean up view/jobs

* correct indentation error

* update broken view

* correct mistake

* update jobs_controller_spec

* update houndci

* update company_registrations spec files

* update job features

* update houndci

* update houndci

* update job_application_viewer after houndci updates

* update spec & feature files

* update feature file

* initial review change

* complete review changes

* clean up codes

* clear houndci

* update to pass feature test

* update job_policy_spec

* Closes AgileVentures/MetPlus_tracker#496

fix postgresql migrations (#450)

* Closes AgileVentures/MetPlus_tracker#479 (#440)

* Setup Jasmine for JavaScript Testing

* Add spec file for testing
Remove duplicated jasmine gem

* Setup test for UTC to Local time

* Add test for UTC to Local time

* Add var before ele and define var top of page

* update to fix failing scenario

* Closes AgileVentures/MetPlus_tracker#478 (#447)

* update _applied_jobs_list partial

* fix failing features

* change indent tabs to spaces

* fix failing spec

* fix failing features

* fix failing view_job_application.feature

* update job_seekers_controller

* dry code in job_application_viewer

* update houndci

* update job_application.feature

* Add step file

* changed selenium to poltergeist tests

* pre-fetch commit

* Closes AgileVentures/MetPlus_tracker#281 Refactor eleigible job seeker to job seeker assigned (#451)

* Refactor eleigible job seeker to job seeker assigned

* Fixes hound errors

* Refactor space issues

* converted tests to poltergeist

* added waits

* more waits

* added minimum expected for select find()

* reduce wait time

* increased poltergeist timeout param

* changed comment to prefer poltergeist over selenium

* added explicit labels for fields

* Closes AgileVentures/MetPlus_tracker#462 (#455)

* fix git merge conflict

* Adds Jasmine test for job_applications.js

* Corrects filname error and rearranges spec

* added back selenium for 2 scenarios

* Closes AgileVentures/MetPlus_tracker#411 (#452)

* interim progress

* interim progress

* interim progress

* added tests for instance method, rubocop fixes

* added spinner

* controller tests

* added auth tests

* rspec controller tests

* rubocop fixes

* rubocop fixes

* houndci fixes job.css

* more houndci fixes

* yet more houndci fixes

* backed out changes to jobs form

* changed tabs to spaces

* For Pull Request

* Closes AgileVentures/MetPlus_tracker#412 (#461)

* interim progress

* added task creation

* added policy test

* wip - adding tests

* more rspec tests

* added cuke test, renamed feature file

* removed cuke step

* rubocop fixes

* corrected action

* rubocop fixes

* added comment (#464)

* re-commit

* Active Jobs

* AR Not Found Exception

* removed unused instance variable

* Closes AgileVentures/MetPlus_tracker#509 (#465)

* Add missing tests for OTHER JD APPLY

* Change to 2 spaces

* Closes AgileVentures/MetPlus_tracker#500 (#468)

Refactor create and update in jobs_controller

* Closes AgileVentures/MetPlus_tracker#508 (#466)

* parameter for agency admin email

* remove rspec example file

* corrected from-address

* 506 PR

* add counter_cache to job_skills

* add test to skill_spec

* update houndci violations

*  ignore example.txt and Editor file

* added wait for 2 tests

* removed 100 year old birth date from test

* jobseeker notifications

* changes to event.rb

* add notification to jobseeker

* fixing errors

* rubocop implement

* remove extra spaces

* added new method app for job

* created new jobseeker mailer revoke

* added event

* add method jobseekermailer

* Created new jonseeker preview mailer

* Remove spaces

* rubo implement

* Add action for job developer to match job seekers against a job

* Resolve rubo issues

* updates for spec

* Resolve issues rspec test

* Add job policy and policy specs

* Refactor code and fix rubocop violations

* migrate seed and updates event

* removed Factory creation

* Resolved conflicts

* changes for jobseeker templateview

* Handle nil job_seeker_ids

Fixes the issue when a user bypasses the javascript validation and force submits the form
without selecting a job seeker

* Add controller tests

* fix rspec test

* Resolved mergeconflicts

* increased capybara wait time

* Fixed rspec test

* Add cuke tests

* Resolve bug caused when agency person updates his/her email address

Fix minor rubocop warnings in controller and controller spec

* Remove job category placeholder from job_info view closes issue #498

* Flash message when updating email address (#477)

* added crucher stub files (#475)

* added crucher stub files

* updates and rebase code

* fixed errors

* Changed Flash message for Company person email update

* UI Assets (#481)

* company people rspec

* All changes for #514 pull request

* push changes

* prior to pul request

* Corrected Jobs Search Feature Tests

* Corrected HoundCI issues

* Cucumber File fix

* Rebase to origin

* restored company jobs edit revoke list

* fixed some hound issues

* semaphore corrections

* corrected jobs_controller_spec tests

* some index.html.haml hound issues

* changes to footer

* removal of company_jobs list

* remove edit and revoke buttons from jobs search list

* git hound corrections

* corrections to features

* corrections to jobs_steps.rb and layout/_footer.html.haml

* corrections to jobs_controller and _search_job.html.haml

* fixed layouts/_footer.html.haml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants