feat(config): added a configuration to add prefix to the view note url#418
Merged
CorentinTh merged 1 commit intomainfrom Mar 22, 2025
Merged
feat(config): added a configuration to add prefix to the view note url#418CorentinTh merged 1 commit intomainfrom
CorentinTh merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a configuration option to prepend a prefix to the view note URLs. Key changes include:
- Adding a new helper (buildViewNotePagePath) and associated tests to correctly format note view paths based on a configurable prefix.
- Updating route definitions, configuration types, and URL construction functions in both the app client and library packages to support the new prefix.
- Integrating the new configuration across the codebase, including dependency updates and usage in note creation use cases.
Reviewed Changes
Copilot reviewed 13 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/app-client/src/modules/notes/notes.models.test.ts | Added tests for buildViewNotePagePath validating correct path construction. |
| packages/app-client/src/routes.tsx | Refactored routes to be generated dynamically using the configured view note path prefix. |
| packages/lib/src/notes/notes.models.test.ts | Added tests for createNoteUrl to ensure proper URL structure with a provided prefix. |
| packages/app-client/src/modules/notes/notes.models.ts | Introduced buildViewNotePagePath to handle prefix logic for view note URLs. |
| pnpm-workspace.yaml | Updated to include the @corentinth/chisels dependency required for URL joining. |
| packages/app-server/src/modules/app/config/config.ts | Added configuration schema for viewNotePathPrefix. |
| packages/app-client/src/modules/notes/pages/create-note.page.tsx | Updated note creation to pass the viewNotePathPrefix configuration to the use case. |
| packages/lib/src/notes/notes.models.ts | Modified createNoteUrl to include an optional pathPrefix when building the URL. |
| packages/app-client/src/modules/config/config.types.ts | Updated Config type to include viewNotePathPrefix. |
| packages/lib/src/notes/notes.usecases.ts and packages/app-client/src/modules/notes/notes.usecases.ts | Integrated pathPrefix into the note creation use cases. |
| packages/app-client/src/index.tsx | Refactored to use getRoutes function for route generation. |
Files not reviewed (4)
- packages/app-client/package.json: Language not supported
- packages/app-server/package.json: Language not supported
- packages/lib/package.json: Language not supported
- pnpm-lock.yaml: Language not supported
|
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #408