diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 03:06:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 03:06:08 +0300 |
commit | 157f9a451a428f66666ba85d8b880df78aff6cc4 (patch) | |
tree | 7c38cacafb9720d144a6add0a170a07a7cc376f6 /app | |
parent | 7f15e74dae019ac96c65ec769eae2d67aae65a8c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
6 files changed, 36 insertions, 16 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue index ffc3e0967d4..a297156ab10 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue @@ -4,6 +4,7 @@ import ArtifactsApp from './artifacts_list_app.vue'; import Deployment from './deployment.vue'; import MrWidgetContainer from './mr_widget_container.vue'; import MrWidgetPipeline from './mr_widget_pipeline.vue'; +import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; /** * Renders the pipeline and related deployments from the store. @@ -23,6 +24,7 @@ export default { MergeTrainPositionIndicator: () => import('ee_component/vue_merge_request_widget/components/merge_train_position_indicator.vue'), }, + mixins: [glFeatureFlagsMixin()], props: { mr: { type: Object, @@ -62,7 +64,7 @@ export default { return this.isPostMerge ? this.mr.mergePipeline : this.mr.pipeline; }, showVisualReviewAppLink() { - return this.mr.visualReviewAppAvailable; + return this.mr.visualReviewAppAvailable && this.glFeatures.anonymousVisualReviewFeedback; }, showMergeTrainPositionIndicator() { return _.isNumber(this.mr.mergeTrainIndex); diff --git a/app/assets/javascripts/vue_merge_request_widget/components/review_app_link.vue b/app/assets/javascripts/vue_merge_request_widget/components/review_app_link.vue index 75f557d05dd..d2d32492e6c 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/review_app_link.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/review_app_link.vue @@ -18,7 +18,14 @@ export default { }; </script> <template> - <a :href="link" target="_blank" rel="noopener noreferrer nofollow" :class="cssClass"> + <a + :href="link" + target="_blank" + rel="noopener noreferrer nofollow" + :class="cssClass" + data-track-event="open_review_app" + data-track-label="review_app" + > {{ __('View app') }} <icon class="fgray" name="external-link" /> </a> </template> diff --git a/app/models/project.rb b/app/models/project.rb index 9a208b0058b..0887e742d96 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1773,7 +1773,6 @@ class Project < ApplicationRecord InternalId.flush_records!(project: self) import_state.finish - import_state.remove_jid update_project_counter_caches after_create_default_branch join_pool_repository diff --git a/app/models/project_import_state.rb b/app/models/project_import_state.rb index bff00816e15..b79e3554926 100644 --- a/app/models/project_import_state.rb +++ b/app/models/project_import_state.rb @@ -42,6 +42,14 @@ class ProjectImportState < ApplicationRecord end end + after_transition any => :finished do |state, _| + if state.jid.present? + Gitlab::SidekiqStatus.unset(state.jid) + + state.update_column(:jid, nil) + end + end + after_transition started: :finished do |state, _| project = state.project @@ -81,14 +89,6 @@ class ProjectImportState < ApplicationRecord status == 'started' && project.import? end - def remove_jid - return unless jid - - Gitlab::SidekiqStatus.unset(jid) - - update_column(:jid, nil) - end - # Refreshes the expiration time of the associated import job ID. # # This method can be used by asynchronous importers to refresh the status, diff --git a/app/presenters/clusters/cluster_presenter.rb b/app/presenters/clusters/cluster_presenter.rb index 1634d2479a0..97771d84031 100644 --- a/app/presenters/clusters/cluster_presenter.rb +++ b/app/presenters/clusters/cluster_presenter.rb @@ -18,8 +18,20 @@ module Clusters end end - def gke_cluster_url - "https://console.cloud.google.com/kubernetes/clusters/details/#{provider.zone}/#{name}" if gcp? + def provider_label + if aws? + s_('ClusterIntegration|Elastic Kubernetes Service') + elsif gcp? + s_('ClusterIntegration|Google Kubernetes Engine') + end + end + + def provider_management_url + if aws? + "https://console.aws.amazon.com/eks/home?region=#{provider.region}\#/clusters/#{name}" + elsif gcp? + "https://console.cloud.google.com/kubernetes/clusters/details/#{provider.zone}/#{name}" + end end def can_read_cluster? diff --git a/app/views/clusters/clusters/_advanced_settings.html.haml b/app/views/clusters/clusters/_advanced_settings.html.haml index 493d7a00854..59cdf2016fb 100644 --- a/app/views/clusters/clusters/_advanced_settings.html.haml +++ b/app/views/clusters/clusters/_advanced_settings.html.haml @@ -8,10 +8,10 @@ - unless @cluster.provided_by_user? .append-bottom-20 %label.append-bottom-10 - = s_('ClusterIntegration|Google Kubernetes Engine') + = @cluster.provider_label %p - - link_gke = link_to(s_('ClusterIntegration|Google Kubernetes Engine'), @cluster.gke_cluster_url, target: '_blank', rel: 'noopener noreferrer') - = s_('ClusterIntegration|Manage your Kubernetes cluster by visiting %{link_gke}').html_safe % { link_gke: link_gke } + - provider_link = link_to(@cluster.provider_label, @cluster.provider_management_url, target: '_blank', rel: 'noopener noreferrer') + = s_('ClusterIntegration|Manage your Kubernetes cluster by visiting %{provider_link}').html_safe % { provider_link: provider_link } = form_for @cluster, url: clusterable.cluster_path(@cluster), as: :cluster, html: { class: 'cluster_management_form' } do |field| |