Skip to content

Commit

Permalink
UI-3135: Remove service property when not service plan is selected (#…
Browse files Browse the repository at this point in the history
…77)

* Only set user service plan with valid IDs on creation

* Remove `services` from document when no plan is selected
  • Loading branch information
joristirado authored Aug 7, 2018
1 parent c12b483 commit 4a0f3b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion submodules/users/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -3067,6 +3067,8 @@ define(function(require) {
account_id: monster.config.resellerId,
overrides: {}
};
} else {
delete userData.service;
}
}

Expand Down Expand Up @@ -3571,7 +3573,7 @@ define(function(require) {
};

if (formattedData.user.extra) {
if (formattedData.user.extra.hasOwnProperty('licensedRole')) {
if (formattedData.user.extra.hasOwnProperty('licensedRole') && formattedData.user.extra.licensedRole !== 'none') {
formattedData.user.service = formattedData.user.service || {};
formattedData.user.service.plans = {};
formattedData.user.service.plans[formattedData.user.extra.licensedRole] = {
Expand Down
4 changes: 3 additions & 1 deletion submodules/users/views/creation.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
<label for="licensed_role" class="control-label"><i class="fa fa-user"></i></label>
<div class="controls">
<select id="licensed_role" name="user.extra.licensedRole" data-placeholder="{{ i18n.users.licensedUserRoles.selectPlaceholder }}">
<option value></option>
<option value="none">
{{ i18n.users.licensedUserRoles.licensedUserRoles.none }}
</option>
{{#each licensedUserRoles}}
<option value="{{id}}">{{name}}</option>
{{/each}}
Expand Down

0 comments on commit 4a0f3b8

Please sign in to comment.