8000 fix ip VIC plugin throws a parsing error when customer tries to speci… by zhoumeina · Pull Request #583 · vmware/vic-ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix ip VIC plugin throws a parsing error when customer tries to speci… #583

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

Merged
merged 1 commit into from
Sep 5, 2018

Conversation

zhoumeina
Copy link
Contributor
@zhoumeina zhoumeina commented Aug 30, 2018

issue description:
When you provide a gateway for the management network, it's mandatory to provide at least one routing destination. UI Plugin doesn't reflect that. It has two separate fields for Gateway and Routing destinations. If the customer doesn't provide both the fields properly, plugin throws a weird parsing error [Refer to the screenshot].

Fix:
1 Modify UI to make routing destination required.
2 Modify the components destination input and ip address to one input.
Signed-off-by: Meina Zhou meinaz@vmware.com

Fixes #

PR acceptance checklist:

[ ] All unit tests pass
[ ] All e2e tests pass
[ ] Unit test(s) included*
[ ] e2e test(s) included*
[ ] Screenshot attached and UX approved*

*if applicable, add n/a if not

@zjs
Copy link
Member
zjs commented Aug 30, 2018

Adding @javierfz1980 and @lmalvins as I'm not a familiar enough with our UI code to properly review this.

Copy link
Member
@zjs zjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we usually attach screenshots to UI changes so that they can be reviewed by the UX team.

@@ -0,0 +1,13461 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unrelated to the change being made. Is this supposed to be included in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, not related with this issue, but necessary

@@ -70,6 +70,7 @@ export class NetworksComponent implements OnInit {
Validators.pattern(ipPattern)
]],
clientNetworkRouting: [{ value: '', disabled: true }, [
Validators.required,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this may make the field required. I'm not sure that's the correct behavior. It seems like we want to require that either both client-network-routing and client-network-gateway are supplied or both are blank.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steven had checked the code in backend. This field is required.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zach, for the client-network-gateway is it also set for the default route which vCH assigned IP range belongs to? or just for the optional IP range?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screen shot 2018-08-31 at 9 48 30 am

I took a further look at the previous version, I don't think we even need this change. as this change performs the similar functionality as before.

<span class="tooltip-content" *ngIf="form.get('clientNetworkGateway').hasError('pattern')">
Gateway address is not valid
<span class="tooltip-content" *ngIf="form.get('clientNetworkRouting').hasError('pattern')">
IP addresses are not valid,please input one or more routing destinations in a comma separated list, e.g. 10.1.0.0/16,10.2.0.0/16:10.0.0.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IP addresses are not valid,please input ...

There's a space missing after the comma ("valid, please").

e.g. 10.1.0.0/16,10.2.0.0/16:10.0.0.1

This content seems to be for the routing destinations field. Maybe it should exclude the ":10.0.0.1" from the example, since that goes in the other field?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

</span>

<span class="tooltip-content" *ngIf="form.get('clientNetworkGateway').hasError('pattern')">
Gateway address is not valid, please input ip address with format *.*.*.*. e.g. 10.1.119.23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ip address

It seems like we capitalize "IP" elsewhere in the UI.

with format .... e.g. 10.1.119.23

This may just be personal preference, but I find the "..." hard to read. I think most users should understand how to format an IP address, so the example is probably sufficient.

@zhoumeina zhoumeina force-pushed the fix_destiniation_ip branch 2 times, most recently from 2176327 to 672fd6a Compare August 31, 2018 04:44
@zhoumeina
Copy link
Contributor Author

@zjs , now I modify the destination routing to be optional. But if users input the static ip and gateway without destination routing, backend will return "parsing vch body from "" failed, because json: cannot unmarshal object into Go struct field Network.static of type models.CIDR" error message. I tried to not pass destination routing in the payload, also tried to set it empty. All returns same error. I believe logic should be modified in the backend to support it.

Copy link
@ninjadq ninjadq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

 fix ip VIC plugin throws a parsing error when customer tries to specify only the gateway for management network.

    When you provide a gateway for the management network, it's mandatory to provide at least one routing destination. UI Plugin doesn't reflect that. It has two separate fields for Gateway and Routing destinations. If the customer doesn't provide both the fields properly, plugin throws a weird parsing error [Refer to the screenshot].

    Fix:
    1 Modify UI to make routing destination required.
    2 Modify the components destination input and ip address to one input.
    Signed-off-by: Meina Zhou <meinaz@vmware.com>

Signed-off-by: Meina Zhou <meinaz@vmware.com>
@zhoumeina zhoumeina merged commit 3817223 into vmware:master Sep 5, 2018
zjs pushed a commit to zjs/vic-ui that referenced this pull request Sep 10, 2018
…re#583)

fix ip VIC plugin throws a parsing error when customer tries to specify only the gateway for management network.

    When you provide a gateway for the management network, it's mandatory to provide at least one routing destination. UI Plugin doesn't reflect that. It has two separate fields for Gateway and Routing destinations. If the customer doesn't provide both the fields properly, plugin throws a weird parsing error [Refer to the screenshot].

    Fix:
    1 Modify UI to make routing destination required.
    2 Modify the components destination input and ip address to one input.
    Signed-off-by: Meina Zhou <meinaz@vmware.com>

Signed-off-by: Meina Zhou <meinaz@vmware.com>
(cherry picked from commit 3817223)
renmaosheng pushed a commit that referenced this pull request Sep 13, 2018
#595)

fix ip VIC plugin throws a parsing error when customer tries to specify only the gateway for management network.

    When you provide a gateway for the management network, it's mandatory to provide at least one routing destination. UI Plugin doesn't reflect that. It has two separate fields for Gateway and Routing destinations. If the customer doesn't provide both the fields properly, plugin throws a weird parsing error [Refer to the screenshot].

    Fix:
    1 Modify UI to make routing destination required.
    2 Modify the components destination input and ip address to one input.
    Signed-off-by: Meina Zhou <meinaz@vmware.com>

Signed-off-by: Meina Zhou <meinaz@vmware.com>
(cherry picked from commit 3817223)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0