-
Notifications
You must be signed in to change notification settings - Fork 7
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
Issue #49: Granting Stock Keepers access to ALTA through the mobile client #165
Conversation
New 'login-mobile' endpoint will handle logging in exclusively from the mobile client This new endpoint will distinguish which client the user is logging in from For now the authentication logic is still exactly the same (it will be changed later, as the authentication process has different requirements for stock keepers) However only stock keepers (and inventory managers) will currently be redirected to the mobile landing page
We require seperate routing for the mobile app
Landing 'activity' after mobile log in
Using an ion-menu as the side navigation drawer
Pylint Report '- ----------------------------------- |
NG Lint Report |
A standalone app is alot more easily maintainable I have attempted many multi-project solutions with contstant issues. The drawback of this solution is slightly increased code redundancy This is a template app generated by ionic start with the sidenav option
The template code required some changes to fit our requirements Added 3 template pages to later rename and use for the side menu Routing is all attached to it
Integrated authetnicated login with tokens and auth service Protected routes login by email and password Using the canLoad interface for protected pages
Automatically closing the nav menu when a user clicks on a route Making the size of it smaller
Also fixed some lint errors
Since the ionic app is kept seperate now, this code is no longer required
Pylint Report '+ ************* Module user_account.urls |
NG Lint Report |
Pylint Report '+ ************* Module user_account.urls |
NG Lint Report |
Codecov Report
@@ Coverage Diff @@
## master #165 +/- ##
==========================================
- Coverage 97.40% 97.28% -0.13%
==========================================
Files 20 20
Lines 501 515 +14
==========================================
+ Hits 488 501 +13
- Misses 13 14 +1
Continue to review full report at Codecov.
|
Pylint Report '+ ************* Module user_account.urls |
NG Lint Report |
…tation error This mobile specific login endpoint will be implemented later (when different options to password authentication are determined)
Pylint Report '+ ************* Module user_account.urls |
NG Lint Report |
Pylint Report '+ ************* Module user_account.urls |
NG Lint Report |
Pylint Report '+ ************* Module user_account.urls |
NG Lint Report |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested everything out extensively, I don't see any issues feature wise, nor code wise.
I will merge it now.
New API endpoint to login from the mobile client
This new endpoint will distinguish from which client the user is logging in from
For now the authentication logic is still exactly the same (it will be changed later, as the authentication process has different requirements for stock keepers see: User Story 4.9 User Story 4.9 #132)
Current issues are mainly going to be related to routing. A big head scratcher is finding a way to keep the routing between the mobile and web client separate. This is a big deal because the default route is automatically redirected to after the app is reopened after being closed (so the web dashboard will be shown as that is set as being redirected from the default route). Also we potentially might want these mobile routes to not be accessible from the normal browser.
A nice cleaner option would be to use a multi-project workspace:https://angular.io/guide/file-structure#multiple-projects
Edit:
I have tried to implement the multiple project solution with some success but the drawbacks were too severe to go ahead with the solution. This is mainly due to ionic still requiring the entire config files (like its own package.json) to be generated, unless the command 'ionic init' is used which transforms an existing angular project into an ionic one.
However, when attempting this, porting the current web application to the multi project structure causes weird UI bugs to surface.
It would be possible to look into this later but for now I determined it to be not worth the time effort.
I decided to simply generate a full isolated ionic app. This has the major benefit of ease of use and maintainability as the ionic specific code will be fully segregated. Also i recon performance and device compatibility will be improved as ionic specific elements are used everywhere. The main drawbacks is that there might be some minor code redundancies and a less elegant directory structure.
The ionic app (''alta-mobile') now includes:
From inside the
client/alta-mobile
directory there is no need to specify the project name anymore to run any of the ionic commands:For example:
To start the app:
ionic serve
To add changes to native builds:
ionic cap copy