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

Use title in place of examples #271

Merged
merged 6 commits into from
Jan 7, 2025
Merged

Use title in place of examples #271

merged 6 commits into from
Jan 7, 2025

Conversation

waxlamp
Copy link
Member

@waxlamp waxlamp commented Dec 10, 2024

Closes #270; addresses dandi/dandi-archive#2090 indirectly.

The title property is rendered by VJSF as dimmed placeholder text inside the field itself, which is a subtle but clear hint to the user to format the name correctly. This is simpler and less obtrusive than using examples, which causes VJSF to instead render a dropdown menu containing the examples. This prevents editing of an existing name and implies that the example names are the only suggested names in the system.

The `title` property is rendered by VJSF as dimmed placeholder text
inside the field itself, which is a subtle but clear hint to the user to
format the name correctly. This is simpler and less obtrusive than using
`examples`, which causes VJSF to instead render a dropdown menu
containing the examples. This prevents editing of an existing name and
implies that the example names are the only suggested names in the
system.
dandischema/models.py Outdated Show resolved Hide resolved
@satra satra added patch Increment the patch version when merged release Create a release when this pr is merged labels Dec 11, 2024
@kabilar kabilar requested review from yarikoptic and satra December 16, 2024 18:25
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.54%. Comparing base (395bc5b) to head (30586fd).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #271   +/-   ##
=======================================
  Coverage   97.54%   97.54%           
=======================================
  Files          16       16           
  Lines        1753     1753           
=======================================
  Hits         1710     1710           
  Misses         43       43           
Flag Coverage Δ
unittests 97.54% <100.00%> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kabilar kabilar requested a review from candleindark January 6, 2025 18:07
@@ -11,6 +11,7 @@
"0.6.5",
Copy link
Member

Choose a reason for hiding this comment

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

I think DANDI_SCHEMA_VERSION = "0.6.8" in line 1 should change to `DANDI_SCHEMA_VERSION = "0.6.9" as well since we are publishing a new version of the schema.

@candleindark
Copy link
Member

I compared the generated JSON schemas with the 0.6.8 version. All differences are expected. Since both the title and examples attributes in JSON schema are not used for validation. It's unlikely that this change will break anything.

@satra satra merged commit eb76377 into master Jan 7, 2025
64 checks passed
@satra satra deleted the improve-name-field-vjsf branch January 7, 2025 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid using examples in Person model
3 participants