Commit a7d0e3f6 authored by David O'Regan's avatar David O'Regan

Merge branch '297340-update-endpoint-to-request-monitor-logs' into 'master'

Improve LCP for Monitor_Logs

See merge request gitlab-org/gitlab!60100
parents f1173f87 f835649b
......@@ -127,7 +127,7 @@ export const fetchEnvironments = ({ commit, dispatch }, environmentsPath) => {
return axios
.get(environmentsPath)
.then(({ data }) => {
commit(types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS, data.environments);
commit(types.RECEIVE_ENVIRONMENTS_DATA_SUCCESS, data);
dispatch('fetchLogs', tracking.ENVIRONMENT_SELECTED);
})
.catch(() => {
......
......@@ -34,7 +34,7 @@ module EnvironmentsHelper
def environment_logs_data(project, environment)
{
"environment_name": environment.name,
"environments_path": project_environments_path(project, format: :json),
"environments_path": api_v4_projects_environments_path(id: project.id),
"environment_id": environment.id,
"cluster_applications_documentation_path" => help_page_path('user/clusters/applications.md', anchor: 'elastic-stack'),
"clusters_path": project_clusters_path(project, format: :json)
......
......@@ -61,7 +61,7 @@ RSpec.describe EnvironmentsHelper do
it 'returns environment parameters data' do
expect(subject).to include(
"environment_name": environment.name,
"environments_path": project_environments_path(project, format: :json)
"environments_path": api_v4_projects_environments_path(id: project.id)
)
end
......
......@@ -191,7 +191,7 @@ describe('Logs Store actions', () => {
});
it('should commit RECEIVE_ENVIRONMENTS_DATA_SUCCESS mutation on correct data', () => {
mock.onGet(mockEnvironmentsEndpoint).replyOnce(200, { environments: mockEnvironments });
mock.onGet(mockEnvironmentsEndpoint).replyOnce(200, mockEnvironments);
return testAction(
fetchEnvironments,
mockEnvironmentsEndpoint,
......
......@@ -191,7 +191,7 @@ RSpec.describe EnvironmentsHelper do
it 'returns logs data' do
expected_data = {
"environment_name": environment.name,
"environments_path": project_environments_path(project, format: :json),
"environments_path": api_v4_projects_environments_path(id: project.id),
"environment_id": environment.id,
"cluster_applications_documentation_path" => help_page_path('user/clusters/applications.md', anchor: 'elastic-stack'),
"clusters_path": project_clusters_path(project, format: :json)
......
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