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

fix(nc-gui): update calendar #8474

Merged
merged 4 commits into from
May 16, 2024
Merged

fix(nc-gui): update calendar #8474

merged 4 commits into from
May 16, 2024

Conversation

DarkPhoenix2704
Copy link
Member

Change Summary

Provide summary of changes with issue number if any.

Change type

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

Test/ Verification

Provide summary of changes.

Additional information / screenshots (optional)

Anything for maintainers to be made aware of

@DarkPhoenix2704 DarkPhoenix2704 self-assigned this May 14, 2024
Copy link
Contributor

coderabbitai bot commented May 14, 2024

Walkthrough

Walkthrough

The recent updates primarily focus on refining the user interface and enhancing the responsiveness of various components within the nc-gui package. Key changes include the removal of certain props for simplification, adjustments to CSS classes for better styling, and improved conditional rendering based on device mode (e.g., mobile vs. desktop). Additionally, the updates introduce more interactive and user-friendly features in calendar-related components, such as better date selection and tooltip positioning.

Changes

File(s) Change Summary
.../DateWeekSelector.vue, .../MonthYearSelector.vue Removed certain props (isDisabled, disablePagination, etc.) and updated CSS classes for styling.
.../Toolbar.vue Adjusted conditional rendering and class bindings based on isMobileMode and isCalendar conditions.
.../calendar/DayView/DateTimeField.vue, .../calendar/MonthView.vue, .../calendar/YearView/Month.vue Updated CSS classes for better styling and transitions.
.../calendar/SideMenu.vue Adjusted tooltip positioning and button visibility logic based on showSideMenu and isMobileMode.
.../calendar/WeekView/DateField.vue, .../calendar/WeekView/DateTimeField.vue Modified div element classes for improved styling and layout.
.../calendar/index.vue Removed conditional rendering based on isMobileMode for LazySmartsheetCalendarSideMenu.
.../toolbar/Calendar/Mode.vue Introduced isTab computed property for conditional styling and layout adjustments.
.../toolbar/Calendar/Range.vue Updated import statements and component usage within the saveCalendarRange function.
.../useCalendarViewStore.ts Added isMobileMode declaration and changed initialization of showSideMenu based on isMobileMode.
tests/playwright/pages/Dashboard/Calendar/CalendarWeekDateTime.ts Changed position object's x and y values from 1 to 0.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 6c4d048 and 2b4efbd.
Files selected for processing (15)
  • packages/nc-gui/components/nc/DateWeekSelector.vue (7 hunks)
  • packages/nc-gui/components/nc/MonthYearSelector.vue (5 hunks)
  • packages/nc-gui/components/smartsheet/Toolbar.vue (2 hunks)
  • packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue (2 hunks)
  • packages/nc-gui/components/smartsheet/calendar/MonthView.vue (2 hunks)
  • packages/nc-gui/components/smartsheet/calendar/SideMenu.vue (1 hunks)
  • packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue (1 hunks)
  • packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue (3 hunks)
  • packages/nc-gui/components/smartsheet/calendar/YearView/Month.vue (1 hunks)
  • packages/nc-gui/components/smartsheet/calendar/YearView/index.vue (4 hunks)
  • packages/nc-gui/components/smartsheet/calendar/index.vue (1 hunks)
  • packages/nc-gui/components/smartsheet/toolbar/Calendar/Mode.vue (3 hunks)
  • packages/nc-gui/components/smartsheet/toolbar/Calendar/Range.vue (2 hunks)
  • packages/nc-gui/composables/useCalendarViewStore.ts (2 hunks)
  • tests/playwright/pages/Dashboard/Calendar/CalendarWeekDateTime.ts (1 hunks)
Files not reviewed due to errors (1)
  • packages/nc-gui/components/nc/DateWeekSelector.vue (no review received)
Additional Context Used
Learnings (4)
packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue (1)
User: DarkPhoenix2704
URL: https://github.com/nocodb/nocodb/pull/8262

Timestamp: 2024-04-13T05:12:01.225Z
Learning: The `min-h-9` class is confirmed as the correct class for the `VRecordCard.vue` component in the `packages/nc-gui/components/smartsheet/calendar/` directory, as per user confirmation.
packages/nc-gui/components/smartsheet/calendar/MonthView.vue (1)
User: DarkPhoenix2704
URL: https://github.com/nocodb/nocodb/pull/8262

Timestamp: 2024-04-13T05:12:01.225Z
Learning: The `min-h-9` class is confirmed as the correct class for the `VRecordCard.vue` component in the `packages/nc-gui/components/smartsheet/calendar/` directory, as per user confirmation.
packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue (1)
User: pranavxc
URL: https://github.com/nocodb/nocodb/pull/7997

Timestamp: 2024-04-02T08:59:00.469Z
Learning: In the `DateTimeField.vue` file for the `DayView` component, each minute of an event's duration is represented as 1 pixel in height, and `perRecordHeight` serves as a minimum height constraint for visibility and user interaction purposes.
packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue (1)
User: DarkPhoenix2704
PR: nocodb/nocodb#8379
File: packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue:811-811
Timestamp: 2024-05-04T07:20:25.878Z
Learning: The event `'c:calendar:day:drag-record'` is related to Posthog analytics and should not be considered for duplicate handling in the application logic.
Additional comments not posted (38)
tests/playwright/pages/Dashboard/Calendar/CalendarWeekDateTime.ts (1)

62-63: Ensure the new position values are correct.

The x and y values have been changed from 1 to 0. Verify that this adjustment correctly clicks within the hour element and doesn't cause any issues with element interaction.

packages/nc-gui/components/smartsheet/calendar/YearView/index.vue (5)

16-16: Verify the initialization and usage of useElementSize.

Ensure that the calendarContainer ref is properly initialized and that useElementSize correctly tracks the element's size.


18-36: Verify the conditions for updating size and cols.

Ensure that the conditions for updating the size and cols reactive variables cover all possible width ranges and correctly adjust the layout.


Line range hint 38-41: Ensure the correctness of the changeView function.

Verify that the changeView function correctly updates the selectedDate and activeCalendarView values when a date is selected.


27-31: Ensure the correctness of the onMounted and watch functions.

Verify that the onMounted lifecycle hook and watch function correctly handle resizing and update the layout accordingly.


53-65: Ensure the correctness of the template changes.

Verify that the template changes correctly reflect the updated layout based on the cols and size reactive variables.

packages/nc-gui/components/smartsheet/toolbar/Calendar/Mode.vue (4)

8-9: Ensure the correctness of the isTab computed property.

Verify that the isTab computed property correctly determines if the toolbar should be displayed as tabs based on the tab prop.


Line range hint 12-17: Ensure the correctness of the setActiveCalendarMode function.

Verify that the setActiveCalendarMode function correctly updates the calendar view and highlight position when a tab is clicked.


Line range hint 19-25: Ensure the correctness of the updateHighlightPosition function.

Verify that the updateHighlightPosition function correctly updates the highlight position based on the active tab.


27-32: Ensure the correctness of the onMounted and watch functions.

Verify that the onMounted lifecycle hook and watch function correctly update the highlight position based on the active calendar view.

packages/nc-gui/components/smartsheet/Toolbar.vue (4)

25-25: Ensure the correctness of the updated conditional rendering.

Verify that the updated conditional rendering correctly handles the new conditions for isCalendar and isMobileMode.


27-29: Ensure the correctness of the updated class bindings.

Verify that the updated class bindings correctly reflect the new conditions for isCalendar and isMobileMode.


82-87: Ensure the correctness of the template changes.

Verify that the template changes correctly reflect the new conditions and elements based on isCalendar and isTab.


89-89: Ensure the correctness of the scoped styles.

Verify that the scoped styles correctly apply to the toolbar elements and do not cause any unintended side effects.

packages/nc-gui/components/nc/MonthYearSelector.vue (4)

5-5: Verify the impact of the prop removals.

Ensure that the removal of the isDisabled and hideHeader props does not affect the component's functionality or cause any issues.


Line range hint 89-139: Ensure the correctness of the template updates.

Verify that the template updates correctly reflect the removal of the isDisabled and hideHeader props and do not cause any issues.


5-5: Ensure the correctness of the script updates.

Verify that the script updates correctly reflect the removal of the isDisabled and hideHeader props and do not cause any issues.


Line range hint 21-33: Ensure the correctness of the computed properties.

Verify that the computed properties for years and months correctly generate the arrays based on the pageDate value.

packages/nc-gui/components/smartsheet/calendar/index.vue (2)

164-164: Verify the impact of the conditional rendering directive removal.

Ensure that the removal of the conditional rendering directive for the side menu component does not affect the component's functionality or cause any issues.


164-164: Ensure the correctness of the template updates.

Verify that the template updates correctly reflect the removal of the conditional rendering directive for the side menu component and do not cause any issues.

packages/nc-gui/components/smartsheet/calendar/YearView/Month.vue (2)

4-10: Ensure the correctness of the new props.

Verify that the new props are correctly defined and used within the component, and that they do not cause any issues.


19-94: Ensure the correctness of the new functions.

Verify that the new functions for managing dates and events are correctly defined and used within the component, and that they do not cause any issues.

packages/nc-gui/components/smartsheet/toolbar/Calendar/Range.vue (2)

2-2: Import statement update looks good.


122-129: Usage of GeneralViewIcon component looks good.

packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue (1)

554-561: Class attribute updates look good.

packages/nc-gui/components/smartsheet/calendar/SideMenu.vue (4)

318-319: Ensure the tooltip positioning logic is correct.

The added condition for showSideMenu && isMobileMode seems logical, but please verify that the tooltip appears correctly in all scenarios.


323-324: Ensure the transition class is applied correctly.

The addition of the transition-all class should be verified to ensure it does not cause any unintended side effects.


327-327: Ensure the dynamic component for the icon is correct.

The use of a dynamic component for the icon (iconMap.sidebar) should be verified to ensure it renders correctly.


333-333: Ensure the side menu visibility logic is correct.

The added condition for props.visible && isMobileMode should be verified to ensure the side menu appears correctly on mobile devices.

packages/nc-gui/components/smartsheet/calendar/MonthView.vue (2)

703-703: Ensure the day cell styling is correct.

The updated class attribute for the day cell should be verified to ensure it applies the correct styles and does not cause any layout issues.


815-815: Ensure the record card styling is correct.

The updated class attribute for the record card should be verified to ensure it applies the correct styles and does not cause any layout issues.

packages/nc-gui/composables/useCalendarViewStore.ts (2)

38-39: Correctly added isMobileMode from useGlobal.


59-59: Correctly initialized showSideMenu based on isMobileMode.value.

packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue (3)

880-880: Ensure the new div element is necessary and correctly styled.

The new div element with class flex sticky h-6 z-1 top-0 pl-16 bg-gray-50 w-full appears to be a header row for the calendar. Verify that this addition is necessary and correctly styled.


887-887: Verify the updated class attribute for consistency.

The updated class attribute includes w-1/7 text-center text-[10px] font-semibold leading-4 flex items-center justify-center uppercase text-gray-500 w-full py-1 border-gray-200 last:border-r-0 border-b-1 border-l-1 border-r-0 bg-gray-50. Ensure these changes are consistent with the overall design and necessary for the component's functionality.


910-910: Verify the updated class attribute for consistency.

The updated class attribute includes text-center relative transition h-13 text-sm text-gray-500 w-full hover:bg-gray-50 py-1 border-transparent border-1 border-x-gray-100 border-t-gray-100 border-l-gray-200. Ensure these changes are consistent with the overall design and necessary for the component's functionality.

packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue (2)

892-892: Ensure the class attribute update is consistent with the project's styling conventions.

Please verify that the class attribute update aligns with the project's styling conventions and does not introduce any visual inconsistencies.


1002-1002: Ensure the class attribute update is consistent with the project's styling conventions.

Please verify that the class attribute update aligns with the project's styling conventions and does not introduce any visual inconsistencies.

Copy link
Contributor

github-actions bot commented May 14, 2024

Uffizzi Preview deployment-51691 was deleted.

@dstala dstala added the 🛑 Status: Do Not Merge Used in PR only. The PR cannot be merged due to some reasons. label May 15, 2024
@dstala dstala merged commit 44aeaab into develop May 16, 2024
32 of 39 checks passed
@dstala dstala deleted the nc-cal-fixes branch May 16, 2024 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛑 Status: Do Not Merge Used in PR only. The PR cannot be merged due to some reasons.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants