From def769b7c654dc1df41d50c08c251d301ccb8b32 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Tue, 26 Oct 2021 23:44:37 +1300 Subject: [PATCH 1/3] Improvement: Visual Indicator for Loading Profiles --- Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js b/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js index 1930c374d..dd8fdd58f 100644 --- a/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js +++ b/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js @@ -2420,6 +2420,11 @@ function newUiObject() { /* Image */ if (icon !== undefined) { if (icon.canDrawIcon === true) { + + // If this is a User Profile and blockchainTokens is still being loaded then display at half opacity + if(thisObject.payload.node.type === "User Profile" && thisObject.payload.blockchainTokens === undefined) { + browserCanvasContext.globalAlpha = 0.5 + } let additionalImageSize = 0 if (isRunningAtBackend === true || isReadyToReferenceAttach === true || isReadyToChainAttach === true) { additionalImageSize = 20 } let totalImageSize = additionalImageSize + thisObject.payload.floatingObject.currentImageSize @@ -2454,6 +2459,7 @@ function newUiObject() { totalImageSize, totalImageSize) } + browserCanvasContext.globalAlpha = 1 } if (executingIcon !== undefined) { From 67355c875d038e62abbde8248535f46832356b51 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Wed, 27 Oct 2021 11:24:17 +1300 Subject: [PATCH 2/3] Improvement: isLoading Opacity Change for UiObject --- .../Foundations/UI/Spaces/Floating-Space/UiObject.js | 9 ++++++--- .../UI/Spaces/User-Profile-Space/UserProfile.js | 10 ++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js b/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js index dd8fdd58f..503354fbf 100644 --- a/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js +++ b/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js @@ -21,6 +21,7 @@ function newUiObject() { uiObjectTitle: undefined, uiObjectMessage: undefined, circularProgressBar: undefined, + isLoading: undefined, isRunning: undefined, isPlaying: undefined, shortcutKey: undefined, @@ -2421,10 +2422,13 @@ function newUiObject() { if (icon !== undefined) { if (icon.canDrawIcon === true) { - // If this is a User Profile and blockchainTokens is still being loaded then display at half opacity - if(thisObject.payload.node.type === "User Profile" && thisObject.payload.blockchainTokens === undefined) { + // If this UiObject is being loaded then display at half opacity + if(thisObject.payload.isLoading === true) { browserCanvasContext.globalAlpha = 0.5 + } else { + browserCanvasContext.globalAlpha = 1 } + let additionalImageSize = 0 if (isRunningAtBackend === true || isReadyToReferenceAttach === true || isReadyToChainAttach === true) { additionalImageSize = 20 } let totalImageSize = additionalImageSize + thisObject.payload.floatingObject.currentImageSize @@ -2459,7 +2463,6 @@ function newUiObject() { totalImageSize, totalImageSize) } - browserCanvasContext.globalAlpha = 1 } if (executingIcon !== undefined) { diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 6d130f1e6..8bf1391cf 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -55,6 +55,13 @@ function newGovernanceUserProfileSpace() { } } let userProfiles = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile') + + // Initialise the isLoading parameter for each User Profile + for (let i = 0; i < userProfiles.length; i++) { + let userProfile = userProfiles[i] + + userProfile.payload.isLoading = true + } /* let pools = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('Pools') let assets = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('Assets') @@ -374,11 +381,13 @@ function newGovernanceUserProfileSpace() { if (userProfile.payload === undefined) { continue } if (userProfile.payload.bloackchainBalancesLoading === true) { + userProfile.payload.isLoading = true return } if (userProfile.payload.blockchainTokens === undefined) { userProfile.payload.bloackchainBalancesLoading = true + userProfile.payload.isLoading = true UI.projects.foundations.spaces.cockpitSpace.setStatus('Loading blockchain balances for User Profile # ' + (i + 1) + ' / ' + userProfiles.length, 1500, UI.projects.foundations.spaces.cockpitSpace.statusTypes.ALL_GOOD) getBlockchainAccount(userProfile) @@ -461,6 +470,7 @@ function newGovernanceUserProfileSpace() { return response.json(); }).then(function (data) { userProfile.payload.bloackchainBalancesLoading = false + userProfile.payload.isLoading = false if (data.result === "Max rate limit reached, please use API Key for higher rate limit") { userProfile.payload.blockchainTokens = undefined } else { From b2e510c5bae39e8383f4bc0326c798aa375f3865 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Wed, 27 Oct 2021 16:15:17 +1300 Subject: [PATCH 3/3] Bug Fix: Hovering over UiObject opacity bug --- Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js b/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js index 503354fbf..ac32a5e08 100644 --- a/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js +++ b/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js @@ -2462,6 +2462,8 @@ function newUiObject() { position.y - totalImageSize / 2, totalImageSize, totalImageSize) + + browserCanvasContext.globalAlpha = 1 } }