Skip to content

Commit

Permalink
Private Dir: Use separate label to display prompt instead of TextInpu…
Browse files Browse the repository at this point in the history
…t bead prompt for password

(reference #35)
  • Loading branch information
piotrzarzycki21 committed Aug 23, 2023
1 parent 194af64 commit 2a9ce40
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package interfaces
function get isPasswordDisabled():Boolean;
function set isPasswordDisabled(value:Boolean):void;
function get passwordChange():IEventDispatcher;
function set passwordPrompt(value:String):void;
function get passwordPrompt():Object;

function get labelText():String;
function get urlText():String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ package mediator.applications
private function onPasswordChangeClick(event:MouseEvent):void
{
view.isPasswordDisabled = false;
view.passwordPrompt = "";
view.passwordPrompt.visible = false;
}

private function updateView():void
Expand All @@ -122,11 +122,13 @@ package mediator.applications
{
this.view.titleGenesisDir = "Edit Genesis Directory";
this.view.isPasswordDisabled = true;
this.view.passwordPrompt.visible = true;
}
else
{
this.view.titleGenesisDir = "Add Genesis Directory";
this.view.isPasswordDisabled = false;
this.view.passwordPrompt.visible = false;
}

this.refreshPasswordInputPrompt();
Expand All @@ -136,11 +138,11 @@ package mediator.applications
{
if (genesisDirsProxy.selectedDir && genesisDirsProxy.selectedDir.isPrivate)
{
view.passwordPrompt = "Password set";
this.view.passwordPrompt.text = "Password set";
}
else
{
view.passwordPrompt = "No password required";
this.view.passwordPrompt.text = "No password required";
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,11 @@
return this.changePassword;
}
public function set passwordPrompt(value:String):void
public function get passwordPrompt():Object
{
if (!this.passwordPromptTextInput) return;
this.passwordPromptTextInput.prompt = value;
}
return this.passwordPromptLabel;
}
public function installationResult(message:String):void
{
Snackbar.show(message, 4000, null);
Expand Down Expand Up @@ -151,12 +149,13 @@
<controls:CustomFormItem className="horizontalContentCenterExpandFormItem"
labelClass="formItemNonRequiredGDirLabel"
label="Password (optional):">
<j:HGroup gap="2">
<j:HGroup gap="2" itemsVerticalAlign="itemsCenter">
<j:Label localId="passwordPromptLabel" text="Password set" visible="false" percentWidth="100"
className="bold"/>
<j:TextInput localId="passwordTextInput" className="flexShrink"
text="{genesisDir.password}" percentWidth="100">
text="{genesisDir.password}" percentWidth="100" visible="{passwordPromptLabel.visible == false}">
<j:beads>
<j:PasswordInput />
<j:TextPrompt localId="passwordPromptTextInput" prompt="Password set"/>
<j:Disabled localId="passwordDisabled" />
</j:beads>
</j:TextInput>
Expand Down
2 changes: 1 addition & 1 deletion Super.Human.Portal_Royale/src/resources/app-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,12 @@ a:hover {

.jewel.label.formItemRequiredGDirLabel {
width: 10em;
marginRight: 4px;
fontWeight: bold;
}

.jewel.label.formItemNonRequiredGDirLabel {
width: 11em;
marginRight: 2px;
fontWeight: bold;
}

Expand Down

0 comments on commit 2a9ce40

Please sign in to comment.