diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-09 18:10:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-09 18:10:05 +0300 |
commit | c0f42c6d662b776777afbf79ba72d8e833b8de48 (patch) | |
tree | d94d38bccd5297f59522090fd3c814d9264a1cc9 /app/assets/javascripts/logs | |
parent | f4d6d3ec77286fa64810bd6a25c58671e0deedaf (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/logs')
-rw-r--r-- | app/assets/javascripts/logs/components/environment_logs.vue | 25 | ||||
-rw-r--r-- | app/assets/javascripts/logs/constants.js | 1 | ||||
-rw-r--r-- | app/assets/javascripts/logs/stores/actions.js | 32 | ||||
-rw-r--r-- | app/assets/javascripts/logs/stores/getters.js | 13 | ||||
-rw-r--r-- | app/assets/javascripts/logs/stores/mutation_types.js | 3 | ||||
-rw-r--r-- | app/assets/javascripts/logs/stores/mutations.js | 25 | ||||
-rw-r--r-- | app/assets/javascripts/logs/stores/state.js | 10 |
7 files changed, 7 insertions, 102 deletions
diff --git a/app/assets/javascripts/logs/components/environment_logs.vue b/app/assets/javascripts/logs/components/environment_logs.vue index 5092c6905c4..39041aa1447 100644 --- a/app/assets/javascripts/logs/components/environment_logs.vue +++ b/app/assets/javascripts/logs/components/environment_logs.vue @@ -5,7 +5,6 @@ import { GlDropdown, GlDropdownSectionHeader, GlDropdownItem, - GlDropdownDivider, GlInfiniteScroll, } from '@gitlab/ui'; import { throttle } from 'lodash'; @@ -25,7 +24,6 @@ export default { GlDropdown, GlDropdownSectionHeader, GlDropdownItem, - GlDropdownDivider, GlInfiniteScroll, LogSimpleFilters, LogAdvancedFilters, @@ -66,7 +64,7 @@ export default { }; }, computed: { - ...mapState('environmentLogs', ['environments', 'timeRange', 'logs', 'pods', 'managedApps']), + ...mapState('environmentLogs', ['environments', 'timeRange', 'logs', 'pods']), ...mapGetters('environmentLogs', ['trace', 'showAdvancedFilters']), showLoader() { @@ -88,15 +86,12 @@ export default { }); this.fetchEnvironments(this.environmentsPath); - this.fetchManagedApps(this.clustersPath); }, methods: { ...mapActions('environmentLogs', [ 'setInitData', 'showEnvironment', - 'showManagedApp', 'fetchEnvironments', - 'fetchManagedApps', 'refreshPodLogs', 'fetchMoreLogsPrepend', 'dismissRequestEnvironmentsError', @@ -107,9 +102,6 @@ export default { isCurrentEnvironment(envName) { return envName === this.environments.current; }, - isCurrentManagedApp(appName) { - return appName === this.managedApps.current; - }, topReached() { if (!this.logs.isLoading) { this.fetchMoreLogsPrepend(); @@ -173,7 +165,7 @@ export default { <div class="flex-grow-0"> <gl-dropdown id="environments-dropdown" - :text="environments.current || managedApps.current" + :text="environments.current" :disabled="environments.isLoading" class="gl-mr-3 gl-mb-3 gl-display-flex gl-md-display-block js-environments-dropdown" > @@ -189,19 +181,6 @@ export default { > {{ env.name }} </gl-dropdown-item> - <gl-dropdown-divider /> - <gl-dropdown-section-header> - {{ s__('Environments|Managed apps') }} - </gl-dropdown-section-header> - <gl-dropdown-item - v-for="app in managedApps.options" - :key="app.id" - :is-check-item="true" - :is-checked="isCurrentManagedApp(app.name)" - @click="showManagedApp(app.name)" - > - {{ app.name }} - </gl-dropdown-item> </gl-dropdown> </div> diff --git a/app/assets/javascripts/logs/constants.js b/app/assets/javascripts/logs/constants.js index 0cdef53df34..abc4d6679a0 100644 --- a/app/assets/javascripts/logs/constants.js +++ b/app/assets/javascripts/logs/constants.js @@ -13,5 +13,4 @@ export const tracking = { export const logExplorerOptions = { environments: 'environments', - managedApps: 'managedApps', }; diff --git a/app/assets/javascripts/logs/stores/actions.js b/app/assets/javascripts/logs/stores/actions.js index c3dc9f4bc12..56b832de9b8 100644 --- a/app/assets/javascripts/logs/stores/actions.js +++ b/app/assets/javascripts/logs/stores/actions.js @@ -25,15 +25,9 @@ const requestUntilData = (url, params) => const requestLogsUntilData = ({ commit, state }) => { const params = {}; - const type = state.environments.current - ? logExplorerOptions.environments - : logExplorerOptions.managedApps; + const type = logExplorerOptions.environments; const selectedObj = state[type].options.find(({ name }) => name === state[type].current); - - const path = - type === logExplorerOptions.environments - ? selectedObj.logs_api_path - : selectedObj.gitlab_managed_apps_logs_path; + const path = selectedObj.logs_api_path; if (state.pods.current) { params.pod_name = state.pods.current; @@ -106,11 +100,6 @@ export const showEnvironment = ({ dispatch, commit }, environmentName) => { dispatch('fetchLogs', tracking.ENVIRONMENT_SELECTED); }; -export const showManagedApp = ({ dispatch, commit }, managedApp) => { - commit(types.SET_MANAGED_APP, managedApp); - dispatch('fetchLogs', tracking.MANAGED_APP_SELECTED); -}; - export const refreshPodLogs = ({ dispatch, commit }) => { commit(types.REFRESH_POD_LOGS); dispatch('fetchLogs', tracking.REFRESH_POD_LOGS); @@ -135,23 +124,6 @@ export const fetchEnvironments = ({ commit, dispatch }, environmentsPath) => { }); }; -/** - * Fetch managed apps data - * @param {Object} store - * @param {String} clustersPath - */ - -export const fetchManagedApps = ({ commit }, clustersPath) => { - return axios - .get(clustersPath) - .then(({ data }) => { - commit(types.RECEIVE_MANAGED_APPS_DATA_SUCCESS, data.clusters); - }) - .catch(() => { - commit(types.RECEIVE_MANAGED_APPS_DATA_ERROR); - }); -}; - export const fetchLogs = ({ commit, state }, trackingLabel) => { commit(types.REQUEST_LOGS_DATA); diff --git a/app/assets/javascripts/logs/stores/getters.js b/app/assets/javascripts/logs/stores/getters.js index 836e6e82385..bf71cfd8eb2 100644 --- a/app/assets/javascripts/logs/stores/getters.js +++ b/app/assets/javascripts/logs/stores/getters.js @@ -6,16 +6,9 @@ const mapTrace = ({ timestamp = null, pod = '', message = '' }) => export const trace = (state) => state.logs.lines.map(mapTrace).join('\n'); export const showAdvancedFilters = (state) => { - if (state.environments.current) { - const environment = state.environments.options.find( - ({ name }) => name === state.environments.current, - ); - - return Boolean(environment?.enable_advanced_logs_querying); - } - const managedApp = state.managedApps.options.find( - ({ name }) => name === state.managedApps.current, + const environment = state.environments.options.find( + ({ name }) => name === state.environments.current, ); - return Boolean(managedApp?.enable_advanced_logs_querying); + return Boolean(environment?.enable_advanced_logs_querying); }; diff --git a/app/assets/javascripts/logs/stores/mutation_types.js b/app/assets/javascripts/logs/stores/mutation_types.js index eaa4b13f8bd..c1ed65ff48b 100644 --- a/app/assets/javascripts/logs/stores/mutation_types.js +++ b/app/assets/javascripts/logs/stores/mutation_types.js @@ -13,9 +13,6 @@ export const RECEIVE_ENVIRONMENTS_DATA_SUCCESS = 'RECEIVE_ENVIRONMENTS_DATA_SUCC export const RECEIVE_ENVIRONMENTS_DATA_ERROR = 'RECEIVE_ENVIRONMENTS_DATA_ERROR'; export const HIDE_REQUEST_ENVIRONMENTS_ERROR = 'HIDE_REQUEST_ENVIRONMENTS_ERROR'; -export const RECEIVE_MANAGED_APPS_DATA_SUCCESS = 'RECEIVE_MANAGED_APPS_DATA_SUCCESS'; -export const RECEIVE_MANAGED_APPS_DATA_ERROR = 'RECEIVE_MANAGED_APPS_DATA_ERROR'; - export const REQUEST_LOGS_DATA = 'REQUEST_LOGS_DATA'; export const RECEIVE_LOGS_DATA_SUCCESS = 'RECEIVE_LOGS_DATA_SUCCESS'; export const RECEIVE_LOGS_DATA_ERROR = 'RECEIVE_LOGS_DATA_ERROR'; diff --git a/app/assets/javascripts/logs/stores/mutations.js b/app/assets/javascripts/logs/stores/mutations.js index 21031838adf..6736d7204b4 100644 --- a/app/assets/javascripts/logs/stores/mutations.js +++ b/app/assets/javascripts/logs/stores/mutations.js @@ -32,9 +32,6 @@ export default { // Clear current pod options state.pods.current = null; state.pods.options = []; - - // Clear current managedApps options - state.managedApps.current = null; }, [types.REQUEST_ENVIRONMENTS_DATA](state) { state.environments.options = []; @@ -110,26 +107,4 @@ export default { [types.RECEIVE_PODS_DATA_ERROR](state) { state.pods.options = []; }, - // Managed apps data - [types.RECEIVE_MANAGED_APPS_DATA_SUCCESS](state, apps) { - state.managedApps.options = apps.filter( - ({ gitlab_managed_apps_logs_path }) => gitlab_managed_apps_logs_path, // eslint-disable-line babel/camelcase - ); - state.managedApps.isLoading = false; - }, - [types.RECEIVE_MANAGED_APPS_DATA_ERROR](state) { - state.managedApps.options = []; - state.managedApps.isLoading = false; - state.managedApps.fetchError = true; - }, - [types.SET_MANAGED_APP](state, managedApp) { - state.managedApps.current = managedApp; - - // Clear current pod options - state.pods.current = null; - state.pods.options = []; - - // Clear current environment options - state.environments.current = null; - }, }; diff --git a/app/assets/javascripts/logs/stores/state.js b/app/assets/javascripts/logs/stores/state.js index e2028621ac8..83080589362 100644 --- a/app/assets/javascripts/logs/stores/state.js +++ b/app/assets/javascripts/logs/stores/state.js @@ -31,16 +31,6 @@ export default () => ({ }, /** - * Managed apps list information - */ - managedApps: { - options: [], - isLoading: false, - current: null, - fetchError: false, - }, - - /** * Logs including trace */ logs: { |