-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Labels
Description
Summary
Three validation bugs in Angular components for max_upstream_conn feature.
Expected Behaviour
- Check
maxUpstreamConnErroraftervalidateMaxUpstreamConnections() isValidgetter includesmaxUpstreamConnErrorto disable submit on error- Input uses property binding
[disabled]="!allowUpdateProxyCacheConfiguration"
Actual Behaviour
Wrong error variable checked
src/portal/src/app/base/left-side-nav/projects/create-project/create-project.component.ts:369
Checks bandwidthError instead of maxUpstreamConnError after validation:
this.validateMaxUpstreamConnections();
if (this.bandwidthError) { // should be maxUpstreamConnError
this.inlineAlert.showInlineError(this.maxUpstreamConnError);isValid getter missing check
src/portal/src/app/base/left-side-nav/projects/create-project/create-project.component.ts:445-452
isValid ignores maxUpstreamConnError, allowing form submission with errors:
public get isValid(): boolean {
return (
this.currentForm &&
this.currentForm.valid &&
!this.isSubmitOnGoing &&
this.isNameValid &&
!this.checkOnGoing &&
!this.bandwidthError // missing: && !this.maxUpstreamConnError
);
}Input always disabled
src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.html:107
Uses literal string instead of property binding:
disabled="!allowUpdateProxyCacheConfiguration" // always disabled
[disabled]="!allowUpdateProxyCacheConfiguration" // correct binding