Adding policy create UI updates

revert-dabc3590
dilanua 8 years ago
parent 891f0964ba
commit aada09de10

@ -1,279 +1,280 @@
{{#zone "content"}} {{#zone "content"}}
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="wr-steps hidden"> <div class="wr-steps hidden">
<div class="col-md-3 col-xs-3"> <div class="col-md-3 col-xs-3">
<div class="itm-wiz itm-wiz-current" data-step="policy-platform"> <div class="itm-wiz itm-wiz-current" data-step="policy-platform">
<div class="wiz-no">1</div> <div class="wiz-no">1</div>
<div class="wiz-lbl hidden-xs"><span>Select a platform</span></div> <div class="wiz-lbl hidden-xs"><span>Select a platform</span></div>
</div>
<br class="c-both" />
</div>
<div class="col-md-3 col-xs-3">
<div class="itm-wiz" data-step="policy-profile">
<div class="wiz-no">2</div>
<div class="wiz-lbl hidden-xs"><span>Configure profile</span></div>
</div>
<br class="c-both" />
</div>
<div class="col-md-3 col-xs-3">
<div class="itm-wiz" data-step="policy-criteria">
<div class="wiz-no">3</div>
<div class="wiz-lbl hidden-xs"><span>Assign to groups</span></div>
</div>
<br class="c-both" />
</div>
<div class="col-md-3 col-xs-3">
<div class="itm-wiz" data-step="policy-naming">
<div class="wiz-no">4</div>
<div class="wiz-lbl hidden-xs"><span>Publish to devices</span></div>
</div>
<br class="c-both" />
</div>
</div> </div>
<br class="c-both" />
</div>
<div class="col-md-3 col-xs-3">
<div class="itm-wiz" data-step="policy-profile">
<div class="wiz-no">2</div>
<div class="wiz-lbl hidden-xs"><span>Configure profile</span></div>
</div>
<br class="c-both" />
</div>
<div class="col-md-3 col-xs-3">
<div class="itm-wiz" data-step="policy-criteria">
<div class="wiz-no">3</div>
<div class="wiz-lbl hidden-xs"><span>Assign to groups</span></div>
</div>
<br class="c-both" />
</div>
<div class="col-md-3 col-xs-3">
<div class="itm-wiz" data-step="policy-naming">
<div class="wiz-no">4</div>
<div class="wiz-lbl hidden-xs"><span>Publish to devices</span></div>
</div>
<br class="c-both" />
</div>
</div>
<div class="container col-centered policy-message hidden"> <div class="container col-centered policy-message hidden">
<div class="wr-form"> <div class="wr-form">
<h1 id="policy-message-page-wizard-title" class="page-sub-title">Policy creation is successful.</h1> <h1 id="policy-message-page-wizard-title" class="page-sub-title">Policy creation is successful.</h1>
<br>Please click <b>"Add Another Policy"</b>, if you wish to add another policy or click <br>Please click <b>"Add Another Policy"</b>, if you wish to add another policy or click
<b>"View policy list"</b> to complete the process and go back to the policy list. <b>"View policy list"</b> to complete the process and go back to the policy list.
<hr> <hr>
<button class="wr-btn wizard-stepper" data-current="policy-message" data-direct="/emm/policies/"> <button class="wr-btn wizard-stepper" data-current="policy-message" data-direct="/emm/policies/">
View policy list View policy list
</button> </button>
<a href="/emm/policies/add-policy" class="cu-btn-inner"> <a href="/emm/policies/add-policy" class="cu-btn-inner">
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i> <i class="fw fw-add fw-stack-1x"></i>
</span> </span>
Add another policy Add another policy
</a> </a>
</div> </div>
</div> </div>
<div class="container col-centered wr-content policy-naming hidden"> <div class="container col-centered wr-content policy-naming hidden">
<div class="wr-form"> <div class="wr-form">
<h1 id="policy-naming-page-wizard-title" class="page-sub-title">ADD POLICY</h1> <h1 id="policy-naming-page-wizard-title" class="page-sub-title">ADD POLICY</h1>
<hr> <hr>
<div id="policy-naming-wizard-steps" class="row wr-wizard"></div> <div id="policy-naming-wizard-steps" class="row wr-wizard"></div>
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h4 class="visible-xs">Step 4: Publish to devices</h4> <h4 class="visible-xs">Step 4: Publish to devices</h4>
<br> <br>
<div id="policy-naming-main-error-msg" class="alert alert-danger hidden" role="alert"> <div id="policy-naming-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div> <div>
<label class="wr-input-label">Set a Name for your Policy *</label> <label class="wr-input-label">Set a Name for your Policy *</label>
<br /> <br />
<label class="wr-input-label"> <label class="wr-input-label">
(Policy name should be 1-to-30 characters long) (Policy name should be 1-to-30 characters long)
</label> </label>
<div id="policyNameField" class="wr-input-control"> <div id="policyNameField" class="wr-input-control">
<div class="cus-col-50 form-group wr-input-control"> <div class="cus-col-50 form-group wr-input-control">
<input id="policy-name-input" class="form-control" type="text" value="" /> <input id="policy-name-input" class="form-control" type="text" value="" />
<label class="error nameEmpty hidden" for="summary">Policy name is required & <label class="error nameEmpty hidden" for="summary">Policy name is required &
Should be be 1-to-30 Should be be 1-to-30
characters long.</label> characters long.</label>
</div>
<br class="c-both" />
</div>
<label class="wr-input-label">
Add a description
</label>
<div class="wr-input-control">
<div class="cus-col-50">
<textarea id="policy-description-input" class="form-control" rows="10"
placeholder="[ Summary about the policy ]"></textarea>
</div>
<br class="c-both" />
</div>
</div> </div>
<div class="wr-input-control wr-btn-grp"> <br class="c-both" />
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-is-back-btn="true" </div>
data-current="policy-naming" data-next="policy-criteria">Back</a> <label class="wr-input-label">
<a href="javascript:void(0)" class="wr-btn wizard-stepper" Add a description
data-current="policy-naming-publish" data-next="policy-message" data-validate="true">Publish </label>
to <div class="wr-input-control">
Devices</a> <div class="cus-col-50">
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-current="policy-naming" <textarea id="policy-description-input" class="form-control" rows="10"
data-next="policy-message" data-validate="true">Save</a> placeholder="[ Summary about the policy ]"></textarea>
</div> </div>
<br class="c-both" />
</div> </div>
</div> </div>
<div class="wr-input-control wr-btn-grp">
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-is-back-btn="true"
data-current="policy-naming" data-next="policy-criteria">Back</a>
<a href="javascript:void(0)" class="wr-btn wizard-stepper"
data-current="policy-naming-publish" data-next="policy-message" data-validate="true">Publish
to
Devices</a>
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-current="policy-naming"
data-next="policy-message" data-validate="true">Save</a>
</div>
</div> </div>
</div> </div>
</div>
</div>
<div class="container col-centered wr-content policy-criteria hidden"> <div class="container col-centered wr-content policy-criteria hidden">
<div class="wr-form"> <div class="wr-form">
<h1 id="policy-criteria-page-wizard-title" class="page-sub-title">ADD POLICY</h1> <h1 id="policy-criteria-page-wizard-title" class="page-sub-title">ADD POLICY</h1>
<hr> <hr>
<div id="policy-criteria-wizard-steps" class="row wr-wizard"></div> <div id="policy-criteria-wizard-steps" class="row wr-wizard"></div>
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h4 class="visible-xs">Step 3: Assign to groups</h4> <h4 class="visible-xs">Step 3: Assign to groups</h4>
<br> <br>
<div id="policy-criteria-main-error-msg" class="alert alert-danger hidden" role="alert"> <div id="policy-criteria-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div>
<div>
<label class="wr-input-label">
Set device ownership type
</label>
<div class="wr-input-control">
<div class="cus-col-50">
<select id="ownership-input" class="form-control">
<option value="ANY" selected>ANY</option>
<option value="BYOD">BYOD (Bring Your Own Device)</option>
<option value="COPE">COPE (Corporate-Owned, Personally Enabled)</option>
</select>
</div> </div>
<div> <br class="c-both" />
<label class="wr-input-label"> </div>
Set device ownership type <div class="wr-input-control">
</label> <label class="wr-input-control radio light">
<div class="wr-input-control"> <input id="user-roles-radio-btn" type="radio" name="select-users-radio-btn"
<div class="cus-col-50"> class="select-users-radio" checked />
<select id="ownership-input" class="form-control"> <span class="helper">&nbsp;Set user role(s)</span>
<option value="ANY" selected>ANY</option> </label>
<option value="BYOD">BYOD (Bring Your Own Device)</option> <label class="wr-input-control radio light" rel="assetfilter">
<option value="COPE">COPE (Corporate-Owned, Personally Enabled)</option> <input id="users-radio-btn" type="radio" name="select-users-radio-btn"
</select> class="select-users-radio" />
</div> <span class="helper">&nbsp;Set user(s)</span>
<br class="c-both" /> </label>
</div> </div>
<div class="wr-input-control"> <div id="user-roles-select-field" class="select-users">
<label class="wr-input-control radio light"> <div class="wr-input-control">
<input id="user-roles-radio-btn" type="radio" name="select-users-radio-btn" <div class="cus-col-50">
class="select-users-radio" checked /> <select id="user-roles-input" class="form-control select2"
<span class="helper">&nbsp;Set user role(s)</span> multiple="multiple">
</label> <option value="ANY" selected>ANY</option>
<label class="wr-input-control radio light" rel="assetfilter"> {{#each roles}}
<input id="users-radio-btn" type="radio" name="select-users-radio-btn" <option>{{this}}</option>
class="select-users-radio" /> {{/each}}
<span class="helper">&nbsp;Set user(s)</span> </select>
</label>
</div>
<div id="user-roles-select-field" class="select-users">
<div class="wr-input-control">
<div class="cus-col-50">
<select id="user-roles-input" class="form-control select2"
multiple="multiple">
<option value="ANY" selected>ANY</option>
{{#each roles}}
<option>{{this}}</option>
{{/each}}
</select>
</div>
<br class="c-both" />
</div>
</div>
<div id="users-select-field" class="select-users">
<div class="wr-input-control">
<div class="cus-col-50">
<select id="users-input" class="form-control select2" multiple="multiple">
</select>
</div>
<br class="c-both" />
</div>
</div> </div>
<br> <br class="c-both" />
<label class="wr-input-label" title=""> </div>
Set an action upon non-compliance </div>
</label> <div id="users-select-field" class="select-users">
<div class="wr-input-control"> <div class="wr-input-control">
<div class="cus-col-50"> <div class="cus-col-50">
<select id="action-input" class="form-control"> <select id="users-input" class="form-control select2" multiple="multiple">
<option data-action="enforce" selected>Enforce</option> </select>
<option data-action="warn">Warn</option>
<option data-action="monitor">Monitor</option>
</select>
</div>
<br class="c-both" />
</div> </div>
<br class="c-both" />
</div> </div>
<div class="wr-input-control wr-btn-grp"> </div>
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-is-back-btn="true" <br>
data-current="policy-criteria" data-next="policy-profile">Back</a> <label class="wr-input-label" title="">
<a href="javascript:void(0)" class="wr-btn wizard-stepper" Set an action upon non-compliance
data-current="policy-criteria" data-next="policy-naming" data-validate="true">Continue</a> </label>
<div class="wr-input-control">
<div class="cus-col-50">
<select id="action-input" class="form-control">
<option data-action="enforce" selected>Enforce</option>
<option data-action="warn">Warn</option>
<option data-action="monitor">Monitor</option>
</select>
</div> </div>
<br class="c-both" />
</div> </div>
</div> </div>
<div class="wr-input-control wr-btn-grp">
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-is-back-btn="true"
data-current="policy-criteria" data-next="policy-profile">Back</a>
<a href="javascript:void(0)" class="wr-btn wizard-stepper"
data-current="policy-criteria" data-next="policy-naming" data-validate="true">Continue</a>
</div>
</div> </div>
</div> </div>
</div>
</div>
<div class="container col-centered wr-content policy-profile hidden"> <div class="container col-centered wr-content policy-profile hidden">
<div class="wr-form"> <div class="wr-form">
<h1 id="policy-profile-page-wizard-title" class="page-sub-title">ADD POLICY</h1> <h1 id="policy-profile-page-wizard-title" class="page-sub-title">ADD POLICY</h1>
<hr> <hr>
<div id="policy-profile-wizard-steps" class="row wr-wizard"></div> <div id="policy-profile-wizard-steps" class="row wr-wizard"></div>
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h4 class="visible-xs">Step 2: Configure profile</h4> <h4 class="visible-xs">Step 2: Configure profile</h4>
<br>
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<div class="wr-advance-operations">
<div class="wr-advance-operations-init">
<br> <br>
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert"> &nbsp;&nbsp;&nbsp;&nbsp;<i class="fw fw-settings fw-spin fw-2x"></i>
<i class="icon fw fw-error"></i><span></span> &nbsp;&nbsp;&nbsp;Loading platform features . . .
</div> <br><br>
<div class="wr-advance-operations">
<div class="wr-advance-operations-init">
<br>
&nbsp;&nbsp;&nbsp;&nbsp;<i class="fw fw-settings fw-spin fw-2x"></i>
&nbsp;&nbsp;&nbsp;Loading platform features . . .
<br><br>
</div>
</div>
<div class="wr-input-control wr-btn-grp">
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-is-back-btn="true"
data-current="policy-profile" data-next="policy-platform">Back</a>
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-current="policy-profile"
data-next="policy-criteria" data-validate="true">Continue</a>
</div>
</div> </div>
</div> </div>
<div class="wr-input-control wr-btn-grp">
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-is-back-btn="true"
data-current="policy-profile" data-next="policy-platform">Back</a>
<a href="javascript:void(0)" class="wr-btn wizard-stepper" data-current="policy-profile"
data-next="policy-criteria" data-validate="true">Continue</a>
</div>
</div> </div>
</div> </div>
<div id="loading-content" class="col-centered"> </div>
<br><br> </div>
&nbsp;&nbsp;<i class="fw fw-settings fw-spin fw-2x"></i> <div id="loading-content" class="col-centered">
&nbsp;&nbsp;&nbsp;Loading policy creation wizard . . . <br><br>
<br><br> &nbsp;&nbsp;<i class="fw fw-settings fw-spin fw-2x"></i>
</div> &nbsp;&nbsp;&nbsp;Loading policy creation wizard . . .
<div class="container col-centered wr-content policy-platform hidden"> <br><br>
<div class="wr-form"> </div>
<h1 id="policy-platform-page-wizard-title" class="page-sub-title">ADD POLICY</h1> <div class="container col-centered wr-content policy-platform hidden">
<hr> <div class="wr-form">
<div id="policy-platform-wizard-steps" class="row wr-wizard"></div> <h1 id="policy-platform-page-wizard-title" class="page-sub-title">ADD POLICY</h1>
<hr> <hr>
<!--<div id="policy-platform-main-error-msg" class="alert alert-danger hidden" role="alert">--> <div id="policy-platform-wizard-steps" class="row wr-wizard"></div>
<!--<i class="icon fw fw-error"></i><span></span>--> <hr>
<!--</div>--> <!--<div id="policy-platform-main-error-msg" class="alert alert-danger hidden" role="alert">-->
<div class="row"> <!--<i class="icon fw fw-error"></i><span></span>-->
<div class="col-lg-12"> <!--</div>-->
<h4 class="visible-xs"> Step 1: Select a platform</h4> <div class="row">
<br> <div class="col-lg-12">
<div id="policy-platform-main-error-msg" class="alert alert-danger hidden" role="alert"> <h4 class="visible-xs"> Step 1: Select a platform</h4>
<i class="icon fw fw-error"></i><span></span> <br>
</div> <div id="policy-platform-main-error-msg" class="alert alert-danger hidden" role="alert">
<div class="row wr-tile-buttons-list"> <i class="icon fw fw-error"></i><span></span>
<div class="wr-input-control"> </div>
<ul class="tile-buttons row"> <div class="row wr-tile-buttons-list">
{{#each types}} <div class="wr-input-control">
<li class="col-xs-12 col-sm-12 col-md- 4 col-lg-4" <ul class="tile-buttons row">
style="margin-top: 5px;margin-bottom: 5px;"> {{#each types}}
<a href="javascript:void(0)" <li class="col-xs-12 col-sm-12 col-md- 4 col-lg-4"
class="wizard-stepper {{name}}-platform" style="margin-top: 5px;margin-bottom: 5px;">
data-current="policy-platform" <a href="javascript:void(0)"
data-next="policy-profile" data-platform="android" class="wizard-stepper {{name}}-platform"
data-validate="false"> data-current="policy-platform"
<img src="{{icon}}" width="50px" height="50px" /><br><br> data-next="policy-profile" data-platform="{{name}}"
<b>{{label}}</b> data-validate="false">
</a> <img src="{{icon}}" width="50px" height="50px" />
</li> <br><br>
{{/each}} <b>{{label}}</b>
</ul> </a>
</div> </li>
</div> {{/each}}
</ul>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- content -->
</div> </div>
</div> </div>
<!-- content -->
</div>
</div>
{{/zone}} {{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
<script id="hidden-operations-ios" src="{{@unit.publicUri}}/templates/hidden-operations-ios.hbs" <script id="hidden-operations-ios" src="{{@unit.publicUri}}/templates/hidden-operations-ios.hbs"

@ -16,17 +16,20 @@
* under the License. * under the License.
*/ */
function onRequest(context) { function onRequest() {
var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType"; var log = new Log("/app/units/mdm.unit.policy.create");
var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label";
var utility = require("/app/modules/utility.js").utility; var CONF_DEVICE_TYPE_KEY = "deviceType";
var CONF_DEVICE_TYPE_LABEL_KEY = "label";
var utility = require("/app/modules/utility.js")["utility"];
var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var types = {}; var viewModelData = {};
types["types"] = []; viewModelData["types"] = [];
var typesListResponse = userModule.getPlatforms(); var typesListResponse = userModule.getPlatforms();
var deviceTypes = typesListResponse["content"]["deviceTypes"]; var deviceTypes = typesListResponse["content"]["deviceTypes"];
if (typesListResponse["status"] == "success") { if (typesListResponse["status"] == "success") {
for (var i = 0; i < deviceTypes.length; i++) { for (var i = 0; i < deviceTypes.length; i++) {
var content = {}; var content = {};
@ -34,16 +37,25 @@ function onRequest(context) {
content["name"] = deviceType; content["name"] = deviceType;
var configs = utility.getDeviceTypeConfig(deviceType); var configs = utility.getDeviceTypeConfig(deviceType);
var deviceTypeLabel = deviceType; var deviceTypeLabel = deviceType;
if (configs && configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_DEVICE_TYPE_LABEL_KEY]) { if (configs && configs[CONF_DEVICE_TYPE_KEY][CONF_DEVICE_TYPE_LABEL_KEY]) {
deviceTypeLabel = configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_DEVICE_TYPE_LABEL_KEY]; deviceTypeLabel = configs[CONF_DEVICE_TYPE_KEY][CONF_DEVICE_TYPE_LABEL_KEY];
} }
var policyWizard = new File("/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-wizard")); var policyWizard = new File("/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-wizard"));
log.error("/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-wizard"));
if (policyWizard.isExists()) { if (policyWizard.isExists()) {
content["icon"] = utility.getDeviceThumb(deviceType); content["icon"] = utility.getDeviceThumb(deviceType);
content["label"] = deviceTypeLabel; content["label"] = deviceTypeLabel;
types["types"].push(content); viewModelData["types"].push(content);
} }
} }
} }
return types;
var result = userModule.getRolesByUserStore();
if (result["status"] == "success") {
viewModelData["roles"] = result["content"];
}
return viewModelData;
} }

@ -403,7 +403,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "VPN server port is not within the range " + "subErrorMsg": "VPN server port is not within the range " +
"of valid port numbers.", "of valid port numbers.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -491,7 +491,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more package names of " + "subErrorMsg": "One or more package names of " +
"applications are empty.", "applications are empty.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -500,7 +500,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist with " + "subErrorMsg": "Duplicate values exist with " +
"for package names.", "for package names.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -739,7 +739,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more permitted App ID entries in " + "subErrorMsg": "One or more permitted App ID entries in " +
"Autonomous Single App Mode are empty.", "Autonomous Single App Mode are empty.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -747,7 +747,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist with permitted App ID entries in " + "subErrorMsg": "Duplicate values exist with permitted App ID entries in " +
"Autonomous Single App Mode.", "Autonomous Single App Mode.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -820,7 +820,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Wi-Fi Proxy Port is not within the range " + "subErrorMsg": "Wi-Fi Proxy Port is not within the range " +
"of valid port numbers.", "of valid port numbers.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -870,7 +870,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more Payload Certificate " + "subErrorMsg": "One or more Payload Certificate " +
"Anchor UUIDs are empty.", "Anchor UUIDs are empty.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -878,7 +878,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist " + "subErrorMsg": "Duplicate values exist " +
"with Payload Certificate Anchor UUIDs.", "with Payload Certificate Anchor UUIDs.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -930,7 +930,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist " + "subErrorMsg": "Duplicate values exist " +
"with TLS Trusted Server Names.", "with TLS Trusted Server Names.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -991,7 +991,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more Roaming Consortium OIs " + "subErrorMsg": "One or more Roaming Consortium OIs " +
"are out of allowed length.", "are out of allowed length.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1000,7 +1000,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more Roaming Consortium OIs " + "subErrorMsg": "One or more Roaming Consortium OIs " +
"contain non-hexadecimal characters.", "contain non-hexadecimal characters.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1139,7 +1139,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more MCC/MNC pairs " + "subErrorMsg": "One or more MCC/MNC pairs " +
"do not fulfill the accepted length of 6 digits.", "do not fulfill the accepted length of 6 digits.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1273,7 +1273,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Incoming Mail Server Port is not within the range " + "subErrorMsg": "Incoming Mail Server Port is not within the range " +
"of valid port numbers.", "of valid port numbers.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1307,7 +1307,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Outgoing Mail Server Port is not within the range " + "subErrorMsg": "Outgoing Mail Server Port is not within the range " +
"of valid port numbers.", "of valid port numbers.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1388,7 +1388,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more Device Names of " + "subErrorMsg": "One or more Device Names of " +
"AirPlay Credentials are empty.", "AirPlay Credentials are empty.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1397,7 +1397,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist with " + "subErrorMsg": "Duplicate values exist with " +
"Device Names of AirPlay Credentials.", "Device Names of AirPlay Credentials.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1420,7 +1420,7 @@ validateStep["policy-profile"] = function () {
// if child input field is empty // if child input field is empty
emptyChildInputCount++; emptyChildInputCount++;
} else if (!inputIsValidAgainstRegExp( } else if (!inputIsValidAgainstRegExp(
/([a-z|A-Z|0-9][a-z|A-Z|0-9][:]){5}([a-z|A-Z|0-9][a-z|A-Z|0-9])$/, childInput)) { /([a-z|A-Z|0-9][a-z|A-Z|0-9][:]){5}([a-z|A-Z|0-9][a-z|A-Z|0-9])$/, childInput)) {
// if child input field is invalid against RegEx // if child input field is invalid against RegEx
invalidAgainstRegExCount++ invalidAgainstRegExCount++
} }
@ -1455,7 +1455,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more AirPlay Destination fields " + "subErrorMsg": "One or more AirPlay Destination fields " +
"do not fulfill expected format.", "do not fulfill expected format.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1545,7 +1545,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more email domains of " + "subErrorMsg": "One or more email domains of " +
"unmarked email domains are empty.", "unmarked email domains are empty.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1554,7 +1554,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist with " + "subErrorMsg": "Duplicate values exist with " +
"email domains of unmarked email domains.", "email domains of unmarked email domains.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1604,7 +1604,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "One or more managed safari web domains of " + "subErrorMsg": "One or more managed safari web domains of " +
"unmarked email domains are empty.", "unmarked email domains are empty.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1613,7 +1613,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist with " + "subErrorMsg": "Duplicate values exist with " +
"managed safari web domains of unmarked email domains.", "managed safari web domains of unmarked email domains.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1705,7 +1705,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist with " + "subErrorMsg": "Duplicate values exist with " +
"Search Setting Search Base and Scope pairs.", "Search Setting Search Base and Scope pairs.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1762,7 +1762,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Account Port is not within the range " + "subErrorMsg": "Account Port is not within the range " +
"of valid port numbers.", "of valid port numbers.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1875,7 +1875,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist with " + "subErrorMsg": "Duplicate values exist with " +
"APN fields of Configurations.", "APN fields of Configurations.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -1963,7 +1963,7 @@ validateStep["policy-profile"] = function () {
validationStatus = { validationStatus = {
"error": true, "error": true,
"subErrorMsg": "Duplicate values exist with " + "subErrorMsg": "Duplicate values exist with " +
"APN fields of APN Configurations.", "APN fields of APN Configurations.",
"erroneousFeature": operation "erroneousFeature": operation
}; };
continueToCheckNextInputs = false; continueToCheckNextInputs = false;
@ -2062,7 +2062,7 @@ stepForwardFrom["policy-profile"] = function () {
var ownershipTypeSelectOptions = $("#ownership-input"); var ownershipTypeSelectOptions = $("#ownership-input");
ownershipTypeSelectOptions.empty(); ownershipTypeSelectOptions.empty();
ownershipTypeSelectOptions.append($("<option></option>"). ownershipTypeSelectOptions.append($("<option></option>").
attr("value", "BYOD").text("BYOD (Bring Your Own Device)")); attr("value", "BYOD").text("BYOD (Bring Your Own Device)"));
ownershipTypeSelectOptions.attr("disabled", true); ownershipTypeSelectOptions.attr("disabled", true);
} }
}; };
@ -2074,13 +2074,13 @@ stepBackFrom["policy-profile"] = function () {
// so that, the wrong content would not be shown at the first glance, in case // so that, the wrong content would not be shown at the first glance, in case
// the user selects a different platform // the user selects a different platform
$(".wr-advance-operations").html( $(".wr-advance-operations").html(
"<div class='wr-advance-operations-init'>" + "<div class='wr-advance-operations-init'>" +
"<br>" + "<br>" +
"<i class='fw fw-settings fw-spin fw-2x'></i>" + "<i class='fw fw-settings fw-spin fw-2x'></i>" +
"Loading Platform Features . . ." + "Loading Platform Features . . ." +
"<br>" + "<br>" +
"<br>" + "<br>" +
"</div>" "</div>"
); );
}; };
@ -2250,10 +2250,10 @@ var savePolicy = function (policy, isActive, serviceURL) {
} }
if (policy["profile"].hasOwnProperty(key)) { if (policy["profile"].hasOwnProperty(key)) {
profilePayloads.push({ profilePayloads.push({
"featureCode": key, "featureCode": key,
"deviceType": policy["platform"], "deviceType": policy["platform"],
"content": policy["profile"][key] "content": policy["profile"][key]
}); });
} }
} }
@ -2393,7 +2393,7 @@ var slideDownPaneAgainstValueSet = function (selectElement, paneID, valueSet) {
} }
$(paneSelector).slideUp(); $(paneSelector).slideUp();
/** now follows the code to reinitialize all inputs of the slidable pane */ /** now follows the code to reinitialize all inputs of the slidable pane */
// reinitializing input fields into the defaults // reinitializing input fields into the defaults
$(paneSelector + " input").each( $(paneSelector + " input").each(
function () { function () {
if ($(this).is("input:text")) { if ($(this).is("input:text")) {
@ -2480,9 +2480,9 @@ function formatRepo(user) {
return; return;
} }
var markup = '<div class="clearfix">' + var markup = '<div class="clearfix">' +
'<div clas="col-sm-8">' + '<div clas="col-sm-8">' +
'<div class="clearfix">' + '<div class="clearfix">' +
'<div class="col-sm-3">' + user.username + '</div>'; '<div class="col-sm-3">' + user.username + '</div>';
if (user.firstname) { if (user.firstname) {
markup += '<div class="col-sm-3"><i class="fa fa-code-fork"></i> ' + user.firstname + '</div>'; markup += '<div class="col-sm-3"><i class="fa fa-code-fork"></i> ' + user.firstname + '</div>';
} }
@ -2509,42 +2509,42 @@ function promptErrorPolicyPlatform(errorMsg) {
$(document).ready(function () { $(document).ready(function () {
$("#users-input").select2({ $("#users-input").select2({
multiple: true, multiple: true,
tags: false, tags: false,
ajax: { ajax: {
url: "/emm/api/invoker/execute/", url: "/emm/api/invoker/execute/",
method: "POST", method: "POST",
dataType: 'json', dataType: 'json',
delay: 250, delay: 250,
id: function (user) { id: function (user) {
return user.username; return user.username;
}, },
data: function (params) { data: function (params) {
var postData = {}; var postData = {};
postData.actionMethod = "GET"; postData.requestMethod = "GET";
postData.actionUrl = "/api/device-mgt/v1.0/users/search/usernames?filter=" + params.term; postData.requestURL = "/api/device-mgt/v1.0/users/search/usernames?filter=" + params.term;
postData.actionPayload = null; postData.requestPayload = null;
return JSON.stringify(postData); return JSON.stringify(postData);
}, },
processResults: function (data) { processResults: function (data) {
var newData = []; var newData = [];
$.each(data, function (index, value) { $.each(data, function (index, value) {
value.id = value.username; value.id = value.username;
newData.push(value); newData.push(value);
}); });
return { return {
results: newData results: newData
}; };
}, },
cache: true cache: true
}, },
escapeMarkup: function (markup) { escapeMarkup: function (markup) {
return markup; return markup;
}, // let our custom formatter work }, // let our custom formatter work
minimumInputLength: 1, minimumInputLength: 1,
templateResult: formatRepo, // omitted for brevity, see the source of this page templateResult: formatRepo, // omitted for brevity, see the source of this page
templateSelection: formatRepoSelection // omitted for brevity, see the source of this page templateSelection: formatRepoSelection // omitted for brevity, see the source of this page
}); });
$("#loading-content").remove(); $("#loading-content").remove();
$(".policy-platform").removeClass("hidden"); $(".policy-platform").removeClass("hidden");
@ -2552,8 +2552,8 @@ $(document).ready(function () {
$("#policy-platform-wizard-steps").html($(".wr-steps").html()); $("#policy-platform-wizard-steps").html($(".wr-steps").html());
$("select.select2[multiple=multiple]").select2({ $("select.select2[multiple=multiple]").select2({
"tags": false "tags": false
}); });
$("#users-select-field").hide(); $("#users-select-field").hide();
$("#user-roles-select-field").show(); $("#user-roles-select-field").show();
@ -2571,8 +2571,8 @@ $(document).ready(function () {
// Support for special input type "ANY" on user(s) & user-role(s) selection // Support for special input type "ANY" on user(s) & user-role(s) selection
$("#user-roles-input").select2({ $("#user-roles-input").select2({
"tags": false "tags": false
}).on("select2:select", function (e) { }).on("select2:select", function (e) {
if (e.params.data.id == "ANY") { if (e.params.data.id == "ANY") {
$(this).val("ANY").trigger("change"); $(this).val("ANY").trigger("change");
} else { } else {
@ -2707,7 +2707,7 @@ $(document).ready(function () {
$(advanceOperations).on("click", "[data-click-event=add-form]", function () { $(advanceOperations).on("click", "[data-click-event=add-form]", function () {
var addFormContainer = $("[data-add-form-container=" + $(this).attr("href") + "]"); var addFormContainer = $("[data-add-form-container=" + $(this).attr("href") + "]");
var clonedForm = $("[data-add-form=" + $(this).attr("href") + "]").clone(). var clonedForm = $("[data-add-form=" + $(this).attr("href") + "]").clone().
find("[data-add-form-element=clone]").attr("data-add-form-clone", $(this).attr("href")); find("[data-add-form-element=clone]").attr("data-add-form-clone", $(this).attr("href"));
// adding class .child-input to capture text-input-array-values // adding class .child-input to capture text-input-array-values
$("input, select", clonedForm).addClass("child-input"); $("input, select", clonedForm).addClass("child-input");

Loading…
Cancel
Save