-
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
Initial wiring up for capture interval #1230
Conversation
Breaking up the cols to make manipulation a bit easier
Making the function a bit safer
} | ||
RediscoverButton={ | ||
<RediscoverButton | ||
<WorkflowHydrator> |
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 is the actual change... grouped all hydrators into a shared spot
const canBeEmpty = useMemo( | ||
() => configCanBeEmpty(connectorTag?.endpoint_spec_schema), | ||
[connectorTag?.endpoint_spec_schema] | ||
); |
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 using this function in the store want to make sure they use the same logic.
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.
The new guard to ensure we have a connector selected on .../create/new
.
@@ -193,5 +193,5 @@ export const getDereffedSchema = async (val: any) => { | |||
}; | |||
|
|||
export const configCanBeEmpty = (schema: any) => { | |||
return Boolean(!schema.properties || isEmpty(schema.properties)); | |||
return Boolean(!schema?.properties || isEmpty(schema?.properties)); |
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.
wanted to make this code just a bit more safe.
Fixing issues with broken reg ex Checking catalog name is valid while loading details
// TODO (Validators) we need to build out validators for specific types of data | ||
details.data.connectorImage.connectorId && | ||
details.data.connectorImage.connectorId.length === 23 && | ||
MAC_ADDR_RE.test(details.data.connectorImage.connectorId) && |
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 now have a regex for this so using that
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.
Validator for details page to ensure the catalog name in the URL is valid.
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.
Added the new guard to the two ...CreateNew
files
useMount(() => { | ||
logRocketEvent(CustomEvents.ENTITY_NOT_FOUND, { | ||
catalogName, | ||
}); | ||
}); |
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.
Added the event as we are now validating catalog names on details and want to be safe... but also makes sense to track if this component is shown.
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.
Starting to move some validation stuff over to validation
so that can all be in one spot.
src/validation/index.ts
Outdated
// Based on the patterns connectors use for date time | ||
// eslint-disable-next-line no-useless-escape | ||
export const DATE_TIME_PATTERN = `[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z`; | ||
export const DATE_TIME_RE = new RegExp(`^(${DATE_TIME_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.
This was copied from old location. But ended up being invalid because it had an opening (
but not a closing one. So added the new closing one.
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.
Approved without manual testing.
'workflows.interval.header': `Polling Interval`, | ||
'workflows.interval.message': `Allows controlling how often the Capture will check for new data. Intervals are relative to the start of an invocation and not its completion. For example, if the interval is five minutes, and an invocation of the capture finishes after two minutes, then the next invocation will be started after three additional minutes.`, | ||
'workflows.interval.input.label': `Interval`, | ||
'workflows.interval.input.seconds': `seconds`, |
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 use time-based units often. Would it make sense to move these to CommonMessages
?
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.
Yeah I wasn't sure... I was feeling like maybe we make a Units
grouping makes the most sense cause it feels like Common
is starting to get too full.
Issues
Starting #1194
Changes
1194
default_capture_interval
stubbed in (but commented out)Misc
validation
related stuff cause that is hard to find sometimesEntity not found
pageTests
Manually tested
Automated tests
Playwright tests ran locally
Screenshots
If applicable - please include some screenshots of the new UI