Skip to content

Commit

Permalink
Imprive app install UI
Browse files Browse the repository at this point in the history
  • Loading branch information
lasanthaDLPDS committed Oct 26, 2018
1 parent 15ce39f commit 4a13488
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,51 +43,68 @@
{{!--buttons --}}
<div class="actions">
{{#if user}}
{{#if inDashboard}}
{{#if isDeviceSubscriptionEnabled}}
<a id="btn-add-gadget" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}" data-toggle="modal"
data-target="#modalInstallApp"
class="btn btn-default"><i class="fw fw-refresh"></i>Re-Install</a>
{{#if isDeviceAvailable}}
{{#if inDashboard}}
{{#if isDeviceSubscriptionEnabled}}
<a id="btn-add-gadget" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}" data-toggle="modal"
data-target="#modalInstallApp"
class="btn btn-default"><i class="fw fw-refresh"></i>Re-Install</a>
{{else}}
<a id="btn-add-gadget-install" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}"
class="btn btn-default"><i class="fw fw-refresh"></i>Re-Install</a>
{{/if}}
{{!--Check if already subscribed to previous version of the app--}}
{{else}} {{#if isUpdatedApp}}
{{#if isDeviceSubscriptionEnabled}}
<a id="btn-add-gadget-update" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}" data-toggle="modal"
data-target="#modalUpdateApp"
class="btn btn-default"><i class="fw fw-refresh"></i>Update</a>
{{else}}
<a id="btn-add-gadget-install" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}"
class="btn btn-default"><i class="fw fw-refresh"></i>Update</a>
{{/if}}
{{else}}
<a id="btn-add-gadget-install" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}"
class="btn btn-default"><i class="fw fw-refresh"></i>Re-Install</a>
{{/if}}
{{!--Check if already subscribed to previous version of the app--}}
{{else}} {{#if isUpdatedApp}}
{{#if isDeviceSubscriptionEnabled}}
<a id="btn-add-gadget-update" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}" data-toggle="modal"
data-target="#modalUpdateApp"
class="btn btn-default"><i class="fw fw-refresh"></i>Update</a>
{{#if isDeviceSubscriptionEnabled}}
<a id="btn-add-gadget" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}" data-toggle="modal"
data-target="#modalInstallApp"
class="btn btn-subscribe"> <i class="fw fw-mobile"></i>Install</a>
{{else}}
<a id="btn-add-gadget-install" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}"
class="btn btn-subscribe"> <i class="fw fw-mobile"></i>Install</a>
{{/if}}
{{/if}}{{/if}}
{{#if isEnterpriseInstallEnabled}}
<a href="#" id="btn-ent-install" data-aid="{{asset.id}}" data-toggle="modal"
data-target="#modalEnterpriseInstall"
class="btn btn-subscribe"><i class="fw fw-enterprise"></i>Ent. Install</a>
<input id="isEnterpriseInstallEnabledisEnterpriseInstallEnabled" type="hidden" value="true">
{{else}}
<a id="btn-add-gadget-install" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}"
class="btn btn-default"><i class="fw fw-refresh"></i>Update</a>
{{/if}}
{{else}}
{{#if isDeviceSubscriptionEnabled}}
<a id="btn-add-gadget" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}" data-toggle="modal"
data-target="#modalInstallApp"
class="btn btn-subscribe"> <i class="fw fw-mobile"></i>Install</a>
{{else}}
<a id="btn-add-gadget-install" href="#" data-app="{{asset.id}}"
data-platform="{{asset.attributes.overview_platform}}"
class="btn btn-subscribe"> <i class="fw fw-mobile"></i>Install</a>
{{/if}}
{{/if}}{{/if}}
<a id="btn-add-gadget-install" href="#" class="btn btn-subscribe disabled">
<i class="fw fw-mobile"></i>
Install
</a>
<a href="#" id="btn-ent-install" class="btn btn-subscribe disabled">
<i class="fw fw-enterprise"></i>
Ent. Install
</a>
{{/if}}
{{else}}
<a id="btn-add-gadget-install" href="{{tenantedUrl "/login"}}"
class="btn btn-subscribe"> <i class="fw fw-mobile"></i>Install</a>
{{/if}}

{{#if isEnterpriseInstallEnabled}}
<a href="#" id="btn-ent-install" data-aid="{{asset.id}}" data-toggle="modal"
data-target="#modalEnterpriseInstall"
class="btn btn-subscribe"><i class="fw fw-enterprise"></i>Ent. Install</a>
<input id="isEnterpriseInstallEnabled" type="hidden" value="true">
<a id="btn-add-gadget-install" href="#" class="btn btn-subscribe disabled">
<i class="fw fw-mobile"></i>
Install
</a>
<a href="#" id="btn-ent-install" class="btn btn-subscribe disabled">
<i class="fw fw-enterprise"></i>
Ent. Install
</a>
{{/if}}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4a13488

Please sign in to comment.