Merge pull request #1644 from westlywright/tech-preview

Tech preview
This commit is contained in:
Vincent Fiduccia 2018-02-19 14:18:54 -07:00 committed by GitHub
commit e51a261393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 19 deletions

View File

@ -40,14 +40,15 @@ export default Route.extend({
if ( !results.namespace )
{
let neuNSN = results.tpl.get('defaultName');
let dupe = '';
if (results.namespaces.findBy('id', neuNSN)){
neuNSN = `${neuNSN}-1`;
if ( dupe = results.namespaces.findBy('id', neuNSN)){
neuNSN = `${dupe.name}-${Math.random().toString(36).substring(7)}`; // generate a random 5 char string for the dupename
}
results.namespace = clusterStore.createRecord({
type: 'namespace',
name: neuNSN,
id: neuNSN,
projectId: this.modelFor('authenticated.project').get('project.id'),
answers: {},
});
}

View File

@ -15,7 +15,8 @@ export default Controller.extend({
modalService: service('modal'),
isGithub : computed('access.providers', function() {
return get(this, 'access.providers').findBy('id', 'github');
let gh = get(this, 'access.providers').findBy('id', 'github');
return gh && get(gh, 'enabled');
}),
isActiveDirectory : computed('access.provider', function() {
return get(this, 'access.providers').findBy('id', 'activedirectory');
@ -33,6 +34,10 @@ export default Controller.extend({
isCaas : computed('app.mode', function() {
return get(this, 'app.mode') === 'caas' ? true : false;
}),
authCount : computed('access.providers', function() {
return get(this, 'access.providers.length') === 1;
}),
promptPasswordReset: alias('resetPassword'),
waiting : false,

View File

@ -54,8 +54,8 @@
{{!-- {{#if (or isLocal isActiveDirectory isOpenLdap isAzureAd)}} --}}
{{#if (or isLocal)}}
{{login-user-pass action="authenticate" waiting=waiting}}
{{#if isLocal}}
{{login-user-pass action="authenticate" waiting=waiting shown=authCount}}
{{/if}}
</section>

View File

@ -38,15 +38,18 @@ export default Component.extend({
}));
// TODO
// debugger;
// Find a namespace
if ( this.get('mode') === REUSE ) {
let namespace = get(this,'namespace') || // Passed in
all.findBy('isDefault', true) || // The default one
all.objectAt(0); // Ok any one
if ( namespace ) {
if ( namespace && namespace.id) {
this.set('reuseNamespaceId', get(namespace, 'id'));
} else if (namespace){
this.set('createNamespace', namespace);
this.set('mode', CREATE);
return;
} else {
next(() => {
this.set('mode', CREATE);

View File

@ -76,10 +76,9 @@ export default Component.extend(NewOrEdit, {
}
},
didReceiveAttrs: function() {
init() {
this._super(...arguments);
set(this, 'selectedTemplateModel', null);
scheduleOnce('afterRender', () => {
if ( get(this, 'selectedTemplateUrl') ) {
this.templateChanged();
@ -192,7 +191,8 @@ export default Component.extend(NewOrEdit, {
set(this, 'readmeContent', null);
}
this.updateReadme();
// TODO 2.0 base64 encoded readmes cause issues
// this.updateReadme();
}),
templateChanged: function() {
@ -254,12 +254,6 @@ export default Component.extend(NewOrEdit, {
let namespace = get(this, 'namespaceResource');
if ( get(this, 'actuallySave') ) {
namespace.setProperties({
// answers: get(this, 'answers'),
// externalId: get(this, 'newExternalId'),
externalId: get(this, 'selectedTemplateModel.externalId'),
});
return true;
} else {
// TODO 2.0 this is part of the volumes stuff so we need to investigate if this still works
@ -283,7 +277,6 @@ export default Component.extend(NewOrEdit, {
setProperties(app, {
installNamespace: neu.name,
name: neu.name,
externalId: get(this, 'selectedTemplateModel.externalId'),
projectId: get(neu, 'projectId'),
});

View File

@ -56,7 +56,7 @@
<section class="{{sectionClass}}">
<h4>{{t 'newCatalog.newApp'}}</h4>
{{form-name-description
model=templateResource
model=catalogApp
nameRequired=true
descriptionShow=false
}}