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>2023-09-28 15:08:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-28 15:08:02 +0300
commit5573dc288d880386a96afc9458f7d1abd6cd745f (patch)
treefb3ec81501f337b71b10e35285e56654c9c9ab52 /app/assets/javascripts/boards
parent1e16ecd8e2fd4b23ee56519072d245d261ea2804 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/boards')
-rw-r--r--app/assets/javascripts/boards/components/board_form.vue26
1 files changed, 17 insertions, 9 deletions
diff --git a/app/assets/javascripts/boards/components/board_form.vue b/app/assets/javascripts/boards/components/board_form.vue
index d12478b42d8..6ea94e04e44 100644
--- a/app/assets/javascripts/boards/components/board_form.vue
+++ b/app/assets/javascripts/boards/components/board_form.vue
@@ -1,13 +1,15 @@
<script>
import { GlModal, GlAlert } from '@gitlab/ui';
// eslint-disable-next-line no-restricted-imports
-import { mapActions, mapState } from 'vuex';
+import { mapActions } from 'vuex';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { visitUrl, updateHistory, getParameterByName } from '~/lib/utils/url_utility';
import { __, s__ } from '~/locale';
import eventHub from '~/boards/eventhub';
import { formType } from '../constants';
+import { setError } from '../graphql/cache_updates';
+import errorQuery from '../graphql/client/error.query.graphql';
import createBoardMutation from '../graphql/board_create.mutation.graphql';
import destroyBoardMutation from '../graphql/board_destroy.mutation.graphql';
import updateBoardMutation from '../graphql/board_update.mutation.graphql';
@@ -93,8 +95,13 @@ export default {
isLoading: false,
};
},
+ apollo: {
+ error: {
+ query: errorQuery,
+ update: (data) => data.boardsAppError,
+ },
+ },
computed: {
- ...mapState(['error']),
isNewForm() {
return this.currentPage === formType.new;
},
@@ -177,7 +184,8 @@ export default {
}
},
methods: {
- ...mapActions(['setError', 'unsetError', 'setBoard']),
+ ...mapActions(['setBoard']),
+ setError,
isFocusMode() {
return Boolean(document.querySelector('.content-wrapper > .js-focus-mode-board.is-focused'));
},
@@ -211,8 +219,8 @@ export default {
try {
await this.deleteBoard();
visitUrl(this.boardBaseUrl);
- } catch {
- this.setError({ message: this.$options.i18n.deleteErrorMessage });
+ } catch (error) {
+ setError({ error, message: this.$options.i18n.deleteErrorMessage });
} finally {
this.isLoading = false;
}
@@ -236,8 +244,8 @@ export default {
: '';
updateHistory({ url: `${this.boardBaseUrl}/${getIdFromGraphQLId(board.id)}${param}` });
}
- } catch {
- this.setError({ message: this.$options.i18n.saveErrorMessage });
+ } catch (error) {
+ setError({ error, message: this.$options.i18n.saveErrorMessage });
} finally {
this.isLoading = false;
}
@@ -295,11 +303,11 @@ export default {
@hide.prevent
>
<gl-alert
- v-if="!isApolloBoard && error"
+ v-if="error"
class="gl-mb-3"
variant="danger"
:dismissible="true"
- @dismiss="unsetError"
+ @dismiss="() => setError({ message: null, captureError: false })"
>
{{ error }}
</gl-alert>