Skip to content

Commit

Permalink
Merge branch 'integration' of github.com:portagenetwork/roadmap into …
Browse files Browse the repository at this point in the history
…integration
  • Loading branch information
pengyin-shan committed Apr 11, 2022
2 parents e0cdddc + 9bc2fc5 commit 07a301f
Show file tree
Hide file tree
Showing 7 changed files with 3,623 additions and 5,541 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [3.0.4+portage-3.0.9] - 2022-04-11

### Fixed

- Fixed sandbox setting based on the server configuration

## [3.0.4+portage-3.0.8] - 2022-04-08

### Fixed

- Fixed invalid org selection when new user accept invitation [#177](https://github.com/portagenetwork/roadmap/issues/177)
## [3.0.4+portage-3.0.7] - 2022-04-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/invitations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
form: f,
default_org: nil,
required: true,
orgs: @orgs
orgs: @all_orgs
} %>
</div>
<%= f.button(_('Create account'), class: "btn btn-default", type: "submit") %>
Expand Down
10 changes: 6 additions & 4 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defaults: &defaults
adapter: mysql2
encoding: utf8mb4
pool: 16
database: <%= ENV["MYSQL_DATABASE"] %>
# database: <%= ENV["MYSQL_DATABASE"] %>
username: <%= ENV["MYSQL_USER"] %>
password: <%= ENV["MYSQL_PASSWORD"] %>
host: <%= ENV["DATABASE_URL"] || '127.0.0.1' %>
Expand All @@ -27,9 +27,11 @@ staging:
url: <%= Rails.application.secrets.database_url %>

sandbox:
<<: *defaults
database: <%= Rails.application.secrets.database_url %>

encoding: utf8mb4
url: <%= Rails.application.secrets.database_url %>
pool: 5
timeout: 5000

production:
<<: *defaults
url: <%= Rails.application.secrets.database_url %>
387 changes: 212 additions & 175 deletions config/secrets.yml

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions db/seeds/sandbox/seeds_4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# -------------------------------------------------------
# Admins are created 5 years ago
Faker::Config.random = Random.new(60)
pwd = ENV["USER_PASSWORD"].to_s # pwd for regular user
pwd = Rails.application.secrets.user_password.to_s # pwd for regular user
users = [
{email: "dmp.super.admin@engagedri.ca",
firstname: "Super",
surname: "Admin",
language_id: 1,
password: ENV["SUPER_ADMIN_PASSWORD"].to_s,
password_confirmation: ENV["SUPER_ADMIN_PASSWORD"].to_s,
password: Rails.application.secrets.super_admin_password.to_s,
password_confirmation: Rails.application.secrets.super_admin_password.to_s,
org: Org.find_by(abbreviation: "Portage"),
language: Language.all.first,
perms: Perm.all,
Expand All @@ -22,8 +22,8 @@
{email: "dmp.test.user.admin@engagedri.ca",
firstname: "Test",
surname: "User",
password: ENV["ENGLISH_ADMIN_PASSWORD"].to_s,
password_confirmation: ENV["ENGLISH_ADMIN_PASSWORD"].to_s,
password: Rails.application.secrets.english_admin_password.to_s,
password_confirmation: Rails.application.secrets.english_admin_password.to_s,
org: Org.find_by(abbreviation: 'IEO'),
language_id: 1, # English
perms: Perm.where.not(name: ['admin', 'add_organisations', 'change_org_affiliation', 'grant_api_to_orgs']),
Expand All @@ -36,8 +36,8 @@
{email: "dmp.utilisateur.test.admin@engagedri.ca",
firstname: "Utilisateur",
surname: "test",
password: ENV["FRENCH_ADMIN_PASSWORD"].to_s,
password_confirmation: ENV["FRENCH_ADMIN_PASSWORD"].to_s,
password: Rails.application.secrets.french_admin_password.to_s,
password_confirmation: Rails.application.secrets.french_admin_password.to_s,
language_id: 2, # French
org: Org.find_by(abbreviation: 'OEO'),
perms: Perm.where.not(name: ['admin', 'add_organisations', 'change_org_affiliation', 'grant_api_to_orgs']),
Expand All @@ -48,7 +48,7 @@
active:1
}
]
users.each{ |u| User.create!(u) }
users.each{ |u| User.create(u) }
# Some existing users for statistics. Creation times are within 12 months
(1..20).each do |index|
user = {
Expand All @@ -57,7 +57,7 @@
surname: Faker::Name.last_name,
password: pwd,
password_confirmation: pwd,
org: Org.find_by(id: ENV["FUNDER_ORG_ID"].to_i),
org: Org.find_by(id: Rails.application.secrets.funder_org_id.to_i),
language: Language.all.first,
perms: [],
accept_terms: true,
Expand All @@ -75,7 +75,7 @@
surname: Faker::Name.last_name,
password: pwd,
password_confirmation: pwd,
org: Org.find_by(id: ENV["ENGLISH_ORG_ID"].to_i),
org: Org.find_by(id: Rails.application.secrets.english_org_id.to_i),
language: Language.all.first,
perms: [],
accept_terms: true,
Expand All @@ -93,7 +93,7 @@
surname: Faker::Name.last_name,
password: pwd,
password_confirmation: pwd,
org: Org.find_by(id:ENV["FRENCH_ORG_ID"].to_i),
org: Org.find_by(id: Rails.application.secrets.french_org_id.to_i),
language: Language.all.last, # French
perms: [],
accept_terms: true,
Expand All @@ -107,12 +107,12 @@

# Before enter plan data, change two template's org to the two test organization to add data to user statistics
t1 = Template.where(:title => "Portage Template").where.not(:org_id => 8).first
t1.org_id = ENV["ENGLISH_ORG_ID"].to_i
t1.org_id = Rails.application.secrets.english_org_id.to_i.to_i
t1.title += "-Test1"
t1.save!

t2 = Template.where(:title => "Portage Template").where.not(:org_id => 8).first
t2.org_id = ENV["FRENCH_ORG_ID"].to_i
t2.org_id = Rails.application.secrets.french_org_id.to_i.to_i
t2.title += "-Test2"
t2.save!

Expand Down
Loading

0 comments on commit 07a301f

Please sign in to comment.