Commit 489d9d9e authored by Rajat Jain's avatar Rajat Jain

Show CSV has been exported banner on export

Show alert when requirements csv is being exported
parent 586070ae
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
>{{ __('Select all') }}</gl-form-checkbox >{{ __('Select all') }}</gl-form-checkbox
> >
</div> </div>
<div class="gl-pt-5 gl-pb-4 scrollbox-body"> <div class="gl-pt-5 gl-pb-4 gl-pl-6 scrollbox-body">
<gl-form-checkbox <gl-form-checkbox
v-for="field in $options.fields" v-for="field in $options.fields"
:key="field.key" :key="field.key"
......
<script> <script>
import { GlPagination } from '@gitlab/ui'; import { GlPagination, GlAlert } from '@gitlab/ui';
import Api from '~/api'; import Api from '~/api';
import createFlash, { FLASH_TYPES } from '~/flash'; import createFlash, { FLASH_TYPES } from '~/flash';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
AvailableSortOptions, AvailableSortOptions,
components: { components: {
GlPagination, GlPagination,
GlAlert,
FilteredSearchBar, FilteredSearchBar,
RequirementsTabs, RequirementsTabs,
RequirementsLoading, RequirementsLoading,
...@@ -234,6 +235,7 @@ export default { ...@@ -234,6 +235,7 @@ export default {
ARCHIVED: this.initialRequirementsCount[FilterState.archived], ARCHIVED: this.initialRequirementsCount[FilterState.archived],
ALL: this.initialRequirementsCount[FilterState.all], ALL: this.initialRequirementsCount[FilterState.all],
}, },
alert: null,
}; };
}, },
computed: { computed: {
...@@ -455,6 +457,15 @@ export default { ...@@ -455,6 +457,15 @@ export default {
selectedFields, selectedFields,
}, },
}) })
.then(() => {
this.alert = {
variant: 'info',
message: sprintf(
__('Your CSV export has started. It will be emailed to %{email} when complete.'),
{ email: this.currentUserEmail },
),
};
})
.catch((e) => { .catch((e) => {
createFlash({ createFlash({
message: __('Something went wrong while exporting requirements'), message: __('Something went wrong while exporting requirements'),
...@@ -675,6 +686,16 @@ export default { ...@@ -675,6 +686,16 @@ export default {
<template> <template>
<div class="requirements-list-container"> <div class="requirements-list-container">
<gl-alert
v-if="alert"
:variant="alert.variant"
:dismissible="true"
class="gl-mt-3 gl-mb-4"
@dismiss="alert = null"
>
{{ alert.message }}
</gl-alert>
<requirements-tabs <requirements-tabs
:filter-by="filterBy" :filter-by="filterBy"
:requirements-count="requirementsCount" :requirements-count="requirementsCount"
......
---
title: Show CSV has been exported banner on export
merge_request: 55965
author:
type: changed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment