diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-25 00:09:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-25 00:09:08 +0300 |
commit | e09f6bdfd191f0cf8e54f0bc272e4e0635990ed9 (patch) | |
tree | 0791fa74b2321e5f815458e35615cfbfacbe231b /app/assets/javascripts/vue_merge_request_widget | |
parent | 8015f09545c35b833f4955fc2e0b8f1a3214cbcb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget')
4 files changed, 21 insertions, 13 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue b/app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue index 0efc157bcdf..a6b37d93979 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/extensions/base.vue @@ -155,7 +155,7 @@ export default { requests.forEach((request) => { const poll = new Poll({ resource: { - fetchData: () => request(this.$props), + fetchData: () => request(this), }, method: 'fetchData', successCallback: (response) => { @@ -180,7 +180,7 @@ export default { initExtensionPolling() { const poll = new Poll({ resource: { - fetchData: () => this.fetchCollapsedData(this.$props), + fetchData: () => this.fetchCollapsedData(this), }, method: 'fetchData', successCallback: ({ data }) => { @@ -208,7 +208,7 @@ export default { this.initExtensionPolling(); } } else { - this.fetchCollapsedData(this.$props) + this.fetchCollapsedData(this) .then((data) => { this.setCollapsedData(data); }) @@ -231,7 +231,7 @@ export default { this.loadingState = LOADING_STATES.expandedLoading; - this.fetchFullData(this.$props) + this.fetchFullData(this) .then((data) => { this.loadingState = null; this.fullData = data.map((x, i) => ({ id: i, ...x })); diff --git a/app/assets/javascripts/vue_merge_request_widget/components/extensions/container.js b/app/assets/javascripts/vue_merge_request_widget/components/extensions/container.js index b9dfd3bd41e..c38e1054090 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/extensions/container.js +++ b/app/assets/javascripts/vue_merge_request_widget/components/extensions/container.js @@ -34,13 +34,7 @@ export default { { ...extension }, { props: { - ...extension.props.reduce( - (acc, key) => ({ - ...acc, - [key]: this.mr[key], - }), - {}, - ), + mr: this.mr, }, }, ), diff --git a/app/assets/javascripts/vue_merge_request_widget/components/extensions/index.js b/app/assets/javascripts/vue_merge_request_widget/components/extensions/index.js index 65273678fb9..f22c6c756cd 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/extensions/index.js +++ b/app/assets/javascripts/vue_merge_request_widget/components/extensions/index.js @@ -10,12 +10,26 @@ export const registerExtension = (extension) => { registeredExtensions.extensions.push({ extends: ExtensionBase, name: extension.name, - props: extension.props, + props: { + mr: { + type: Object, + required: true, + }, + }, i18n: extension.i18n, expandEvent: extension.expandEvent, enablePolling: extension.enablePolling, modalComponent: extension.modalComponent, computed: { + ...extension.props.reduce( + (acc, propKey) => ({ + ...acc, + [propKey]() { + return this.mr[propKey]; + }, + }), + {}, + ), ...Object.keys(extension.computed).reduce( (acc, computedKey) => ({ ...acc, diff --git a/app/assets/javascripts/vue_merge_request_widget/components/extensions/status_icon.vue b/app/assets/javascripts/vue_merge_request_widget/components/extensions/status_icon.vue index 456a1f17aae..bb626c9adba 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/extensions/status_icon.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/extensions/status_icon.vue @@ -49,7 +49,7 @@ export default { ]" class="gl-rounded-full gl-mr-3 gl-relative gl-p-2" > - <gl-loading-icon v-if="isLoading" size="lg" inline class="gl-display-block" /> + <gl-loading-icon v-if="isLoading" size="sm" inline class="gl-display-block" /> <gl-icon v-else :name="$options.EXTENSION_ICON_NAMES[iconName]" |