Skip to content

fix(ui): create condition rules with the name the backend accepts - #1650

Open
AsperforMias wants to merge 1 commit into
apache:developfrom
AsperforMias:fix/condition-rule-create-from-ui
Open

AsperforMias wants to merge 1 commit into
apache:developfrom
AsperforMias:fix/condition-rule-create-from-ui

Conversation

@AsperforMias

Copy link
Copy Markdown
Contributor

Please provide a description of this PR:

Fixes #1648.

A condition rule could not be created from the UI:

  • The form view built the rule name as <application> or <service>:<version>:<group> without the .condition-router suffix, which the backend rejects.
  • The YAML view checked key == 'application' instead of scope == 'application', so an application-scope rule asked for a version and group.

Both views now build the name with one helper, conditionRuleName(scope, key, version, group).

Validation: unit tests for the helper; the routing rule and full vitest suites pass, and prettier, eslint and type-check report nothing new for the changed files. In the mock-mode UI, submitting the form sends POST /condition-rule/router-demo-server.condition-router for application scope and .../greet.GreetService:1.0.0:gray.condition-router for service scope, and the YAML view creates an application-scope rule without asking for a version and group. On develop the same steps send names without the suffix, and the YAML view sends nothing.

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Docs
  • Installation
  • User Experience
  • Dubboctl
  • Console
  • Core Component

Please check any characteristics that apply to this pull request.

The form view built rule names without the .condition-router suffix, so
the backend rejected every new rule, and the YAML view checked key
instead of scope, so an application-scope rule asked for a version and
group. Build the name in one helper used by both views.

Fixes apache#1648
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Condition rules cannot be created from the UI

1 participant