Merge pull request #1764 from westlywright/tech-preview

Tech preview
This commit is contained in:
Vincent Fiduccia 2018-03-26 16:25:37 -07:00 committed by GitHub
commit 000dfc47ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 5 deletions

View File

@ -1,14 +1,25 @@
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { get } from '@ember/object';
import { get, computed } from '@ember/object';
import C from 'ui/utils/constants';
export default Controller.extend({
router: service(),
access: service(),
showCurrent: computed('access.userCode.password', function() {
if (get(this, 'access.userCode.password')) {
return false;
}
return true;
}),
currentPassword: computed('', function() {
return get(this, 'access.userCode.password') || null;
}),
complete(success) {
let backTo = get(this, 'session').get(C.SESSION.BACK_TO)
let router = get(this, 'router');
if (success) {
get(this, 'access').set('userCode', null);
if ( backTo ) {
// console.log('Going back to', backTo);
window.location.href = backTo;

View File

@ -15,7 +15,8 @@ export default Route.extend({
model: function() {
return {
user: get(this, 'access.me')
user: get(this, 'access.me'),
code: get(this, 'access.userCode')||'',
};
},
});

View File

@ -6,7 +6,8 @@
{{input-edit-password
complete=(action (action complete))
user=model.user
showCurrent=true
showCurrent=showCurrent
currentPassword=currentPassword
cancelDisabled=true
}}
</div>

View File

@ -108,12 +108,14 @@ export default Controller.extend({
get(this, 'access').login(provider, code).then((user) => {
if ( get(user, 'mustChangePassword') && provider === 'local' ) {
get(this,'session').set(C.SESSION.BACK_TO, window.location.origin);
get(this, 'access').set('userCode', code);
get(this, 'router').transitionTo('update-password');
} else {
setProperties(this, {
user: null,
code: null,
});
get(this, 'access').set('userCode', null);
this.send('complete', true);
}
}).catch((err) => {

View File

@ -18,6 +18,7 @@ export default Service.extend({
app: service(),
me: null,
userCode: null,
// These are set by authenticated/route
// Is access control enabled

View File

@ -1,7 +1,7 @@
{{#if showHeader}}
<div class="header">
<h1>{{t 'serverUrl.header.label'}}</h1>
<p class="help-text">{{t 'serverUrl.header.detail'}}</p>
<p class="help-text">{{t 'serverUrl.header.detail' appName=settings.appName}}</p>
</div>
{{/if}}
<form class="horizontal-form container-fluid text-left" {{action 'saveServerUrl' on="submit"}}>

View File

@ -5029,7 +5029,7 @@ serviceLog:
serverUrl:
header:
label: Rancher Server URL
detail: TBD
detail: "What URL should be used for this {appName} installation? All the nodes in your clusters will need to be able to reach this."
button:
save: Save URL