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

Display options groundwork & config for boolean, number #1239

Merged
merged 23 commits into from
Mar 30, 2022

Conversation

pavish
Copy link
Member

@pavish pavish commented Mar 26, 2022

Related to: #257, #258

This PR:

  • implements groundwork for display options configuration
  • detaches form validation from component layer dependency
  • implements display options for Boolean Mathesar type
  • implements display options for Number Mathesar type
  • reorganizes type configuration components

Screenshots:

Boolean display options

Screenshot 2022-03-27 at 1 11 24 AM

Number display options

Screenshot 2022-03-27 at 1 11 46 AM

* The formats listed here are as per conversations over the past week in the Matrix channels.

Validation

  • Encountered an UX issue:
    • The user enters an invalid value in one of the tabs, say in Display options tab.
    • The error message appears only below the input. We disable the Save button.
    • User switches the tab to Database options.
    • The Save button will still be disabled, but the user may not know where the error lies, since the error message lies within the Display options tab.
  • This PR improvises a design to handle that:
  • User enters invalid value in Display options tab:
    • Screenshot 2022-03-27 at 1 12 01 AM
    • Error indication is displayed in the input and also the tab header.
  • User switches tab:
    • Screenshot 2022-03-27 at 1 12 12 AM
    • Tab header indicates some error is present in Display options

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the master branch of the repository
  • My commit messages follow best practices.
  • x ] My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@pavish pavish requested review from a team and seancolsen March 26, 2022 19:51
@codecov-commenter
Copy link

codecov-commenter commented Mar 26, 2022

Codecov Report

Merging #1239 (52385b3) into master (61a24cc) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1239   +/-   ##
=======================================
  Coverage   93.41%   93.41%           
=======================================
  Files         113      113           
  Lines        4328     4328           
=======================================
  Hits         4043     4043           
  Misses        285      285           
Flag Coverage Δ
pytest-backend 93.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61a24cc...52385b3. Read the comment docs.

@pavish pavish added the pr-status: review A PR awaiting review label Mar 27, 2022
@pavish pavish changed the base branch from master to select_component_refactor March 27, 2022 09:44
@pavish
Copy link
Member Author

pavish commented Mar 27, 2022

I'm stacking this over #1240, to avoid merge conflicts.

Base automatically changed from select_component_refactor to master March 27, 2022 17:49
@seancolsen
Copy link
Contributor

I'll review this, but I want to wait until we resolve #1243 first

@pavish
Copy link
Member Author

pavish commented Mar 29, 2022

@seancolsen This PR is mostly groundwork on display options. The whole number configuration is one file: mathesar_ui/src/stores/abstract-types/type-configs/number.ts.

I added both boolean and number display options in this PR, so that we can view the usage on the product. Even tests haven't been added yet and will be added as part of each individual data types issue.

If #1243 takes longer, I'd suggest reviewing and merging this one. If we decide on different options for number, we can make that change in the Number type implementation issue.

Copy link
Contributor

@seancolsen seancolsen left a comment

Choose a reason for hiding this comment

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

This looks good. The validation stuff (and behavior with respect to the tabs) is very slick. Nice work!

@seancolsen seancolsen enabled auto-merge March 30, 2022 01:00
@seancolsen seancolsen merged commit 9ba0fbb into master Mar 30, 2022
@seancolsen seancolsen deleted the display_options branch March 30, 2022 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-status: review A PR awaiting review
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

3 participants