From 591292cf52d8f74f0c04ddab7b120d0dad1b2605 Mon Sep 17 00:00:00 2001
From: Richard Frank
Date: Tue, 9 Aug 2016 16:27:44 -0600
Subject: [PATCH 1/4] Fixes infinite loop, adds styling to deal with it,
extends styling to board create offer also
---
app/assets/stylesheets/application.css.scss | 1 +
app/assets/stylesheets/board/create.scss | 52 +++++++++++++
app/controllers/board_controller.rb | 8 +-
app/views/board/create_board.html.erb | 81 ++++++++++++++++-----
4 files changed, 121 insertions(+), 21 deletions(-)
create mode 100644 app/assets/stylesheets/board/create.scss
diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss
index 09395414..81c0c3aa 100644
--- a/app/assets/stylesheets/application.css.scss
+++ b/app/assets/stylesheets/application.css.scss
@@ -15,6 +15,7 @@
@import "breadcrumbs";
@import "account";
@import "sidebar";
+@import "board/create";
form {
margin: 0;
diff --git a/app/assets/stylesheets/board/create.scss b/app/assets/stylesheets/board/create.scss
new file mode 100644
index 00000000..6a64f45f
--- /dev/null
+++ b/app/assets/stylesheets/board/create.scss
@@ -0,0 +1,52 @@
+.create-new-board--container {
+ max-width: 600px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.create-new-board--message {
+ margin: 0px auto 30px auto;
+ margin-bottom: 30px;
+ font-size: 15px;
+}
+
+.create-new-board--list {
+ list-style: none;
+ padding-left: 10px;
+ padding-bottom: 10px;
+ text-align: left;
+ li {
+ border-left-style: solid;
+ border-left-color: $lightGrey;
+ padding-left: 10px;
+ margin-bottom: 14px;
+ }
+}
+
+.create-new-board--form {
+ input.btn.primary {
+ background: none;
+ font-size: 16px;
+ border-style: solid;
+ padding: 18px;
+ border-radius: 6px;
+ text-shadow: none;
+ &:hover {
+ background-color: $hb-purple;
+ color: white;
+ }
+ }
+}
+
+.create-new-board--labels {
+ @include display(flex);
+ @include align-items(center);
+ @include justify-content(center);
+ .labels-create-message {
+ font-size: 16px;
+ margin-bottom: 20px;
+ }
+ .labels-create-columns {
+ font-size: 14px;
+ }
+}
diff --git a/app/controllers/board_controller.rb b/app/controllers/board_controller.rb
index 48c95524..fc362dda 100644
--- a/app/controllers/board_controller.rb
+++ b/app/controllers/board_controller.rb
@@ -23,7 +23,7 @@ def index
def create_board
return not_found unless logged_in?
- @parameters = params
+ @parameters = params || []
@repo = gh.repos(params[:user],params[:repo])
board = huboard.board(params[:user], params[:repo])
@@ -34,11 +34,13 @@ def create_board
def create
begin
- huboard.board(params[:user], params[:repo]).create_board
- @event = 'board_created'
+ board = huboard.board(params[:user], params[:repo])
+ board.create_board
rescue Ghee::UnprocessableEntity
redirect_to "/#{params[:user]}/#{params[:repo]}/"
end
+
+ return redirect_to action: 'create_board', create_failed: true unless board.has_board?
redirect_to "/#{params[:user]}/#{params[:repo]}/"
end
end
diff --git a/app/views/board/create_board.html.erb b/app/views/board/create_board.html.erb
index f2116560..97443a4a 100644
--- a/app/views/board/create_board.html.erb
+++ b/app/views/board/create_board.html.erb
@@ -1,21 +1,66 @@
-
-
We noticed your repository issue tracker is not yet configured for HuBoard
- <% if @repo && @repo['permissions'] && @repo['permissions']['push'] %>
-
No worries, HuBoard can automatically get you started with a default label configuration
-
HuBoard will create the following labels
-
- - Backlog
- - Ready
- - Working
- - Review
- - Done
-
- <%= form_tag 'create' do %>
-
-
No thanks, I want to do this manually
- <% end %>
+
+
+ <% if @parameters['create_failed']%>
+
Oops!
+
+ <% end %>
+
+ <% elsif @repo && @repo['permissions'] && @repo['permissions']['push'] %>
+
<%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet configured for HuBoard
+
+
We can automatically get you started with a default label configuration:
+
+
+
+
Allow HuBoard to create the following labels?
+
+
+
+ - 0 - Backlog
+ - 1 - Ready
+ - 2 - Working
+ - 3 - Review
+ - 4 - Done
+
+
+
+ <%= form_tag 'create', class: 'create-new-board--form' do %>
+
+
+
+
+
+ <% end %>
<% else %>
-
Unfortunately, HuBoard doesn't have permission to fix that for you.
-
You'll need to head over to GitHub for that
+
<%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet configured for HuBoard
+
+ <% end %>
+
<% end %>
+
From 67318f71182aa7c5d1dce75312d50eceba31098e Mon Sep 17 00:00:00 2001
From: Ryan Rauh
Date: Mon, 29 Aug 2016 12:57:58 -0500
Subject: [PATCH 2/4] Refactors to BEM and cleans up some markup
---
app/assets/stylesheets/board/create.scss | 42 +++-----
app/views/board/create_board.html.erb | 130 +++++++++++++----------
2 files changed, 85 insertions(+), 87 deletions(-)
diff --git a/app/assets/stylesheets/board/create.scss b/app/assets/stylesheets/board/create.scss
index 6a64f45f..21ee0ccd 100644
--- a/app/assets/stylesheets/board/create.scss
+++ b/app/assets/stylesheets/board/create.scss
@@ -1,52 +1,34 @@
-.create-new-board--container {
+.create-new-board__container {
max-width: 600px;
margin-left: auto;
margin-right: auto;
+ padding-bottom: 30px;
+ font-size: 15px;
}
-.create-new-board--message {
- margin: 0px auto 30px auto;
- margin-bottom: 30px;
- font-size: 15px;
+.create-new-board__message {
+ margin: 0px auto;
}
-.create-new-board--list {
+.create-new-board__list {
list-style: none;
padding-left: 10px;
- padding-bottom: 10px;
text-align: left;
- li {
+ &__item {
border-left-style: solid;
border-left-color: $lightGrey;
padding-left: 10px;
margin-bottom: 14px;
- }
-}
-
-.create-new-board--form {
- input.btn.primary {
- background: none;
- font-size: 16px;
- border-style: solid;
- padding: 18px;
- border-radius: 6px;
- text-shadow: none;
- &:hover {
- background-color: $hb-purple;
- color: white;
+ &--error {
+ border-left-color: $red;
}
}
}
-.create-new-board--labels {
+.create-new-board__labels {
@include display(flex);
@include align-items(center);
@include justify-content(center);
- .labels-create-message {
- font-size: 16px;
- margin-bottom: 20px;
- }
- .labels-create-columns {
- font-size: 14px;
- }
+ padding-bottom: 10px;
+ font-size: 16px;
}
diff --git a/app/views/board/create_board.html.erb b/app/views/board/create_board.html.erb
index 97443a4a..3936c5c1 100644
--- a/app/views/board/create_board.html.erb
+++ b/app/views/board/create_board.html.erb
@@ -1,66 +1,82 @@
-
- <% if @parameters['create_failed']%>
-
Oops!
-
-
HuBoard is unable to create a board for you!
-
- <%= form_tag 'create', class: 'create-new-board--form' do %>
-
-
-
-
+
+ <% if @parameters['create_failed']%>
+
Oops!
+
+
HuBoard is unable to create a board for you!
+
+ -
+
+ You will need write permissions to <%= @parameters['user'] %>/<%= @parameters['repo'] %>
+
+ <% if @repo['owner'] && @repo['owner']['type'] == "Organization" %>
+
+ <%= @repo['owner']['login'] %> is a GitHub Organization: Please ensure no access restrictions are present
+
+ <% end %>
+
+ Talk to us!
+
+
+
+ <%= form_tag 'create', class: 'create-new-board__form' do %>
+
+
+ Go Home
+
+ <% end %>
- <% end %>
-
- <% elsif @repo && @repo['permissions'] && @repo['permissions']['push'] %>
-
<%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet configured for HuBoard
-
-
We can automatically get you started with a default label configuration:
-
-
-
-
Allow HuBoard to create the following labels?
+ <% elsif @repo && @repo['permissions'] && @repo['permissions']['push'] %>
+
<%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet configured for HuBoard
+
+
We can automatically get you started with a default label configuration:
+
+
+
+
Allow HuBoard to create the following labels?
+
+
+
+ - 0 - Backlog
+ - 1 - Ready
+ - 2 - Working
+ - 3 - Review
+ - 4 - Done
+
+
+
+ <%= form_tag 'create', class: 'create-new-board__form' do %>
+
+
+
+
+ <% end %>
-
-
- - 0 - Backlog
- - 1 - Ready
- - 2 - Working
- - 3 - Review
- - 4 - Done
+ <% else %>
+ <%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet configured for HuBoard
+
+
+ -
+
+ You will need write permissions to <%= @parameters['user'] %>/<%= @parameters['repo'] %>
+
+ <% if @repo['owner'] && @repo['owner']['type'] == "Organization" %>
+
+ <%= @repo['owner']['login'] %> is a GitHub Organization: Please ensure no access restrictions are present
+
+ <% end %>
+
+ Talk to us!
+
+
-
-
- <%= form_tag 'create', class: 'create-new-board--form' do %>
-
-
-
-
-
- <% end %>
- <% else %>
-
<%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet configured for HuBoard
-
- <% end %>
-
- <% end %>
+ <% end %>
From 1e3d528b72b7aa8629ad0ff670667e66909964df Mon Sep 17 00:00:00 2001
From: Ryan Rauh
Date: Wed, 31 Aug 2016 11:17:31 -0500
Subject: [PATCH 3/4] adds analytics paths to determine retry or abandons
---
app/views/board/create_board.html.erb | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/views/board/create_board.html.erb b/app/views/board/create_board.html.erb
index 3936c5c1..c0752575 100644
--- a/app/views/board/create_board.html.erb
+++ b/app/views/board/create_board.html.erb
@@ -20,8 +20,8 @@
<%= form_tag 'create', class: 'create-new-board__form' do %>
-
-
+
+
Go Home
<% end %>
@@ -47,8 +47,8 @@
<%= form_tag 'create', class: 'create-new-board__form' do %>
-
-
+
+ Create columns manually
<% end %>
@@ -70,10 +70,10 @@
-
+
Try again
-
+
Go Home
From 41aaab999e49754bd33f3e41401db96630f4fc5d Mon Sep 17 00:00:00 2001
From: Richard Frank
Date: Tue, 20 Sep 2016 09:11:09 -0600
Subject: [PATCH 4/4] Tweaks copy
---
app/views/board/create_board.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/board/create_board.html.erb b/app/views/board/create_board.html.erb
index c0752575..7829a9f9 100644
--- a/app/views/board/create_board.html.erb
+++ b/app/views/board/create_board.html.erb
@@ -27,7 +27,7 @@
<% end %>
<% elsif @repo && @repo['permissions'] && @repo['permissions']['push'] %>
- <%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet configured for HuBoard
+ <%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet setup for HuBoard
We can automatically get you started with a default label configuration:
@@ -53,7 +53,7 @@
<% end %>
<% else %>
- <%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet configured for HuBoard
+ <%= @parameters['user'] %>/<%= @parameters['repo'] %> is not yet setup for HuBoard