-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: add timed docs to top nav #570
base: main
Are you sure you want to change the base?
Conversation
2f4a26f
to
f15114a
Compare
f15114a
to
13f9bdc
Compare
get getDocsURL() { | ||
const docsUrlMatch = { | ||
// timedUrl: DocsUrl | ||
"/attendances": "tracking/attendances", | ||
"/reports": "tracking/timesheet", | ||
"/analysis": "analysis", | ||
"/statistics": "statistics", | ||
"/projects": "projects", | ||
"/users": "users", | ||
"/": "tracking/activities", | ||
}; | ||
|
||
for (const timedUrl of Object.keys(docsUrlMatch)) { | ||
if (this.router.currentURL?.startsWith(timedUrl)) { | ||
return docsUrlMatch[timedUrl]; | ||
} | ||
} | ||
return ""; | ||
} | ||
} |
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.
you could use the current route instead of the current url
} | ||
|
||
get getDocsURL() { | ||
const docsUrlMatch = { |
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.
this could be a constant
// filename.js
const ROUTE_DOCS_MAP = {
...
}
timedDocsURL = "https://timed.dev/docs/"; | ||
@service router; | ||
|
||
get getDocsEndpoint() { |
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.
you could just call it docsEndpoint
No description provided.