From 2a9ce4083c9586a0a4dbcd71966018c27c571b89 Mon Sep 17 00:00:00 2001 From: Piotr Zarzycki Date: Wed, 23 Aug 2023 13:34:51 +0200 Subject: [PATCH] Private Dir: Use separate label to display prompt instead of TextInput bead prompt for password (reference #35) --- .../interfaces/IGenesisEditDirView.as | 2 +- .../applications/MediatorGenesisEditDir.as | 8 +++++--- .../view/applications/GenesisEditDirView.mxml | 17 ++++++++--------- .../src/resources/app-styles.css | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/interfaces/IGenesisEditDirView.as b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/interfaces/IGenesisEditDirView.as index c88122a..57c56ba 100644 --- a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/interfaces/IGenesisEditDirView.as +++ b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/interfaces/IGenesisEditDirView.as @@ -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; diff --git a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/mediator/applications/MediatorGenesisEditDir.as b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/mediator/applications/MediatorGenesisEditDir.as index e44f517..6e6b023 100644 --- a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/mediator/applications/MediatorGenesisEditDir.as +++ b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/mediator/applications/MediatorGenesisEditDir.as @@ -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 @@ -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(); @@ -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"; } } } diff --git a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/view/applications/GenesisEditDirView.mxml b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/view/applications/GenesisEditDirView.mxml index 1f59178..eebdd99 100644 --- a/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/view/applications/GenesisEditDirView.mxml +++ b/Super.Human.Portal_Royale/src/net/apacheRoyaleTemplatedApp/view/applications/GenesisEditDirView.mxml @@ -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); @@ -151,12 +149,13 @@ - + + + text="{genesisDir.password}" percentWidth="100" visible="{passwordPromptLabel.visible == false}"> - diff --git a/Super.Human.Portal_Royale/src/resources/app-styles.css b/Super.Human.Portal_Royale/src/resources/app-styles.css index 67473bd..e83f62a 100644 --- a/Super.Human.Portal_Royale/src/resources/app-styles.css +++ b/Super.Human.Portal_Royale/src/resources/app-styles.css @@ -451,12 +451,12 @@ a:hover { .jewel.label.formItemRequiredGDirLabel { width: 10em; + marginRight: 4px; fontWeight: bold; } .jewel.label.formItemNonRequiredGDirLabel { width: 11em; - marginRight: 2px; fontWeight: bold; }