-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(editor): Migrate components to composition API #11497
base: master
Are you sure you want to change the base?
Conversation
function onUpdateClick() { | ||
if (!props.communityPackage) return; | ||
openCommunityPackageUpdateConfirmModal(props.communityPackage.packageName); | ||
} | ||
</script> | ||
|
||
<template> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's replace the $locale in the template for i18n
return parsed; | ||
} | ||
const usersStore = useUsersStore(); | ||
const settingsStore = useSettingsStore(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Let's keep the order we have in the document
}); | ||
const enabledButton = computed((): boolean => { | ||
return emailsCount.value >= 1; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: let's add spaces
return settingsStore.isEnterpriseFeatureEnabled[EnterpriseEditionFeature.AdvancedPermissions]; | ||
}); | ||
|
||
function validateEmails(value: string | number | boolean | null | undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpit: We have a mix of arrow functions assigned to a variable and normal functions. Can we stick to one? ideally the former
} | ||
} | ||
return parsed; | ||
} | ||
</script> | ||
|
||
<template> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace $locale from template with i18n
const { isPublicApiEnabled, isSwaggerUIEnabled, publicApiPath, publicApiLatestVersion } = | ||
settingsStore; | ||
const isTrialing = computed((): boolean => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: const isTrialing = computed(() => cloudPlanStore.userIsTrialing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with isLoadingCloudPlans
const isTrialing = computed((): boolean => { | ||
return cloudPlanStore.userIsTrialing; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: spaces between functions and maybe arrow functions instead. Also, keep order suggested in the document
@@ -185,14 +171,14 @@ export default defineComponent({ | |||
<div :class="$style.hint"> | |||
<n8n-text size="small"> | |||
{{ | |||
$locale.baseText(`settings.api.view.${swaggerUIEnabled ? 'tryapi' : 'more-details'}`) | |||
$locale.baseText(`settings.api.view.${isSwaggerUIEnabled ? 'tryapi' : 'more-details'}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove $locale and use i18n instead
}, | ||
}); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove $locale from template and use i18n
await this.getDestinationDataFromBackend(); | ||
const eventBus = createEventBus(); | ||
const disableLicense = ref(false); | ||
const allDestinations = ref<MessageEventBusDestinationOptions[]>([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: keep the order suggested in the document
Summary
Migrate the following components to composition API:
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)