diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-14 12:08:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-14 12:08:46 +0300 |
commit | 6035fcc36ead3b415fa2422b0204a795a70f3e2f (patch) | |
tree | 011ffa756aa74a83dd1b6d5da5edb0380f4c52a2 /app/assets/javascripts/design_management/pages | |
parent | 4a159b9f98bf1c1a62035ea42e8ba56cafb48d98 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/design_management/pages')
-rw-r--r-- | app/assets/javascripts/design_management/pages/index.vue | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/app/assets/javascripts/design_management/pages/index.vue b/app/assets/javascripts/design_management/pages/index.vue index fb6a91abcdc..eab46d146da 100644 --- a/app/assets/javascripts/design_management/pages/index.vue +++ b/app/assets/javascripts/design_management/pages/index.vue @@ -3,6 +3,7 @@ import { GlLoadingIcon, GlButton, GlAlert } from '@gitlab/ui'; import VueDraggable from 'vuedraggable'; import { deprecatedCreateFlash as createFlash } from '~/flash'; import { s__, sprintf } from '~/locale'; +import { getFilename } from '~/lib/utils/file_upload'; import UploadButton from '../components/upload/button.vue'; import DeleteButton from '../components/delete_button.vue'; import Design from '../components/list/item.vue'; @@ -31,7 +32,7 @@ import { isValidDesignFile, moveDesignOptimisticResponse, } from '../utils/design_management_utils'; -import { getFilename } from '~/lib/utils/file_upload'; +import { trackDesignCreate, trackDesignUpdate } from '../utils/tracking'; import { DESIGNS_ROUTE_NAME } from '../router/constants'; const MAXIMUM_FILE_UPLOAD_LIMIT = 10; @@ -186,6 +187,7 @@ export default { updateStoreAfterUploadDesign(store, designManagementUpload, this.projectQueryBody); }, onUploadDesignDone(res) { + // display any warnings, if necessary const skippedFiles = res?.data?.designManagementUpload?.skippedDesigns || []; const skippedWarningMessage = designUploadSkippedWarning(this.filesToBeSaved, skippedFiles); if (skippedWarningMessage) { @@ -196,7 +198,19 @@ export default { if (!this.isLatestVersion) { this.$router.push({ name: DESIGNS_ROUTE_NAME }); } + + // reset state this.resetFilesToBeSaved(); + this.trackUploadDesign(res); + }, + trackUploadDesign(res) { + (res?.data?.designManagementUpload?.designs || []).forEach(design => { + if (design.event === 'CREATION') { + trackDesignCreate(); + } else if (design.event === 'MODIFICATION') { + trackDesignUpdate(); + } + }); }, onUploadDesignError() { this.resetFilesToBeSaved(); |