Skip to content
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
dbc148b
updated travis ci badges & iter0 doc
junyu-w Oct 8, 2016
79445f8
updated code climate badge & iter0 doc
junyu-w Oct 8, 2016
089e1eb
added pivotal tracker project url
junyu-w Oct 8, 2016
703b0be
iter 1: cucumber
Shuotong Oct 14, 2016
cc649b2
Merge remote-tracking branch 'upstream/develop' into develop
junyu-w Oct 15, 2016
ac82d6f
added status of both main repo and forked repo to readme
junyu-w Oct 15, 2016
982f2a3
Merge branch 'cucumber' into develop
junyu-w Oct 15, 2016
a3ada8b
added heroku staging url
junyu-w Oct 15, 2016
acad466
added github login functionality
junyu-w Oct 20, 2016
e594d45
removed copied sample code
junyu-w Oct 20, 2016
65dee30
added bootstrap gems
junyu-w Oct 20, 2016
aeb22e1
added annotate gem and better error gem
junyu-w Oct 20, 2016
a59f53d
added role attr to users
junyu-w Oct 20, 2016
210605a
added migration to create root user
junyu-w Oct 20, 2016
7abeb4d
changed omniauth github path
junyu-w Oct 20, 2016
d78f7b1
added updated application.yml.asc file
junyu-w Oct 20, 2016
b94d7fd
added credential for test env
junyu-w Oct 20, 2016
d71c2da
added whitelist authorized user checking during login
junyu-w Oct 20, 2016
5c127d4
fixed root user migration & added success msg for github signing in
junyu-w Oct 20, 2016
fa7c364
updated env file
junyu-w Oct 20, 2016
3d0caf7
passed tests assumed no whitelist functionality
junyu-w Oct 20, 2016
bab3832
removed test from env file
junyu-w Oct 20, 2016
a70594d
fixed bug in user login feature
junyu-w Oct 20, 2016
1a1b511
removed duplicated notice msg
junyu-w Oct 20, 2016
f99a57d
updated env file to include staging environment
junyu-w Oct 21, 2016
d9eba9a
removed whitelist checking
junyu-w Oct 21, 2016
8e3e1bd
added user uid validation
junyu-w Oct 21, 2016
327480a
removed uid validation because of conflict with admin
junyu-w Oct 21, 2016
f9959ab
front-end added
junyu-w Oct 21, 2016
76378af
added user authentication
junyu-w Oct 21, 2016
c47f8dd
updated schema & staging env encryption key
junyu-w Oct 21, 2016
3a2ce5e
fixed old tests except for view metric sample with secrets & removed …
junyu-w Oct 21, 2016
10790f9
removed redundant user session check
junyu-w Oct 21, 2016
687b040
Merge remote-tracking branch 'upstream/develop' into develop
junyu-w Oct 24, 2016
e720fd9
Merge branch 'develop' into feature/login-with-github
junyu-w Oct 24, 2016
800848a
removed username/password related stuff
junyu-w Oct 25, 2016
031c182
removed unused controller files
junyu-w Oct 26, 2016
edcaff0
added root user with github credentials
junyu-w Oct 26, 2016
4c274c5
test passing with intermittent db locking error after adding mocked o…
junyu-w Oct 26, 2016
fbbe572
fixed tests
junyu-w Oct 26, 2016
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
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,19 @@ gem 'timecop'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'devise'
gem 'omniauth-github', github: 'intridea/omniauth-github'

gem 'bootstrap-sass', '~> 3.3.6'

group :development, :test do
gem 'sqlite3'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'dotenv-rails'
gem 'annotate'
gem 'better_errors'
gem 'binding_of_caller'
end

group :test do
Expand Down
54 changes: 53 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
GIT
remote: git://github.com/intridea/omniauth-github.git
revision: 45f2fc73d6d06f30863adac0e6aa112bcaaadf67
specs:
omniauth-github (1.1.2)
omniauth (~> 1.0)
omniauth-oauth2 (>= 1.1.1, < 2.0)

GIT
remote: https://github.com/AgileVentures/ProjectMetrics/
revision: 8ddb909abe2396cb2b9f454aa35821a5d1a6ff9c
Expand Down Expand Up @@ -80,15 +88,28 @@ GEM
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
annotate (2.7.1)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 12.0)
arel (6.0.3)
attr_encrypted (3.0.3)
encryptor (~> 3.0.0)
autoprefixer-rails (6.5.1)
execjs
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
bcrypt (3.1.11)
better_errors (2.1.1)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
rack (>= 0.9.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
builder (3.2.2)
byebug (9.0.5)
capybara (2.8.1)
Expand All @@ -99,6 +120,7 @@ GEM
rack-test (>= 0.5.4)
xpath (~> 2.0)
cliver (0.3.2)
coderay (1.1.1)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
coffee-rails (4.1.1)
Expand Down Expand Up @@ -136,6 +158,12 @@ GEM
uber (>= 0.0.15)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.2.0)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0, < 5.1)
responders
warden (~> 1.2.3)
diff-lcs (1.2.5)
docile (1.1.5)
dotenv (2.1.1)
Expand Down Expand Up @@ -178,6 +206,7 @@ GEM
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
jwt (1.5.6)
launchy (2.4.3)
addressable (~> 2.3)
loofah (2.0.3)
Expand All @@ -196,8 +225,21 @@ GEM
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
oauth2 (1.2.0)
faraday (>= 0.8, < 0.10)
jwt (~> 1.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-oauth2 (1.4.0)
oauth2 (~> 1.0)
omniauth (~> 1.2)
orm_adapter (0.5.0)
pg (0.18.4)
phantomjs (2.1.1.0)
pkg-config (1.1.7)
Expand Down Expand Up @@ -246,6 +288,8 @@ GEM
representable (3.0.0)
declarative (~> 0.0.5)
uber (~> 0.0.15)
responders (2.3.0)
railties (>= 4.2.0, < 5.1)
rspec-core (3.5.3)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
Expand Down Expand Up @@ -325,6 +369,8 @@ GEM
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
warden (1.2.6)
rack (>= 1.0)
web-console (2.3.0)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
Expand All @@ -344,19 +390,25 @@ PLATFORMS
ruby

DEPENDENCIES
annotate
attr_encrypted
better_errors
binding_of_caller
bootstrap-sass (~> 3.3.6)
byebug
coffee-rails (~> 4.1.0)
cucumber-rails
cucumber-rails-training-wheels
database_cleaner
devise
dotenv-rails
factory_girl_rails
figaro
haml
jbuilder (~> 2.0)
jquery-rails
launchy
omniauth-github!
pg
phantomjs
poltergeist
Expand Down Expand Up @@ -386,4 +438,4 @@ RUBY VERSION
ruby 2.3.1p112

BUNDLED WITH
1.12.5
1.13.3
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Main Repo Status:

<a href="https://codeclimate.com/github/AgileVentures/projectscope_mvp"><img src="https://codeclimate.com/github/AgileVentures/projectscope_mvp/badges/gpa.svg" /></a>
<a href="https://travis-ci.org/AgileVentures/projectscope_mvp"><img src="https://travis-ci.org/AgileVentures/projectscope_mvp.svg?branch=master"></a>

CS169 Group Forked Repo Status:

<a href="https://codeclimate.com/github/DrakeW/projectscope"><img src="https://codeclimate.com/github/DrakeW/projectscope/badges/gpa.svg" /></a>
<a href="https://travis-ci.org/DrakeW/projectscope"><img src="https://travis-ci.org/DrakeW/projectscope.svg?branch=develop"></a>

# MVP dashboard for ProjectScope

A dashboard to show project metrics such as those supported by gems like
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
//
//= require jquery
//= require jquery_ujs
//= require bootstrap-sprockets
//= require turbolinks
//= require_tree .
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";
3 changes: 2 additions & 1 deletion app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
class ProjectsController < ApplicationController
before_action :set_project, only: [:show, :edit, :update, :destroy]
before_action :authenticate_user!

http_basic_authenticate_with name: "cs169", password: ENV['PROJECTSCOPE_PASSWORD']
# http_basic_authenticate_with name: "cs169", password: ENV['PROJECTSCOPE_PASSWORD']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's remove this if not being used any more - we should avoid commenting old code - old code is kept in git history


# GET /projects
# GET /projects.json
Expand Down
28 changes: 28 additions & 0 deletions app/controllers/users/confirmations_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class Users::ConfirmationsController < Devise::ConfirmationsController
# GET /resource/confirmation/new
# def new
# super
# end

# POST /resource/confirmation
# def create
# super
# end

# GET /resource/confirmation?confirmation_token=abcdef
# def show
# super
# end

# protected

# The path used after resending confirmation instructions.
# def after_resending_confirmation_instructions_path_for(resource_name)
# super(resource_name)
# end

# The path used after confirmation.
# def after_confirmation_path_for(resource_name, resource)
# super(resource_name, resource)
# end
end
39 changes: 39 additions & 0 deletions app/controllers/users/omniauth_callbacks_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
# You should configure your model like this:
# devise :omniauthable, omniauth_providers: [:twitter]

# You should also create an action method in this controller like this:
# def twitter
# end

# More info at:
# https://github.com/plataformatec/devise#omniauth

# GET|POST /resource/auth/twitter
# def passthru
# super
# end

# GET|POST /users/auth/twitter/callback
# def failure
# super
# end

# protected

# The path used when OmniAuth fails
# def after_omniauth_failure_path_for(scope)
# super(scope)
# end

def github
@user = User.from_omniauth(request.env["omniauth.auth"])
if @user.nil?
flash[:alert] = "You are not authorized."
redirect_to new_user_session_path
else
flash[:notice] = "Signed in successfully."
sign_in_and_redirect @user
end
end
end
32 changes: 32 additions & 0 deletions app/controllers/users/passwords_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class Users::PasswordsController < Devise::PasswordsController
# GET /resource/password/new
# def new
# super
# end

# POST /resource/password
# def create
# super
# end

# GET /resource/password/edit?reset_password_token=abcdef
# def edit
# super
# end

# PUT /resource/password
# def update
# super
# end

# protected

# def after_resetting_password_path_for(resource)
# super(resource)
# end

# The path used after sending reset password instructions
# def after_sending_reset_password_instructions_path_for(resource_name)
# super(resource_name)
# end
end
60 changes: 60 additions & 0 deletions app/controllers/users/registrations_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
class Users::RegistrationsController < Devise::RegistrationsController
# before_action :configure_sign_up_params, only: [:create]
# before_action :configure_account_update_params, only: [:update]

# GET /resource/sign_up
# def new
# super
# end

# POST /resource
# def create
# super
# end

# GET /resource/edit
# def edit
# super
# end

# PUT /resource
# def update
# super
# end

# DELETE /resource
# def destroy
# super
# end

# GET /resource/cancel
# Forces the session data which is usually expired after sign
# in to be expired now. This is useful if the user wants to
# cancel oauth signing in/up in the middle of the process,
# removing all OAuth session data.
# def cancel
# super
# end

# protected

# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_up_params
# devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])
# end

# If you have extra params to permit, append them to the sanitizer.
# def configure_account_update_params
# devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
# end

# The path used after sign up.
# def after_sign_up_path_for(resource)
# super(resource)
# end

# The path used after sign up for inactive accounts.
# def after_inactive_sign_up_path_for(resource)
# super(resource)
# end
end
25 changes: 25 additions & 0 deletions app/controllers/users/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class Users::SessionsController < Devise::SessionsController
# before_action :configure_sign_in_params, only: [:create]

# GET /resource/sign_in
# def new
# super
# end

# POST /resource/sign_in
# def create
# super
# end

# DELETE /resource/sign_out
# def destroy
# super
# end

# protected

# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_in_params
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
# end
end
Loading