mirror of https://github.com/rancher/dashboard.git
Feature Flags: Don't show activate options if user does not have permission
This commit is contained in:
parent
c71016ed8c
commit
9907b82baa
|
|
@ -2215,6 +2215,7 @@ sortableTable:
|
|||
some: "Available for {actionable} of the {total} selected"
|
||||
noData: There are no rows which match your search query.
|
||||
noRows: There are no rows to show.
|
||||
noActions: No actions available
|
||||
paging:
|
||||
generic: |-
|
||||
{pages, plural,
|
||||
|
|
|
|||
|
|
@ -85,6 +85,10 @@ export default {
|
|||
action, args, opts
|
||||
});
|
||||
this.hide();
|
||||
},
|
||||
|
||||
hasOptions(options) {
|
||||
return options.length !== undefined ? options.length : Object.keys(options).length > 0;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
@ -98,6 +102,9 @@ export default {
|
|||
<i v-if="opt.icon" :class="{icon: true, [opt.icon]: true}" />
|
||||
<span v-html="opt.label" />
|
||||
</li>
|
||||
<li v-if="!hasOptions(options)" class="no-actions">
|
||||
<span v-t="'sortableTable.noActions'" />
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -138,6 +145,16 @@ export default {
|
|||
.icon {
|
||||
display: unset;
|
||||
}
|
||||
|
||||
&.no-actions {
|
||||
color: var(--disabled-text);
|
||||
}
|
||||
|
||||
&.no-actions:hover {
|
||||
background-color: initial;
|
||||
color: var(--disabled-text);
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export default {
|
|||
action: 'toggleFeatureFlag',
|
||||
label: state ? 'Deactivate' : 'Activate',
|
||||
icon: 'icon icon-edit',
|
||||
enabled: true,
|
||||
enabled: this.canUpdate,
|
||||
};
|
||||
|
||||
out.unshift(enableAction);
|
||||
|
|
|
|||
Loading…
Reference in New Issue