diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 21:08:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 21:08:00 +0000 |
commit | be59dd1d43332496def276c8d3e78fc82e94273a (patch) | |
tree | 19c25e5a7e7f88a0ac4bd797bf70ac48603656cc /app | |
parent | 855bf0533bc5d5df2821e9a5951fae4f153f7492 (diff) | |
download | gitlab-ce-be59dd1d43332496def276c8d3e78fc82e94273a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
11 files changed, 126 insertions, 23 deletions
diff --git a/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue index f5a67299dde..4996ce3d342 100644 --- a/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue +++ b/app/assets/javascripts/create_cluster/eks_cluster/components/eks_cluster_configuration_form.vue @@ -153,7 +153,7 @@ export default { ), { startLink: - '<a href="https://docs.aws.amazon.com/eks/latest/userguide/getting-started-console.html#role-create" target="_blank" rel="noopener noreferrer">', + '<a href="https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html#create-service-role" target="_blank" rel="noopener noreferrer">', externalLinkIcon: this.externalLinkIcon, endLink: '</a>', }, diff --git a/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue b/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue index 6b2ef34c960..3398cd091ba 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue @@ -1,12 +1,13 @@ <script> -import $ from 'jquery'; import { mapActions } from 'vuex'; -import { __ } from '~/locale'; +import { sprintf, __ } from '~/locale'; +import { GlModal } from '@gitlab/ui'; import FileIcon from '~/vue_shared/components/file_icon.vue'; import ChangedFileIcon from '~/vue_shared/components/changed_file_icon.vue'; export default { components: { + GlModal, FileIcon, ChangedFileIcon, }, @@ -17,7 +18,13 @@ export default { }, }, computed: { - activeButtonText() { + discardModalId() { + return `discard-file-${this.activeFile.path}`; + }, + discardModalTitle() { + return sprintf(__('Discard changes to %{path}?'), { path: this.activeFile.path }); + }, + actionButtonText() { return this.activeFile.staged ? __('Unstage') : __('Stage'); }, isStaged() { @@ -25,7 +32,7 @@ export default { }, }, methods: { - ...mapActions(['stageChange', 'unstageChange']), + ...mapActions(['stageChange', 'unstageChange', 'discardFileChanges']), actionButtonClicked() { if (this.activeFile.staged) { this.unstageChange(this.activeFile.path); @@ -34,7 +41,7 @@ export default { } }, showDiscardModal() { - $(document.getElementById(`discard-file-${this.activeFile.path}`)).modal('show'); + this.$refs.discardModal.show(); }, }, }; @@ -53,6 +60,7 @@ export default { <div class="ml-auto"> <button v-if="!isStaged" + ref="discardButton" type="button" class="btn btn-remove btn-inverted append-right-8" @click="showDiscardModal" @@ -60,6 +68,7 @@ export default { {{ __('Discard') }} </button> <button + ref="actionButton" :class="{ 'btn-success': !isStaged, 'btn-warning': isStaged, @@ -68,8 +77,19 @@ export default { class="btn btn-inverted" @click="actionButtonClicked" > - {{ activeButtonText }} + {{ actionButtonText }} </button> </div> + <gl-modal + ref="discardModal" + ok-variant="danger" + cancel-variant="light" + :ok-title="__('Discard changes')" + :modal-id="discardModalId" + :title="discardModalTitle" + @ok="discardFileChanges(activeFile.path)" + > + {{ __("You will lose all changes you've made to this file. This action cannot be undone.") }} + </gl-modal> </div> </template> diff --git a/app/assets/javascripts/ide/stores/actions/merge_request.js b/app/assets/javascripts/ide/stores/actions/merge_request.js index 6790c0fbdaa..806ec38430c 100644 --- a/app/assets/javascripts/ide/stores/actions/merge_request.js +++ b/app/assets/javascripts/ide/stores/actions/merge_request.js @@ -141,7 +141,7 @@ export const getMergeRequestVersions = ( }); export const openMergeRequest = ( - { dispatch, state }, + { dispatch, state, getters }, { projectId, targetProjectId, mergeRequestId } = {}, ) => dispatch('getMergeRequestData', { @@ -152,17 +152,18 @@ export const openMergeRequest = ( .then(mr => { dispatch('setCurrentBranchId', mr.source_branch); - // getFiles needs to be called after getting the branch data - // since files are fetched using the last commit sha of the branch return dispatch('getBranchData', { projectId, branchId: mr.source_branch, - }).then(() => - dispatch('getFiles', { + }).then(() => { + const branch = getters.findBranch(projectId, mr.source_branch); + + return dispatch('getFiles', { projectId, branchId: mr.source_branch, - }), - ); + ref: branch.commit.id, + }); + }); }) .then(() => dispatch('getMergeRequestVersions', { diff --git a/app/assets/javascripts/ide/stores/actions/project.js b/app/assets/javascripts/ide/stores/actions/project.js index 20887e7d0ac..52bf9becd0f 100644 --- a/app/assets/javascripts/ide/stores/actions/project.js +++ b/app/assets/javascripts/ide/stores/actions/project.js @@ -111,7 +111,7 @@ export const loadFile = ({ dispatch, state }, { basePath }) => { } }; -export const loadBranch = ({ dispatch }, { projectId, branchId }) => +export const loadBranch = ({ dispatch, getters }, { projectId, branchId }) => dispatch('getBranchData', { projectId, branchId, @@ -121,9 +121,13 @@ export const loadBranch = ({ dispatch }, { projectId, branchId }) => projectId, branchId, }); + + const branch = getters.findBranch(projectId, branchId); + return dispatch('getFiles', { projectId, branchId, + ref: branch.commit.id, }); }) .catch(() => { diff --git a/app/assets/javascripts/ide/stores/actions/tree.js b/app/assets/javascripts/ide/stores/actions/tree.js index 72cd099c5a5..ba85194b910 100644 --- a/app/assets/javascripts/ide/stores/actions/tree.js +++ b/app/assets/javascripts/ide/stores/actions/tree.js @@ -46,19 +46,20 @@ export const setDirectoryData = ({ state, commit }, { projectId, branchId, treeL }); }; -export const getFiles = ({ state, commit, dispatch, getters }, { projectId, branchId } = {}) => +export const getFiles = ({ state, commit, dispatch }, payload = {}) => new Promise((resolve, reject) => { + const { projectId, branchId, ref = branchId } = payload; + if ( !state.trees[`${projectId}/${branchId}`] || (state.trees[`${projectId}/${branchId}`].tree && state.trees[`${projectId}/${branchId}`].tree.length === 0) ) { const selectedProject = state.projects[projectId]; - const selectedBranch = getters.findBranch(projectId, branchId); commit(types.CREATE_TREE, { treePath: `${projectId}/${branchId}` }); service - .getFiles(selectedProject.web_url, selectedBranch.commit.id) + .getFiles(selectedProject.web_url, ref) .then(({ data }) => { const { entries, treeList } = decorateFiles({ data, @@ -77,8 +78,8 @@ export const getFiles = ({ state, commit, dispatch, getters }, { projectId, bran .catch(e => { dispatch('setErrorMessage', { text: __('An error occurred whilst loading all the files.'), - action: payload => - dispatch('getFiles', payload).then(() => dispatch('setErrorMessage', null)), + action: actionPayload => + dispatch('getFiles', actionPayload).then(() => dispatch('setErrorMessage', null)), actionText: __('Please try again'), actionPayload: { projectId, branchId }, }); diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index 52674107df2..96c4741fc2e 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -2,12 +2,12 @@ import $ from 'jquery'; import Vue from 'vue'; +import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils'; import Cookies from 'js-cookie'; import axios from './lib/utils/axios_utils'; import flash from './flash'; import BlobForkSuggestion from './blob/blob_fork_suggestion'; import initChangesDropdown from './init_changes_dropdown'; -import bp from './breakpoints'; import { parseUrlPathname, handleLocationHash, @@ -194,7 +194,7 @@ export default class MergeRequestTabs { if (!isInVueNoteablePage()) { this.loadDiff(href); } - if (bp.getBreakpointSize() !== 'lg') { + if (bp.getBreakpointSize() !== 'xl') { this.shrinkView(); } this.expandViewContainer(); diff --git a/app/assets/javascripts/pages/projects/issues/show.js b/app/assets/javascripts/pages/projects/issues/show.js index 28a136a5fa5..75df80a0f6c 100644 --- a/app/assets/javascripts/pages/projects/issues/show.js +++ b/app/assets/javascripts/pages/projects/issues/show.js @@ -4,11 +4,13 @@ import ShortcutsIssuable from '~/behaviors/shortcuts/shortcuts_issuable'; import ZenMode from '~/zen_mode'; import '~/notes/index'; import initIssueableApp from '~/issue_show'; +import initSentryErrorStackTraceApp from '~/sentry_error_stack_trace'; import initRelatedMergeRequestsApp from '~/related_merge_requests'; import initVueIssuableSidebarApp from '~/issuable_sidebar/sidebar_bundle'; export default function() { initIssueableApp(); + initSentryErrorStackTraceApp(); initRelatedMergeRequestsApp(); new Issue(); // eslint-disable-line no-new new ShortcutsIssuable(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/sentry_error_stack_trace/components/sentry_error_stack_trace.vue b/app/assets/javascripts/sentry_error_stack_trace/components/sentry_error_stack_trace.vue new file mode 100644 index 00000000000..c90478db620 --- /dev/null +++ b/app/assets/javascripts/sentry_error_stack_trace/components/sentry_error_stack_trace.vue @@ -0,0 +1,43 @@ +<script> +import Stacktrace from '~/error_tracking/components/stacktrace.vue'; +import { GlLoadingIcon } from '@gitlab/ui'; +import { mapActions, mapState, mapGetters } from 'vuex'; + +export default { + name: 'SentryErrorStackTrace', + components: { + Stacktrace, + GlLoadingIcon, + }, + props: { + issueStackTracePath: { + type: String, + required: true, + }, + }, + computed: { + ...mapState('details', ['loadingStacktrace', 'stacktraceData']), + ...mapGetters('details', ['stacktrace']), + }, + mounted() { + this.startPollingStacktrace(this.issueStackTracePath); + }, + methods: { + ...mapActions('details', ['startPollingStacktrace']), + }, +}; +</script> + +<template> + <div> + <div :class="{ 'border-bottom-0': loadingStacktrace }" class="card card-slim mt-4 mb-0"> + <div class="card-header border-bottom-0"> + <h5 class="card-title my-1">{{ __('Stack trace') }}</h5> + </div> + </div> + <div v-if="loadingStacktrace" class="card"> + <gl-loading-icon class="py-2" label="Fetching stack trace" :size="1" /> + </div> + <stacktrace v-else :entries="stacktrace" /> + </div> +</template> diff --git a/app/assets/javascripts/sentry_error_stack_trace/index.js b/app/assets/javascripts/sentry_error_stack_trace/index.js new file mode 100644 index 00000000000..9b24ddc335d --- /dev/null +++ b/app/assets/javascripts/sentry_error_stack_trace/index.js @@ -0,0 +1,22 @@ +import Vue from 'vue'; +import SentryErrorStackTrace from './components/sentry_error_stack_trace.vue'; +import store from '~/error_tracking/store'; + +export default function initSentryErrorStacktrace() { + const sentryErrorStackTraceEl = document.querySelector('#js-sentry-error-stack-trace'); + if (sentryErrorStackTraceEl) { + const { issueStackTracePath } = sentryErrorStackTraceEl.dataset; + // eslint-disable-next-line no-new + new Vue({ + el: sentryErrorStackTraceEl, + components: { + SentryErrorStackTrace, + }, + store, + render: createElement => + createElement('sentry-error-stack-trace', { + props: { issueStackTracePath }, + }), + }); + } +} diff --git a/app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue b/app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue index 4a72cca5f02..37e3643bf6c 100644 --- a/app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue +++ b/app/assets/javascripts/vue_shared/components/user_popover/user_popover.vue @@ -30,11 +30,16 @@ export default { }, computed: { statusHtml() { + if (!this.user.status) { + return ''; + } + if (this.user.status.emoji && this.user.status.message_html) { return `${glEmojiTag(this.user.status.emoji)} ${this.user.status.message_html}`; } else if (this.user.status.message_html) { return this.user.status.message_html; } + return ''; }, nameIsLoading() { @@ -97,7 +102,9 @@ export default { class="animation-container-small mb-1" /> </div> - <div v-if="user.status" class="mt-2"><span v-html="statusHtml"></span></div> + <div v-if="statusHtml" class="js-user-status mt-2"> + <span v-html="statusHtml"></span> + </div> </div> </div> </gl-popover> diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 17f6fe95f10..9062f2097b8 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -71,6 +71,9 @@ = edited_time_ago_with_tooltip(@issue, placement: 'bottom', html_class: 'issue-edited-ago js-issue-edited-ago') + - if @issue.sentry_issue.present? + #js-sentry-error-stack-trace{ data: error_details_data(@project, @issue.sentry_issue.sentry_issue_identifier) } + = render_if_exists 'projects/issues/related_issues' #js-related-merge-requests{ data: { endpoint: expose_path(api_v4_projects_issues_related_merge_requests_path(id: @project.id, issue_iid: @issue.iid)), project_namespace: @project.namespace.path, project_path: @project.path } } |