Skip to content

Commit

Permalink
CHE-1002 Add target UX improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaliy Guliy <vguliy@codenvy.com>
  • Loading branch information
Vitaliy Guliy committed Apr 21, 2016
1 parent 8fc806c commit 8e276a9
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,17 @@ public void run() {
clickCount = 0;
delegate.onDoubleClick(notification);
break;

case ONMOUSEOVER:
hideTimer.cancel();
break;

case ONMOUSEOUT:
hideTimer.schedule(DEFAULT_TIME);
if (notification.getStatus() == PROGRESS) {
hideTimer.cancel();
} else {
hideTimer.schedule(DEFAULT_TIME);
}
break;
}
}
Expand Down Expand Up @@ -305,7 +311,9 @@ private void update() {
break;
}

if (PROGRESS != notification.getStatus()) {
if (PROGRESS == notification.getStatus()) {
hideTimer.cancel();
} else {
hideTimer.schedule(DEFAULT_TIME);
}
}
Expand Down Expand Up @@ -349,4 +357,4 @@ public void onExecute() {
super.removeFromParent();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,11 @@ public void onCloseClicked() {

@Override
public void onAddTarget(String category) {
Target target = new Target("[new target]", SSH_CATEGORY);
target.setHost("127.0.0.1");
Target target = new Target("new_target", SSH_CATEGORY);
target.setHost("");
target.setPort("22");
target.setUserName("root");
target.setPassword("root");
target.setPassword("");
target.setDirty(true);
target.setConnected(false);
targets.add(target);
Expand Down Expand Up @@ -340,13 +340,12 @@ private void updateButtons() {
return;
}

view.enableConnectButton(!selectedTarget.isDirty());

if (selectedTarget.isConnected()) {
view.setConnectButtonText("Disconnect");
} else {
view.setConnectButtonText("Connect");
}
view.enableConnectButton(!selectedTarget.isDirty());

view.enableCancelButton(selectedTarget.isDirty());

Expand All @@ -355,6 +354,19 @@ private void updateButtons() {
StringUtils.isNullOrEmpty(view.getPort())) {
view.enableSaveButton(false);
} else {
if (selectedTarget.isDirty()) {
for (Target target : targets) {
if (target == selectedTarget) {
continue;
}

if (target.getName().equals(view.getTargetName())) {
view.enableSaveButton(false);
return;
}
}
}

view.enableSaveButton(selectedTarget.isDirty());
}
}
Expand Down Expand Up @@ -697,6 +709,7 @@ public void apply(MachineDto machineDto) throws OperationException {
connectNotification.setStatus(StatusNotification.Status.SUCCESS);
updateTargets(machineDto.getConfig().getName());
} else {
onConnectingFailed(null);
}
}
}).catchError(new Operation<PromiseError>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
<g:TextBox width="100%" height="14px" ui:field="userName" tabIndex="0"/>

<g:Label width="100%" text="Password" addStyleNames="{style.label}"/>
<g:PasswordTextBox width="100%" height="14px" ui:field="password" tabIndex="0"/>
<g:PasswordTextBox width="100%" height="18px" ui:field="password" tabIndex="0"/>

<g:FlowPanel ui:field="footer" styleName="{style.footer}" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,13 @@ view.targets.save.success = Target configuration successfully saved
view.targets.save.error = Failed to save target configuration due to an error
view.targets.connect.progress = Connecting to target {0}...
view.targets.connect.success = Successfully connected to target {0}
view.targets.connect.error = Failed to connect to target {0} due to en error
view.targets.connect.error = Failed to connect to target {0} due to an error
view.targets.disconnect.success = Successfully disconnected from target {0}
view.targets.disconnect.error = Failed to disconnect from target {0} due to en error
view.targets.disconnect.error = Failed to disconnect from target {0} due to an error
view.targets.delete.confirm = Are you sure you want to delete target <b>{0}</b>?
view.targets.delete.success = Target {0} successfully deleted
view.targets.delete.error = Failed to remove target <b>{0}</b> due to an error


##### process #####
process.active=[Active]
process.table.name=Name
Expand Down

0 comments on commit 8e276a9

Please sign in to comment.