Blueprint Admin Module - actimeo/simmage-ui GitHub Wiki

  • To create a new module for the admin side, use the following command :

    • ng g(enerate) admin-module admin/module-name
  • Bellow is the list of the files which need to be modified :

    • module-name.service.ts : - replace all urls used for pgcall to match the pg functions - add all necessary fields to match the class(es) generated from the database table(s) - uncomment the import line at the top of the file, remove the fake-class (used to avoid any error when trying to run the website just after generating the module), and update the import link accordingly to retrieve the class(es) which are used in the file
    • module-name-list.component.ts : - update isSelected function at the end of file so the id name matches the one of the class
    • module-name-list.component.html : - add all necessary fields that should be shown on each object occurrence - replace all fields names to match the class used
    • module-name-form.component.ts : - add any FormControl required to match the number of fields in the class - add those fields in originalData, and replace those already existing by the class fields - inside ngOnInit function, initialize the new form controls, add them to the Form_Builder, and add their set values (either to the ones retrieved from the route or default values) - update setOriginalDataFromFields and originalDataChanged to replace originalData fields values and to check whether those values were changed or not
    • module-name-form.component.html : - add new inputs/selector/checkbox/etc... to match the formControls created before
    • admin.routing.ts : - add a new path to match the new module (path name must be "module-name" ; loadChildren must be "app/admin/module-name/module-name.module#ModuleNameModule")
    • all files ending with .spec.ts : - update all tests files to match the calls defined in module-name.service.ts file - be aware of field names !