Skip to content

Collaborative signal editing (user groups etc) #9

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 4 commits into from
Apr 30, 2025

Conversation

happy-devs
Copy link
Collaborator

@happy-devs happy-devs commented Apr 21, 2025

Summary

This request adds a comprehensive collaboration system for signals, allowing users to work together on draft signals through direct user collaboration and user groups. It includes database schema updates, new API endpoints, and tests for the collaboration functionality.

New Features

  • Added database support for draft signals with a new is_draft column
  • Created user groups system with group management endpoints
  • Implemented signal collaborator functionality allowing users and groups to edit signals
  • Added permission checks for signal editing based on collaboration status
  • Developed comprehensive testing for the collaboration system

Bug Fixes

  • No bug fixes

Checklist

  • I have read the contribution guidelines.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added required dependencies to requirements.txt
  • I have updated the documentation (if applicable).

@amaguire-undp amaguire-undp marked this pull request as ready for review April 29, 2025 21:01
@amaguire-undp amaguire-undp merged commit a0beb02 into dev Apr 30, 2025
amaguire-undp added a commit that referenced this pull request May 1, 2025
…g Integration (#7)

* Feature: User favourites (#2)

* Feature: initial routers / methods for favourites

- add env documentation / adminer image for easier inspection of db
- create / delete favourite entry in database
- fetch list of favourites by user

* Chore: update formatting, tests

* update test methods / logging

-

* updates

* expand tests / logging

* env updates

* .env updates (#8)

* env updates

* update example env

* initial routes

* update methods

* Add secondary country to signals data (#10)

* initial routes

* update methods

* Fix: Update Python setup action to v4 and fix cache configuration

* Update signal.py

* Collaborative signal editing (user groups etc) (#9)

* full routers / entities / test setup

* update methods

* Delete signal_collaborators.sql

---------

Co-authored-by: amaguire-undp <andrew.maguire@undp.org>

* add endpoints to get auth user's groups + signals

* add emails to user group routes

* configure application with bugsnag

* update app configuration with bugsnag

---------

Co-authored-by: amaguire-undp <andrew.maguire@undp.org>
amaguire-undp added a commit that referenced this pull request May 23, 2025
* Feature: User favourites (#2)

* Feature: initial routers / methods for favourites

- add env documentation / adminer image for easier inspection of db
- create / delete favourite entry in database
- fetch list of favourites by user

* Chore: update formatting, tests

* update test methods / logging

-

* updates

* expand tests / logging

* env updates

* .env updates (#8)

* env updates

* update example env

* initial routes

* update methods

* Add secondary country to signals data (#10)

* initial routes

* update methods

* Fix: Update Python setup action to v4 and fix cache configuration

* Update signal.py

* Collaborative signal editing (user groups etc) (#9)

* full routers / entities / test setup

* update methods

* Delete signal_collaborators.sql

---------

Co-authored-by: amaguire-undp <andrew.maguire@undp.org>

* add endpoints to get auth user's groups + signals

* add emails to user group routes

* configure application with bugsnag

* update app configuration with bugsnag

* Enhance user groups functionality and improve API robustness

* update user groups calls

* update user group calls

* Update .gitignore

* update user groups issue

---------

Co-authored-by: amaguire-undp <andrew.maguire@undp.org>
amaguire-undp added a commit that referenced this pull request May 29, 2025
* Feature: User favourites (#2)

* Feature: initial routers / methods for favourites

- add env documentation / adminer image for easier inspection of db
- create / delete favourite entry in database
- fetch list of favourites by user

* Chore: update formatting, tests

* update test methods / logging

-

* updates

* expand tests / logging

* env updates

* .env updates (#8)

* env updates

* update example env

* initial routes

* update methods

* Add secondary country to signals data (#10)

* initial routes

* update methods

* Fix: Update Python setup action to v4 and fix cache configuration

* Update signal.py

* Collaborative signal editing (user groups etc) (#9)

* full routers / entities / test setup

* update methods

* Delete signal_collaborators.sql

---------

Co-authored-by: amaguire-undp <andrew.maguire@undp.org>

* add endpoints to get auth user's groups + signals

* add emails to user group routes

* configure application with bugsnag

* update app configuration with bugsnag

* Enhance user groups functionality and improve API robustness

* update user groups calls

* update user group calls

* Update .gitignore

* update user groups issue

* enhance trends endpoint

* Squashed commit of the following:

commit 70c750e
Author: happy-devs <andrew@happysoft.dev>
Date:   Sun May 25 23:23:06 2025 +0300

    updates

commit d25cb1e
Author: happy-devs <andrew@happysoft.dev>
Date:   Sun May 25 23:22:34 2025 +0300

    factory updates

commit 2beb502
Author: happy-devs <andrew@happysoft.dev>
Date:   Fri May 23 21:52:10 2025 +0300

    update digest attempts

commit 9c86f15
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed May 14 22:23:22 2025 +0300

    add email digest logic

commit 9e1b804
Merge: 3453c0d 5203c91
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed May 14 19:27:30 2025 +0300

    Merge dev branch into features/email-sending, resolving .env.example conflicts

commit 3453c0d
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu Apr 17 11:40:15 2025 +0300

    initial routers / tests

commit fef9710
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu Dec 19 16:40:00 2024 +0000

    Config: set up router / methods using sendgrid

* Update authentication.py

* CORS updates

- Set allow_origins to ["*"] for production mode
- Disable credentials when using wildcard origins (CORS requirement)
- Update CORSHandlerMiddleware to handle all origins properly
- Maintain localhost support with credentials for local development

🤖 Generated with [Claude Code](https://claude.ai/code)

* remove legacy Sengrid code

* revert CORS

* Force deployment - fix sendgrid import error 🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update .gitignore

* Force new deployment - trigger fresh build

* Fix email service startup errors - lazy initialization and graceful fallback

- Move email service creation from module level to endpoint level
- Handle missing credentials gracefully with warnings instead of errors
- Add configuration checks in email service methods
- Prevent startup failures due to missing CLIENT_SECRET env var

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* add llm data export

* update signals search

* Revert "add llm data export"

This reverts commit a1454fb.

---------

Co-authored-by: amaguire-undp <andrew.maguire@undp.org>
Co-authored-by: Claude <noreply@anthropic.com>
amaguire-undp added a commit that referenced this pull request May 30, 2025
* Feature: User favourites (#2)

* Feature: initial routers / methods for favourites

- add env documentation / adminer image for easier inspection of db
- create / delete favourite entry in database
- fetch list of favourites by user

* Chore: update formatting, tests

* update test methods / logging

-

* updates

* expand tests / logging

* env updates

* .env updates (#8)

* env updates

* update example env

* initial routes

* update methods

* Add secondary country to signals data (#10)

* initial routes

* update methods

* Fix: Update Python setup action to v4 and fix cache configuration

* Update signal.py

* Collaborative signal editing (user groups etc) (#9)

* full routers / entities / test setup

* update methods

* Delete signal_collaborators.sql

---------

Co-authored-by: amaguire-undp <andrew.maguire@undp.org>

* add endpoints to get auth user's groups + signals

* add emails to user group routes

* configure application with bugsnag

* update app configuration with bugsnag

* Enhance user groups functionality and improve API robustness

* update user groups calls

* update user group calls

* Update .gitignore

* update user groups issue

* enhance trends endpoint

* Squashed commit of the following:

commit 70c750e
Author: happy-devs <andrew@happysoft.dev>
Date:   Sun May 25 23:23:06 2025 +0300

    updates

commit d25cb1e
Author: happy-devs <andrew@happysoft.dev>
Date:   Sun May 25 23:22:34 2025 +0300

    factory updates

commit 2beb502
Author: happy-devs <andrew@happysoft.dev>
Date:   Fri May 23 21:52:10 2025 +0300

    update digest attempts

commit 9c86f15
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed May 14 22:23:22 2025 +0300

    add email digest logic

commit 9e1b804
Merge: 3453c0d 5203c91
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed May 14 19:27:30 2025 +0300

    Merge dev branch into features/email-sending, resolving .env.example conflicts

commit 3453c0d
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu Apr 17 11:40:15 2025 +0300

    initial routers / tests

commit fef9710
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu Dec 19 16:40:00 2024 +0000

    Config: set up router / methods using sendgrid

* Update authentication.py

* CORS updates

- Set allow_origins to ["*"] for production mode
- Disable credentials when using wildcard origins (CORS requirement)
- Update CORSHandlerMiddleware to handle all origins properly
- Maintain localhost support with credentials for local development

🤖 Generated with [Claude Code](https://claude.ai/code)

* remove legacy Sengrid code

* revert CORS

* Force deployment - fix sendgrid import error 🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update .gitignore

* Force new deployment - trigger fresh build

* Fix email service startup errors - lazy initialization and graceful fallback

- Move email service creation from module level to endpoint level
- Handle missing credentials gracefully with warnings instead of errors
- Add configuration checks in email service methods
- Prevent startup failures due to missing CLIENT_SECRET env var

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* add llm data export

* update signals search

* Revert "add llm data export"

This reverts commit a1454fb.

* add echo AI system prompt

* user group updates

* update docs/scripts

---------

Co-authored-by: amaguire-undp <andrew.maguire@undp.org>
Co-authored-by: Claude <noreply@anthropic.com>
happy-devs added a commit that referenced this pull request May 30, 2025
commit cb5ec8c
Author: happy-devs <andrew@happysoft.dev>
Date:   Fri May 30 18:49:04 2025 +0300

    user group updates

commit f5d4d58
Author: happy-devs <andrew@happysoft.dev>
Date:   Fri May 30 17:00:11 2025 +0300

    add echo AI system prompt

commit 5581ee8
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu May 29 18:54:36 2025 +0300

    Revert "add llm data export"

    This reverts commit a1454fb.

commit 2eae477
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu May 29 18:53:32 2025 +0300

    update signals search

commit a1454fb
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu May 29 14:25:39 2025 +0300

    add llm data export

commit c8697a4
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed May 28 10:49:09 2025 +0300

    Fix email service startup errors - lazy initialization and graceful fallback

    - Move email service creation from module level to endpoint level
    - Handle missing credentials gracefully with warnings instead of errors
    - Add configuration checks in email service methods
    - Prevent startup failures due to missing CLIENT_SECRET env var

    🤖 Generated with [Claude Code](https://claude.ai/code)

    Co-Authored-By: Claude <noreply@anthropic.com>

commit b0af730
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed May 28 10:16:35 2025 +0300

    Force new deployment - trigger fresh build

commit da995f0
Author: happy-devs <andrew@happysoft.dev>
Date:   Tue May 27 22:14:13 2025 +0300

    Update .gitignore

commit 19d333b
Author: happy-devs <andrew@happysoft.dev>
Date:   Tue May 27 22:07:44 2025 +0300

    Force deployment - fix sendgrid import error 🤖 Generated with [Claude Code](https://claude.ai/code)

    Co-Authored-By: Claude <noreply@anthropic.com>

commit 1121642
Author: happy-devs <andrew@happysoft.dev>
Date:   Tue May 27 21:40:10 2025 +0300

    revert CORS

commit d2ac4de
Author: Andrew Maguire <andrew@happysoft.dev>
Date:   Tue May 27 21:00:37 2025 +0300

    remove legacy Sengrid code

commit 217de9c
Author: happy-devs <andrew@happysoft.dev>
Date:   Tue May 27 13:21:36 2025 +0300

    CORS updates

    - Set allow_origins to ["*"] for production mode
    - Disable credentials when using wildcard origins (CORS requirement)
    - Update CORSHandlerMiddleware to handle all origins properly
    - Maintain localhost support with credentials for local development

    🤖 Generated with [Claude Code](https://claude.ai/code)

commit 066834c
Author: happy-devs <andrew@happysoft.dev>
Date:   Tue May 27 12:46:29 2025 +0300

    Update authentication.py

commit da87d14
Merge: d17d498 7d83386
Author: happy-devs <andrew@happysoft.dev>
Date:   Tue May 27 12:34:15 2025 +0300

    Merge branch 'main' into dev

commit d17d498
Author: happy-devs <andrew@happysoft.dev>
Date:   Tue May 27 12:09:39 2025 +0300

    Squashed commit of the following:

    commit 70c750e
    Author: happy-devs <andrew@happysoft.dev>
    Date:   Sun May 25 23:23:06 2025 +0300

        updates

    commit d25cb1e
    Author: happy-devs <andrew@happysoft.dev>
    Date:   Sun May 25 23:22:34 2025 +0300

        factory updates

    commit 2beb502
    Author: happy-devs <andrew@happysoft.dev>
    Date:   Fri May 23 21:52:10 2025 +0300

        update digest attempts

    commit 9c86f15
    Author: happy-devs <andrew@happysoft.dev>
    Date:   Wed May 14 22:23:22 2025 +0300

        add email digest logic

    commit 9e1b804
    Merge: 3453c0d 5203c91
    Author: happy-devs <andrew@happysoft.dev>
    Date:   Wed May 14 19:27:30 2025 +0300

        Merge dev branch into features/email-sending, resolving .env.example conflicts

    commit 3453c0d
    Author: happy-devs <andrew@happysoft.dev>
    Date:   Thu Apr 17 11:40:15 2025 +0300

        initial routers / tests

    commit fef9710
    Author: happy-devs <andrew@happysoft.dev>
    Date:   Thu Dec 19 16:40:00 2024 +0000

        Config: set up router / methods using sendgrid

commit a9f3ab5
Author: happy-devs <andrew@happysoft.dev>
Date:   Sun May 25 23:23:57 2025 +0300

    enhance trends endpoint

commit 9557a90
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu May 22 00:25:55 2025 +0300

    update user groups issue

commit 5203c91
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed May 14 19:23:04 2025 +0300

    Update .gitignore

commit b9ad11f
Merge: 75602d8 1e0324f
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed May 14 19:20:14 2025 +0300

    Merge branch 'main' into dev

commit 75602d8
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed May 14 19:15:41 2025 +0300

    update user group calls

commit b30d588
Author: happy-devs <andrew@happysoft.dev>
Date:   Tue May 13 15:47:04 2025 +0300

    update user groups calls

commit b620e43
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu May 8 01:49:38 2025 +0300

    Enhance user groups functionality and improve API robustness

commit e2a310b
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed Apr 30 15:52:42 2025 +0300

    update app configuration with bugsnag

commit e5d9e22
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed Apr 30 15:35:27 2025 +0300

    configure application with bugsnag

commit cc3104b
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed Apr 30 15:17:26 2025 +0300

    add emails to user group routes

commit 85fd193
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed Apr 30 14:44:49 2025 +0300

    add endpoints to get auth user's groups + signals

commit a0beb02
Author: Andrew Maguire <andrew@happysoft.dev>
Date:   Wed Apr 30 12:36:09 2025 +0100

    Collaborative signal editing (user groups etc) (#9)

    * full routers / entities / test setup

    * update methods

    * Delete signal_collaborators.sql

    ---------

    Co-authored-by: amaguire-undp <andrew.maguire@undp.org>

commit 66dc248
Author: happy-devs <andrew@happysoft.dev>
Date:   Mon Apr 28 23:39:05 2025 +0300

    Update signal.py

commit 1966fb3
Author: happy-devs <andrew@happysoft.dev>
Date:   Mon Apr 28 22:58:19 2025 +0300

    Fix: Update Python setup action to v4 and fix cache configuration

commit 56b62f6
Merge: 5cd85fe 099bb75
Author: happy-devs <andrew@happysoft.dev>
Date:   Mon Apr 28 20:00:04 2025 +0300

    Merge branch 'dev' of https://github.com/UNDP-Data/ftss-api into dev

commit 5cd85fe
Merge: c58a539 501a20f
Author: happy-devs <andrew@happysoft.dev>
Date:   Mon Apr 28 19:59:59 2025 +0300

    Merge branch 'feature/secondary-country' into dev

commit 099bb75
Author: Andrew Maguire <andrew@happysoft.dev>
Date:   Mon Apr 28 17:58:46 2025 +0100

    Add secondary country to signals data (#10)

    * initial routes

    * update methods

commit 501a20f
Author: happy-devs <andrew@happysoft.dev>
Date:   Mon Apr 28 19:57:57 2025 +0300

    update methods

commit 4b2ca90
Author: andrew-maguire <andrew@happysoft.dev>
Date:   Mon Apr 28 15:47:46 2025 +0300

    initial routes

commit c58a539
Merge: 29adada 42f6086
Author: happy-devs <andrew@happysoft.dev>
Date:   Wed Apr 23 11:15:39 2025 +0300

    Merge branch 'dev' of https://github.com/UNDP-Data/ftss-api into dev

commit 42f6086
Author: Andrew Maguire <andrew@happysoft.dev>
Date:   Tue Apr 22 01:13:46 2025 +0300

    .env updates (#8)

    * env updates

    * update example env

commit 29adada
Author: happy-devs <andrew@happysoft.dev>
Date:   Thu Apr 17 12:19:56 2025 +0300

    env updates

commit cd47b8d
Author: Andrew Maguire <andrew@happysoft.dev>
Date:   Tue Jan 14 17:45:26 2025 +0200

    Feature: User favourites (#2)

    * Feature: initial routers / methods for favourites

    - add env documentation / adminer image for easier inspection of db
    - create / delete favourite entry in database
    - fetch list of favourites by user

    * Chore: update formatting, tests

    * update test methods / logging

    -

    * updates

    * expand tests / logging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants