Skip to content
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

Open
wants to merge 18 commits into
base: upgrade-vue3
Choose a base branch
from

Conversation

Ovsdrak
Copy link
Collaborator

@Ovsdrak Ovsdrak commented Mar 8, 2023

Fixes: #number

Description

Refactors all the components from Options API to Composition API

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
    • Good variable naming.
    • Constants are capitalized and snake cased.
    • Code uses const instead of let and var.
  • My commit history is nice and readable
  • My PR doesn't contain more than 10 or max 15 files changed
  • I've added the number of the issue I'm fixing at the top of my file
  • My code has been reviewed
  • My code passed all the checks on the Pipeline (Action)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@Ovsdrak Ovsdrak added the WIP Work in progress label Mar 8, 2023
@Ovsdrak Ovsdrak requested a review from diavrank March 8, 2023 19:12
@Ovsdrak Ovsdrak self-assigned this Mar 8, 2023
@Ovsdrak Ovsdrak changed the base branch from dev to t_upgrade_pinia March 8, 2023 19:12
Base automatically changed from t_upgrade_pinia to upgrade-vue3 March 8, 2023 19:22
@Ovsdrak Ovsdrak added RFR Ready for Review and removed WIP Work in progress labels Mar 9, 2023
@@ -157,12 +157,14 @@ export const updatePersonalDataMethod = new ValidatedMethod({
validate({ user }: { user: Meteor.User }) {
try {
check(user, {
_id: String,
Copy link
Owner

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
Copy link
Owner

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?

Comment on lines +27 to +32
onMounted(() => {
provide(Injections.AlertMessage, alertMessage.value);
provide(Injections.Loader, loader.value);
const emitter = mitt();
provide(Injections.Emitter, emitter);
})
Copy link
Owner

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.

Comment on lines +90 to +91
const alert = inject<AlertMessageType>(Injections.AlertMessage);
const loader = inject<LoaderType>(Injections.Loader);
Copy link
Owner

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);
Copy link
Owner

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

Comment on lines +19 to +23
export interface LoaderType {
activate(progressLabel: string): void;
deactivate(): void;
}

Copy link
Owner

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.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
©{{ currentLocalDate().getFullYear() }} By Ovsdrak.
©{{ currentLocalDate().getFullYear() }} By Antware.

Comment on lines +52 to +53
const alert = inject<AlertMessageType>(Injections.AlertMessage);
const loader = inject<LoaderType>(Injections.Loader);
Copy link
Owner

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

Comment on lines +4 to +5
<Form as="v-form" v-slot="{handleSubmit}" ref="setPasswordFormObserver">
<v-form @submit="handleSubmit($event, resetPassword)" autocomplete="off">
Copy link
Owner

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">
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants