From 603c7d4cac5e28bc1c75e50c23ed2cbe56f1aafc Mon Sep 17 00:00:00 2001
From: GitLab Bot
Date: Tue, 24 Mar 2020 18:07:55 +0000
Subject: Add latest changes from gitlab-org/gitlab@master
---
app/assets/javascripts/api.js | 9 -
.../javascripts/code_navigation/components/app.vue | 3 +-
.../code_navigation/components/popover.vue | 13 +-
.../javascripts/code_navigation/store/actions.js | 9 +-
.../javascripts/code_navigation/store/mutations.js | 7 +-
.../ide/components/branches/search_list.vue | 4 +-
.../ide/components/commit_sidebar/actions.vue | 4 +-
.../javascripts/ide/components/jobs/detail.vue | 4 +-
.../ide/components/merge_requests/list.vue | 4 +-
.../ide/components/panes/collapsible_sidebar.vue | 3 +-
.../javascripts/ide/components/pipelines/list.vue | 4 +-
.../ide/components/preview/clientside.vue | 6 +-
app/assets/javascripts/ide/index.js | 4 +-
app/assets/javascripts/ide/lib/diff/controller.js | 2 +-
app/assets/javascripts/ide/lib/editor.js | 4 +-
app/assets/javascripts/ide/stores/actions.js | 4 +-
.../javascripts/ide/stores/actions/project.js | 6 +-
app/assets/javascripts/ide/stores/actions/tree.js | 4 +-
.../logs/components/environment_logs.vue | 205 +++++----------------
.../logs/components/log_advanced_filters.vue | 128 +++++++++++++
.../logs/components/log_simple_filters.vue | 73 ++++++++
app/assets/javascripts/logs/stores/getters.js | 8 +-
22 files changed, 301 insertions(+), 207 deletions(-)
create mode 100644 app/assets/javascripts/logs/components/log_advanced_filters.vue
create mode 100644 app/assets/javascripts/logs/components/log_simple_filters.vue
(limited to 'app/assets/javascripts')
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js
index 022d79ecf49..14381f63e4b 100644
--- a/app/assets/javascripts/api.js
+++ b/app/assets/javascripts/api.js
@@ -44,7 +44,6 @@ const Api = {
mergeRequestsPipeline: '/api/:version/projects/:id/merge_requests/:merge_request_iid/pipelines',
adminStatisticsPath: '/api/:version/application/statistics',
pipelineSinglePath: '/api/:version/projects/:id/pipelines/:pipeline_id',
- lsifPath: '/api/:version/projects/:id/commits/:commit_id/lsif/info',
environmentsPath: '/api/:version/projects/:id/environments',
group(groupId, callback) {
@@ -474,14 +473,6 @@ const Api = {
return axios.get(url);
},
- lsifData(projectPath, commitId, paths) {
- const url = Api.buildUrl(this.lsifPath)
- .replace(':id', encodeURIComponent(projectPath))
- .replace(':commit_id', commitId);
-
- return axios.get(url, { params: { paths } });
- },
-
environments(id) {
const url = Api.buildUrl(this.environmentsPath).replace(':id', encodeURIComponent(id));
return axios.get(url);
diff --git a/app/assets/javascripts/code_navigation/components/app.vue b/app/assets/javascripts/code_navigation/components/app.vue
index 0e5f1f0485d..0e0160b9832 100644
--- a/app/assets/javascripts/code_navigation/components/app.vue
+++ b/app/assets/javascripts/code_navigation/components/app.vue
@@ -7,7 +7,7 @@ export default {
Popover,
},
computed: {
- ...mapState(['currentDefinition', 'currentDefinitionPosition']),
+ ...mapState(['currentDefinition', 'currentDefinitionPosition', 'definitionPathPrefix']),
},
mounted() {
this.blobViewer = document.querySelector('.blob-viewer');
@@ -39,5 +39,6 @@ export default {
v-if="currentDefinition"
:position="currentDefinitionPosition"
:data="currentDefinition"
+ :definition-path-prefix="definitionPathPrefix"
/>
diff --git a/app/assets/javascripts/code_navigation/components/popover.vue b/app/assets/javascripts/code_navigation/components/popover.vue
index d5bbe430fcd..f216a4c6e6f 100644
--- a/app/assets/javascripts/code_navigation/components/popover.vue
+++ b/app/assets/javascripts/code_navigation/components/popover.vue
@@ -14,6 +14,10 @@ export default {
type: Object,
required: true,
},
+ definitionPathPrefix: {
+ type: String,
+ required: true,
+ },
},
data() {
return {
@@ -27,6 +31,11 @@ export default {
top: `${this.position.y + this.position.height}px`,
};
},
+ definitionPath() {
+ return (
+ this.data.definition_path && `${this.definitionPathPrefix}/${this.data.definition_path}`
+ );
+ },
},
watch: {
position: {
@@ -67,8 +76,8 @@ export default {
{{ hover.value }}
-
-
+
+
{{ __('Go to definition') }}
diff --git a/app/assets/javascripts/code_navigation/store/actions.js b/app/assets/javascripts/code_navigation/store/actions.js
index 5220b1215b8..9b607023f39 100644
--- a/app/assets/javascripts/code_navigation/store/actions.js
+++ b/app/assets/javascripts/code_navigation/store/actions.js
@@ -1,4 +1,4 @@
-import api from '~/api';
+import axios from '~/lib/utils/axios_utils';
import * as types from './mutation_types';
import { getCurrentHoverElement, setCurrentHoverElement, addInteractionClass } from '../utils';
@@ -12,11 +12,10 @@ export default {
fetchData({ commit, dispatch, state }) {
commit(types.REQUEST_DATA);
- api
- .lsifData(state.projectPath, state.commitId, [state.blobPath])
+ axios
+ .get(state.codeNavUrl)
.then(({ data }) => {
- const dataForPath = data[state.blobPath];
- const normalizedData = dataForPath.reduce((acc, d) => {
+ const normalizedData = data.reduce((acc, d) => {
if (d.hover) {
acc[`${d.start_line}:${d.start_char}`] = d;
addInteractionClass(d);
diff --git a/app/assets/javascripts/code_navigation/store/mutations.js b/app/assets/javascripts/code_navigation/store/mutations.js
index bb833a5adbc..febb7afe2f8 100644
--- a/app/assets/javascripts/code_navigation/store/mutations.js
+++ b/app/assets/javascripts/code_navigation/store/mutations.js
@@ -1,10 +1,9 @@
import * as types from './mutation_types';
export default {
- [types.SET_INITIAL_DATA](state, { projectPath, commitId, blobPath }) {
- state.projectPath = projectPath;
- state.commitId = commitId;
- state.blobPath = blobPath;
+ [types.SET_INITIAL_DATA](state, { codeNavUrl, definitionPathPrefix }) {
+ state.codeNavUrl = codeNavUrl;
+ state.definitionPathPrefix = definitionPathPrefix;
},
[types.REQUEST_DATA](state) {
state.loading = true;
diff --git a/app/assets/javascripts/ide/components/branches/search_list.vue b/app/assets/javascripts/ide/components/branches/search_list.vue
index 31f1dec43ad..76821bcd986 100644
--- a/app/assets/javascripts/ide/components/branches/search_list.vue
+++ b/app/assets/javascripts/ide/components/branches/search_list.vue
@@ -1,6 +1,6 @@
+
+
+
+
+ {{ s__('Environments|Filter by pod') }}
+
+
+
+
+ {{ s__('Environments|No pods to display') }}
+
+
+
+
+
+
+
+
{{ s__('Environments|All pods') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/assets/javascripts/logs/components/log_simple_filters.vue b/app/assets/javascripts/logs/components/log_simple_filters.vue
new file mode 100644
index 00000000000..21fe1695624
--- /dev/null
+++ b/app/assets/javascripts/logs/components/log_simple_filters.vue
@@ -0,0 +1,73 @@
+
+
+
+
+
+ {{ s__('Environments|Select pod') }}
+
+
+
+
+ {{ s__('Environments|No pods to display') }}
+
+
+
+
+
+
+
+
diff --git a/app/assets/javascripts/logs/stores/getters.js b/app/assets/javascripts/logs/stores/getters.js
index 8770306fdd6..d92969c5389 100644
--- a/app/assets/javascripts/logs/stores/getters.js
+++ b/app/assets/javascripts/logs/stores/getters.js
@@ -5,5 +5,9 @@ const mapTrace = ({ timestamp = null, pod = '', message = '' }) =>
export const trace = state => state.logs.lines.map(mapTrace).join('\n');
-// prevent babel-plugin-rewire from generating an invalid default during karma tests
-export default () => {};
+export const showAdvancedFilters = state => {
+ const environment = state.environments.options.find(
+ ({ name }) => name === state.environments.current,
+ );
+ return Boolean(environment?.enable_advanced_logs_querying);
+};
--
cgit v1.2.1