Function: registerDetailsViewHeaderActionsProcessor()
function registerDetailsViewHeaderActionsProcessor(processor: HeaderActionsProcessor | HeaderActionFuncType): void
Add a processor for the details view header actions. Allowing the modification of header actions.
Parameters
Parameter | Type | Description |
---|---|---|
processor | HeaderActionsProcessor | HeaderActionFuncType | The processor to add. Receives a resource (for which we are processing the header actions) and the current header actions and returns the new header actions. Return an empty array to remove all header actions. |
Returns
void
Example
import { registerDetailsViewHeaderActionsProcessor, DetailsViewDefaultHeaderActions } from '@kinvolk/headlamp-plugin/lib';
// Processor that removes the default edit action.
registerDetailsViewHeaderActionsProcessor((resource, headerActions) => {
return headerActions.filter(action => action.name !== DetailsViewDefaultHeaderActions.EDIT);
});
More complete detail view example in plugins/examples/details-view:
@see {@link http://github.com/kinvolk/headlamp/plugins/examples/details-view/ Detail View Example}
## Defined in
[src/plugin/registry.tsx:450](https://github.com/kubernetes-sigs/headlamp/blob/0970281cf7540f9672571da7fa98d93b43d0ccb8/frontend/src/plugin/registry.tsx#L450)