summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 15:08:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-04 15:08:40 +0000
commit6b833f1e0340e00fdee074da9c42c0d4e07a46d2 (patch)
tree6fc3a7a2f8a02fec8d1e7561b453d33eb4048dad /app/assets
parent88a0824944720b6edaaef56376713541b9a02118 (diff)
downloadgitlab-ce-6b833f1e0340e00fdee074da9c42c0d4e07a46d2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/diffs/components/diff_stats.vue2
-rw-r--r--app/assets/javascripts/error_tracking/components/error_details.vue35
-rw-r--r--app/assets/javascripts/error_tracking/store/actions.js6
-rw-r--r--app/assets/javascripts/releases/list/components/release_block_author.vue2
-rw-r--r--app/assets/javascripts/repository/components/last_commit.vue3
-rw-r--r--app/assets/javascripts/snippets/components/snippet_header.vue4
-rw-r--r--app/assets/javascripts/snippets/components/snippet_title.vue2
7 files changed, 43 insertions, 11 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_stats.vue b/app/assets/javascripts/diffs/components/diff_stats.vue
index 5329cb1e241..0138790cf0e 100644
--- a/app/assets/javascripts/diffs/components/diff_stats.vue
+++ b/app/assets/javascripts/diffs/components/diff_stats.vue
@@ -17,7 +17,7 @@ export default {
diffFilesLength: {
type: Number,
required: false,
- default: 0,
+ default: null,
},
},
computed: {
diff --git a/app/assets/javascripts/error_tracking/components/error_details.vue b/app/assets/javascripts/error_tracking/components/error_details.vue
index 98fc121d39f..88861b7da0e 100644
--- a/app/assets/javascripts/error_tracking/components/error_details.vue
+++ b/app/assets/javascripts/error_tracking/components/error_details.vue
@@ -2,7 +2,15 @@
import { mapActions, mapGetters, mapState } from 'vuex';
import dateFormat from 'dateformat';
import createFlash from '~/flash';
-import { GlButton, GlFormInput, GlLink, GlLoadingIcon, GlBadge } from '@gitlab/ui';
+import {
+ GlButton,
+ GlFormInput,
+ GlLink,
+ GlLoadingIcon,
+ GlBadge,
+ GlAlert,
+ GlSprintf,
+} from '@gitlab/ui';
import { __, sprintf, n__ } from '~/locale';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import Icon from '~/vue_shared/components/icon.vue';
@@ -26,6 +34,8 @@ export default {
Icon,
Stacktrace,
GlBadge,
+ GlAlert,
+ GlSprintf,
},
directives: {
TrackEvent: TrackEventDirective,
@@ -85,6 +95,8 @@ export default {
return {
GQLerror: null,
issueCreationInProgress: false,
+ isAlertVisible: false,
+ closedIssueId: null,
};
},
computed: {
@@ -184,7 +196,14 @@ export default {
onResolveStatusUpdate() {
const status =
this.errorStatus === errorStatus.RESOLVED ? errorStatus.UNRESOLVED : errorStatus.RESOLVED;
- this.updateResolveStatus({ endpoint: this.issueUpdatePath, status });
+
+ // eslint-disable-next-line promise/catch-or-return
+ this.updateResolveStatus({ endpoint: this.issueUpdatePath, status }).then(res => {
+ this.closedIssueId = res.closed_issue_iid;
+ if (this.closedIssueId) {
+ this.isAlertVisible = true;
+ }
+ });
},
formatDate(date) {
return `${this.timeFormatted(date)} (${dateFormat(date, 'UTC:yyyy-mm-dd h:MM:ssTT Z')})`;
@@ -199,6 +218,18 @@ export default {
<gl-loading-icon :size="3" />
</div>
<div v-else-if="showDetails" class="error-details">
+ <gl-alert v-if="isAlertVisible" @dismiss="isAlertVisible = false">
+ <gl-sprintf
+ :message="
+ __('The associated issue #%{issueId} has been closed as the error is now resolved.')
+ "
+ >
+ <template #issueId>
+ <span>{{ closedIssueId }}</span>
+ </template>
+ </gl-sprintf>
+ </gl-alert>
+
<div class="top-area align-items-center justify-content-between py-3">
<span v-if="!loadingStacktrace && stacktrace" v-html="reported"></span>
<div class="d-inline-flex">
diff --git a/app/assets/javascripts/error_tracking/store/actions.js b/app/assets/javascripts/error_tracking/store/actions.js
index 49fa5f3cec5..8f6f404ef8a 100644
--- a/app/assets/javascripts/error_tracking/store/actions.js
+++ b/app/assets/javascripts/error_tracking/store/actions.js
@@ -11,9 +11,11 @@ export const setStatus = ({ commit }, status) => {
export const updateStatus = ({ commit }, { endpoint, redirectUrl, status }) =>
service
.updateErrorStatus(endpoint, status)
- .then(() => {
- if (redirectUrl) visitUrl(redirectUrl);
+ .then(resp => {
commit(types.SET_ERROR_STATUS, status);
+ if (redirectUrl) visitUrl(redirectUrl);
+
+ return resp.data.result;
})
.catch(() => createFlash(__('Failed to update issue status')));
diff --git a/app/assets/javascripts/releases/list/components/release_block_author.vue b/app/assets/javascripts/releases/list/components/release_block_author.vue
index ff6b00d8221..e7075d4d67a 100644
--- a/app/assets/javascripts/releases/list/components/release_block_author.vue
+++ b/app/assets/javascripts/releases/list/components/release_block_author.vue
@@ -27,7 +27,7 @@ export default {
<template>
<div class="d-flex">
- <gl-sprintf message="by %{user}">
+ <gl-sprintf :message="__('by %{user}')">
<template #user>
<user-avatar-link
class="prepend-left-4"
diff --git a/app/assets/javascripts/repository/components/last_commit.vue b/app/assets/javascripts/repository/components/last_commit.vue
index 573b0c4963e..c0c599f4b3c 100644
--- a/app/assets/javascripts/repository/components/last_commit.vue
+++ b/app/assets/javascripts/repository/components/last_commit.vue
@@ -146,9 +146,8 @@ export default {
v-if="commit.description"
:class="{ 'd-block': showDescription }"
class="commit-row-description append-bottom-8"
+ >{{ commit.description }}</pre
>
- {{ commit.description }}
- </pre>
</div>
<div class="commit-actions flex-row">
<div v-if="commit.signatureHtml" v-html="commit.signatureHtml"></div>
diff --git a/app/assets/javascripts/snippets/components/snippet_header.vue b/app/assets/javascripts/snippets/components/snippet_header.vue
index e8f1bfeaf43..36ba6eeecbd 100644
--- a/app/assets/javascripts/snippets/components/snippet_header.vue
+++ b/app/assets/javascripts/snippets/components/snippet_header.vue
@@ -165,7 +165,7 @@ export default {
<gl-icon :name="visibilityLevelIcon" :size="14" />
</div>
<div class="creator">
- <gl-sprintf message="Authored %{timeago} by %{author}">
+ <gl-sprintf :message="__('Authored %{timeago} by %{author}')">
<template #timeago>
<time-ago-tooltip
:time="snippet.createdAt"
@@ -218,7 +218,7 @@ export default {
errorMessage
}}</gl-alert>
- <gl-sprintf message="Are you sure you want to delete %{name}?">
+ <gl-sprintf :message="__('Are you sure you want to delete %{name}?')">
<template #name
><strong>{{ snippet.title }}</strong></template
>
diff --git a/app/assets/javascripts/snippets/components/snippet_title.vue b/app/assets/javascripts/snippets/components/snippet_title.vue
index fc8a9b4a390..6646e70f5db 100644
--- a/app/assets/javascripts/snippets/components/snippet_title.vue
+++ b/app/assets/javascripts/snippets/components/snippet_title.vue
@@ -25,7 +25,7 @@ export default {
</div>
<small v-if="snippet.updatedAt !== snippet.createdAt" class="edited-text">
- <gl-sprintf message="Edited %{timeago}">
+ <gl-sprintf :message="__('Edited %{timeago}')">
<template #timeago>
<time-ago-tooltip :time="snippet.updatedAt" tooltip-placement="bottom" />
</template>