diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-27 18:09:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-27 18:09:33 +0300 |
commit | ab421e159d39cf91a95f4a911821308d258e77d9 (patch) | |
tree | 5302fe495229b90d39e9ea5710fe5b91ee4e5a0b /app/assets/javascripts/vue_shared/components/user_callout_dismisser.vue | |
parent | bbd945a9eaeaf8ff084fcd5f697902fe9f67ccdb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/user_callout_dismisser.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/user_callout_dismisser.vue | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_shared/components/user_callout_dismisser.vue b/app/assets/javascripts/vue_shared/components/user_callout_dismisser.vue index 121c3bd94ef..ab5ddbc8af8 100644 --- a/app/assets/javascripts/vue_shared/components/user_callout_dismisser.vue +++ b/app/assets/javascripts/vue_shared/components/user_callout_dismisser.vue @@ -56,7 +56,13 @@ import getUserCalloutsQuery from '~/graphql_shared/queries/get_user_callouts.que * - shouldShowCallout: boolean * - A combination of the above which should cover 95% of use cases: `true` * if the query has loaded without error, and the user is logged in, and - * the callout has not been dismissed yet; `false` otherwise. + * the callout has not been dismissed yet; `false` otherwise + * + * The component emits a `queryResult` event when the GraphQL query + * completes. The payload is a combination of the ApolloQueryResult object and + * this component's `slotProps` computed property. This is useful for things + * like cleaning up/unmounting the component if the callout shouldn't be + * displayed. */ export default { name: 'UserCalloutDismisser', @@ -86,6 +92,9 @@ export default { update(data) { return data?.currentUser; }, + result(data) { + this.$emit('queryResult', { ...data, ...this.slotProps }); + }, error(err) { this.queryError = err; }, |