Skip to content

Commit c3115bc

Browse files
CopilotRMCampos
andauthored
Add public note sharing feature (#22)
* Initial plan * Add note sharing feature: share/unshare endpoints, public note view, share token Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com> * Remove redundant nullable=true annotation from NoteEntity shareToken column Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com> * Fix checkstyle line-length violations in test files Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com> * Fix frontend build and test failures: add shared/shareToken fields to NoteAdd payloads and test Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com> * chore: reorganize scripts and migration name * docs: update readme with new feature --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: RMCampos <2219519+RMCampos@users.noreply.github.com> Co-authored-by: Ricardo Campos <ricardompcampos@gmail.com>
1 parent 91e48f2 commit c3115bc

38 files changed

+645
-447
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ The project was born from a month-long technical challenge and has since grown t
4040
- **File Attachments**: URL attachments for tasks and notes
4141
- **Tagging System**: `#tag` support for better organization
4242
- **Mobile App**: Native mobile applications for iOS and Android with PWA plugin
43+
- **Collaboration**: Share tasks and notes with other users
4344

4445
### Upcoming Features
4546
- **Advanced Filters**: Enhanced search with date ranges, priority levels, and status filters
46-
- **Collaboration**: Share tasks and notes with other users
4747
- **Notifications**: Email and push notifications for due dates and reminders
4848

4949
## 🚀 Tech Stack

client/run-from-docker.sh

Lines changed: 0 additions & 37 deletions
This file was deleted.

client/src/App.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import Register from './views/Register';
1616
import EmailConfirmation from './views/EmailConfirmation';
1717
import ResetPassword from './views/ResetPassword';
1818
import CompleteResetPassword from './views/CompleteResetPassword';
19+
import SharedNote from './views/SharedNote';
1920
import './styles/custom.scss';
2021

2122
/**
@@ -65,6 +66,10 @@ function App(): React.ReactNode {
6566
path: '/finish-reset-password',
6667
element: <CompleteResetPassword />
6768
},
69+
{
70+
path: '/public/notes/:token',
71+
element: <SharedNote />
72+
},
6873
{
6974
path: '*',
7075
element: <Navigate to="/" replace />
@@ -86,6 +91,10 @@ function App(): React.ReactNode {
8691
}
8792
]
8893
},
94+
{
95+
path: '/public/notes/:token',
96+
element: <SharedNote />
97+
},
8998
{
9099
path: '*',
91100
element: <NotFound />

client/src/__test__/views/NoteAdd.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ describe('NoteAdd Component', () => {
143143
description: 'Note content',
144144
url: '',
145145
tag: '',
146-
lastUpdate: ''
146+
lastUpdate: '',
147+
shared: false,
148+
shareToken: null
147149
}
148150
expect(api.postJSON).toHaveBeenCalledWith(ApiConfig.notesUrl, newNote);
149151
});

client/src/api-service/api.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ const api = {
8181
return handleResponse(response);
8282
},
8383

84+
getJSONNoAuth: async (url: string) => {
85+
const response = await fetch(url, getRequestInit('GET', {}, false));
86+
return handleResponse(response);
87+
},
88+
8489
postJSON: async (url: string, payload: object) => {
8590
const response = await fetch(url, getRequestInit('POST', payload, isAddAuth(url)));
8691
return handleResponse(response);

client/src/api-service/apiConfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const ApiConfig = {
2626

2727
notesUrl: `${server}/rest/notes`,
2828

29+
publicNotesUrl: `${server}/public/notes`,
30+
2931
userUrl: `${server}/rest/users`
3032
};
3133

client/src/constants/english.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ const enTranslations = {
114114
note_form_submit: 'Save note',
115115
note_table_btn_edit: 'Edit',
116116
note_table_btn_delete: 'Delete',
117+
note_action_share: 'Share',
118+
note_action_unshare: 'Unshare',
119+
note_action_copy_link: 'Copy link',
117120

118121
about_page_title_one: 'About the',
119122
about_page_title_two: 'TaskNote App',

client/src/constants/portuguese.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ const ptBrTranslations = {
114114
note_form_submit: 'Salvar nota',
115115
note_table_btn_edit: 'Alterar',
116116
note_table_btn_delete: 'Excluir',
117+
note_action_share: 'Compartilhar',
118+
note_action_unshare: 'Parar de compartilhar',
119+
note_action_copy_link: 'Copiar link',
117120

118121
about_page_title_one: 'Sobre o',
119122
about_page_title_two: 'App TaskNote',

client/src/constants/russian.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ const ruTranslations = {
114114
note_form_submit: 'Сохранить заметку',
115115
note_table_btn_edit: 'Редактировать',
116116
note_table_btn_delete: 'Удалить',
117+
note_action_share: 'Поделиться',
118+
note_action_unshare: 'Закрыть доступ',
119+
note_action_copy_link: 'Копировать ссылку',
117120

118121
about_page_title_one: 'около',
119122
about_page_title_two: 'TaskNote App',

client/src/constants/spanish.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ const esTranslations = {
114114
note_form_submit: 'Guardar nota',
115115
note_table_btn_edit: 'Editar',
116116
note_table_btn_delete: 'Eliminar',
117+
note_action_share: 'Compartir',
118+
note_action_unshare: 'Dejar de compartir',
119+
note_action_copy_link: 'Copiar enlace',
117120

118121
about_page_title_one: 'Acerca de',
119122
about_page_title_two: 'TaskNote App',

0 commit comments

Comments
 (0)