Replace hardcoded pageLabels in logic with semantic urls from config
See original GitHub issueIn few places we have hardcoded pageLabel
s / pageContext.id
s of CMS routes:
- logout guard -
'/logout'
- cms page guard -
'/not-found'
- router reducer -
'/login'
,'/login/register'
We need to get them from the routes configuration.
Now we have only a method UrlService.generateUrl()
returns an array of url commands to be passed to Angular’s routerLink
or router.navigate
. This is not what we simply need here. We just need string with a page label for given named route.
To build a full bullet-proof solution we need considering:
- passing parameters
- URI-encoding segments of url
- supporting aliases
- supporting relative links
Or we can simply build a method that returns just a string from configuration (with leading slash).
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How do I handle hard coded URL, database configuration in ...
First, move all your config options into a configuration file (or files). Use a language agnostic format such as JSON or YAML.
Read more >Extend Cart Save and Validation Logic in Fewer Steps
This logic class validates and saves the cart, and you can easily extend this ... To revert, change the Use Cart Page 2.0...
Read more >Javascript Setup - Yext Hitchhikers
To start, this template won't display anything – just a hardcoded string (which we'll replace later on). We'll place this within our onReady...
Read more >PyMuPDF Documentation
cd PyMuPDF && python setup.py install. This will automatically download a specific hard-coded MuPDF source release, and build it into ...
Read more >Changelog - Doxygen Manual
The specific options DOT_FONTNAME and DOT_FONTSIZE have been replaced be more generic ... Make templated HTML output more similar to hardcoded output.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Tested on dev2.
QA steps
1. Logout is configurable
/my-logout
2. ‘Page not found’ route is configurable
/not-found
to/my-404
/my-404