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

Validator and metrics for non-standard date-time display formats #5841

Merged
merged 15 commits into from
Sep 27, 2024

Conversation

labkey-adam
Copy link
Contributor

@labkey-adam labkey-adam commented Sep 8, 2024

Rationale

First part of Date/Time formatting simplifications story: https://docs.google.com/document/d/1XcatQe9wRDw1ONLML9x4fFv_fIq9zhXPHoYANBuOykw/edit

Adds a validation provider for non-standard date display formats and a metrics provider that collects & reports all non-standard patterns.

Changes

  • Define server-side lists of standard date and time format patterns. Add isStandard*DisplayFormat() methods. Push standard display formats into client-side LABKEY object.
  • Rework site validation to register provider factories instead of providers. Creating a new provider on every run allows it to query and compute warnings before container iteration, which allows for a more efficient validation process in some cases.
  • Add root container when validating "all projects & folders"
  • Fix ModuleReportResource date parsing... don't use display formats to parse!
  • Add validation for root/folder/project default date/time display formats
  • Add validation for custom query and table override metadata (QueryDef XML)
  • Add validation for provisioned table columns
  • Add metrics provider implemented using the same code paths

@labkey-matthewb
Copy link
Contributor

labkey-matthewb commented Sep 18, 2024

Suggestion for the formatting of the messages. The "more" link is useful for context, but maybe display the folder path consistently in the message? Also, maybe some formatting for the actual format string to make it stand out. e.g.

Instead of
Project default display format for DateTimes: hh 'o''clock' a, zzzz More info
Date property "lists.asdf.F": hh 'o''clock' a, zzzz More info

Maybe
Default display format for DateTimes in Project /home : hh 'o''clock' a, zzzz More info
Date format for column "lists.asdf.F" in Folder /home/mystudy : hh 'o''clock' a, zzzz More info

I see that they are actually grouped by folder. So that's nice.

@labkey-matthewb
Copy link
Contributor

Adding a non-standard format using edit metadata in the schema browser did not show up in the site validation report.

E.g. setting the format for list.xyz.created to yyMMddHHmmssZ

@labkey-adam
Copy link
Contributor Author

Suggestion for the formatting of the messages. The "more" link is useful for context, but maybe display the folder path consistently in the message? Also, maybe some formatting for the actual format string to make it stand out. e.g.

Instead of Project default display format for DateTimes: hh 'o''clock' a, zzzz More info Date property "lists.asdf.F": hh 'o''clock' a, zzzz More info

Maybe Default display format for DateTimes in Project /home : hh 'o''clock' a, zzzz More info Date format for column "lists.asdf.F" in Folder /home/mystudy : hh 'o''clock' a, zzzz More info

I see that they are actually grouped by folder. So that's nice.

Yes, they are grouped by folder and project + folder name is listed immediately above each group, so seems redundant to include in every message as well.

Site validation messages have never supported HTML... but now they do. See latest commit. Format patterns are now rendered in italics.

@labkey-adam
Copy link
Contributor Author

Adding a non-standard format using edit metadata in the schema browser did not show up in the site validation report.

E.g. setting the format for list.xyz.created to yyMMddHHmmssZ

I'll take a look at this...

@labkey-adam
Copy link
Contributor Author

Adding a non-standard format using edit metadata in the schema browser did not show up in the site validation report.
E.g. setting the format for list.xyz.created to yyMMddHHmmssZ

I'll take a look at this...

This should be fixed... please try again

@labkey-adam labkey-adam merged commit ec96fec into develop Sep 27, 2024
5 checks passed
@labkey-adam labkey-adam deleted the fb_df_validator branch September 27, 2024 17:18
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.

3 participants