diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-14 12:09:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-14 12:09:02 +0300 |
commit | 6d8f30ab0ae82678f10450d2158f24772f0c765c (patch) | |
tree | f308a3feb16199440421980e68501d5efa0a9b10 /app/assets/javascripts/repository | |
parent | c192f26df39e9a2ab122c2d097b86e461599bde8 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
-rw-r--r-- | app/assets/javascripts/repository/components/fork_info.vue | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/app/assets/javascripts/repository/components/fork_info.vue b/app/assets/javascripts/repository/components/fork_info.vue index 07a29bd3b96..99cbe555a2d 100644 --- a/app/assets/javascripts/repository/components/fork_info.vue +++ b/app/assets/javascripts/repository/components/fork_info.vue @@ -1,7 +1,7 @@ <script> import { GlIcon, GlLink, GlSkeletonLoader, GlLoadingIcon, GlSprintf, GlButton } from '@gitlab/ui'; import { s__, sprintf, n__ } from '~/locale'; -import { createAlert } from '~/alert'; +import { createAlert, VARIANT_INFO } from '~/alert'; import syncForkMutation from '~/repository/mutations/sync_fork.mutation.graphql'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import eventHub from '../event_hub'; @@ -26,6 +26,9 @@ export const i18n = { error: s__('ForksDivergence|Failed to fetch fork details. Try again later.'), updateFork: s__('ForksDivergence|Update fork'), createMergeRequest: s__('ForksDivergence|Create merge request'), + successMessage: s__( + 'ForksDivergence|Successfully fetched and merged from the upstream repository.', + ), }; export default { @@ -62,6 +65,10 @@ export default { this.increasePollInterval(); } if (this.isForkUpdated) { + createAlert({ + message: this.$options.i18n.successMessage, + variant: VARIANT_INFO, + }); eventHub.$emit(FORK_UPDATED_EVENT); } }, @@ -124,7 +131,6 @@ export default { return { project: {}, currentPollInterval: null, - isSyncTriggered: false, }; }, computed: { @@ -150,7 +156,7 @@ export default { return this.forkDetails?.isSyncing; }, isForkUpdated() { - return !this.hasConflicts && !this.isSyncing && this.currentPollInterval; + return this.isUpToDate && this.currentPollInterval; }, ahead() { return this.project?.forkDetails?.ahead; @@ -216,9 +222,8 @@ export default { }, watch: { hasConflicts(newVal) { - if (newVal && this.isSyncTriggered) { + if (newVal && this.currentPollInterval) { this.showConflictsModal(); - this.isSyncTriggered = false; } }, }, @@ -257,7 +262,6 @@ export default { this.$refs.modal.show(); }, startSyncing() { - this.isSyncTriggered = true; this.syncForkWithPolling(); }, checkIfSyncIsPossible() { |