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
Resolver Detail Hooks #90
Resolver Detail Hooks #90
Conversation
f39e744
to
30ea471
Compare
👀 |
onPreHookChange(preHook) { | ||
const preHookValidation = Validate([ | ||
Validators.String.minLength(1), preHook, | ||
Validators.String.maxLength(255), preHook, |
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.
Could be too small for a URL. The limit seems to be closer to 2000 chars: https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers
This is more related to #80, but should we warn user about unsaved changes in Resolvers tab also when the page is being reloaded? |
ui/helper/Validators.js
Outdated
URL: { | ||
valid: u => { | ||
try { | ||
return !!new URL(u); |
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.
Is it correct ! !
?
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.
That's correct, it's a quick way to parse any value into a boolean
.
464ee43
to
933e76b
Compare
return; | ||
} | ||
|
||
fetch(url) |
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 needs to be done in the backend. Otherwise you only test whether the user's browser can callthat URL, not if the sync backend (probably hosted on some Openshift cluster) can reach it.
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.
Fetch also doesn't seem to allow cross origin requests by default which also breaks this.
) { | ||
upsertResolver( | ||
id: $id, | ||
schemaId: $schemaId, | ||
dataSourceId: $dataSourceId, | ||
type: $type, | ||
field: $field, | ||
preHook: $preHook, |
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.
You need to add preHook
and postHook
to the result of the mutation too. Otherwise they will be emptied after save.
add missing properties
…nc-ui into AEROGEAR-7724-hooks
NOTE: built on top of #80, do not merge until #80 it is merged.This PR adds:
TODO: