-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Support for custom dashboards #1555
Comments
There's already a dashboard persistence service that would be the place to start looking for this, I believe the current implementation uses local storage, so swapping in a different store that's loading from remote would be straightforward. The problem we still have to solve however is how to make that configurable without modifying source. |
Hey @aaron-steinfeld |
@akashmane2209 - that's what the persistence service already does, everything you're describing is already built with the exception of remote persistence. So let's look at API overview: <ht-navigable-dashboard
*htLoadAsync="this.filterConfig$ as filterConfig"
navLocation="${apiOverviewDashboard.location}"
[filterConfig]="filterConfig"
>
</ht-navigable-dashboard> NavigableDashboard accepts a constant location (i.e. a key to indicate which dashboard it's looking for), and asks dashboard persistence service to give it the dashboard: At the same time in the API overview module, we import So now the persistence service tries to query the store for that location, falling back to that registered default: public getForLocation(locationKey: string): Observable<PersistedDashboard> {
return this.getById(this.getLocationId(locationKey)).pipe(
catchError(() => this.getDefaultForLocation(locationKey))
);
}
public getById(id: string): Observable<PersistedDashboard> {
return this.dashboardStore.read(id);
} Sorry for the confusing explanation, hopefully it makes sense! The conclusion I'm driving at though is that by changing to a different implementation of DashboardStore (which is just an interface, currently implemented via a browser local storage version), it can be set up to use a remote URL and have exactly the behavior you're looking for: export interface DashboardStore {
read(id: string): Observable<PersistedDashboard>;
readAll(): Observable<PersistedDashboard>;
create(dashboard: DashboardCreationData): Observable<PersistedDashboard>;
update(dashboard: DashboardUpdateData): Observable<PersistedDashboard>;
upsert(dashboard: DashboardUpsertData): Observable<PersistedDashboard>;
delete(id: string): Observable<void>;
} |
Okay understood. Let me try updating the service and check. |
Use Case
To enable customising dashboard layouts by passing custom JSON for widgets instead of
.dashboard.ts
Proposal
All dashboards in hypertrace are powered through a JSON object which are exported from the respective
.dashboard.ts
file. This limits the users from creating custom dashboards as per their need.To add support for custom dashboards we can fetch the JSON config before loading the dashboard screen. For the first phase this config can be served via static JSON files as well
The text was updated successfully, but these errors were encountered: