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

2024 05 16 integrate user feedback #164

Closed
wants to merge 98 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
62d24d9
Merge branch 'master' of github.com:Ches-ctrl/Cheddar
Ches-ctrl May 13, 2024
4e3275c
Merge branch 'master' of github.com:Ches-ctrl/Cheddar
Ches-ctrl May 13, 2024
ff95567
minor update to re-push
Ches-ctrl May 13, 2024
f1fcdf8
change matching for log and tmp files
Ches-ctrl May 13, 2024
45b4d5a
change log file matching
Ches-ctrl May 14, 2024
d3c9e48
refactor job card into separate partials
Ches-ctrl May 17, 2024
35b6271
correct incorrectly placed div
Ches-ctrl May 17, 2024
1409c34
update meta tags
Ches-ctrl May 17, 2024
535439d
start to add responsiveness
Ches-ctrl May 17, 2024
4f11920
adding responsiveness to the index page
Ches-ctrl May 17, 2024
4cc794f
install brakeman to review vulnerabilities
Ches-ctrl May 17, 2024
ea57811
add new relic
Ches-ctrl May 17, 2024
f15d3f3
hide license key
Ches-ctrl May 18, 2024
90f23ac
fetch key
Ches-ctrl May 18, 2024
9fa6474
test adding brakeman to github actions
Ches-ctrl May 18, 2024
9b49a8f
enable brakeman in test environment
Ches-ctrl May 18, 2024
6ab248d
bundle exec
Ches-ctrl May 18, 2024
5b90e0c
continue on error
Ches-ctrl May 18, 2024
551dc24
add hubspot api client
Ches-ctrl May 18, 2024
15d7b84
add utility class for background color
Ches-ctrl May 18, 2024
e4939cd
update footer
Ches-ctrl May 18, 2024
6ec2de8
remove unnecessary css
Ches-ctrl May 18, 2024
a73ec06
clean about page
Ches-ctrl May 18, 2024
5f8ce40
update pages controller
Ches-ctrl May 18, 2024
7b55a1e
comment out footer for now
Ches-ctrl May 18, 2024
ae060c6
remove old pages
Ches-ctrl May 18, 2024
5ac0136
tidy routes
Ches-ctrl May 18, 2024
cf6c1af
minor updates
Ches-ctrl May 18, 2024
a95fd2a
add todo
Ches-ctrl May 18, 2024
dfb0810
remove
Ches-ctrl May 18, 2024
74eb1ba
adding example component for testing
Ches-ctrl May 18, 2024
74f45b9
install sendgrid gem
Ches-ctrl May 18, 2024
04ef0df
put signup form in a partial for reuse elsewhere
Ches-ctrl May 18, 2024
21ebb18
add user mailer
Ches-ctrl May 18, 2024
f98b711
add mailer views
Ches-ctrl May 18, 2024
e7b48a1
add config for sendgrid
Ches-ctrl May 18, 2024
03e5e10
add factory bot to rails helper
Ches-ctrl May 18, 2024
92198b9
require vcr
Ches-ctrl May 18, 2024
a8487c3
add emails controller - working this time with proper requires in place
Ches-ctrl May 18, 2024
6896fff
add emails to routes
Ches-ctrl May 18, 2024
2399d17
add emails controller
Ches-ctrl May 18, 2024
013384a
update user mailer
Ches-ctrl May 18, 2024
1123e43
add post request to form
Ches-ctrl May 18, 2024
92e0f95
tidy
Ches-ctrl May 18, 2024
cbf1462
install hotjar
Ches-ctrl May 19, 2024
2ca2c71
tidying
Ches-ctrl May 19, 2024
ade5242
refactor script into partial
Ches-ctrl May 19, 2024
fd6bcd7
tidying 2
Ches-ctrl May 19, 2024
54f8afe
install google analytics
Ches-ctrl May 19, 2024
ed22258
tidying 3
Ches-ctrl May 19, 2024
49855f5
move tinymce - will need to check this doesn't break anything
Ches-ctrl May 19, 2024
356e543
tidying 5
Ches-ctrl May 19, 2024
89b8203
add contact to sendgrid support
Ches-ctrl May 19, 2024
e8265f8
configure sendgrid in production
Ches-ctrl May 19, 2024
0036d3f
rubocop change
Ches-ctrl May 19, 2024
5d8ea60
install hubspot api client gem
Ches-ctrl May 19, 2024
25a81f3
omit hash value
Ches-ctrl May 19, 2024
759b614
move hubspot and sendgrid into service classes to clean up controller
Ches-ctrl May 19, 2024
2479024
access token and hubspot tracking
Ches-ctrl May 19, 2024
5b9c4fd
add hubspot todo and comment out gem for now
Ches-ctrl May 19, 2024
9ab011f
add todo for later
Ches-ctrl May 19, 2024
b83ea65
update html
Ches-ctrl May 19, 2024
6ca05ab
update meta tag
Ches-ctrl May 19, 2024
f36adec
move css round
Ches-ctrl May 19, 2024
1b4851a
col-10 > col-11
Ches-ctrl May 19, 2024
bb8dbd2
format update
Ches-ctrl May 19, 2024
7aa61d5
tidy and add todo to speak with dan
Ches-ctrl May 19, 2024
d749010
add kaminari and update controller
Ches-ctrl May 19, 2024
b0a0e87
update container
Ches-ctrl May 19, 2024
50a2724
add spacing for pagination links
Ches-ctrl May 19, 2024
8d51825
remove will_paginate
Ches-ctrl May 19, 2024
dd8c2d8
minor padding update
Ches-ctrl May 19, 2024
3353941
add utility class for text
Ches-ctrl May 19, 2024
0abb407
add sort functionality on index page
Ches-ctrl May 19, 2024
14f2d19
scss update
Ches-ctrl May 19, 2024
ff07be9
add turbo frame
Ches-ctrl May 19, 2024
5794b58
add event listener for search box is empty
Ches-ctrl May 19, 2024
bd1ddda
update formatting for search box
Ches-ctrl May 19, 2024
04e8506
bundle update
Ches-ctrl May 19, 2024
ad75ef8
update styling of category sidebar
Ches-ctrl May 19, 2024
e0f2e76
sort by
Ches-ctrl May 19, 2024
607b860
sort by
Ches-ctrl May 19, 2024
fff21a8
adding back div
Ches-ctrl May 19, 2024
d31579f
add responsive dropdowns for mobile
Ches-ctrl May 19, 2024
6ef6233
update ordering
Ches-ctrl May 19, 2024
310678b
add dropdowns on small screens
Ches-ctrl May 19, 2024
a60e573
styling updates
Ches-ctrl May 19, 2024
8a040e7
make job card look reasonable on small screens - messy and needs upda…
Ches-ctrl May 19, 2024
7ebc521
Merge branch 'master' into 2024-05-16-integrate-user-feedback
Ches-ctrl May 19, 2024
aa50f27
update for git status
Ches-ctrl May 19, 2024
a98c47f
Merge branch '2024-05-16-integrate-user-feedback' of github.com:Ches-…
Ches-ctrl May 19, 2024
fcb359f
remove old gem version causing error
Ches-ctrl May 19, 2024
accd00c
relable other piece
Ches-ctrl May 19, 2024
7d0d395
commenting out mobile version for now until we have time to add
Ches-ctrl May 19, 2024
f045c5d
removing cache for category_sidebar
Ches-ctrl May 19, 2024
91d5273
remove rubocop error
Ches-ctrl May 19, 2024
1f8d269
turn off hubspot for now
Ches-ctrl May 19, 2024
30d83de
removing commented code as causing failures?
Ches-ctrl May 19, 2024
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
19 changes: 19 additions & 0 deletions .github/workflows/rubyonrails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,22 @@ jobs:

- name: Lint Ruby files
run: bundle exec rubocop --parallel

brakeman:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ruby and gems
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Run Brakeman
run: bundle exec brakeman -f sarif -o output.sarif.json
continue-on-error: true
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: output.sarif.json
3 changes: 3 additions & 0 deletions .slugignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec/**
.gitignore
.dockerignore

# Ignore contributing files
CONTRIBUTING.md

# Ignore yml files generated by VCR.
spec/fixtures/cassettes/ApplicantTrackingSystem/*.yml

Expand Down
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ gem 'rails-html-sanitizer'
gem "flipper-active_record", "~> 1.3"

# Monitoring
# gem 'newrelic_rpm' # TODO: install this gem for monitoring
gem 'newrelic_rpm'

# Analytics
# gem 'analytics-ruby', '~> 2.4.0', :require => 'segment/analytics' # TODO: install this gem for analytics
Expand Down Expand Up @@ -124,6 +124,9 @@ group :development, :test do
gem 'rubocop-rails'
gem 'rubocop-rspec'

# Security
gem 'brakeman', require: false

# Email
# gem 'letter_opener' # TODO: install this gem for email testing
end
Expand All @@ -135,9 +138,6 @@ group :development do
gem "better_errors"
gem "binding_of_caller"

# Security
# gem 'brakeman', require: false # TODO: install this gem for security checks

# Performance
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler" # TODO: install this gem for performance monitoring
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ GEM
bootstrap (5.3.2)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 2.11.8, < 3)
brakeman (6.1.2)
racc
builder (3.2.4)
bullet (7.1.6)
activesupport (>= 3.0.0)
Expand Down Expand Up @@ -246,6 +248,7 @@ GEM
timeout
net-smtp (0.5.0)
net-protocol
newrelic_rpm (9.9.0)
nio4r (2.7.1)
nokogiri (1.16.4-aarch64-linux)
racc (~> 1.4)
Expand Down Expand Up @@ -484,6 +487,7 @@ DEPENDENCIES
binding_of_caller
bootsnap
bootstrap
brakeman
bullet
capybara
cloudinary
Expand All @@ -502,6 +506,7 @@ DEPENDENCIES
importmap-rails
json (~> 2.6, >= 2.6.3)
meta-tags
newrelic_rpm
nokogiri
pg (~> 1.1)
pg_search
Expand Down
23 changes: 23 additions & 0 deletions app/views/jobs/_add_job_to_basket.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="d-flex align-items-center justify-content-center me-3">
<% if user_signed_in? %>
<% if @saved_job_ids.include?(job.id) %>
<%= link_to saved_job_path(job.saved_job_ids), data: {turbo_method: :delete} do %>
<i class="fa-solid fa-bookmark pe-2"></i>
<% end %>
<% else %>
<%= link_to job_saved_jobs_path(job), data: {turbo_method: :post} do %>
<i class="fa-regular fa-bookmark pe-2"></i>
<% end %>
<% end %>
<% include_checkboxes ||= false %>
<% if include_checkboxes %>
<div class="ms-3">
<%= check_box_tag "job_ids[]", job.id, onclick: "document.getElementById('apply_button').disabled = false" %>
</div>
<% end %>
<% end %>

<%= link_to job.posting_url, target: "_blank" do %>

Check notice

Code scanning / Brakeman

Potentially unsafe model attribute in link_to href. Note

Potentially unsafe model attribute in link\_to href.
<i class="fa-solid fa-arrow-up-right-from-square"></i>
<% end %>
</div>
13 changes: 13 additions & 0 deletions app/views/jobs/_basic_info.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="basic-info d-flex flex-column align-items-end justify-space-between text-sm">
<div class="salaryBudget"><%= job.salary.present? ? job.salary : "<br>".html_safe %></div>
<div class="my-1"><%= job.employment_type %> •
<% if job.remote %>
<%= "Remote"%>
<% elsif job.hybrid %>
<%= "Hybrid" %>
<% else %>
<%= "In-office" %>
<% end %>
</div>
<div><%= job.date_posted.strftime("%d/%m") %> <span class="meter"><hr class="line-horizontal"><div class="triangle-inverted-blue" style="left:<%= (job.deadline.nil? || job.deadline < Date.today) ? 50 : (Date.today - job.date_posted).to_i.fdiv((job.deadline - job.date_posted).to_i) * 100 %>%;"></div></span> <%= (job.deadline.nil? || job.deadline < Date.today) ? "Rolling" : job.deadline.strftime("%d/%m") %></div>
</div>
3 changes: 1 addition & 2 deletions app/views/jobs/_category_sidebar.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="col-sm-3" data-job-index-toggle-target="leftSection">
<div data-job-index-toggle-target="leftSection">

<div class = "d-flex">
<p class="pb-0"><%= @jobs.count %> jobs • <%= link_to 'Clear filters', jobs_path %></p>
Expand All @@ -20,5 +20,4 @@
<% @resources.each_with_index do |(resource, data), index| %>
<%= render partial: 'category_sidebar_section', locals: {title: section_titles[index], resource: resource, resources: data, icon: icons[index]} %>
<% end %>

</div>
3 changes: 3 additions & 0 deletions app/views/jobs/_climate_rating.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="d-flex flex-column align-items-center justify-content-center text-sm">
<div class="climate-rating"><%# job.company.carbon_pledge || 'no data' %>no data</div>
</div>
13 changes: 13 additions & 0 deletions app/views/jobs/_difficulty_rating.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="d-flex flex-column align-items-center justify-content-center text-sm">
<div class="apply-rating">
<%# To-do: Create a difficulty column for jobs table and transfer this logic to JobCreator; eventually GetFormFieldsJob will distinguish between input and text fields (for longer responses), which will help with accurate classification %>
<% if job.requirement.no_of_qs < 8 && !job.requirement.cover_letter %>
<% apply_rating = 'no data' %>
<% elsif job.requirement.no_of_qs > 15 %>
<% apply_rating = 'hard' %>
<% else %>
<% apply_rating = 'medium' %>
<% end %>
<%= apply_rating %>
</div>
</div>
104 changes: 9 additions & 95 deletions app/views/jobs/_job_card.html.erb
Original file line number Diff line number Diff line change
@@ -1,103 +1,17 @@
<div class="card job-card mb-2" data-select-by-job-type-target="jobRow">
<div class="row card-body">
<%# TODO: Store company logo, use clearbit when we don't have one %>

<%# Logo %>
<div class="col-5 d-flex flex-row align-items-center">
<div class="d-flex justify-content-center align-items-center mx-2">
<%= link_to company_path(job.company), target: "_blank" do %>
<%= image_tag("https://logo.clearbit.com/#{job.company.url_website}", onerror: "this.src='https://i.pinimg.com/736x/ec/d9/c2/ecd9c2e8ed0dbbc96ac472a965e4afda.jpg'", style: "width: 60px; height: 60px; padding-right: 0.5rem;") %>
<% end %>
</div>

<%# Job Title, Company, Location %>
<div class="d-flex flex-column justify-content-center align-items-start" data-role="<%= job.title %>">
<%= link_to job_path(job), target: "_blank" do %>
<strong><%= job.title.truncate(35) %></strong>
<% end %>

<%= link_to company_path(job.company), target: "_blank" do %>
<strong class="text-sm"><%= job.company.name %></strong>
<% end %>

<div class="text-sm">
<% if job.remote || job.locations.empty? %>
Remote
<% else %>
<%= job.locations.map(&:city).join(' | ') %>
<% end %>
<% if job.countries.loaded? || job.countries.count == 1 %>
<%= " | #{job.countries.first.name}" if job.countries.count == 1 %>
<% else %>
<%= " | #{job.countries.first.name}" if job.countries.size == 1 %>
<% end %>
</div>
</div>
<%# Logo & Info %>
<div class="col-12 col-md-5 col-lg-5 d-flex flex-row align-items-center mb-2 mb-md-0">
<%= render partial: 'jobs/logo', locals: { job: job } %>
<%= render partial: 'jobs/job_info', locals: { job: job } %>
</div>

<%# Job Details %>
<div class="col-7 d-flex flex-row justify-content-between align-items-center">

<%# Salary etc. %>
<div class="basic-info d-flex flex-column align-items-end justify-space-between text-sm">
<div class="salaryBudget"><%= job.salary.present? ? job.salary : "<br>".html_safe %></div>
<div class="my-1"><%= job.employment_type %> •
<% if job.remote %>
<%= "Remote"%>
<% elsif job.hybrid %>
<%= "Hybrid" %>
<% else %>
<%= "In-office" %>
<% end %>
</div>
<div><%= job.date_posted.strftime("%d/%m") %> <span class="meter"><hr class="line-horizontal"><div class="triangle-inverted-blue" style="left:<%= (job.deadline.nil? || job.deadline < Date.today) ? 50 : (Date.today - job.date_posted).to_i.fdiv((job.deadline - job.date_posted).to_i) * 100 %>%;"></div></span> <%= (job.deadline.nil? || job.deadline < Date.today) ? "Rolling" : job.deadline.strftime("%d/%m") %></div>
</div>

<%# Net Zero Rating %>
<div class="d-flex flex-column align-items-center justify-content-center text-sm">
<div class="climate-rating"><%# job.company.carbon_pledge || 'no data' %>no data</div>
</div>

<%# Ease of Applying %>
<div class="d-flex flex-column align-items-center justify-content-center text-sm">
<div class="apply-rating">
<%# To-do: Create a difficulty column for jobs table and transfer this logic to JobCreator; eventually GetFormFieldsJob will distinguish between input and text fields (for longer responses), which will help with accurate classification %>
<% if job.requirement.no_of_qs < 8 && !job.requirement.cover_letter %>
<% apply_rating = 'no data' %>
<% elsif job.requirement.no_of_qs > 15 %>
<% apply_rating = 'hard' %>
<% else %>
<% apply_rating = 'medium' %>
<% end %>
<%= apply_rating %>
</div>
</div>


<%# Add job to basket %>
<div class="d-flex align-items-center justify-content-center me-3">
<% if user_signed_in? %>
<% if @saved_job_ids.include?(job.id) %>
<%= link_to saved_job_path(job.saved_job_ids), data: {turbo_method: :delete} do %>
<i class="fa-solid fa-bookmark pe-2"></i>
<% end %>
<% else %>
<%= link_to job_saved_jobs_path(job), data: {turbo_method: :post} do %>
<i class="fa-regular fa-bookmark pe-2"></i>
<% end %>
<% end %>
<% include_checkboxes ||= false %>
<% if include_checkboxes %>
<div class="ms-3">
<%= check_box_tag "job_ids[]", job.id, onclick: "document.getElementById('apply_button').disabled = false" %>
</div>
<% end %>
<% end %>

<%= link_to job.posting_url, target: "_blank" do %>
<i class="fa-solid fa-arrow-up-right-from-square"></i>
<% end %>
</div>
<div class="col-12 col-md-7 col-lg-7 d-flex flex-row justify-content-between align-items-center">
<%= render partial: 'jobs/basic_info', locals: { job: job } %>
<%= render partial: 'jobs/climate_rating', locals: { job: job } %>
<%= render partial: 'jobs/difficulty_rating', locals: { job: job } %>
<%= render partial: 'jobs/add_job_to_basket', locals: { job: job, saved_job_ids: @saved_job_ids } %>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/jobs/_job_cards_container.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="col-sm-9">
<div>
<turbo-frame id="job-cards-frame">
<%= render partial: 'job_card', collection: @jobs, as: :job %>
</turbo-frame>
Expand Down
22 changes: 22 additions & 0 deletions app/views/jobs/_job_info.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<div class="d-flex flex-column justify-content-center align-items-start" data-role="<%= job.title %>">
<%= link_to job_path(job), target: "_blank" do %>
<strong><%= job.title.truncate(35) %></strong>
<% end %>

<%= link_to company_path(job.company), target: "_blank" do %>
<strong class="text-sm"><%= job.company.name %></strong>
<% end %>

<div class="text-sm">
<% if job.remote || job.locations.empty? %>
Remote
<% else %>
<%= job.locations.map(&:city).join(' | ') %>
<% end %>
<% if job.countries.loaded? || job.countries.count == 1 %>
<%= " | #{job.countries.first.name}" if job.countries.count == 1 %>
<% else %>
<%= " | #{job.countries.first.name}" if job.countries.size == 1 %>
<% end %>
</div>
</div>
5 changes: 5 additions & 0 deletions app/views/jobs/_logo.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="d-flex justify-content-center align-items-center mx-2">
<%= link_to company_path(job.company), target: "_blank" do %>
<%= image_tag("https://logo.clearbit.com/#{job.company.url_website}", onerror: "this.src='https://i.pinimg.com/736x/ec/d9/c2/ecd9c2e8ed0dbbc96ac472a965e4afda.jpg'", style: "width: 60px; height: 60px; padding-right: 0.5rem;") %>
<% end %>
</div>
22 changes: 13 additions & 9 deletions app/views/jobs/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<%# The title meta tag here seems to be affecting the filter_category_sidebar. Not sure how to fix because I don't want to break anything but uncomment the title "All Jobs" below to see what I mean %>

<%# <% title "All Jobs" %>
<% description "Discover thousands of jobs on our platform. With Cheddar's innovative one-click applciation process, you can select multiple positions that interest you and apply to all of them at once without having to leave our site." %>
<% title "Find Jobs" %>
<% description "Discover and apply to thousands of jobs with Cheddar's innovative one-click application process. Add jobs that interest you to your basket and apply to all of them at once, without ever need to leave our site." %>

<div class="container" data-controller="select-by-job-type">

<div class="d-flex justify-content-center align-items-center pb-4">
<%= render 'search' %>
<div class="row d-flex justify-content-center align-items-center pb-4">
<div class="col-12 col-md-8">
<%= render 'search' %>
</div>
</div>

<div class="row">
<%= render 'category_sidebar' %>
<%= render 'job_cards_container' %>
<div class="col-12 col-md-9 order-md-2">
<%= render 'job_cards_container' %>
</div>
<div class="col-12 col-md-3 order-md-1 mb-4 mb-md-0">
<%= render 'category_sidebar' %>
</div>
</div>
</div>
Loading
Loading