-
Notifications
You must be signed in to change notification settings - Fork 166
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
Fix update dialog pops several times when click ok/cancel button issue #2013
Conversation
366b6f7
to
d1c5d9e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Rui!
@@ -67,7 +67,7 @@ public SparkServerlessClusterNode(@NotNull Node parent, | |||
protected void refreshItems() throws AzureCmdException { | |||
try { | |||
cluster.get().toBlocking().singleOrDefault(cluster); | |||
if (Optional.ofNullable(cluster.getMasterState()).orElse("") | |||
if (getNodeActionByName("Update") == null && Optional.ofNullable(cluster.getMasterState()).orElse("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you may need to remove all actions before adding one. The method name is refreshItems
#Resolved
@@ -90,7 +90,7 @@ protected void loadActions() { | |||
this, cluster, adlAccount, SparkServerlessClusterOps.getInstance().getDestroyAction())); | |||
addAction("View Cluster Status", new SparkServerlessMonitorAction( | |||
this, cluster, SparkServerlessClusterOps.getInstance().getMonitorAction())); | |||
if (Optional.ofNullable(cluster.getMasterState()).orElse("") | |||
if (getNodeActionByName("Update") == null && Optional.ofNullable(cluster.getMasterState()).orElse("") | |||
.equals(SparkItemGroupState.STABLE.toString())) { | |||
addAction("Update", new SparkServerlessUpdateAction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the action needs to be added twice? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After user provision a new cluster, the cluster state is not STABLE
. So the actions for this new provisioned cluster node don't contain Update
. Update
action will be enabled when cluster is in STABLE
state and user refreshes the node.
In reply to: 217964570 [](ancestors = 217964570)
d1c5d9e
to
6006747
Compare
this, cluster, SparkServerlessClusterOps.getInstance().getUpdateAction())); | ||
} | ||
Boolean isClusterStabled = Optional.ofNullable(cluster.getMasterState()).orElse("") | ||
.equals(SparkItemGroupState.STABLE.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
equalsIgnoreCase
? #Resolved
addAction("Update", new SparkServerlessUpdateAction( | ||
this, cluster, SparkServerlessClusterOps.getInstance().getUpdateAction())); | ||
} | ||
Boolean isClusterStabled = Optional.ofNullable(cluster.getMasterState()).orElse("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This val can be private function #Resolved
this, cluster, SparkServerlessClusterOps.getInstance().getUpdateAction())); | ||
} | ||
|
||
NodeAction updateAction = addAction("Update", new SparkServerlessUpdateAction( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we assign Update
to a const String value? #Resolved
6dc243b
to
7af7782
Compare
@@ -115,6 +109,11 @@ protected void actionPerformed(NodeActionEvent e) throws AzureCmdException { | |||
}); | |||
} | |||
|
|||
private Boolean isClusterStable() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no boxing, boolean
is enough #Resolved
3c57c13
to
aa2a92d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Rui! You can find the Squash
operation.
microsoft#2013) * Fix update dialog pops several times when click ok/cancel button issue * Update based on review comments
To fix #1920