Skip to content

Service support for admin actions #415

@amcclain

Description

@amcclain

Goal is to build a better version of clearCaches, where a HoistService can spec out a set of actions it wishes to expose via the Hoist Admin Console "Services" tab.

Each "action" could map onto a method on the server. Actions could be given an admin-friendly displayName, which I envision Hoist React rendering as the text on a button. Any HOIST_ADMIN could call any defined action via the Services tab, without app devs needing to write a dedicated controller.

Actions could also be spec'd as primaryOnly, meaning they would only be enabled on the primary instance.

Could also consider supporting:

  • description - explanation / hint as to what it does, if name not enough
  • intent - or potentially some flag like isDisruptive (???) - mainly I want a way to signal that some service actions are "fine to do anytime - don't hesitate to press this green button to request a refresh" vs. "this will drop the core business data cache and all users will start seeing failed refreshes or exceptions until state can be rebuilt". Could be handled by description or name, just like the idea of green vs. red button TBH

Would want to decide / plan ahead as to support for accepting args. I am wary of growing the scope in that way - seems like a significant additional complexity - but understand that certain actions might need an arg to be useful - although some use cases could be handled by adding additional methods.

If successful, could replace ambiguous clearCaches entirely.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions