Commit 0c9684aa authored by Miguel Rincon's avatar Miguel Rincon

Add a new feature flag to switch environment logs page to vue

- Add switching to haml
- Add switch to gon.features in browser
- Add feature flag to feature/spec
parent 9d866455
import logsBundle from 'ee/logs/logs_bundle';
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 kubernetesLog = new KubernetesLogs(kubernetesLogContainer);
kubernetesLog.getData();
});
});
}
......@@ -9,6 +9,9 @@ module EE
before_action :authorize_read_pod_logs!, only: [:logs]
before_action :environment_ee, only: [:logs]
before_action :authorize_create_environment_terminal!, only: [:terminal]
before_action do
push_frontend_feature_flag(:environment_logs_use_vue_ui)
end
end
def logs
......
.js-kubernetes-logs{ data: environment_logs_data(@project, @environment) }
- if Feature.enabled?('environment_logs_use_vue_ui')
#environment-logs{ data: environment_logs_data(@project, @environment) }
- else
.js-kubernetes-logs{ data: environment_logs_data(@project, @environment) }
.build-page-pod-logs
.build-trace-container.prepend-top-default
.top-bar.js-top-bar.d-flex
......
......@@ -15,6 +15,7 @@ describe 'Environment > Pod Logs', :js do
before do
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(: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