Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MitanOmar
Copy link
Member

No description provided.

@MitanOmar MitanOmar requested a review from a team as a code owner January 9, 2025 15:31
@MitanOmar MitanOmar force-pushed the Add-Timed-Docs-To-Top-Nav branch 2 times, most recently from 2f4a26f to f15114a Compare January 9, 2025 15:50
@MitanOmar MitanOmar self-assigned this Jan 9, 2025
@MitanOmar MitanOmar force-pushed the Add-Timed-Docs-To-Top-Nav branch from f15114a to 13f9bdc Compare January 9, 2025 15:57
Comment on lines +11 to +30
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 "";
}
}
Copy link
Collaborator

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 = {
Copy link
Collaborator

@c0rydoras c0rydoras Jan 9, 2025

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() {
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants