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(database): table view progress filtering #5454

Merged
merged 8 commits into from
Nov 28, 2023

Conversation

sseooh
Copy link
Contributor

@sseooh sseooh commented Nov 26, 2023

The reason why filtering for the progress value did not work properly seems to be because the initialization did not proceed properly when a new column (type=progress) was added to the table view. Therefore, the code was modified to proceed with initialization in the function that sets the property type in the file 'database-block-datasource.ts'.

The video below shows filtering operating normally after modifying the code.

blocksuite.pr.mov

close #5451

Copy link

vercel bot commented Nov 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 28, 2023 0:33am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
blocksuite-docs ⬜️ Ignored (Inspect) Visit Preview Nov 28, 2023 0:33am

Copy link
Member

@doodlewind doodlewind left a comment

Choose a reason for hiding this comment

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

Great to see your contribution, could you sign our CLA for the following review process? Thanks!

@sseooh sseooh changed the title fix: Table View Progress Filtering fix: table view progress filtering Nov 26, 2023
@zzj3720
Copy link
Member

zzj3720 commented Nov 27, 2023

Considering the amount of data, doing this to add a column to a large table may require initializing a very large number of cells, and it's best to deal with this situation in the filter logic like this

  greatThan: {
    type: tFunction({
      args: [tNumber.create(), tNumber.create()],
      rt: tBoolean.create(),
    }),
    label: '>',
    impl: (value, target) => {
      value = value ?? 0;
      if (typeof value !== 'number' || typeof target !== 'number') {
        return true;
      }
      return value > target;
    },
  },

@sseooh
Copy link
Contributor Author

sseooh commented Nov 28, 2023

Thank you for reviewing my code. I will fix it quickly!

@doodlewind doodlewind changed the title fix: table view progress filtering fix(database): table view progress filtering Nov 28, 2023
@doodlewind doodlewind enabled auto-merge (squash) November 28, 2023 12:32
@doodlewind doodlewind merged commit 58ba269 into toeverything:master Nov 28, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Progress Filtering Issue
3 participants