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: load fields from composable instead of fields menu #8519

Merged
merged 1 commit into from
May 20, 2024
Merged

Conversation

mertmit
Copy link
Member

@mertmit mertmit commented May 18, 2024

Change Summary

  • We don't render fields menu for xs mobile views

Change type

  • fix: (bug fix for the user, not a fix to a build script)

@mertmit mertmit requested a review from pranavxc May 18, 2024 07:51
Copy link
Contributor

coderabbitai bot commented May 18, 2024

Walkthrough

Walkthrough

The recent updates aim to improve the functionality and performance of the nc-gui package components. Changes include refining field handling, updating field provisioning, and introducing parameters and reactive variables to enhance data management and loading states across various components.

Changes

File Path Change Summary
packages/nc-gui/components/smartsheet/grid/Table.vue Added a setTimeout call to retry grid rendering after a delay.
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue Removed const rootFields = inject(FieldsInj) and sortedAndFilteredFields declarations.
packages/nc-gui/components/tabs/Smartsheet.vue Replaced fields with rootFields in useProvideViewColumns, updated FieldsInj provider.
packages/nc-gui/composables/useViewColumns.ts Added params parameter to reloadData, introduced rootFields variable, added watch on sortedAndFilteredFields to update rootFields.

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: 2

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 86e7f49 and 0c70e57.
Files selected for processing (4)
  • packages/nc-gui/components/smartsheet/grid/Table.vue (1 hunks)
  • packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue (3 hunks)
  • packages/nc-gui/components/tabs/Smartsheet.vue (3 hunks)
  • packages/nc-gui/composables/useViewColumns.ts (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/nc-gui/components/smartsheet/grid/Table.vue
Additional comments not posted (1)
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue (1)

Line range hint 1-1: The removal of rootFields and sortedAndFilteredFields from FieldsMenu.vue aligns with the PR's objective to centralize field management. Ensure that this component now correctly uses the data provided from the composable and that there are no references to the removed variables left in the component.

Verification successful

The FieldsMenu.vue component no longer references rootFields and sortedAndFilteredFields, and it now uses several composables (useGlobal, useNuxtApp, useViewColumnsOrThrow, useSmartsheetStoreOrThrow, useUndoRedo, and useMenuCloseOnEsc). This aligns with the PR's objective to centralize field management and simplify the component.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that `FieldsMenu.vue` does not reference the removed variables and uses the data from the composable correctly.

# Test: Search for the usage of `rootFields` and `sortedAndFilteredFields` in `FieldsMenu.vue`. Expect: No occurrences.
rg --type vue $'rootFields|sortedAndFilteredFields' packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

Length of output: 141



Script:

#!/bin/bash
# Description: Verify that `FieldsMenu.vue` does not reference the removed variables and uses the data from the composable correctly.

# Test: Search for the usage of `rootFields` and `sortedAndFilteredFields` in `FieldsMenu.vue`. Expect: No occurrences.
rg 'rootFields|sortedAndFilteredFields' packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

Length of output: 102



Script:

#!/bin/bash
# Description: Verify that `FieldsMenu.vue` uses the centralized composable for data management.

# Test: Search for the usage of the composable in `FieldsMenu.vue`. Expect: At least one occurrence.
rg 'useComposable' packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

Length of output: 79



Script:

#!/bin/bash
# Description: List all imports in `FieldsMenu.vue` to identify any composables being used.

# Test: List all import statements in `FieldsMenu.vue`.
rg '^import' packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

Length of output: 308



Script:

#!/bin/bash
# Description: Search for any other composables or methods being used within `FieldsMenu.vue`.

# Test: Search for the usage of any composables or methods in `FieldsMenu.vue`.
rg 'use[A-Za-z]+' packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

Length of output: 388

packages/nc-gui/components/tabs/Smartsheet.vue Outdated Show resolved Hide resolved
packages/nc-gui/composables/useViewColumns.ts Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented May 18, 2024

Uffizzi Preview deployment-51957 was deleted.

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 0c70e57 and 8a6c451.
Files selected for processing (4)
  • packages/nc-gui/components/smartsheet/grid/Table.vue (1 hunks)
  • packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue (3 hunks)
  • packages/nc-gui/components/tabs/Smartsheet.vue (2 hunks)
  • packages/nc-gui/composables/useViewColumns.ts (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • packages/nc-gui/components/smartsheet/grid/Table.vue
  • packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
  • packages/nc-gui/components/tabs/Smartsheet.vue
  • packages/nc-gui/composables/useViewColumns.ts

Signed-off-by: mertmit <mertmit99@gmail.com>
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 8a6c451 and 549d38a.
Files selected for processing (9)
  • packages/nc-gui/components/shared-view/Calendar.vue (1 hunks)
  • packages/nc-gui/components/shared-view/Gallery.vue (1 hunks)
  • packages/nc-gui/components/shared-view/Grid.vue (1 hunks)
  • packages/nc-gui/components/shared-view/Kanban.vue (1 hunks)
  • packages/nc-gui/components/shared-view/Map.vue (1 hunks)
  • packages/nc-gui/components/smartsheet/grid/Table.vue (1 hunks)
  • packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue (3 hunks)
  • packages/nc-gui/components/tabs/Smartsheet.vue (3 hunks)
  • packages/nc-gui/composables/useViewColumns.ts (2 hunks)
Files skipped from review due to trivial changes (2)
  • packages/nc-gui/components/shared-view/Calendar.vue
  • packages/nc-gui/components/shared-view/Map.vue
Files skipped from review as they are similar to previous changes (4)
  • packages/nc-gui/components/smartsheet/grid/Table.vue
  • packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
  • packages/nc-gui/components/tabs/Smartsheet.vue
  • packages/nc-gui/composables/useViewColumns.ts
Additional comments not posted (3)
packages/nc-gui/components/shared-view/Gallery.vue (1)

Line range hint 1-1: Ensure that the removal of FieldsInj provider does not break dependent components.

Verification successful

The verification confirms that no components are trying to inject FieldsInj, indicating that the removal of the FieldsInj provider does not break any dependent components.

  • No occurrences of inject(FieldsInj) were found in the codebase.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for any component still trying to inject `FieldsInj`.

# Test: Search for `inject(FieldsInj)` in Vue components. Expect: No occurrences.
rg --type vue $'inject(FieldsInj)'

Length of output: 63



Script:

#!/bin/bash
# Description: Check for any component still trying to inject `FieldsInj`.

# Test: Search for `inject(FieldsInj)` in Vue components. Expect: No occurrences.
rg 'inject(FieldsInj)' --glob '*.vue'

Length of output: 39

packages/nc-gui/components/shared-view/Kanban.vue (1)

Line range hint 1-1: Ensure that the removal of FieldsInj provider does not break dependent components.

Verification successful

The verification confirms that no components are dependent on the FieldsInj injection.

  • No occurrences of inject(FieldsInj) were found in the codebase.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for any component still trying to inject `FieldsInj`.

# Test: Search for `inject(FieldsInj)` in Vue components. Expect: No occurrences.
rg --type vue $'inject(FieldsInj)'

Length of output: 63



Script:

#!/bin/bash
# Description: Check for any component still trying to inject `FieldsInj`.

# Test: Search for `inject(FieldsInj)` in Vue components. Expect: No occurrences.
rg --glob '*.vue' $'inject(FieldsInj)'

Length of output: 39

packages/nc-gui/components/shared-view/Grid.vue (1)

Line range hint 1-1: Ensure that the removal of FieldsInj provider does not break dependent components.

Verification successful

Ensure no components are injecting FieldsInj

The previous script did not produce any output, indicating that no components are injecting FieldsInj. This suggests that the removal of provide(FieldsInj, columns) from Grid.vue should not break any dependent components.

  • No occurrences of inject(FieldsInj) were found in the codebase.
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for any component still trying to inject `FieldsInj`.

# Test: Search for `inject(FieldsInj)` in Vue components. Expect: No occurrences.
rg --type vue $'inject(FieldsInj)'

Length of output: 63



Script:

#!/bin/bash
# Description: Check for any component still trying to inject `FieldsInj`.

# Find all Vue files and search for `inject(FieldsInj)` within them.
fd -e vue -x rg 'inject(FieldsInj)' {}

Length of output: 42

@dstala dstala merged commit 84b8708 into develop May 20, 2024
23 checks passed
@dstala dstala deleted the fix/vscroll branch May 20, 2024 14:40
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.

None yet

3 participants