Skip to content

Smart documents: Fix name count bug for new klagevedtak/ankevedtak #1026

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

eriksson-daniel
Copy link
Contributor

No description provided.

@Copilot Copilot AI review requested due to automatic review settings May 14, 2025 09:43
Copy link

@Copilot 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 fixes the document name count bug for new klagevedtak/ankevedtak by refactoring how document titles are generated. Key changes include replacing getDocumentCount with a new getTitle function in the smart editor component, refactoring title enforcement in get-document-count.ts, and updating tests accordingly.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontend/src/components/smart-editor/new-document/new-document.tsx Updated title generation using getTitle instead of getDocumentCount.
frontend/src/components/smart-editor/new-document/get-document-count.ts Refactored title functions; removed getDefaultTitle and added getTitle and getSmartDocumentTitle.
frontend/src/components/smart-editor/new-document/get-document-count.test.ts Modified tests to validate naming and counting using getTitle.
Comments suppressed due to low confidence (1)

frontend/src/components/smart-editor/new-document/get-document-count.ts:70

  • [nitpick] Consider renaming 'getSmartDocumentTitle' to 'getEnforcedTitle' or similar, to more clearly express that this function returns a title based on enforced template rules.
const getSmartDocumentTitle = (templateId: TemplateIdEnum, fallback: string) => {

@eriksson-daniel eriksson-daniel force-pushed the count branch 2 times, most recently from b3c816e to 1f0be94 Compare May 14, 2025 09:48
@eriksson-daniel eriksson-daniel merged commit aba4b1c into main May 14, 2025
5 checks passed
@eriksson-daniel eriksson-daniel deleted the count branch May 14, 2025 11:04
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