Commit 594c3ea3 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '33537-refactor-env-pod-logs-to-vue-ff' into 'master'

Logs Page: Add a new feature flag to switch environment logs page to vue

See merge request gitlab-org/gitlab!19000
parents ca23fd2a 0f1c010e
import logsBundle from 'ee/logs/logs_bundle';
import KubernetesLogs from '../../../../kubernetes_logs'; import KubernetesLogs from '../../../../kubernetes_logs';
document.addEventListener('DOMContentLoaded', () => { if (gon.features.environmentLogsUseVueUi) {
document.addEventListener('DOMContentLoaded', logsBundle);
} else {
document.addEventListener('DOMContentLoaded', () => {
const kubernetesLogContainer = document.querySelector('.js-kubernetes-logs'); const kubernetesLogContainer = document.querySelector('.js-kubernetes-logs');
const kubernetesLog = new KubernetesLogs(kubernetesLogContainer); const kubernetesLog = new KubernetesLogs(kubernetesLogContainer);
kubernetesLog.getData(); kubernetesLog.getData();
}); });
}
...@@ -9,6 +9,9 @@ module EE ...@@ -9,6 +9,9 @@ module EE
before_action :authorize_read_pod_logs!, only: [:logs] before_action :authorize_read_pod_logs!, only: [:logs]
before_action :environment_ee, only: [:logs] before_action :environment_ee, only: [:logs]
before_action :authorize_create_environment_terminal!, only: [:terminal] before_action :authorize_create_environment_terminal!, only: [:terminal]
before_action do
push_frontend_feature_flag(:environment_logs_use_vue_ui)
end
end end
def logs def logs
......
.js-kubernetes-logs{ data: environment_logs_data(@project, @environment) } - if Feature.enabled?('environment_logs_use_vue_ui')
#js-environment-logs{ data: environment_logs_data(@project, @environment) }
- else
.js-kubernetes-logs{ data: environment_logs_data(@project, @environment) }
.build-page-pod-logs .build-page-pod-logs
.build-trace-container.prepend-top-default .build-trace-container.prepend-top-default
.top-bar.js-top-bar.d-flex .top-bar.js-top-bar.d-flex
......
...@@ -15,6 +15,7 @@ describe 'Environment > Pod Logs', :js do ...@@ -15,6 +15,7 @@ describe 'Environment > Pod Logs', :js do
before do before do
stub_licensed_features(pod_logs: true) stub_licensed_features(pod_logs: true)
stub_feature_flags(environment_logs_use_vue_ui: false)
create(:cluster, :provided_by_gcp, environment_scope: '*', projects: [project]) create(:cluster, :provided_by_gcp, environment_scope: '*', projects: [project])
create(:deployment, :success, environment: environment) create(:deployment, :success, environment: environment)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment