mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 05:45:46 +00:00
baecab54cb
* Add all the new data required for NodeIdentities * Add potential NodeIdentity to the token list component * Amend the policy-form/selector to allow node identity creation * Fix up CSS for radio buttons and select label * Add node-identity policy template component * Fix up and add acceptance tests for NodeIndentities * Make sure policy previews take node identities into account * Only show certain policy markup if those we have those policies * Potentially temporarily hide dt's that don't have icons yet
31 lines
721 B
JavaScript
31 lines
721 B
JavaScript
export const createPolicies = function(item) {
|
|
return item.Policies.map(function(item) {
|
|
return {
|
|
template: '',
|
|
...item,
|
|
};
|
|
})
|
|
.concat(
|
|
item.ServiceIdentities.map(function(item) {
|
|
const policy = {
|
|
template: 'service-identity',
|
|
Name: item.ServiceName,
|
|
};
|
|
if (typeof item.Datacenters !== 'undefined') {
|
|
policy.Datacenters = item.Datacenters;
|
|
}
|
|
return policy;
|
|
})
|
|
)
|
|
.concat(
|
|
item.NodeIdentities.map(function(item) {
|
|
const policy = {
|
|
template: 'node-identity',
|
|
Name: item.NodeName,
|
|
Datacenter: item.Datacenter,
|
|
};
|
|
return policy;
|
|
})
|
|
);
|
|
};
|