-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Admin UI dashboard widgets #334
Comments
We have one of the payment method as 'cash on delivery'. Once order is checked out with 'cash on delivery' payment method we change that order to 'Arranging Payment' and further order status is supposed to be changed by person who is in charge of handling the logistics. This person would ideally have access to Admin UI dashboard and will be able to perform Order Status changes manually. I tried to have a look around in dashboard and couldn't find any. |
Prior ArtSome screenshots from dashboards of other projects: Sylius
Saleor
Magento 2
nopCommerce
|
Design goals
Implementation ideasConceptually I think we can follow a similar implementation to how we do CustomFieldControls, where we have a central widget registry which we use to register a widget and all the metadata needed like permissions, supported sizes etc. Both built-in widgets and external ones will use this same infrastructure. For native Angular-based widgets, we can provide a re-usable widget-wrapper component, which provides a common "chrome" or "frame" around the widget (e.g. with a standard drag-drop handle, context menu, resize handling etc). For non-Angular widgets we use a modified version which additionally embeds an iframe and sets up the postMessage cross-frame communication channel. Rough sketch: @Component({
template: `
<vdr-widget>
<ul>
<li *ngFor="let product of topProducts$ | async">{{ product.name }}</li>
</ul>
</vdr-widget>
`,
})
export class TopProductsWidget implements DashboardWidget {
readonly dashboardWidgetConfig = {
title: 'Top-selling products', // todo consider l10n
supportedSizes: [WidgetSize.Small, WidgetSize.Medium],
requiredPermissions: [Permission.ReadCatalog, Permission.ReadOrder],
};
topProducts$: Observable<Product[]>;
constructor(private dataService: DataService) {}
// ... implementation omitted
}
@NgModule({
imports: [SharedModule],
declarations: [TopProductsWidget ],
providers: [
registerDashboardWidget(TopProductsWidget),
]
})
export class SharedExtensionModule { } Note: the sketch above does not fulfill the lazy-loading design goal - this will be loaded by default as soon as the Admin UI bootstraps. So the final design needs to do something clever with creating a lazy-loaded module just for the widget. Perhaps we can entirely hide the Angular module boilerplate part? Resources on lazy loading components |
Is your feature request related to a problem? Please describe.
Currently the Admin UI dashboard is empty.
Describe the solution you'd like
There should be a well-defined API that allows modules (including user-defined ui extensions) to provide "dashboard widgets" which can be displayed in the dashboard.
Dashboard widgets could include things like:
The widgets should be configurable by the administrator, i.e. the admin can select which widgets to display and arrange them.
Widgets should be limited by the permissions system, so e.g. only admin with "ReadOrder" permission can see the order list widget.
User widget settings (selection, layout) should be persisted in the back-end somehow. This may be done via a custom field on the Administrator entity.
The text was updated successfully, but these errors were encountered: