Merge branch 'enrollment-app-install-webclip' into 'master'

Allow web clips installation via enrollment app install policy

Closes product-iots#61

See merge request entgra/carbon-device-mgt!46
This commit is contained in:
Dharmakeerthi Lasantha 2019-03-13 05:48:18 +00:00
commit c1d6462e7d
3 changed files with 9 additions and 3 deletions

View File

@ -223,7 +223,13 @@ policyModule = function () {
appObjectToView = {};
appObjectToView["appName"] = appObjectFromRestEndpoint["name"];
appObjectToView["appId"] = appObjectFromRestEndpoint["id"];
if ("webapp" === appObjectFromRestEndpoint["platform"]) {
appObjectToView["packageName"] = appObjectFromRestEndpoint["appmeta"]["weburl"];
appObjectToView["type"] = "Web Clip"
} else {
appObjectToView["packageName"] = appObjectFromRestEndpoint["appmeta"]["package"];
appObjectToView["type"] = "Mobile App"
}
appObjectToView["version"] = appObjectFromRestEndpoint["version"];
appObjectToView["platform"] = appObjectFromRestEndpoint["platform"];
storeApps.push(appObjectToView);

View File

@ -202,7 +202,7 @@ function getStoreApps(storeApps, deviceType) {
var selectedApps = [];
var i;
for (i=0; i<storeApps.length; i++) {
if (deviceType === storeApps[i].platform) {
if (deviceType === storeApps[i].platform || "webapp" === storeApps[i].platform) {
selectedApps.push(storeApps[i]);
}
}

View File

@ -259,7 +259,7 @@ function getStoreApps(storeApps, deviceType) {
var selectedApps = [];
var i;
for (i=0; i<storeApps.length; i++) {
if (storeApps[i].platform === deviceType) {
if (storeApps[i].platform === deviceType || "webapp" === storeApps[i].platform) {
selectedApps.push(storeApps[i]);
}
}