-
Notifications
You must be signed in to change notification settings - Fork 0
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
Task-Upgrade composition api #9
base: upgrade-vue3
Are you sure you want to change the base?
Conversation
- A composable for validation was created to replace the existing validateForm mixin.
- A composable for uploading an image was created to replace the existing uploadImage mixin.
…ructure - A composable for nullify jsons was created to replace the existing json mixin.
- Adds mitt emitter to global providers
- useSelfPermissions - useAllPermissions
@@ -157,12 +157,14 @@ export const updatePersonalDataMethod = new ValidatedMethod({ | |||
validate({ user }: { user: Meteor.User }) { | |||
try { | |||
check(user, { | |||
_id: String, |
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.
this is not necessary since we can take the user id from the current connection
username: String, | ||
emails: [{ address: String, verified: Boolean }], | ||
profile: { | ||
profile: String, | ||
name: String, | ||
path: Match.Maybe(String) | ||
path: Match.Maybe(String), | ||
updated_at: String |
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.
can we use camel case, please?
onMounted(() => { | ||
provide(Injections.AlertMessage, alertMessage.value); | ||
provide(Injections.Loader, loader.value); | ||
const emitter = mitt(); | ||
provide(Injections.Emitter, emitter); | ||
}) |
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.
what is this for?
if it is to use those components in the global scope, I had implemented in their mounted hooks the code to make them globals. Besides, I added mitt in the imports/startup/client/index.ts
file to configure the event emitter as global.
const alert = inject<AlertMessageType>(Injections.AlertMessage); | ||
const loader = inject<LoaderType>(Injections.Loader); |
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.
check if we can access with global props as shown:
this.$alert
this.$loader
const dataFormObserver = ref<FormContext | null>(null); | ||
const alert = inject<AlertMessageType>(Injections.AlertMessage); | ||
const loader = inject<LoaderType>(Injections.Loader); | ||
const emitter = inject<Emitter<Record<EventType, unknown>>>(Injections.Emitter); |
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.
check if we can use this.emitter
instead
export interface LoaderType { | ||
activate(progressLabel: string): void; | ||
deactivate(): void; | ||
} | ||
|
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
@@ -2,7 +2,7 @@ | |||
<v-footer padless> | |||
<div class="d-flex flex-column align-center justify-center"> | |||
<p class="text-white text-caption"> | |||
©{{ currentLocalDate().getFullYear() }} By Diavrank. | |||
©{{ currentLocalDate().getFullYear() }} By Ovsdrak. |
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.
©{{ currentLocalDate().getFullYear() }} By Ovsdrak. | |
©{{ currentLocalDate().getFullYear() }} By Antware. |
const alert = inject<AlertMessageType>(Injections.AlertMessage); | ||
const loader = inject<LoaderType>(Injections.Loader); |
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.
see if we can use global variables
<Form as="v-form" v-slot="{handleSubmit}" ref="setPasswordFormObserver"> | ||
<v-form @submit="handleSubmit($event, resetPassword)" autocomplete="off"> |
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.
why was this changed? regarding to the v-form
component. It's supposed to have v-form as an alias in the Form component, that is treated as v-form component.
<v-text-field v-model="user.password" id="inputNewPassword" | ||
<Form as="v-form" v-slot="{handleSubmit}" ref="setPasswordFormObserver"> | ||
<v-form @submit="handleSubmit($event, resetPassword)" autocomplete="off"> | ||
<Field v-slot="{field, errors}" name="password" rules="strength_password|required"> |
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.
verify the functionality for this since I remembered I had problems with the initial values for this form when I added the field slot.
Fixes: #number
Description
Refactors all the components from Options API to Composition API
Screenshots (if appropriate):
Types of changes
Checklist:
const
instead oflet
andvar
.