mirror of https://github.com/rancher/ui.git
refactor global resource memeber access
pass the access types down rather that own the access types and manipulate rancher/rancher#18938
This commit is contained in:
parent
25e54fae82
commit
ff1d1e56c4
|
|
@ -26,6 +26,7 @@ export default Controller.extend(ViewNewEdit, {
|
||||||
scope: service(),
|
scope: service(),
|
||||||
|
|
||||||
queryParams: ['id'],
|
queryParams: ['id'],
|
||||||
|
memberAccessTypes: ['owner'],
|
||||||
|
|
||||||
id: null,
|
id: null,
|
||||||
errros: null,
|
errros: null,
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@
|
||||||
expand=(action expandFn)
|
expand=(action expandFn)
|
||||||
}}
|
}}
|
||||||
{{form-members-global-access
|
{{form-members-global-access
|
||||||
excludeMember=true
|
optionsForAccessType=memberAccessTypes
|
||||||
readOnly=false
|
readOnly=false
|
||||||
resource=model.globaldns
|
resource=model.globaldns
|
||||||
addAuthorizedPrincipal=(action "addAuthorizedPrincipal")
|
addAuthorizedPrincipal=(action "addAuthorizedPrincipal")
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export default Controller.extend(ViewNewEdit, {
|
||||||
globalStore: service(),
|
globalStore: service(),
|
||||||
|
|
||||||
queryParams: ['id', 'activeProvider'],
|
queryParams: ['id', 'activeProvider'],
|
||||||
|
memberAccessTypes: ['owner', 'read-only'],
|
||||||
id: null,
|
id: null,
|
||||||
|
|
||||||
activeProvider: 'route53',
|
activeProvider: 'route53',
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
expand=(action expandFn)
|
expand=(action expandFn)
|
||||||
}}
|
}}
|
||||||
{{form-members-global-access
|
{{form-members-global-access
|
||||||
excludeMember=true
|
optionsForAccessType=memberAccessTypes
|
||||||
readOnly=false
|
readOnly=false
|
||||||
resource=model
|
resource=model
|
||||||
addAuthorizedPrincipal=(action "addAuthorizedPrincipal")
|
addAuthorizedPrincipal=(action "addAuthorizedPrincipal")
|
||||||
|
|
|
||||||
|
|
@ -69,13 +69,8 @@ export default Component.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
initOptionsForMembersAccessType() {
|
initOptionsForMembersAccessType() {
|
||||||
let accessTypes = this.globalStore.getById('schema', 'member').optionsFor('accessType') || [];
|
let accessTypes = this.optionsForAccessType || this.globalStore.getById('schema', 'member').optionsFor('accessType');
|
||||||
|
|
||||||
if (this.excludeMember) {
|
return set(this, 'optionsForAccessType', accessTypes);
|
||||||
accessTypes = accessTypes.without('member');
|
|
||||||
}
|
|
||||||
set(this, 'optionsForAccessType', accessTypes);
|
|
||||||
|
|
||||||
return;
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
{{member.displayType}}
|
{{member.displayType}}
|
||||||
</td>
|
</td>
|
||||||
<td data-title="{{dt.accessType}}:">
|
<td data-title="{{dt.accessType}}:">
|
||||||
|
{{#if (gt optionsForAccessType.length 1)}}
|
||||||
<select
|
<select
|
||||||
class="form-control"
|
class="form-control"
|
||||||
onchange={{action (mut member.accessType) value="target.value"}}
|
onchange={{action (mut member.accessType) value="target.value"}}
|
||||||
|
|
@ -45,6 +46,9 @@
|
||||||
</option>
|
</option>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</select>
|
</select>
|
||||||
|
{{else}}
|
||||||
|
{{member.accessType}}
|
||||||
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
<td data-title="{{t "generic.actions"}}:" class="actions">
|
<td data-title="{{t "generic.actions"}}:" class="actions">
|
||||||
<div class="p-5">
|
<div class="p-5">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue