mirror of https://github.com/rancher/ui.git
commit
e51a261393
|
|
@ -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: {},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
<section class="{{sectionClass}}">
|
||||
<h4>{{t 'newCatalog.newApp'}}</h4>
|
||||
{{form-name-description
|
||||
model=templateResource
|
||||
model=catalogApp
|
||||
nameRequired=true
|
||||
descriptionShow=false
|
||||
}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue