Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into merge-upstream-0-0-1-3
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Feb 3, 2025
2 parents 3f9d97f + e28690d commit 780a0d9
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 70 deletions.
124 changes: 62 additions & 62 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@eslint/js": "^9.19.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@types/node": "^22.10.10",
"@types/node": "^22.13.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.1",
Expand All @@ -69,7 +69,7 @@
"jsdom": "^26.0.0",
"prettier": "^3.4.2",
"typescript": "^5.7.3",
"typescript-eslint": "^8.21.0",
"typescript-eslint": "^8.22.0",
"vite": "^6.0.11",
"vitest": "^3.0.4"
},
Expand Down
9 changes: 6 additions & 3 deletions src/components/AboutModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ export function AboutModal({
const navigate = useNavigate();

const handleDeleteDocument = async () => {
await deleteDocument(documentId, modificationSecret);
deleteLocalDocument(documentId);
void navigate('/');
const confirmed = confirm(t('modals.about.confirmDelete'));
if (confirmed) {
await deleteDocument(documentId, modificationSecret);
deleteLocalDocument(documentId);
void navigate('/');
}
};
return (
<Modal
Expand Down
14 changes: 14 additions & 0 deletions src/components/EditorMenuBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Bars3Icon,
BoldIcon,
ChatBubbleBottomCenterIcon,
CodeBracketIcon,
DocumentCheckIcon,
DocumentPlusIcon,
ItalicIcon,
Expand Down Expand Up @@ -355,6 +356,19 @@ export default function MenuBar({
<span className="block leading-none w-4">"</span>
</button>
</li>
<li key="btn-code" className="lg:inline-block">
<button
title={t('menuBar.buttons.code')}
onClick={() => editor.chain().focus().toggleCode().run()}
disabled={!editor.can().chain().focus().toggleCode().run()}
className={[
editor.isActive('code') ? 'is-active' : '',
'btn-editor'
].join(' ')}
>
<CodeBracketIcon className="size-4" />
</button>
</li>
{renderCommentButtons(
editor,
currentUser,
Expand Down
4 changes: 3 additions & 1 deletion src/locales/de/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"undo": "Rückgängig",
"redo": "Wiederherstellen",
"quote": "Zitat",
"code": "Code",
"textColor": "Textfarbe",
"showComments": "Kommentare anzeigen",
"link": {
Expand Down Expand Up @@ -91,7 +92,8 @@
"linkLegal": "Impressum",
"buttons": {
"delete": "Text löschen"
}
},
"confirmDelete": "Wirklich löschen?"
}
},
"page": {
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"undo": "Undo",
"redo": "Redo",
"quote": "Quote",
"code": "Code",
"heading": {
"title": "Heading",
"paragraph": "Paragraph",
Expand Down Expand Up @@ -91,7 +92,8 @@
"content": "GroupWriter is a collaboration tool for teams to write and edit documents together.",
"buttons": {
"delete": "Delete text"
}
},
"confirmDelete": "Are you sure you want to delete this text?"
}
},
"page": {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/editorSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const createServerUrl = (targetSubdomain: string, postFix?: string): string => {

return `${protocol}${subdomain}.${hostArray
.slice(1, hostArray.length)
.join('.')}${postFix ? postFix : ''}`;
.join('.')}${postFix ?? ''}`;
};

export const serverUrl = (): string => {
Expand Down

0 comments on commit 780a0d9

Please sign in to comment.