Skip to content

Fix max_upstream_conn validation bugs in Angular components #22673

@bupd

Description

@bupd

Summary

Three validation bugs in Angular components for max_upstream_conn feature.

Expected Behaviour

  • Check maxUpstreamConnError after validateMaxUpstreamConnections()
  • isValid getter includes maxUpstreamConnError to 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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions