Skip to content

WIP: Create router service

What does this MR do?

Uses a service to handle the routing

This MR enables the usages of plugins

I created a router-service to encapsulate the dynamic routing and added the usage of modules to the app.json file.

Due to limitations in the commonjs import system, the plugins must be statically typed at the import statement and must be available through source or in the node_modules. In order to overcome this I created a list of supported modules and I declared the @universis/graduation there.

Although I expected that a declaration of the module should be enough (using a moduleName.d.ts file for example), it seems that the module should be present. It does not load until the import statement is called though.

app.json example:

{
  "settings": {
    "plugins": [
        {
          "route": "degree",
          "module": "@universis/graduation",
          "navigation": {
            "name": "degree",
            "translationKey": "UniversisGraduationModule.Degree",
            "children": [
              {
                "path": "/degree/overview/prerequisites",
                "translationKey": "UniversisGraduationModule.DegreePrerequisites"
              }, {
                "path": "/degree/overview/graduation",
                "translationKey": "UniversisGraduationModule.Graduation"
              }
            ]
          }
        }
      ]
}

Related issues and links

Fix #448

Other relevant links

Developer Checklist

  • I have successfully run the code of this merge request locally

  • I have verified locally that my changes work for all necessary screen sizes

  • I have tried out the changes of this MR with different users to identify bugs

  • Coding is in progress, and I have marked the MR as WIP

  • Coding is completed and the MR is ready for review

  • My branch is up-to-date with the upstream master branch

  • My MR follows the contribution guidelines

  • I have added a comment with screenshots of the code running locally

Tech review Checklist

Have you verified that what is supposed to happen, actually does, and what is not supposed to happen, indeed does not?

  • The MR accurately describes the changes and has a relevant title/description
  • The MR does what it is supposed to according to its title, description and related issues/links
  • I have successfully run the changes locally, and tried the new code

Overall review Checklist

  • The MR references related issues/MRs
  • The MR provides links to screens and screenshots
  • The commits of the MR describe the changes, have proper wording, and follow the guidelines
  • I have successfully run the changes locally, and tried the new code
  • The MR is ready for merge (rebased, commit squashed if needed, etc)
Edited by Dimitrios Pliakos

Merge request reports