diff options
Diffstat (limited to 'app/controllers/projects/google_cloud/gcp_regions_controller.rb')
-rw-r--r-- | app/controllers/projects/google_cloud/gcp_regions_controller.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/controllers/projects/google_cloud/gcp_regions_controller.rb b/app/controllers/projects/google_cloud/gcp_regions_controller.rb index beeb91cfd80..3fbe9a96284 100644 --- a/app/controllers/projects/google_cloud/gcp_regions_controller.rb +++ b/app/controllers/projects/google_cloud/gcp_regions_controller.rb @@ -6,8 +6,10 @@ class Projects::GoogleCloud::GcpRegionsController < Projects::GoogleCloud::BaseC # Source https://cloud.google.com/run/docs/locations 2022-01-30 AVAILABLE_REGIONS = %w[asia-east1 asia-northeast1 asia-southeast1 europe-north1 europe-west1 europe-west4 us-central1 us-east1 us-east4 us-west1].freeze + GCP_REGION_CI_VAR_KEY = 'GCP_REGION' + def index - @google_cloud_path = project_google_cloud_index_path(project) + @google_cloud_path = project_google_cloud_configuration_path(project) params = { per_page: 50 } branches = BranchesFinder.new(project.repository, params).execute(gitaly_pagination: true) tags = TagsFinder.new(project.repository, params).execute(gitaly_pagination: true) @@ -16,16 +18,16 @@ class Projects::GoogleCloud::GcpRegionsController < Projects::GoogleCloud::BaseC screen: 'gcp_regions_form', availableRegions: AVAILABLE_REGIONS, refs: refs, - cancelPath: project_google_cloud_index_path(project) + cancelPath: project_google_cloud_configuration_path(project) } @js_data = js_data.to_json - track_event('gcp_regions#index', 'form_render', js_data) + track_event('gcp_regions#index', 'success', js_data) end def create permitted_params = params.permit(:ref, :gcp_region) response = GoogleCloud::GcpRegionAddOrReplaceService.new(project).execute(permitted_params[:ref], permitted_params[:gcp_region]) - track_event('gcp_regions#create', 'form_submit', response) - redirect_to project_google_cloud_index_path(project), notice: _('GCP region configured') + track_event('gcp_regions#create', 'success', response) + redirect_to project_google_cloud_configuration_path(project), notice: _('GCP region configured') end end |