The main menu can be provided in two forms:
The HTML structure of the Main menu is inside of DC Layout’s SidebarBaseItems component. During the initialization, the component is reading the configuration object from session storage and uses it to display the main menu.
User settings like TimeFormat and DateFormat are received in the token API response. The information is saved in the NGRX Store, from where it can be accessed from all components.
Inside the components, user preferences are applied by:
In addition, the timezone for every site is received from the API during GetUserSite or SetUserSite calls. The timezone is saved in the NGRX Store, and used to correct dates received from API (like CreatedAt, UpdatedAt for Models, Notifications etc.) with MomentJS TimeZone library.
The help functionality is based on pages URLs. The implementation follows the following 3 steps:
Every URL providing a section into the Help, a translation string is added to the current application translation files, e.g. HELP.mvda/model-manager/list, HELP.mvda/model-manager/new/PCA/BLM, HELP.mvda/model-manager/new/PLS/BEM The DcLayout module checks if the current URL has a matching key in the translation files. If a key is found, the button (?) opening the help modal component is shown. In the opened help modal the string (HTML) from the translation files for the current URL is shown. In addition, the help modal contains a search functionality, which searches the loaded application translation files.
The DCP UI supports multiple languages, currently offering German and English. Additional languages can be added easily. Texts in the UI are represented as keys, which are replaced by their corresponding values from the translation files. To avoid handling multiple languages within the API, errors and warnings are returned as status codes, which correspond to specific keys in the Presentation Tier implementation. Keys for errors are defined in the static classes ErrorMessages.cs and Warnings.cs.
The DCP UI has three types of translation files:
Two types of entities can be configured. The type is based on the isModule flag inside the configuration. Supported are:
An example configuration can be found below:
[{
angularticsAction: 'Click on go to dashboard',
iconClass: 'icon-dashboard',
isModule: false,
dividerBefore: false,
ngxPermissionsOnly: ['ADMIN', 'MVDADEVELOPER', 'MVDAUSER', 'VIEWER'],
url: '/dashboard',
text: 'SIDE_MENU.DASHBOARD'
}, {
isModule: true,
name: 'MVDA',
menuModule: 'mvda',
ngxPermissionsOnly: ['ADMIN', 'MVDADEVELOPER', 'MVDAUSER'],
parent: {
angularticsAction: 'Click on MVDA',
ngxPermissionsOnly: ['ADMIN', 'MVDADEVELOPER', 'MVDAUSER'],
tooltip: 'SIDE_MENU.MVDA_FULL',
textShort: 'MVDA',
textLong: 'MVDA',
},
subMenu: [...]
}]
Simple button - can be on first level or as a subMenu element inside the Module element. A simple button has the following configuration:
mat-divider
before element if trueAre expandable buttons, which are used for indicating the different modules. A menu button has the following configuration: