-
Notifications
You must be signed in to change notification settings - Fork 291
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
fix: allow end user to set all url paths (WPB-4676) #16774
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #16774 +/- ##
=======================================
Coverage 45.84% 45.85%
=======================================
Files 747 747
Lines 24443 24442 -1
Branches 5578 5578
=======================================
Hits 11207 11207
+ Misses 11818 11812 -6
- Partials 1418 1423 +5 |
export const URL_PATH = { | ||
CREATE_TEAM: '/create-team/', | ||
DECRYPT_ERROR_1: '/articles/207948115', | ||
DECRYPT_ERROR_2: '/privacy/error-2/', | ||
MANAGE_SERVICES: '/services/', | ||
MANAGE_TEAM: '/login/', | ||
PASSWORD_RESET: '/forgot/', | ||
PRIVACY_HOW: '/privacy/how/', | ||
PRIVACY_UNVERIFIED_USERS: '/articles/202857164', | ||
PRIVACY_WHY: '/articles/207859815', | ||
SUPPORT_USERNAME: '/support/username/', | ||
} as const; |
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.
- some of those are removed as deprecated
- support links still in use have been moved with existing ones as environment variables instead of being hardcoded
- url paths intended to be dynamically appended have been made into the
URL_SUBPATH
env variables as to be end user configurable
src/script/externalRoute.ts
Outdated
|
||
const addLocaleToHelpCenterUrl = (url?: string): string => { | ||
if (!url) { | ||
return undefined; | ||
} | ||
const language = currentLanguage().slice(0, 2); | ||
const websiteLanguage = language == 'de' ? language : 'en-us'; | ||
return url.replace( | ||
`${Config.getConfig().URL.SUPPORT.INDEX}`, | ||
`${Config.getConfig().URL.SUPPORT.INDEX}/hc/${websiteLanguage}`, | ||
); | ||
}; |
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.
help center links do not need to be localized as they follow the browser locale setting
3292d38
to
9f30b9c
Compare
export const getManageServicesUrl = (utmSource?: string): string | undefined => | ||
getTeamSettingsUrl(URL.URL_PATH.MANAGE_SERVICES, utmSource); |
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.
hard to find doc on those UTM sources
we use 2 variations of those in the webapp:
client_landing
when navigating from the main portion of the appclient_settings
when navigating from the settings
Do we want to keep that granularity @atomrc ?
Should I had those to the externalUrl
object and stop exporting those methods?
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.
ah!! I do not know about those utms, honestly. But, since we will be tracking team settings usages soonish, I'm guessing those will be used at some point (if they are not currently).
We should probably keep a way to add utm to some urls I guess
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'll keep the export of the method and add some JSDoc to make the utmSource thing more transparent, how does that sound?
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.
That sounds good to me :)
src/script/externalRoute.ts
Outdated
|
||
export const addLocaleToUrl = (url?: string): string => { | ||
export const addLocaleToUrl = (url?: string | undefined): string | undefined => { |
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.
Why url?: string | undefined? :D You append undefined by ? after url :)
Co-authored-by: Przemysław Jóźwik <[email protected]>
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.
LGTM! :)
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.
LGTM 😎
* fix: allow end user to set all url paths (WPB-4676) * add new urls in env variables to config * remove hard coded path from externalRoutes util * update components using the externalRoutes util * update missing components * remove unused path * rename subpath to url_path * expose external urls instead of get methods * add JS doc to methods appending UTM parameters * Apply suggestions from code review Co-authored-by: Przemysław Jóźwik <[email protected]> --------- Co-authored-by: Virgile <[email protected]> Co-authored-by: Przemysław Jóźwik <[email protected]>
* fix: allow end user to set all url paths (WPB-4676) (#16774) * fix: allow end user to set all url paths (WPB-4676) * add new urls in env variables to config * remove hard coded path from externalRoutes util * update components using the externalRoutes util * update missing components * remove unused path * rename subpath to url_path * expose external urls instead of get methods * add JS doc to methods appending UTM parameters * Apply suggestions from code review Co-authored-by: Przemysław Jóźwik <[email protected]> --------- Co-authored-by: Virgile <[email protected]> Co-authored-by: Przemysław Jóźwik <[email protected]> * chore: bump default config to 0.31.22 [WPB-10937] --------- Co-authored-by: Virgile <[email protected]> Co-authored-by: Przemysław Jóźwik <[email protected]>
Description
externatRoutes.ts
Checklist