-
Notifications
You must be signed in to change notification settings - Fork 356
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
[WIP] Migrate add cloud provider form to data driven forms #5542
Conversation
@miq-bot assign @martinpovolny @martinpovolny can you add it to the React project? |
@Hyperkid123 Cannot apply the following label because they are not recognized: reac |
azure_tenant_id: get(azureValues, 'uid_ems'), | ||
subscription: get(azureValues, 'subscription'), | ||
zone: 'default', | ||
default_url: get(azureValues, 'endpoints[0].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.
why not just azureValues.endpoints[0].url
?
All those get
calls are suprising, given the right side is a constant.
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.
They might not be inside the form state. Not all of the nested fields are required and if you don;t change it it will be undefined
. I agree there is a lot of gets but that whole validation call will change and will be via API. Its just a placeholder for now.
@@ -12,6 +24,9 @@ const fieldsMapper = { | |||
'validate-credentials': AsyncCredentials, | |||
'credentials-password-edit': EditSecretField, | |||
'secret-switch-field': SecretSwitchField, | |||
wizard: MiqWizard, | |||
'provider-initial-step': InitialWizardStep, | |||
summary, |
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.
summary
is not a good generic name for a div with a title and some specific json.
Since this would affect any new form, maybe this should be JsonSummary or something?
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.
ah this is left over it will be deleted. First iteration was in wizard but we scrapped that.
|
||
const summary = ({ formOptions }) => ( | ||
<div> | ||
<h1>Summary</h1> |
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.
i18n
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.
^^
@@ -44,3 +45,4 @@ ManageIQ.component.addReact('CatalogForm', CatalogForm); | |||
ManageIQ.component.addReact('Breadcrumbs', Breadcrumbs); | |||
ManageIQ.component.addReact('TaggingWrapperConnected', TaggingWrapperConnected); | |||
ManageIQ.component.addReact('RemoveCatalogItemModal', RemoveCatalogItemModal); | |||
ManageIQ.component.addReact('CloudProviderForm', CloudProviderForm); |
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.
sort please :)
@@ -64,7 +64,7 @@ | |||
"numeral": "~2.0.6", | |||
"patternfly": "~3.59.1", | |||
"patternfly-bootstrap-treeview": "~2.1.7", | |||
"patternfly-react": "2.10.1", | |||
"patternfly-react": "2.30.6", |
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.
exact version, no ~ ?
@@ -0,0 +1,29 @@ | |||
|
|||
const isHostname = function(value) { | |||
return /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/.test(value); |
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 doesn't look right.
You probably want something like \p{L}
instead of a-zA-Z
. Otherwise, this won't match any national domains...
> isHostname('♡.com')
false
Yet, http://♡.com exists and is a valid domain.
EDIT: the full list of valid unicode chars is probably here https://unicode.org/faq/idn.html
EDIT2: that said, this is fine if we require people to punycode-convert the domains first
}; | ||
|
||
export const asyncValidate = (formValues, asyncFieldsNames) => new Promise((resolve) => { | ||
console.log('validating: ', formValues, asyncFieldsNames); |
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.
console.log
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.
its just a WIP 😉
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.
Aaah, sorry, I didn't notice :)
One thing I'm a bit worried about is the Is that so that we don't have to reload the schema after changing types? (But definitely better than the original |
Yes
They don't but different types share the same attributes but sometimes they have different format requirements. Scoping the will allow you to change types without resetting certain fields and saving the state if the user decides to switch back to some type. Anything that is not in general schema might cause conflict if you change the type if we don't have unique field names. I also have a "plan" for the future that will enable us to "download" pieces of schema on the fly which would allow us also add the prefix on the fly. |
OK, perfect, thanks :) Works for me, just don't base any logic on the prefix strings.. in the future this should be a matter of settings, not types. (has keypair vs is openstack) |
This pull request is not mergeable. Please rebase and repush. |
This pull request has been automatically closed because it has not been updated for at least 6 months. Feel free to reopen this pull request if these changes are still valid. Thank you for all your contributions! |
Changes
openstack.userid
for instanceDependencies
OPTIONS /api/providers
manageiq-api#579TO DO