-
Notifications
You must be signed in to change notification settings - Fork 13
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
Issue 212 - implement hosts Add & Delete buttons #235
Conversation
@carma12 - Not sure how DNS zones are supposed to work. I added code to retrieve all the zones but I'm not actually doing anything with them at the moment. The old UI still wants the FQDN for the hostname, so why have a drop list of all the available dns zones? Because of this I am labeling this PR as WIP. |
83f9bd2
to
737e7f0
Compare
5fd6cd4
to
45ad0e9
Compare
I can help answering some Qs form old UI. When adding a new host, it should be possible to add a host with arbitrary FQDN. Old UI tries to help the user by providing a list of DNS Zones in IPA so that the user might only fill the shortname part of FQDN. But, to be able to fill in arbitrary FQDN, there still needs to be a way to specify arbitrary "domain"/"DNS zone" for the host. The behavior also changes when IPA is installed without DNS server. In such case, it doesn't manage DNS Zones and thus old UI offers (I think) only single textbox where user can provided the FQDN. |
@carma12 - could you start the review on this PR? The work I'm doing on the host settings is starting to overlap with this PR. Thanks! |
45ad0e9
to
70e48b2
Compare
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.
Please see the inline comments below.
@@ -46,12 +67,27 @@ const AddHost = (props: PropsToAddHost) => { | |||
const hostIpAddressHandler = (value: string) => { | |||
setHostIpAddress(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.
We might want to validate this field input to check if the inserted IP address format is valid (similar to what's done in the current WebUI). This can be done in a separate PR.
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 might want to validate this field input to check if the inserted IP address format is valid (similar to what's done in the current WebUI). This can be done in a separate PR.
I'll look into this, or file a new issue...
src/components/modals/AddHost.tsx
Outdated
// Add host data | ||
const addHostData = async () => { | ||
const newHostPayload = { | ||
hostname: hostName, |
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.
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.
Well the DNS zone stuff is what is in WIP. @pvoborni gave me additional info on that. I'll be working on this...
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.
Oh ok, thanks for letting me know that. In any case, a friendly reminder that you still need to send the hostName
+ dnsZoneSelected
to the payload (otherwise, it will throw an error). The current code only takes the hostName
. See in the example below that only the host1
name (hostName
) is being taken:
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.
In any case, a friendly reminder that you still need to send the
hostName
+dnsZoneSelected
to the payload (otherwise, it will throw an error). The current code only takes thehostName
.
Sorry above I said that was still a WIP. I wasn't sure at the time how dns zone was used. So right now hostname expects FQDN, but I guess the old UI wanted a hostname that would be added to the DNS zone: server + ipa.demo ==> server.ipa.demo
72eb749
to
bd14e1e
Compare
@carma12 - ok I think I fixed all the issues, please review... |
45decc7
to
40df36d
Compare
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.
Both 'Add' and 'Delete' modals work as expected in terms of API calls. Although I detected some tiny issues to fix in the code.
if ("data" in response) { | ||
const data = response.data as BatchRPCResponse; | ||
const result = data.result; | ||
const error = data.error as FetchBaseQueryError | SerializedError; |
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 variable is not being used and can be safely removed.
} | ||
} else { | ||
// Clean data and close modal | ||
cleanAndCloseModal(); |
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 modal is resetting all the fields except the Description
one, so it would be convenient to add its default value to the cleanAllFields
function.
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 modal is resetting all the fields except the
Description
one, so it would be convenient to add its default value to thecleanAllFields
function.
Nice catch, fixed. The unused variable is also now fixed. Please review...
40df36d
to
7fa2bcc
Compare
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 changes LGTM, hence approving.
fixes: freeipa#212 Signed-off-by: Mark Reynolds <mreynolds@redhat.com>
7fa2bcc
to
1e9602c
Compare
fixes: #212