Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-30 12:08:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-30 12:08:37 +0300
commite860bae967a4fa90213ff1980fac0bea8f894366 (patch)
treefc0b14df1f44d8e8393a2dd9b5b62aa2ed6630e9 /app/assets
parent0bc8084ef319ca1df4bfb885e66facd04b0540db (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/clusters_list/components/clusters.vue7
-rw-r--r--app/assets/javascripts/clusters_list/store/actions.js19
-rw-r--r--app/assets/javascripts/notes/components/note_actions.vue5
3 files changed, 17 insertions, 14 deletions
diff --git a/app/assets/javascripts/clusters_list/components/clusters.vue b/app/assets/javascripts/clusters_list/components/clusters.vue
index b7c72fcd50f..a51760599ea 100644
--- a/app/assets/javascripts/clusters_list/components/clusters.vue
+++ b/app/assets/javascripts/clusters_list/components/clusters.vue
@@ -1,5 +1,4 @@
<script>
-import * as Sentry from '@sentry/browser';
import { mapState, mapActions } from 'vuex';
import {
GlDeprecatedBadge as GlBadge,
@@ -88,7 +87,7 @@ export default {
this.fetchClusters();
},
methods: {
- ...mapActions(['fetchClusters', 'setPage']),
+ ...mapActions(['fetchClusters', 'reportSentryError', 'setPage']),
k8sQuantityToGb(quantity) {
if (!quantity) {
return 0;
@@ -150,7 +149,7 @@ export default {
};
}
} catch (error) {
- Sentry.captureException(error);
+ this.reportSentryError({ error, tag: 'totalMemoryAndUsageError' });
}
return { totalMemory: null, freeSpacePercentage: null };
@@ -183,7 +182,7 @@ export default {
};
}
} catch (error) {
- Sentry.captureException(error);
+ this.reportSentryError({ error, tag: 'totalCpuAndUsageError' });
}
return { totalCpu: null, freeSpacePercentage: null };
diff --git a/app/assets/javascripts/clusters_list/store/actions.js b/app/assets/javascripts/clusters_list/store/actions.js
index 7d8a728a134..dddcfb3d975 100644
--- a/app/assets/javascripts/clusters_list/store/actions.js
+++ b/app/assets/javascripts/clusters_list/store/actions.js
@@ -16,7 +16,14 @@ const allNodesPresent = (clusters, retryCount) => {
return retryCount > MAX_REQUESTS || clusters.every(cluster => cluster.nodes != null);
};
-export const fetchClusters = ({ state, commit }) => {
+export const reportSentryError = (_store, { error, tag }) => {
+ Sentry.withScope(scope => {
+ scope.setTag('javascript_clusters_list', tag);
+ Sentry.captureException(error);
+ });
+};
+
+export const fetchClusters = ({ state, commit, dispatch }) => {
let retryCount = 0;
commit(types.SET_LOADING_NODES, true);
@@ -49,10 +56,7 @@ export const fetchClusters = ({ state, commit }) => {
commit(types.SET_LOADING_CLUSTERS, false);
commit(types.SET_LOADING_NODES, false);
- Sentry.withScope(scope => {
- scope.setTag('javascript_clusters_list', 'fetchClustersSuccessCallback');
- Sentry.captureException(error);
- });
+ dispatch('reportSentryError', { error, tag: 'fetchClustersSuccessCallback' });
}
},
errorCallback: response => {
@@ -62,10 +66,7 @@ export const fetchClusters = ({ state, commit }) => {
commit(types.SET_LOADING_NODES, false);
flash(__('Clusters|An error occurred while loading clusters'));
- Sentry.withScope(scope => {
- scope.setTag('javascript_clusters_list', 'fetchClustersErrorCallback');
- Sentry.captureException(response);
- });
+ dispatch('reportSentryError', { error: response, tag: 'fetchClustersErrorCallback' });
},
});
diff --git a/app/assets/javascripts/notes/components/note_actions.vue b/app/assets/javascripts/notes/components/note_actions.vue
index 3b0fe8105e9..7615b0518b7 100644
--- a/app/assets/javascripts/notes/components/note_actions.vue
+++ b/app/assets/javascripts/notes/components/note_actions.vue
@@ -128,6 +128,9 @@ export default {
isIssue() {
return this.targetType === 'issue';
},
+ canAssign() {
+ return this.getNoteableData.current_user?.can_update && this.isIssue;
+ },
},
methods: {
onEdit() {
@@ -257,7 +260,7 @@ export default {
{{ __('Copy link') }}
</button>
</li>
- <li v-if="isIssue">
+ <li v-if="canAssign">
<button
class="btn-default btn-transparent"
data-testid="assign-user"