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

[#16] [Frontend] As a User, I can sign up and sign in/out with a username and password #37

Merged
merged 42 commits into from Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
cd2e2f9
[#16] Add UI for Sign In view
malparty Jun 15, 2021
e12fbed
[#16] Add basic navbar for unauthenticated user
malparty Jun 15, 2021
f2b09d5
[#16] Add UI for alert and notice messages
malparty Jun 15, 2021
57ddc5d
[#16] Fix semantic issue in sign in view
malparty Jun 15, 2021
8150621
[#16] Add UI for Sign Up view
malparty Jun 15, 2021
b14e8c0
[#16] Add nav bar for authenticated users
malparty Jun 15, 2021
63e742b
[#16] Add UI to Users/edit view
malparty Jun 15, 2021
257b239
[#16] Add responsiveness to user edit view
malparty Jun 15, 2021
40b078d
[#16] Use translation locales
malparty Jun 15, 2021
b3360ee
[#16] Remove rspec exceptions when asset is missing in test pipeline
malparty Jun 15, 2021
ca268d6
[#16] Fix tests due to Log In button renamed in Sign In
malparty Jun 15, 2021
72e98d3
[#16] Add My Profile link to navbar
malparty Jun 15, 2021
4785ee4
[#16] Add Footer UI
malparty Jun 15, 2021
decca3e
[#16] Extract header and footer in partial views
malparty Jun 15, 2021
0a2bd62
[#16] Update footer to use flex
malparty Jun 15, 2021
11594a6
[#16] Add UI for error messages
malparty Jun 15, 2021
827add8
[#16] Add margin top to footer
malparty Jun 15, 2021
8415fe6
[#16] Update system tests to map error message
malparty Jun 15, 2021
67e64b0
[#16] Move footer into layout scss and shared html
malparty Jun 16, 2021
78d07ec
[#16] Add empty line to logo.svg
malparty Jun 16, 2021
f3befbd
[#16] Move edit/new forms into partial views
malparty Jun 16, 2021
aa9837a
[#16] Add missing class to html footer
malparty Jun 16, 2021
c3929e4
root commit
malparty Jun 11, 2021
1d89d8b
[#17] Reduce unused bootstrap modules
malparty Jun 16, 2021
c84036a
[#17] Update default layout scss to follow conventions
malparty Jun 16, 2021
7482850
[#16] Remove .keep and disable some unused bootstrap modules
malparty Jun 18, 2021
cc1337d
[#16] Rename _default.scss without _ to match convention
malparty Jun 21, 2021
f5731ba
[#16] Add empty lines for code clarity
malparty Jun 21, 2021
b372b7c
[#16] Remove useless div
malparty Jun 21, 2021
81bb783
root commit
malparty Jun 11, 2021
dbc17af
Add Run undercover before run danger in Review workflow
malparty Jun 18, 2021
72d3e29
Add Run undercover before run danger in Review workflow
malparty Jun 18, 2021
e10d6ed
Add Run rspec to generate code coverage data
malparty Jun 18, 2021
3186de2
Add Run rspec to generate code coverage data
malparty Jun 18, 2021
cd36280
Refactor workflow review to use docker container
malparty Jun 18, 2021
be5e3c5
Add missing env var
malparty Jun 18, 2021
4d682b6
Add missing docker-compase.yml
malparty Jun 18, 2021
d3fe8d8
Comment undercover in dangerfile
malparty Jun 18, 2021
2cc6ebb
Comment undercover in dangerfile - simplecov.report
malparty Jun 18, 2021
b9f59b8
Adding false positive for package vulnerability warning
malparty Jun 18, 2021
3c1f73c
Update ignore comment
malparty Jun 18, 2021
27b2f05
root commit
malparty Jun 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dangerfile
Expand Up @@ -19,7 +19,8 @@ suggester.suggest
eslint.lint

# Report your Ruby app test suite code coverage in Danger.
simplecov.report 'coverage/coverage.json'
# simplecov.report 'coverage/coverage.json'

# Report missing test coverage of new changes in Danger
undercover.report
# Commented as undercover reports needs tests to run, which needs a different env
# undercover.report
Empty file removed app/assets/images/.keep
Empty file.
1 change: 1 addition & 0 deletions app/assets/images/logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Expand Up @@ -12,6 +12,7 @@
// Base

// Layouts
@import 'layouts/default';

// Components

Expand Down
Empty file.
Empty file.
9 changes: 9 additions & 0 deletions app/assets/stylesheets/layouts/default.scss
@@ -0,0 +1,9 @@
.layout-default {
.app-footer {
width: 100%;
height: 60px;
margin-top: 2rem;
line-height: 60px;
background-color: $gray-100;
}
}
36 changes: 18 additions & 18 deletions app/assets/stylesheets/vendor/bootstrap/bootstrap.scss
Expand Up @@ -10,33 +10,33 @@
@import 'bootstrap/scss/reboot';
@import 'bootstrap/scss/type';
@import 'bootstrap/scss/utilities';
@import 'bootstrap/scss/images';
//@import 'bootstrap/scss/images';
@import 'bootstrap/scss/grid';
@import 'bootstrap/scss/forms';
@import 'bootstrap/scss/buttons';
@import 'bootstrap/scss/tables';
@import 'bootstrap/scss/code';
@import 'bootstrap/scss/transitions';
//@import 'bootstrap/scss/tables';
//@import 'bootstrap/scss/code';
//@import 'bootstrap/scss/transitions';
@import 'bootstrap/scss/dropdown';
@import 'bootstrap/scss/button-group';
@import 'bootstrap/scss/input-group';
@import 'bootstrap/scss/custom-forms';
//@import 'bootstrap/scss/custom-forms';
@import 'bootstrap/scss/nav';
@import 'bootstrap/scss/navbar';
@import 'bootstrap/scss/card';
@import 'bootstrap/scss/breadcrumb';
//@import 'bootstrap/scss/breadcrumb';
@import 'bootstrap/scss/pagination';
@import 'bootstrap/scss/badge';
@import 'bootstrap/scss/jumbotron';
//@import 'bootstrap/scss/badge';
//@import 'bootstrap/scss/jumbotron';
@import 'bootstrap/scss/alert';
@import 'bootstrap/scss/progress';
@import 'bootstrap/scss/media';
@import 'bootstrap/scss/list-group';
@import 'bootstrap/scss/close';
@import 'bootstrap/scss/toasts';
@import 'bootstrap/scss/modal';
@import 'bootstrap/scss/tooltip';
@import 'bootstrap/scss/popover';
@import 'bootstrap/scss/carousel';
@import 'bootstrap/scss/spinners';
@import 'bootstrap/scss/print';
//@import 'bootstrap/scss/media';
//@import 'bootstrap/scss/list-group';
//@import 'bootstrap/scss/close';
//@import 'bootstrap/scss/toasts';
//@import 'bootstrap/scss/modal';
//@import 'bootstrap/scss/tooltip';
//@import 'bootstrap/scss/popover';
//@import 'bootstrap/scss/carousel';
//@import 'bootstrap/scss/spinners';
//@import 'bootstrap/scss/print';
Empty file removed app/controllers/concerns/.keep
Empty file.
1 change: 1 addition & 0 deletions app/views/devise/confirmations/new.html.erb
@@ -1,6 +1,7 @@
<h2>Resend confirmation instructions</h2>

<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>

<%= render "devise/shared/error_messages", resource: resource %>

<div class="field">
Expand Down
2 changes: 2 additions & 0 deletions app/views/devise/passwords/edit.html.erb
@@ -1,7 +1,9 @@
<h2>Change your password</h2>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>

<%= render "devise/shared/error_messages", resource: resource %>

<%= f.hidden_field :reset_password_token %>

<div class="field">
Expand Down
1 change: 1 addition & 0 deletions app/views/devise/passwords/new.html.erb
@@ -1,6 +1,7 @@
<h2>Forgot your password?</h2>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>

<%= render "devise/shared/error_messages", resource: resource %>

<div class="field">
Expand Down
70 changes: 70 additions & 0 deletions app/views/devise/registrations/_edit_form.html.erb
@@ -0,0 +1,70 @@
<%= form_for(resource, as: resource_name,
url: registration_path(resource_name), html: { method: :put }) do |f| %>

<%= render "devise/shared/error_messages", resource: resource %>
malparty marked this conversation as resolved.
Show resolved Hide resolved

<div class="row">
<div class="col-12 col-md-6">
<div class="form-group">
<%= f.label :first_name %><br/>
<%= f.text_field :first_name, autofocus: true, class: 'form-control' %>
</div>
</div>
<div class="col-12 col-md-6">
<div class="form-group">
<%= f.label :last_name %><br/>
<%= f.text_field :last_name, class: 'form-control' %>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-md-6">
<%= f.label :email %>
<div class="form-group">
<%= f.email_field :email, autocomplete: 'email', class: 'form-control' %>
</div>

<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div><%= t('waiting_confirmation_for') %>: <%= resource.unconfirmed_email %></div>
<% end %>
</div>
<div class="col-12 col-md-6">
<div class="form-group">
<%= f.label :current_password %>
<%= f.password_field :current_password, autocomplete: 'current-password', class: 'form-control' %>
</div>
</div>
</div>
<div class="row">
<a class="btn btn-link"
data-toggle="collapse"
href="#newPassword"
role="button"
aria-expanded="false"
aria-controls="newPassword">
Set a new password
</a>
</div>
<div class="collapse" id="newPassword">
<% if @minimum_password_length %>
Copy link

@github-actions github-actions bot Jun 21, 2021

Choose a reason for hiding this comment

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

⚠️ Replace instance variable with local variable

<em>(<%= "#{@minimum_password_length} #{t('min_char')}" %>)</em>
Copy link

@github-actions github-actions bot Jun 21, 2021

Choose a reason for hiding this comment

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

⚠️ Replace instance variable with local variable

<% end %>
<div class="row">
<div class="col-12 col-md-6">
<div class="form-group">
<%= f.label :password %> <br/>
<%= f.password_field :password, autocomplete: "new-password", class: 'form-control' %>
</div>
</div>
<div class="col-12 col-md-6">
<div class="form-group">
<%= f.label :password_confirmation %><br/>
<%= f.password_field :password_confirmation, autocomplete: 'new-password', class: 'form-control' %>
</div>
</div>
</div>
</div>

<%= f.submit t('update'), class: 'btn btn-primary btn-block' %>

<% end %>
31 changes: 31 additions & 0 deletions app/views/devise/registrations/_new_form.html.erb
@@ -0,0 +1,31 @@
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>

<%= render "devise/shared/error_messages", resource: resource %>

<div class="form-group">
<%= f.label :first_name %><br/>
<%= f.text_field :first_name, autofocus: true, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :last_name %><br/>
<%= f.text_field :last_name, class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :email %><br/>
<%= f.email_field :email, autocomplete: 'email', class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :password %><br/>
<% if @minimum_password_length %>
Copy link

@github-actions github-actions bot Jun 16, 2021

Choose a reason for hiding this comment

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

⚠️ Replace instance variable with local variable

<em>(<%= "#{@minimum_password_length} #{t('min_char')}" %>)</em>
Copy link

@github-actions github-actions bot Jun 16, 2021

Choose a reason for hiding this comment

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

⚠️ Replace instance variable with local variable

<% end %><br/>
<%= f.password_field :password, autocomplete: 'new-password', class: 'form-control' %>
</div>
<div class="form-group">
<%= f.label :password_confirmation %><br/>
<%= f.password_field :password_confirmation, autocomplete: 'new-password', class: 'form-control' %>
</div>
<div class="form-group">
<%= f.submit t('auth.sign_up'), class: 'btn btn-primary btn-block' %>
</div>
<% end %>
78 changes: 27 additions & 51 deletions app/views/devise/registrations/edit.html.erb
@@ -1,53 +1,29 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>

<div class="field">
<%= f.label :first_name %><br />
<%= f.text_field :first_name, autofocus: true %>
<div class="container">
<div class="row justify-content-center">
<div class="col col-md-12 col-lg-8">
<div class="card">
<section class="card-body">
<h2>Edit <%= resource_name.to_s.humanize %></h2>

<%= render 'edit_form' %>
</section>
</div>
</div>
</div>

<div class="field">
<%= f.label :last_name %><br />
<%= f.text_field :last_name %>
</div>

<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autocomplete: "email" %>
<div class="row justify-content-center mt-2">
<div class="col col-md-6 col-lg-4">
<div class="card">
<section class="card-body">
<h3>Cancel my account</h3>

<p><%= t('unhappy') %>? 🥺</p>
<%= button_to t('auth.cancel_my_account'),
registration_path(resource_name),
data: { confirm: t('confirm') },
method: :delete,
class: 'btn btn-danger btn-block' %>
</section>
</div>
</div>
</div>

<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>

<div class="field">
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
<%= f.password_field :password, autocomplete: "new-password" %>
<% if @minimum_password_length %>
<br />
<em><%= @minimum_password_length %> characters minimum</em>
<% end %>
</div>

<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
</div>

<div class="field">
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password, autocomplete: "current-password" %>
</div>

<div class="actions">
<%= f.submit "Update" %>
</div>
<% end %>

<h3>Cancel my account</h3>

<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>

<%= link_to "Back", :back %>
</div>
53 changes: 14 additions & 39 deletions app/views/devise/registrations/new.html.erb
@@ -1,39 +1,14 @@
<h2>Sign up</h2>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>

<div class="field">
<%= f.label :first_name %><br />
<%= f.text_field :first_name, autofocus: true %>
</div>

<div class="field">
<%= f.label :last_name %><br />
<%= f.text_field :last_name %>
</div>

<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autocomplete: "email" %>
</div>

<div class="field">
<%= f.label :password %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autocomplete: "new-password" %>
</div>

<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
</div>

<div class="actions">
<%= f.submit "Sign up" %>
</div>
<% end %>

<%= render "devise/shared/links" %>
<div class="container">
<div class="row justify-content-center">
<div class="col col-md-6 col-lg-4">
<div class="card">
<section class="card-body">
<%= link_to t('auth.sign_in'), new_session_path(resource_name), class: 'float-right btn btn-outline-primary' %>
<h4 class="card-title mb-4 mt-1">Sign up</h4>

<%= render 'devise/registrations/new_form' %>
</section>
</div>
</div>
</div>
</div>