Merge changes I484eabe3,I2672226c,I2653c7ef into stable-3.0
* changes:
Show success message in dialog
Fix display of owner group input on details screen
Make full name and email in details screen better readable
diff --git a/src/main/resources/static/gr-serviceuser-create.html b/src/main/resources/static/gr-serviceuser-create.html
index 57bdcda..9034ada 100644
--- a/src/main/resources/static/gr-serviceuser-create.html
+++ b/src/main/resources/static/gr-serviceuser-create.html
@@ -72,6 +72,20 @@
disabled="[[!_enableButton]]">
Create
</gr-button>
+ <gr-overlay id="successDialogOverlay" with-backdrop>
+ <gr-dialog id="successDialog"
+ confirm-label="OK"
+ cancel-label=""
+ on-confirm="_forwardToDetails"
+ confirm-on-enter>
+ <div class="header" slot="header">
+ Success
+ </div>
+ <div class="main" slot="main">
+ [[_successMessage]]
+ </div>
+ </gr-dialog>
+ </gr-overlay>
</main>
</template>
<script src="gr-serviceuser-create.js"></script>
diff --git a/src/main/resources/static/gr-serviceuser-create.js b/src/main/resources/static/gr-serviceuser-create.js
index bc04de5..84fc808 100644
--- a/src/main/resources/static/gr-serviceuser-create.js
+++ b/src/main/resources/static/gr-serviceuser-create.js
@@ -52,12 +52,20 @@
type: Boolean,
value: false,
},
+ _accountId: String,
},
attached() {
this._getConfig();
},
+ _forwardToDetails() {
+ page.show(
+ this.plugin.screenUrl()
+ + '/user/'
+ + this._accountId);
+ },
+
_getConfig() {
return this.plugin.restApi('/config/server/serviceuser~config/').get('')
.then(config => {
@@ -125,13 +133,12 @@
return this.plugin.restApi('/config/server/serviceuser~serviceusers/')
.post(this._newUsername, body)
.then(response => {
+ this._accountId = response._account_id;
if (this._successMessage) {
- this.fire('show-alert', {message: this._successMessage});
+ this.$.successDialogOverlay.open();
+ } else {
+ this._forwardToDetails();
}
- page.show(
- this.plugin.screenUrl()
- + '/user/'
- + response._account_id);
}).catch(response => {
this.fire('show-error', {message: response});
this._isAdding = false;
diff --git a/src/main/resources/static/gr-serviceuser-detail.html b/src/main/resources/static/gr-serviceuser-detail.html
index 25bc29f..28d1d93 100644
--- a/src/main/resources/static/gr-serviceuser-detail.html
+++ b/src/main/resources/static/gr-serviceuser-detail.html
@@ -46,6 +46,14 @@
text-align: center;
}
+ span.value {
+ width: 50%;
+ }
+
+ input.wide {
+ width: 100%;
+ }
+
span.Active {
background-color: #9fcc6b;
}
@@ -86,25 +94,29 @@
<section>
<span class="title">Full Name</span>
<span class="value">
- <input id="serviceUserFullNameInput" bind-value="{{_newFullName}}" is="iron-input" type="text"
- disabled="[[_changingPrefs]]" placeholder$="[[_serviceUser.name]]"
- on-keyup="_computePrefsChanged">
+ <input id="serviceUserFullNameInput" class="wide" bind-value="{{_newFullName}}"
+ is="iron-input" type="text" disabled="[[_changingPrefs]]"
+ placeholder$="[[_serviceUser.name]]" on-keyup="_computePrefsChanged">
</span>
</section>
<section>
<span class="title">Email Address</span>
- <input id="serviceUserEmailInput" bind-value="{{_newEmail}}" is="iron-input" type="text"
- disabled="[[_changingPrefs]]" placeholder="[[_serviceUser.email]]" on-keyup="_computePrefsChanged"
- hidden$="[[!_allowEmail]]">
+ <span class="value" hidden$="[[!_allowEmail]]">
+ <input id="serviceUserEmailInput" class="wide" bind-value="{{_newEmail}}"
+ is="iron-input" type="text" disabled="[[_changingPrefs]]"
+ placeholder="[[_serviceUser.email]]" on-keyup="_computePrefsChanged">
+ </span>
<span class="value" hidden$="[[_allowEmail]]">[[_serviceUser.email]]</span>
</section>
<section>
<span class="title">Owner Group</span>
- <gr-autocomplete id="serviceUserOwnerInput" text="{{_getOwnerGroup(_serviceUser)}}"
- value="{{_newOwner}}" query="[[_query]]" disabled="[[_changingPrefs]]"
- on-commit="_computePrefsChanged" on-keyup="_computePrefsChanged" hidden$="[[!_allowOwner]]">
- [[_getOwnerGroup(_serviceUser)]]
- </gr-autocomplete>
+ <span class="value" hidden$="[[!_allowOwner]]">
+ <gr-autocomplete id="serviceUserOwnerInput" text="{{_getOwnerGroup(_serviceUser)}}"
+ value="{{_newOwner}}" query="[[_query]]" disabled="[[_changingPrefs]]"
+ on-commit="_computePrefsChanged" on-keyup="_computePrefsChanged">
+ [[_getOwnerGroup(_serviceUser)]]
+ </gr-autocomplete>
+ </span>
<span class="value" hidden$="[[_allowOwner]]">[[_getOwnerGroup(_serviceUser)]]</span>
</section>
<p id="ownerChangeWarning" class="style-scope gr-settings-view" hidden$="[[!_newOwner]]">
diff --git a/src/main/resources/static/gr-serviceuser-detail.js b/src/main/resources/static/gr-serviceuser-detail.js
index c2ea3e5..95aded2 100644
--- a/src/main/resources/static/gr-serviceuser-detail.js
+++ b/src/main/resources/static/gr-serviceuser-detail.js
@@ -94,6 +94,8 @@
this.fire('title-change', {title: this._serviceUser.name});
this._computeStatusButtonText();
this._loading = false;
+ this._newFullName = this._serviceUser.name;
+ this._newEmail = this._serviceUser.email;
});
},