Skip to content

feat(config): added a configuration to add prefix to the view note url#418

Merged
CorentinTh merged 1 commit intomainfrom
note-path-prefix
Mar 22, 2025
Merged

feat(config): added a configuration to add prefix to the view note url#418
CorentinTh merged 1 commit intomainfrom
note-path-prefix

Conversation

@CorentinTh
Copy link
Copy Markdown
Owner

Closes #408

@CorentinTh CorentinTh requested a review from Copilot March 22, 2025 15:35
@CorentinTh CorentinTh self-assigned this Mar 22, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 22, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
enclosed ✅ Ready (View Log) Visit Preview a0d36b6
enclosed-docs ✅ Ready (View Log) Visit Preview a0d36b6

@github-actions
Copy link
Copy Markdown

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
enclosed-docs 🔨 Building (View Log) a0d36b6

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.

[Feature Request] Support all notes on Specific Path for excluding from authentication

2 participants