From 4a13488746161641099d9625cac6987844652741 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Fri, 26 Oct 2018 12:57:47 +0530 Subject: [PATCH] Imprive app install UI --- .../assets/mobileapp/pages/asset.jag | 13 ++- .../partials/page-content-app-details.hbs | 97 +++++++++++-------- .../assets/mobileapp/pages/asset.js | 1 + 3 files changed, 68 insertions(+), 43 deletions(-) diff --git a/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/pages/asset.jag b/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/pages/asset.jag index 3460bb58e..feced0d62 100644 --- a/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/pages/asset.jag +++ b/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/pages/asset.jag @@ -91,9 +91,15 @@ require('/modules/store.js').exec(function (ctx) { var rxtAttributes = utility.getRXTAttributes(tenantId, type); var devices = []; - if(user != null && isNotCatalog && isDeviceSubscriptionEnabled){ - devices = parse(String(devicesClass.getDevicesList(stringify(user), user.tenantId, "user", [user.username], asset.attributes.overview_platform))); - } + var isDeviceAvailable = false; + + if (user != null && isNotCatalog && isDeviceSubscriptionEnabled) { + devices = parse(String(devicesClass.getDevicesList(stringify(user), user.tenantId, "user", [user.username], + asset.attributes.overview_platform))); + if (devices.length > 0) { + isDeviceAvailable = true; + } + } var headerData = site.header(tenantId, { sso: sso, @@ -119,6 +125,7 @@ require('/modules/store.js').exec(function (ctx) { user: user, sso: sso, devices: devices, + isDeviceAvailable : isDeviceAvailable, isEnterpriseInstallEnabled: isEnterpriseInstallEnabled, isDeviceSubscriptionEnabled : isDeviceSubscriptionEnabled, isDirectDownloadEnabled :isDirectDownloadEnabled, diff --git a/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/themes/store/partials/page-content-app-details.hbs b/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/themes/store/partials/page-content-app-details.hbs index 6ae910bca..d6176234c 100644 --- a/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/themes/store/partials/page-content-app-details.hbs +++ b/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/themes/store/partials/page-content-app-details.hbs @@ -43,51 +43,68 @@ {{!--buttons --}}
{{#if user}} - {{#if inDashboard}} - {{#if isDeviceSubscriptionEnabled}} - Re-Install + {{#if isDeviceAvailable}} + {{#if inDashboard}} + {{#if isDeviceSubscriptionEnabled}} + Re-Install + {{else}} + Re-Install + {{/if}} + {{!--Check if already subscribed to previous version of the app--}} + {{else}} {{#if isUpdatedApp}} + {{#if isDeviceSubscriptionEnabled}} + Update + {{else}} + Update + {{/if}} {{else}} - Re-Install - {{/if}} - {{!--Check if already subscribed to previous version of the app--}} - {{else}} {{#if isUpdatedApp}} - {{#if isDeviceSubscriptionEnabled}} - Update + {{#if isDeviceSubscriptionEnabled}} + Install + {{else}} + Install + {{/if}} + {{/if}}{{/if}} + {{#if isEnterpriseInstallEnabled}} + Ent. Install + {{else}} - Update {{/if}} {{else}} - {{#if isDeviceSubscriptionEnabled}} - Install - {{else}} - Install - {{/if}} - {{/if}}{{/if}} + + + Install + + + + Ent. Install + + {{/if}} {{else}} - Install - {{/if}} - - {{#if isEnterpriseInstallEnabled}} - Ent. Install - + + + Install + + + + Ent. Install + {{/if}}
diff --git a/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/themes/store/renderers/extensions/assets/mobileapp/pages/asset.js b/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/themes/store/renderers/extensions/assets/mobileapp/pages/asset.js index 0f3427347..1863b901f 100644 --- a/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/themes/store/renderers/extensions/assets/mobileapp/pages/asset.js +++ b/features/org.wso2.carbon.appmgt.store.feature/src/main/resources/store/extensions/assets/mobileapp/themes/store/renderers/extensions/assets/mobileapp/pages/asset.js @@ -67,6 +67,7 @@ var render = function(theme, data, meta, require) { type: data.type, inDashboard: data.inDashboard, isUpdatedApp: data.isUpdatedApp, + isDeviceAvailable: data.isDeviceAvailable, isEnterpriseInstallEnabled: data.isEnterpriseInstallEnabled, isDeviceSubscriptionEnabled: data.isDeviceSubscriptionEnabled, isDirectDownloadEnabled: data.isDirectDownloadEnabled,