Dashboard
[WORK IN PROGRESS]
Creating a new dashboard component
The implementation of new dashboard components is simple in nature, however there are multiple integration points that need to be considered. The following steps will guide you through the process of creating a new dashboard component.
Frontend
Update
app.constants.ts, creating a new entry for your component underDASHBOARD.ITEMconstant. TheTYPEproperty it is the key (i.e. name) to identify your component, theCOLUMNSis the default number of columns that should be assigned to your component, and theDEFAULTSis the default configuration for your component. You need to define all three properties. If your component should only be included in a dashboard once, add it to theSINGLE_INSTANCE_ITEMSarray.Update
dashboard-item-new.component.ts, adding your component to theitemsListarray inngOnInit().If your component requires custom configuration options, create a DTO to capture your component's configuration under
dto/configuration. The DTO should be nameddashboard-item-<type>-configuration-dto.ts.Create 'view' and 'edit' Angular components for your component under
dashboard/items. The 'view' component should be nameddashboard-item-<type>.component.tsand the 'edit' component should be nameddashboard-item-<type>-edit.component.ts.The value targeting your component will be available in
lastMessagevariables. If you want your component to also receive real-time notification when that value changes (e.g. to perform a manual action 'on change') you can have your component subscribing to thelastMessageEmitteremitter. Check existing components for examples on how to do this.Update
dashboard-view.component.htmlto include your component in thengxMasonryItemdiv.
Backend
Update
AppConstants.java, creating a new entry for your component underDashboard.Type. The name of this entry should match exactly theTYPEproperty defined in the frontend.Create a new class to represent the updates of your component under
esthesis.services.dashboard.impl.dto.update. The class should be namedDashboardUpdate<type>.java.Update
DashboardUpdateJobFactory.javato include the job helper for your component.Update
DashboardUpdateJob.java, by adding your component in theexecutemethod's switch block. Depending on the type of your component, you should probably create a helper class to handle the actual update logic.(Optional) Create a configuration class to capture the configuration of your component under
esthesis.services.dashboard.impl.dto.config. The class should be namedDashboardItem<type>Configuration.java.