Fix UI issue in routing rules page - present indicative message#660
Conversation
1be2cc6 to
f1ba0b0
Compare
|
Quickly skimmed through this. I'm fine with it |
| // TODO Avoid putting mutable objects in fields | ||
| private final UIConfiguration uiConfiguration; | ||
| private final RoutingRulesManager routingRulesManager; | ||
| private final HaGatewayConfiguration haGatewayConfiguration; |
There was a problem hiding this comment.
Please don't put mutable object in fields.
There was a problem hiding this comment.
Not yet done. RoutingRulesConfiguration is also mutable objects.
There was a problem hiding this comment.
Do you have an idea of how to inject this otherwise?
The function getRoutingRules is a route so cannot pass params...
They only thought I had was to copy the object
There was a problem hiding this comment.
maybe extract the fields you want and make them class variables?
in constructor:
isRulesEngineEnabled = routingRules.isRulesEngineEnabled()
ruleType = routingRules.getRulesType()
notice this is omitted. I don't think we need to add this as it's redundant.
| List<DistributionResponse.DistributionChart> distributionChart = lineChartMap.values().stream().map(d -> { | ||
| DistributionResponse.DistributionChart dc = new DistributionResponse.DistributionChart(); | ||
| DistributionResponse.LineChart lc = d.get(0); | ||
| DistributionResponse.LineChart lc = d.getFirst(); |
There was a problem hiding this comment.
Please separate a commit. This change is unrelated to "Fixed bug in UI where non indicative banner appears in routing rules page for external service".
There was a problem hiding this comment.
reverted this, as wasn't part of scope
Please avoid the past tense in the commit title. https://trino.io/development/process.html#pull-request-and-commit-guidelines- |
|
@RoeyoOgen please update commit message to Fix UI issue in routing rules page and optionally have more description in the commit message body |
f1ba0b0 to
70f60f0
Compare
@mosabua done, lmk if anything else is needed |
| } | ||
| else if (res.status === 204) { | ||
| // handle the case of Response.Status.NO_CONTENT when External Routing Service is used | ||
| return { isExternalRouting: true }; |
There was a problem hiding this comment.
Can we make 204 generic so it's not tied to only thrown by isExternalRouting only? Something like
const resJson = await res.json();
if (resJson.msg.type == "external_routing"){
return { isExternalRouting: true }
} else{
return {}
}
There was a problem hiding this comment.
why?
204 is only thrown when: isRulesEngineEnabled && ruleType == RulesType.EXTERNAL under /getRoutingRules in GatewayWebAppResource so i don't seem to understand why make it genreric.
also when status === 204, the body will be empty so res.json() will be none
There was a problem hiding this comment.
Uh I see. I wanted to make it generic so that we can throw 204 in other scenarios as well. But we can figure it out later if we have a use case for it
| setFormApis(new Array(data.length).fill(null)); | ||
| if (data.isExternalRouting) { | ||
| setIsExternalRouting(true); | ||
| setRules([]); |
There was a problem hiding this comment.
rules is default to []. Is this still necessary?
| @@ -81,7 +92,31 @@ export function RoutingRules() { | |||
|
|
|||
| return ( | |||
| <div> | |||
There was a problem hiding this comment.
i tried removing it but got to many errors (and i'm not a front end guy to try and untangle this 😅)
There was a problem hiding this comment.
You could replace it with <> to avoid adding an extra node to the DOM
I see you only changed the PR title but not the commit message. Could you squash your commits and update the message? I think we can do: |
826baac to
0805733
Compare
done |
|
lol we can get rid of this |
|
overall I think this LGTM. @ytwp wdyt |
oopsie - fixed this :) |
0805733 to
7ccccb7
Compare
|
@Chaho12 .. we should merge this right? |
|
Yes we just need to rebase and check for conflict. Can you rebase please? @RoeyoOgen Seems it is out-of-date since June |
Present indicative message when external routing service is used or when no routing rules exist in file based routing
7ccccb7 to
0af9aae
Compare
|
|
If there are any other changes that need to be done @RoeyoOgen can address them in a follow up PR. |
UI Improvements: Fixed bug where banner appears instead of indicative message in routing rules page
Changes
Impact
( X) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: