Skip to content
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

CHE-1002 Add target UX improvements #1109

Merged
merged 1 commit into from
Apr 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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