Skip to content

Commit

Permalink
Merge branch 'master' of github.com:shapeable/prototype-web into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesaurio committed Mar 3, 2017
2 parents d1b8f0b + 1f88e5b commit 4cead2c
Show file tree
Hide file tree
Showing 34 changed files with 402 additions and 33 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Implementation
+ Creation of Mock-ups - [Link](https://github.com/shapeable/prototype-web/blob/master/supporting-documents/design/Prototype%20mock%20ups.pdf)
+ Initial mock ups reviewed with unassociated staff member to provide additional feedback on application behavior - [Link](https://github.com/shapeable/prototype-web/blob/master/supporting-documents/design/Prototype%20mock%20ups%20V1.pdf)
+ Final mock-ups with the implementation of user feedback - [Link](https://github.com/shapeable/prototype-web/blob/master/supporting-documents/design/Prototype%20mock%20ups%20V2.pdf)
+ The [clickable wireframes](https://invis.io/6VAJF25EK) were tested by potential government and resident users. The design of the tests included 4 main tasks. - [Link to user testing](https://github.com/shapeable/prototype-web/tree/master/supporting-documents/user-testing)
+ The [clickable wireframes](https://invis.io/6VAJF25EK) were tested by potential government and resident users. The design of the tests included 4 main tasks. - [Link to user testing](https://github.com/shapeable/prototype-web/blob/master/supporting-documents/user-testing/TasksforUsertesting.pdf)

+ Changes from former feedback were incorporated to design a [final prototype design](https://github.com/shapeable/prototype-web/blob/master/supporting-documents/design/Prototype%20wireframes.pdf) which was tested again in another focus group for validation. The design of the tests included 4 main tasks. - [Link to user testing](https://github.com/shapeable/prototype-web/tree/master/supporting-documents/user-testing)

Expand All @@ -101,6 +101,8 @@ In the absence of actual government administrator user responsibilities, access,
+ A government administrator would have access to all alerts.
+ A government administrator can force alerts when needed.

The sig in tab is available for editing resident profile information, authentication is not required.

#### D. Used at least three “human-centered design” techniques or tools
Multiple human-centered design techniques were used in the development of the prototype.
These included:
Expand Down Expand Up @@ -132,13 +134,15 @@ Results of the accesibility audits for the application can be found under the [a

A style guide was created by the UI designer with all the design elements present in the prototype. - [California Alerts Styleguide](https://github.com/shapeable/prototype-web/blob/master/supporting-documents/design/styleguide_california.pdf)

Other design elements and assets can be found [here](https://github.com/shapeable/prototype-web/blob/master/supporting-documents/design/California%20Assets-20170303T031844Z-001.zip)

#### I. Performed usability tests with people

Usability tests were performed at every step of the process.

+ Testing of initial concepts - [Link to interviews](https://github.com/shapeable/prototype-web/blob/master/supporting-documents/user-testing/Initial%20interviews.pdf).
+ Testing of initial [wireframes](https://invis.io/6VAJF25EK) - [Link to user testing](https://github.com/shapeable/prototype-web/tree/master/supporting-documents/user-testing)
+ Testing of final prototype - [Link to user testing tasks](https://github.com/shapeable/prototype-web/tree/master/supporting-documents/user-testing)
+ Testing of final prototype - [Link to user testing tasks](https://github.com/shapeable/prototype-web/blob/master/supporting-documents/user-testing/TasksforUsertesting.pdf)


#### J. Used an iterative approach, where feedback informed subsequent work or versions of the prototype
Expand Down Expand Up @@ -234,6 +238,8 @@ The production prototype is deployed on AWS server using Docker container techno

The README.md file within the [web-app folder](https://github.com/shapeable/prototype-web/tree/master/web-app) contains complete instructions for deploying and running the prototype on any computer using Docker. The instructions can be found [here](https://github.com/shapeable/prototype-web/blob/master/web-app/README.md)

The url of the docker hub is the following link https://hub.docker.com/r/shapeable/california-alerts/

#### T. Prototype and underlying platforms used to create and run the prototype are openly licensed and free of charge

The prototype is licensed under the [MIT License](https://opensource.org/licenses/MIT). This license is permissive and free of charge.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions supporting-documents/USDS Playbook Checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ The percentage of the code base covered by automated tests was defined using Cov

The Coveralls dashboard could be found [here](https://coveralls.io/github/shapeable/prototype-web?branch=master)

Code climate was also integrated for an automated code review which grades code quality. See full results here.

## Play 11
### Manage security and privacy through reusable processes

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions web-app/app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

//components
@import 'components/base';
@import 'components/login';
@import 'components/intro';
@import 'components/description';
@import 'components/side_image';
Expand Down
6 changes: 6 additions & 0 deletions web-app/app/assets/stylesheets/base/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
text-align: center;
}

.forth-button {
@extend .basic-button;
font-size: $small-font-size;
padding: 20px 30px;
}

.button-top{
margin-top: 20px;
}
Expand Down
3 changes: 2 additions & 1 deletion web-app/app/assets/stylesheets/base/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
display: inline-block;
select {
@extend .general-input;
background: url('/assets/down-arrow-gray.svg') 90% / 10% no-repeat;
padding: 5px 46px 5px 15px;
background: url('/assets/down-arrow-gray.svg') 92% / 15px no-repeat;
width: 100%;
}
}
Expand Down
43 changes: 38 additions & 5 deletions web-app/app/assets/stylesheets/components/_dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
border: 1px solid $light-gray;
border-radius: 8px;
display: flex;

nav.sidebar {
width: 164px;
border-radius: 8px 0 0 8px;
border-right: 1px solid $light-gray;
padding: 30px 16px;
display: inline-block;
background-color: $clear-gray;

a {
font-size: $small-font-size;
display: block;
Expand All @@ -29,33 +31,62 @@
cursor: pointer;
}
}
a.current-section {
color: $light-blue;
}

a.current-section {
color: $light-blue;
}
}

.main-content {
width: calc(100% - 164px);
display: inline-block;
padding: 30px;

h2 {
color: $light-blue;
font-weight: bold;
}

h4 {
font-size: $middle-font-size;
}

p {
font-size: $small-font-size;
margin: 10px 0;
}
}

@include media(min-width 320px max-width 959px) {
flex-direction: column;

nav.sidebar {
width: 100%;

a {
display: inline-block;
padding-left: 15px;
padding-right: 20px;
border-right: 0.5px solid $light-gray;
&:last-child {
border-right: none;
}
}
}

.main-content {
width: 100%;
text-align: center;
}
}
}

.multi-panel {
ul {
list-style: none;
padding: 0;
margin-left: 5px;

li {
display: inline-block;
width: 33%;
Expand All @@ -64,21 +95,23 @@
border: 1px solid $light-gray;
margin-left: -5px;
}

li:first-child {
border-radius: 8px 0 0 8px;
}

li:last-child {
border-radius: 0 8px 8px 0;
}
}

@include media(min-width 320px max-width 779px) {
ul li, li:first-child, li:last-child {
display:block;
padding: 10px;
margin: 20px 0;
margin: 20px auto;
width: 80%;
border-radius: 8px 8px 8px 8px !important;
}
}
}

15 changes: 15 additions & 0 deletions web-app/app/assets/stylesheets/components/_login.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.login{
padding: 15% 0 9% 0 ;
.custom-form {
max-width: 500px;
margin: auto;
input[type=email], input[type=password] {
@extend .general-input;
width: 100%;
}
input[type=submit] {
@extend .third-button;
margin: 20px 0;
}
}
}
1 change: 1 addition & 0 deletions web-app/app/assets/stylesheets/components/_overview.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.graph {
width: 100%;
.graph-title {
text-align: center;
}
Expand Down
8 changes: 8 additions & 0 deletions web-app/app/controllers/alarms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def edit
end

def destroy
UserAlarm.where(alarm_id: @alarm.id).delete_all
@alarm.destroy
respond_to do |format|
flash[:notice] =t("alert.deleted")
Expand All @@ -27,6 +28,13 @@ def dasboard
redirect_to alarms_path
end

def force
alarm = Alarm.find(get_alarm(params[:value]))
ApiWeatherHazards.perform_async(alarm.end_point, alarm.description, alarm.name)
flash[:notice] = t("alert.sent")
redirect_to alarms_path
end

def create
if get_alarm(params[:dashboard])
alarm = Alarm.find(get_alarm(params[:dashboard][:message]))
Expand Down
6 changes: 5 additions & 1 deletion web-app/app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ def create
end
end

private
def login
render layout: "user"
end

private
def comments_params
params.require(:comment).permit(:description)
end
Expand Down
19 changes: 16 additions & 3 deletions web-app/app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class UsersController < ApplicationController
before_action :get_user, only: [:new]
before_action :set_user, only: [:edit, :update, :destroy]
layout 'user'
def index
Expand All @@ -8,6 +9,9 @@ def show
end

def edit
@alarm_categories = AlarmCategory.all
@alarms = Alarm.all
@user_alarms = UserAlarm.where(user_id: @user.id)
end

def new
Expand All @@ -28,9 +32,9 @@ def update
if @user.update(users_params)
UserAlarm.where(user_id: @user.id).delete_all
create_alarms(params['alarm'])
redirect_to users_path, notice: t("user.updated")
redirect_to root_path, notice: t("user.updated")
else
redirect_to users_path, notice: t("user.not_updated")
redirect_to root_path, notice: t("user.not_updated")
end
end

Expand All @@ -49,10 +53,19 @@ def set_user
@user = User.find(params[:id])
end

def get_user
if params[:user]
@user = User.find_by(email: params[:user][:email])
unless @user.nil?
redirect_to edit_user_path(:id=> @user.id)
end
end
end

def create_alarms(param_alarm)
if param_alarm
param_alarm.keys.each do |alarm_name|
if param_alarm[alarm_name] == '1'
if param_alarm[alarm_name] == "1"
UserAlarm.create(user_id: @user.id, alarm_id: Alarm.find_by(name: alarm_name).id)
end
end
Expand Down
2 changes: 1 addition & 1 deletion web-app/app/views/alarms/_alert_categories.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
.custom-text-input
=text_field(:dashboard, :description, size: 340, placeholder: '', type: "text",class: "modal-input")
%p=t('alert.message_warning')
%button.basic-button{:type=>"submit", :class=>"button", :id=> "submit_btn", data: { confirm: t('alert.confirm_send') }}
%button.forth-button{:type=>"submit", :class=>"button", :id=> "submit_btn", data: { confirm: t('alert.confirm_send') }}
=t('alert.button.send')

:javascript
Expand Down
12 changes: 12 additions & 0 deletions web-app/app/views/pages/login.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.login
.container
.custom-form
= form_for(User.new, :url=>{:controller=> "users", :action=>"new"}, :method => "get") do |f|
.form-option
%p=t('login.mail')
= email_field :user, :email, placeholder: t('login.placeholder.email')
.form-option
%p=t('login.pass')
= password_field :user, :password,placeholder: t('login.placeholder.password'), autocomplete: "off"
.center-button
= f.submit t('login.login'), id: "submit_login"
2 changes: 1 addition & 1 deletion web-app/app/views/shared/_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
%ul
%li=link_to t('navbar.residents'), new_user_path, id: "nav_residents", data: { turbolinks: false }
%li=link_to t('navbar.government'), alarms_path, id: "nav_government", data: { turbolinks: false }
%li=link_to t('navbar.about'), root_path(:anchor => "description-jump"), id: "nav_about", data: { turbolinks: false }
%li=link_to t('navbar.about'), login_pages_path, id: "nav_about", data: { turbolinks: false }
%li{class: "#{I18n.locale == :en ? 'lang-active' : 'lang'}"}
=link_to 'EN', { :locale=>'en' }, id: "nav_en", data: { turbolinks: false }
%li{class: "#{I18n.locale == :es ? 'lang-active' : 'lang'}"}
Expand Down
Loading

0 comments on commit 4cead2c

Please sign in to comment.