Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
WKocur committed Jun 22, 2020
2 parents a19d4d5 + 387d8e9 commit 69296fb
Show file tree
Hide file tree
Showing 32 changed files with 58 additions and 57 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
* Adds servers and installations to be associated with projects;
* Adds github authentication;
* Adds new attributes to projects

### 1.0.1 (2020-06-22)

* Fix validation on creating new project
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ group :test do
end

group :development do
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
gem 'annotate'
gem 'spring'
gem 'rubocop', require: false
end
Expand Down
53 changes: 24 additions & 29 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
GIT
remote: git://github.com/ctran/annotate_models.git
revision: c952306966c9bae4438e4d40351561af3d8005c0
specs:
annotate (2.7.0)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 12.0)

GIT
remote: git://github.com/rails/sass-rails.git
revision: dfbcc6a53653d8908007e26324a0f299f026ec4f
Expand Down Expand Up @@ -95,6 +87,9 @@ GEM
addressable (2.4.0)
airbrussh (1.0.2)
sshkit (>= 1.6.1, != 1.7.0)
annotate (3.1.0)
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 14.0)
ansi (1.5.0)
arel (7.0.0)
ast (2.3.0)
Expand Down Expand Up @@ -166,7 +161,7 @@ GEM
railties (>= 3.0.0)
faker (1.6.5)
i18n (~> 0.5)
faraday (0.9.2)
faraday (0.17.3)
multipart-post (>= 1.2, < 3)
font-awesome-rails (4.6.0.0)
railties (>= 3.2, < 5.1)
Expand All @@ -177,7 +172,7 @@ GEM
json
multi_json
request_store (>= 1.0)
hashie (3.4.4)
hashie (4.1.0)
httparty (0.13.7)
json (~> 1.8)
multi_xml (>= 0.5.2)
Expand All @@ -187,7 +182,7 @@ GEM
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
jwt (1.5.4)
jwt (2.2.1)
kramdown (1.9.0)
launchy (2.4.3)
addressable (~> 2.3)
Expand All @@ -206,9 +201,9 @@ GEM
minitest (5.9.0)
mocha (1.1.0)
metaclass (~> 0.0.1)
multi_json (1.12.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
multi_json (1.14.1)
multi_xml (0.6.0)
multipart-post (2.1.1)
nested_form (0.3.2)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
Expand All @@ -219,21 +214,21 @@ GEM
pkg-config (~> 1.1.7)
nokogumbo (1.4.7)
nokogiri
oauth2 (1.2.0)
faraday (>= 0.8, < 0.10)
jwt (~> 1.0)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-github (1.1.2)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.1)
omniauth-oauth2 (1.4.0)
oauth2 (~> 1.0)
omniauth (~> 1.2)
omniauth (1.9.1)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-github (1.4.0)
omniauth (~> 1.5)
omniauth-oauth2 (>= 1.4.0, < 2.0)
omniauth-oauth2 (1.6.0)
oauth2 (~> 1.1)
omniauth (~> 1.9)
orm_adapter (0.5.0)
parser (2.3.1.2)
ast (~> 2.2)
Expand All @@ -247,7 +242,7 @@ GEM
arel
pkg-config (1.1.7)
powerpack (0.1.1)
rack (2.0.1)
rack (2.1.3)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.0)
Expand Down Expand Up @@ -356,7 +351,7 @@ PLATFORMS
ruby

DEPENDENCIES
annotate!
annotate
bootstrap-datepicker-rails (~> 1.5.0)
bootstrap-sass (~> 3.3.6)
byebug
Expand Down Expand Up @@ -411,4 +406,4 @@ RUBY VERSION
ruby 2.2.3p173

BUNDLED WITH
1.16.1
1.17.3
13 changes: 13 additions & 0 deletions app/assets/javascripts/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ $(document).ready(function(){
$(this).replaceWith(this.alt);
}

function addURLPresenceValidation(){
const publishedCheckbox = $("#project_published");
const urlInput = $("#project_url")

urlInput.attr("required", publishedCheckbox.is(":checked"));

publishedCheckbox.change(function() {
urlInput.attr("required", this.checked);
});
}

addURLPresenceValidation();

$(".badge_img").error(showAlt);

$(".tag-field").select2({tags:[]}, {
Expand Down
20 changes: 4 additions & 16 deletions app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ class Project < ApplicationRecord

validates :url, format: { with: URI.regexp(%w(http https)) },
if: Proc.new { |a| a.url.present? }
validates :github_identifier, format: { with: /\A[-a-zA-Z0-9_.]+\/[-a-zA-Z0-9_.]+\z/i },
if: Proc.new { |a| a.github_identifier.present? }
validate :validate_trello_ids
validate :validate_pivotal_tracker_ids
# FIXME: Doesn't seem to work
# validates :github_identifier, format: { with: /\A[-a-zA-Z0-9_.]+\/[-a-zA-Z0-9_.]+\z/i },
# if: Proc.new { |a| a.github_identifier.present? }


validates :state, inclusion: { in: ['Unknown', 'Not Started', 'In Progress', 'Paused', 'Completed', 'Launched (No Maintenance)', 'Launched (Support & Maintenance)', 'Orphaned', 'Offline', 'Abandoned'] }

Expand Down Expand Up @@ -150,18 +150,6 @@ def sync_with_github

private

def validate_trello_ids
if self.trello_ids.detect{ |trello_id| !(/\A([a-z0-9]+\/[-a-z0-9_]+)\z/i.match(trello_id)) }
errors.add(:trello_ids, :invalid)
end
end

def validate_pivotal_tracker_ids
if self.pivotal_tracker_ids.detect{ |pt_id| !(/\A\d+(,\d+)*\z/i.match(pt_id)) }
errors.add(:pivotal_tracker_ids, :invalid)
end
end

def self.pluck_field symbol
pluck(symbol).compact.uniq.reject(&:empty?).sort
end
Expand Down
8 changes: 4 additions & 4 deletions app/views/projects/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@
<div class="form-group">
<%= f.label :title, class: "col-sm-2 control-label" %>
<div class="input col-sm-10">
<%= f.text_field :title, class: "form-control" %>
<%= f.text_field :title, class: "form-control", required: true %>
</div>
</div>

<div class="form-group">
<%= f.label :url, 'Production URL', class: "col-sm-2 control-label" %>
<div class="input col-sm-10">
<%= f.text_field :url, class: "form-control" %>
<%= f.url_field :url, class: "form-control" %>
</div>
</div>

<div class="form-group">
<%= f.label :url_staging, 'Staging URL', class: "col-sm-2 control-label" %>
<div class="input col-sm-10">
<%= f.text_field :url_staging, class: "form-control" %>
<%= f.url_field :url_staging, class: "form-control" %>
</div>
</div>

Expand All @@ -55,7 +55,7 @@
<div class="form-group">
<%= f.label :description, class: "col-sm-2 control-label" %>
<div class="input col-sm-10">
<%= f.text_area :description, class: "form-control" %>
<%= f.text_area :description, class: "form-control", required: true %>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions config/deploy.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# config valid only for current version of Capistrano
lock '3.4.0'
lock '3.5.0'

set :application, 'labs'
set :repo_url, 'git@github.com:unepwcmc/labs.git'

set :branch, 'master'
#set :branch, 'master'

set :deploy_user, 'wcmc'
set :deploy_to, "/home/#{fetch(:deploy_user)}/#{fetch(:application)}"
Expand Down
7 changes: 4 additions & 3 deletions config/deploy/production.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
set :stage, :production
set :branch, "supported-production"

server "web-production.linode.unep-wcmc.org", user: 'wcmc', roles: %w{app web db}
server "db-production.linode.unep-wcmc.org", user: 'wcmc', roles: %w{bkp}, no_release: true
server "web-supported-production.linode.unep-wcmc.org", user: 'wcmc', roles: %w{app web db}

set :application, "labs"
set :server_name, "labs.web-production.linode.unep-wcmc.org"
set :server_name, "labs.web-supported-production.linode.unep-wcmc.org"
set :sudo_user, "wcmc"
set :app_port, "80"




# server-based syntax
# ======================
# Defines a single server with a list of roles and multiple properties.
Expand Down
4 changes: 2 additions & 2 deletions config/deploy/staging.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
set :stage, :staging
set :branch, "develop"

server "web-staging.linode.unep-wcmc.org", user: 'wcmc', roles: %w{app web db}
server "web-supported-staging.linode.unep-wcmc.org", user: 'wcmc', roles: %w{app web db}

set :application, "labs"
set :server_name, "labs.web-staging.linode.unep-wcmc.org"
set :server_name, "labs.web-supported-staging.linode.unep-wcmc.org"
set :sudo_user, "wcmc"
set :app_port, "80"

Expand Down
Binary file added vendor/cache/annotate-3.1.0.gem
Binary file not shown.
Binary file added vendor/cache/faraday-0.17.3.gem
Binary file not shown.
Binary file removed vendor/cache/faraday-0.9.2.gem
Binary file not shown.
Binary file removed vendor/cache/hashie-3.4.4.gem
Binary file not shown.
Binary file added vendor/cache/hashie-4.1.0.gem
Binary file not shown.
Binary file removed vendor/cache/jwt-1.5.4.gem
Binary file not shown.
Binary file added vendor/cache/jwt-2.2.1.gem
Binary file not shown.
Binary file removed vendor/cache/multi_json-1.12.1.gem
Binary file not shown.
Binary file added vendor/cache/multi_json-1.14.1.gem
Binary file not shown.
Binary file removed vendor/cache/multi_xml-0.5.5.gem
Binary file not shown.
Binary file added vendor/cache/multi_xml-0.6.0.gem
Binary file not shown.
Binary file removed vendor/cache/multipart-post-2.0.0.gem
Binary file not shown.
Binary file added vendor/cache/multipart-post-2.1.1.gem
Binary file not shown.
Binary file removed vendor/cache/oauth2-1.2.0.gem
Binary file not shown.
Binary file added vendor/cache/oauth2-1.4.4.gem
Binary file not shown.
Binary file removed vendor/cache/omniauth-1.3.1.gem
Binary file not shown.
Binary file added vendor/cache/omniauth-1.9.1.gem
Binary file not shown.
Binary file removed vendor/cache/omniauth-github-1.1.2.gem
Binary file not shown.
Binary file added vendor/cache/omniauth-github-1.4.0.gem
Binary file not shown.
Binary file removed vendor/cache/omniauth-oauth2-1.4.0.gem
Binary file not shown.
Binary file added vendor/cache/omniauth-oauth2-1.6.0.gem
Binary file not shown.
Binary file removed vendor/cache/rack-2.0.1.gem
Binary file not shown.
Binary file added vendor/cache/rack-2.1.3.gem
Binary file not shown.

0 comments on commit 69296fb

Please sign in to comment.