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

Development 1.1 update homepage calendar filters #384

Merged
merged 8 commits into from
Mar 27, 2024

Conversation

Mahmoud-Emad
Copy link
Collaborator

@Mahmoud-Emad Mahmoud-Emad commented Mar 26, 2024

Description

The issue occurred due to the duplication of events in our system. Presently, we maintain five separate tables: User, Event, Meeting, Public Holiday, and Vacation. Each table has a sequence ID, meaning the first ID assigned to an object in the User table will be 1, and likewise for the Event table and others. Consequently, when sending all objects to the calendar, if there are duplicated IDs across different tables, the first object will be overwritten by the last object with the same ID.

Changes

  1. Enhanced the filter function to selectively filter only the requested events based on user preferences.
  2. Updated the ID field of each event by appending the event type to ensure uniqueness across different event types. For instance, instead of simply 1, the ID becomes event1, meeting1, holiday1, and so forth. This modification prevents ID clashes and ensures each event is uniquely identified.

Related issues

for (const event of data) {
updateEventCalendarType(event)
}
filteredEvents.value = [...homeEvents.value]
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a reason why we are re-setting the filteredEvents to homeEvents afte setting it in the updateEventCalendarType function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After transforming the homeEvents to match the format expected by the Full Calendar, we subsequently load events from the filteredEvents. Therefore, following any modifications to homeEvents, where they are aligned to the Full Calendar event format, it's essential to update the filteredEvents array. This ensures that any changes are accurately reflected in the calendar events displayed.

undefined,

)
const requesting = ref<boolean>(false)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest using the isLoading variable returned from useAsyncState instead on requesting. Here's an example

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, you are right 👍🏻

@@ -6,6 +6,7 @@ const router = createRouter({
routes: [
{ path: '/login', component: () => import('@/views/LoginView.vue') },
{ path: '/', component: () => import('@/views/CalendarView.vue') },
{ path: '/test', component: () => import('@/views/TestView.vue') },
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this needed for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It can be removed, i added it to be used for testing as a testing component, you can hide it if you purpose

@@ -40,7 +40,7 @@ export module Api {
actual_days: number
applying_user: number | any
approval_user: number
user?: Api.User
applying_user_full_name?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why didn't we add a type variable in vacation like meeting and event interfaces?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if its not there please add it

@maayarosama maayarosama merged commit 04dfaa0 into development_1.1 Mar 27, 2024
2 checks passed
@maayarosama maayarosama deleted the development_1.1_update_homepage_calendar branch March 27, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants