Commit 73ef5f7d authored by Dhiraj Bodicherla's avatar Dhiraj Bodicherla

Track pod logs refresh action

This MR adds a snowplow event for pod
logs refresh action
parent 7324b46c
......@@ -91,7 +91,7 @@ export default {
'setInitData',
'showEnvironment',
'fetchEnvironments',
'fetchLogs',
'refreshPodLogs',
'fetchMoreLogsPrepend',
'dismissRequestEnvironmentsError',
'dismissInvalidTimeRangeWarning',
......@@ -204,7 +204,7 @@ export default {
ref="scrollButtons"
class="flex-grow-0 pr-2 mb-2 controllers"
:scroll-down-button-disabled="scrollDownButtonDisabled"
@refresh="fetchLogs()"
@refresh="refreshPodLogs()"
@scrollDown="scrollDown"
/>
</div>
......
......@@ -7,4 +7,5 @@ export const tracking = {
POD_LOG_CHANGED: 'pod_log_changed',
TIME_RANGE_SET: 'time_range_set',
ENVIRONMENT_SELECTED: 'environment_selected',
REFRESH_POD_LOGS: 'refresh_pod_logs',
};
......@@ -100,6 +100,11 @@ export const showEnvironment = ({ dispatch, commit }, environmentName) => {
dispatch('fetchLogs', tracking.ENVIRONMENT_SELECTED);
};
export const refreshPodLogs = ({ dispatch, commit }) => {
commit(types.REFRESH_POD_LOGS);
dispatch('fetchLogs', tracking.REFRESH_POD_LOGS);
};
/**
* Fetch environments data and initial logs
* @param {Object} store
......
......@@ -19,6 +19,7 @@ export const REQUEST_LOGS_DATA_PREPEND = 'REQUEST_LOGS_DATA_PREPEND';
export const RECEIVE_LOGS_DATA_PREPEND_SUCCESS = 'RECEIVE_LOGS_DATA_PREPEND_SUCCESS';
export const RECEIVE_LOGS_DATA_PREPEND_ERROR = 'RECEIVE_LOGS_DATA_PREPEND_ERROR';
export const HIDE_REQUEST_LOGS_ERROR = 'HIDE_REQUEST_LOGS_ERROR';
export const REFRESH_POD_LOGS = 'REFRESH_POD_LOGS';
export const RECEIVE_PODS_DATA_SUCCESS = 'RECEIVE_PODS_DATA_SUCCESS';
export const RECEIVE_PODS_DATA_ERROR = 'RECEIVE_PODS_DATA_ERROR';
---
title: Track pod logs refresh action
merge_request: 33802
author:
type: added
......@@ -301,11 +301,11 @@ describe('EnvironmentLogs', () => {
});
it('refresh button, trace is refreshed', () => {
expect(dispatch).not.toHaveBeenCalledWith(`${module}/fetchLogs`, undefined);
expect(dispatch).not.toHaveBeenCalledWith(`${module}/refreshPodLogs`, undefined);
findLogControlButtons().vm.$emit('refresh');
expect(dispatch).toHaveBeenCalledWith(`${module}/fetchLogs`, undefined);
expect(dispatch).toHaveBeenCalledWith(`${module}/refreshPodLogs`, undefined);
});
});
});
......
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