mirror of https://github.com/rancher/ui.git
Merge pull request #2584 from westlywright/mc-app-bugs
Fix issue with a getting display name on project with no cluster
This commit is contained in:
commit
200ec9b87d
|
|
@ -142,8 +142,8 @@ export default Component.extend(NewOrEdit, CatalogApp, {
|
|||
const nue = {
|
||||
type: 'member',
|
||||
accessType: null,
|
||||
displayType: principal.displayType || principalType,
|
||||
displayName: principal.displayName || principal.loginName || principalType.id,
|
||||
displayType: get(principal, 'displayType') || principalType,
|
||||
displayName: get(principal, 'displayName') || get(principal, 'loginName') || get(principalType, 'id'),
|
||||
};
|
||||
|
||||
if (!members) {
|
||||
|
|
@ -310,10 +310,12 @@ export default Component.extend(NewOrEdit, CatalogApp, {
|
|||
|
||||
allProjectsGroupedByCluster: computed('projects.[]', 'primaryResource.targets.@each.projectId', function() {
|
||||
return get(this, 'projects').map( (p) => {
|
||||
const clusterDisplayNameOrNa = get(p, 'cluster.displayName') || this.intl.t('generic.na');
|
||||
|
||||
const out = {
|
||||
name: p.name,
|
||||
value: p.id,
|
||||
cluster: `Cluster: ${ p.cluster.displayName }`
|
||||
name: get(p, 'name'),
|
||||
value: get(p, 'id'),
|
||||
cluster: `Cluster: ${ clusterDisplayNameOrNa }`
|
||||
};
|
||||
|
||||
if (get(this, 'primaryResource.targets').findBy('projectId', p.id)) {
|
||||
|
|
@ -333,14 +335,14 @@ export default Component.extend(NewOrEdit, CatalogApp, {
|
|||
|
||||
get(this, 'clusters').forEach( (c) => {
|
||||
out.pushObject({
|
||||
name: c.name,
|
||||
value: c.id,
|
||||
name: get(c, 'name'),
|
||||
value: get(c, 'id'),
|
||||
});
|
||||
|
||||
c.get('projects').forEach( (p) => {
|
||||
out.pushObject({
|
||||
name: p.name,
|
||||
value: p.id,
|
||||
name: get(p, 'name'),
|
||||
value: get(p, 'id'),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue