From c66b9dcdbd3098a1a9d3fb2da9d534178a412220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 10 Jul 2017 15:36:38 +0200 Subject: [PATCH] add 'us-east-2' S3 region --- app/models/s3_region_site_setting.rb | 25 ++++++++++++---------- config/locales/client.en.yml | 23 ++++++++++---------- spec/models/s3_region_site_setting_spec.rb | 6 ------ 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/app/models/s3_region_site_setting.rb b/app/models/s3_region_site_setting.rb index 153f92171be..8bb9513fd25 100644 --- a/app/models/s3_region_site_setting.rb +++ b/app/models/s3_region_site_setting.rb @@ -1,6 +1,7 @@ require_dependency 'enum_site_setting' class S3RegionSiteSetting < EnumSiteSetting + def self.valid_value?(val) valid_values.include? val end @@ -10,20 +11,22 @@ class S3RegionSiteSetting < EnumSiteSetting end def self.valid_values - [ 'us-east-1', - 'us-west-1', - 'us-west-2', - 'us-gov-west-1', - 'eu-west-1', - 'eu-west-2', - 'eu-central-1', - 'ap-southeast-1', - 'ap-southeast-2', - 'ap-south-1', + [ 'ap-northeast-1', 'ap-northeast-2', + 'ap-south-1', + 'ap-southeast-1', + 'ap-southeast-2', + 'cn-north-1', + 'eu-central-1', + 'eu-west-1', + 'eu-west-2', 'sa-east-1', - 'cn-north-1' + 'us-east-1', + 'us-east-2', + 'us-gov-west-1', + 'us-west-1', + 'us-west-2', ] end diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 331942c59dc..1bb210eb6ca 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -180,20 +180,21 @@ en: s3: regions: - us_east_1: "US East (N. Virginia)" - us_west_1: "US West (N. California)" - us_west_2: "US West (Oregon)" - us_gov_west_1: "AWS GovCloud (US)" - eu_west_1: "EU (Ireland)" - eu_west_2: "EU (London)" - eu_central_1: "EU (Frankfurt)" - ap_southeast_1: "Asia Pacific (Singapore)" - ap_southeast_2: "Asia Pacific (Sydney)" - ap_south_1: "Asia Pacific (Mumbai)" ap_northeast_1: "Asia Pacific (Tokyo)" ap_northeast_2: "Asia Pacific (Seoul)" - sa_east_1: "South America (Sao Paulo)" + ap_south_1: "Asia Pacific (Mumbai)" + ap_southeast_1: "Asia Pacific (Singapore)" + ap_southeast_2: "Asia Pacific (Sydney)" cn_north_1: "China (Beijing)" + eu_central_1: "EU (Frankfurt)" + eu_west_1: "EU (Ireland)" + eu_west_2: "EU (London)" + sa_east_1: "South America (Sao Paulo)" + us_east_1: "US East (N. Virginia)" + us_east_2: "US East (Ohio)" + us_gov_west_1: "AWS GovCloud (US)" + us_west_1: "US West (N. California)" + us_west_2: "US West (Oregon)" edit: 'edit the title and category of this topic' not_implemented: "That feature hasn't been implemented yet, sorry!" diff --git a/spec/models/s3_region_site_setting_spec.rb b/spec/models/s3_region_site_setting_spec.rb index 9f36a09e28a..8749986801c 100644 --- a/spec/models/s3_region_site_setting_spec.rb +++ b/spec/models/s3_region_site_setting_spec.rb @@ -12,10 +12,4 @@ describe S3RegionSiteSetting do end end - describe 'values' do - it 'returns all the S3 regions' do - expect(S3RegionSiteSetting.values.map {|x| x[:value]}.sort).to eq(['us-east-1', 'us-west-1', 'us-west-2', 'us-gov-west-1', 'eu-west-1', 'eu-west-2', 'eu-central-1', 'ap-southeast-1', 'ap-southeast-2', 'ap-south-1', 'ap-northeast-1', 'ap-northeast-2', 'sa-east-1', 'cn-north-1'].sort) - end - end - end