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:374](https://github.com/headlamp-k8s/headlamp/blob/03cd085a1051d558b8043fc04659c49a7f951695/frontend/src/plugin/registry.tsx#L374)