Skip to content

Commit

Permalink
Private Dir: Add password prompt to indicate whether password is set …
Browse files Browse the repository at this point in the history
…or non required

- Fix issue with parsing whether Genesis dir is private (reference #35 )
  • Loading branch information
piotrzarzycki21 committed Aug 23, 2023
1 parent cdc769f commit 07c6394
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ package classes.managers
for (var i:int = 0; i < viewEntryCount; i++)
{
var privateDir:Object = jsonData[i];
var tmpVO:GenesisDirVO = new GenesisDirVO(privateDir.DominoUniversalID, privateDir["private"], privateDir.label, privateDir.url);
var tmpVO:GenesisDirVO = new GenesisDirVO(privateDir.DominoUniversalID, privateDir["private"] == "true", privateDir.label, privateDir.url);

tmpArr.push(tmpVO);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ package interfaces
function get titleGenesisDir():String;
function set titleGenesisDir(value:String):void;
function get isPasswordDisabled():Boolean;
function set isPasswordDisabled(value:Boolean):void;
function get passwordChange():IEventDispatcher;

function set passwordPrompt(value:String):void;

function get labelText():String;
function get urlText():String;
function get passwordText():String;

function togglePasswordChange():void
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,38 @@ package mediator.applications

private function onPasswordChangeClick(event:MouseEvent):void
{
view.togglePasswordChange();
view.isPasswordDisabled = false;
view.passwordPrompt = "";
}

private function updateView():void
{
this.view.titleGenesisDir = genesisDirsProxy.selectedDir.label ? "Edit Directory" : "Add Directory";
this.view.genesisDir = genesisDirsProxy.selectedDir;

if (genesisDirsProxy.selectedDir.dominoUniversalID)
{
this.view.titleGenesisDir = "Edit Directory";
this.view.isPasswordDisabled = true;
}
else
{
this.view.titleGenesisDir = "Add Directory";
this.view.isPasswordDisabled = false;
}

this.refreshPasswordInputPrompt();
}

private function refreshPasswordInputPrompt():void
{
if (genesisDirsProxy.selectedDir && genesisDirsProxy.selectedDir.isPrivate)
{
view.passwordPrompt = "Password set";
}
else
{
view.passwordPrompt = "No password required";
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ package model.vo

public function toRequestObject():Object
{
return {
var requestObject:Object = {
DominoUniversalID: this.dominoUniversalID,
label: this.label,
url: this.url,
password: this.password
url: this.url
};

if (this.password)
{
requestObject.password = this.password;
}

return requestObject;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,32 @@
return this.passwordTextInput.text;
}
public function get isPasswordDisabled():Boolean
{
if (!this.passwordDisabled) return false;
return this.passwordDisabled.disabled;
}
public function togglePasswordChange():void
public function set isPasswordDisabled(value:Boolean):void
{
this.passwordDisabled.disabled = !this.passwordDisabled.disabled;
if (!this.passwordDisabled) return;
this.passwordDisabled.disabled = value;
}
public function get passwordChange():IEventDispatcher
{
return this.changePassword;
}
public function set passwordPrompt(value:String):void
{
if (!this.passwordPromptTextInput) return;
this.passwordPromptTextInput.prompt = value;
}
public function installationResult(message:String):void
{
Expand Down Expand Up @@ -147,10 +156,11 @@
text="{genesisDir.password}" percentWidth="100">
<j:beads>
<j:PasswordInput />
<j:Disabled localId="passwordDisabled" disabled="{genesisDir.isPrivate}"/>
<j:TextPrompt localId="passwordPromptTextInput" prompt="Password set"/>
<j:Disabled localId="passwordDisabled" />
</j:beads>
</j:TextInput>
<j:Button localId="changePassword" text="Change" width="80" visible="{genesisDir.isPrivate}"/>
<j:Button localId="changePassword" text="Change" width="80" visible="{genesisDir.dominoUniversalID != ''}"/>
</j:HGroup>
</controls:CustomFormItem>
</j:Form>
Expand Down

0 comments on commit 07c6394

Please sign in to comment.