-
Notifications
You must be signed in to change notification settings - Fork 2
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
Premade list of intervals for durations
#1473
Premade list of intervals for durations
#1473
Conversation
These were the connectors I found
A lot of them did not have type='duration' so the ones I tested are: running: select c.image_name
FROM connectors c JOIN connector_tags ct ON c.id = ct.connector_id
where ct.endpoint_spec_schema::text like '%duration%' |
…dd-premade-list-of-time-formats
…dd-premade-list-of-time-formats
Removing blur on select as that is kind of aggressive ux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something I noticed - so just calling out so it is not forgotten
const inputRef = useRef<any | null>(null); | ||
const position = useRef({ | ||
beforeStart: 0, | ||
beforeEnd: 0, | ||
}); | ||
useLayoutEffect(() => { | ||
// Make sure the cursor stays where we want it | ||
inputRef.current | ||
?.querySelector?.('input') | ||
.setSelectionRange?.( | ||
position.current.beforeStart, | ||
position.current.beforeEnd | ||
); | ||
}, [inputValue]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are uppercasing what is typed in we need to handle the cursor moving to the end of the string while typing lower case letters.
@@ -651,6 +654,8 @@ const generateUISchema = ( | |||
addOption(controlObject, Options.format, Formats.date); | |||
} else if (schemaHasFormat('time', jsonSchema)) { | |||
addOption(controlObject, Options.format, Formats.time); | |||
} else if (schemaHasFormat('duration', jsonSchema)) { | |||
jsonSchema.pattern ??= ISO_8601_DURATION_PATTERN; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to toss on the pattern to get validation working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has a fair amount of weirdness - but I won't call it out with GitHub comments as I worked as much detail into the code comments as I could.
durations
Issues
#1467
Changes
1467
type
ofduration
Tests
Manually tested
Automated tests
Playwright tests ran locally
Screenshots
Fills in default initially and after clicking clear button
Default value of something like
PT5M
will match the option correctlyCan enter a full 8601 duration