aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/components/PullRequestMergeForm.vue
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2022-12-23 17:03:11 +0100
committerGitHub <noreply@github.com>2022-12-24 00:03:11 +0800
commit2cf0cf0de1fc298f1b44a0452c8dbb2c2f9dd71c (patch)
tree17afa61c3128109ce8b28505a19f302018de26f9 /web_src/js/components/PullRequestMergeForm.vue
parent71ca3067bcc6c7c7772d38fc7590505c8c7148ed (diff)
downloadgitea-2cf0cf0de1fc298f1b44a0452c8dbb2c2f9dd71c.tar.gz
gitea-2cf0cf0de1fc298f1b44a0452c8dbb2c2f9dd71c.zip
JS refactors (#22227)
- Replace all default exports with named exports, except for Vue SFCs - Remove names from Vue SFCs, they are automatically inferred from the filename - Misc whitespace-related tweaks
Diffstat (limited to 'web_src/js/components/PullRequestMergeForm.vue')
-rw-r--r--web_src/js/components/PullRequestMergeForm.vue12
1 files changed, 1 insertions, 11 deletions
diff --git a/web_src/js/components/PullRequestMergeForm.vue b/web_src/js/components/PullRequestMergeForm.vue
index 1fec12dd5a..1e0ebc5a47 100644
--- a/web_src/js/components/PullRequestMergeForm.vue
+++ b/web_src/js/components/PullRequestMergeForm.vue
@@ -111,11 +111,7 @@ import {SvgIcon} from '../svg.js';
const {csrfToken, pageData} = window.config;
export default {
- name: 'PullRequestMergeForm',
- components: {
- SvgIcon,
- },
-
+ components: {SvgIcon},
data: () => ({
csrfToken,
mergeForm: pageData.pullRequestMergeForm,
@@ -137,20 +133,17 @@ export default {
showMergeStyleMenu: false,
showActionForm: false,
}),
-
computed: {
mergeButtonStyleClass() {
if (this.mergeForm.allOverridableChecksOk) return 'green';
return this.autoMergeWhenSucceed ? 'blue' : 'red';
}
},
-
watch: {
mergeStyle(val) {
this.mergeStyleDetail = this.mergeForm.mergeStyles.find((e) => e.name === val);
}
},
-
created() {
this.mergeStyleAllowedCount = this.mergeForm.mergeStyles.reduce((v, msd) => v + (msd.allowed ? 1 : 0), 0);
@@ -158,15 +151,12 @@ export default {
if (!mergeStyle) mergeStyle = this.mergeForm.mergeStyles.find((e) => e.allowed)?.name;
this.switchMergeStyle(mergeStyle, !this.mergeForm.canMergeNow);
},
-
mounted() {
document.addEventListener('mouseup', this.hideMergeStyleMenu);
},
-
unmounted() {
document.removeEventListener('mouseup', this.hideMergeStyleMenu);
},
-
methods: {
hideMergeStyleMenu() {
this.showMergeStyleMenu = false;