Skip to content
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

Campaign Applications (alpha) #1930

Merged

Conversation

gparlakov
Copy link
Contributor

Editing and file upload and admin section for campaign applications - finalizes first alpha version of the whole process

feat: file upload and summary

  • handle file upload one by one to allow for handling errors individually (otherwise the server just returns response failed for any one file that fails and no information about the successful uploads)
  • add summary where the uploaded and failed (if any) files are top and center
  • add a short explanation of what to do about failed files
  • feat: validation of create campaign application
  • fix: send campaignTypeId + editing + visuals

send campaignTypeId instead of the category (which is a property of the campaign type and is not enough to uniquely distinguish the type)

  • allow for editing and re-editing
  • style the summary
  • fix linting errors

chore: test create application

  • moved the useCreateOrEditApplication hook to own file to reuse for the admin campaign edit
  • added campaign end date handling (if the user selects a date for the end it pops up an input and fills in the preselected by user date or today if none)
  • removed some unused props from the cam app details
  • added msw v1 https://v1.mswjs.io/docs/getting-started/mocks/rest-api to mock the server responses for testing (Mock Service Worker)
  • expanded the test setup to provide Session and QueryClient

chore: add tests for the createOrEdit application hook

feat: admin edit

  • it uses the same controls/steps as the organizer edit but adds the admin only props on top
  • adds a link and copy button for the link where organizer can edit so as to include it if sending a mail to the org (e.g. for more info)
  • deletes the admin types - using same as regular
  • adds the status dropdown for admin edit
  • allows the accept terms checkboxes to be disabled for admin

feat: actual list of campaign applications

#1842

Screenshots:

Before After
https://drive.google.com/file/d/15LWbhsaTiZxSnytUefZ6zHJ-T4w4158e/view?usp=sharing

Testing

Steps to test

  • prerequisites - running frontend + api + (docker compose) pg-db keycloak + s3-ninja + file upload config + email intergration
  • visit the create/edit campaign for organizers i.e. /campaigns/application and /campaigns/application/:id (i.e. https://localhost:3040/campaigns/application) and create a new campaign
    • expected
    • to be able to edit it from the created successful campaign application summary page
    • to receive an email (working email integration required )
  • login as admin and visit admin/campaign-applications
  • expected - list of applications
  • click on name of an application should navigate to admin edit (e.g. admin/campaign-applications/edit/eb4347a2-c8b4-47f1-83e5-67457b20909c) where everything from organizer edit should be available + admin edit props + the "organizer can edit at" link

Affected urls

/campaigns/application
/campaigns/application/eb4347a2-c8b4-47f1-83e5-67457b20909c
/admin/campaign-applications
/admin/campaign-applications/edit/eb4347a2-c8b4-47f1-83e5-67457b20909c

New or updated dependencies:

Dependency name Previous version Updated version Details
msw v1.x.x - DEV mock service worker allows for mocking server responses in tests

Copy link

github-actions bot commented Sep 13, 2024

✅ Tests will run for this PR. Once they succeed it can be merged.

@gparlakov gparlakov marked this pull request as ready for review September 13, 2024 16:29
- handle file upload one by one to allow for handling errors individually (otherwise the server just returns response failed for any one file that fails and no information about the successful uploads)
- add summary where the uploaded and failed (if any) files are top and center
- add a short  explanation of what to do about failed files
- send campaignTypeId instead of the category (which is a property of the campaign type and is not enough to uniquely distinguish the type)
- allow for editing and re-editing
- style the summary
- fix linting errors
- moved the useCreateOrEditApplication hook to own file to reuse for the admin campaign edit
- added campaign end date handling (if the user selects a date for the end it pops up an input and fills in the preselected by user date or today if none)
- removed some unused props from the cam app details
- added msw v1 https://v1.mswjs.io/docs/getting-started/mocks/rest-api to mock the server responses for testing (Mock Service Worker)
- expanded the test setup to provide Session and QueryClient
- it uses the same controls/steps as the organizer edit but adds the admin only props on top
- adds a link and copy button for the link where organizer can edit so as to include it if sending a mail to the org (e.g. for more info)
- deletes the admin types - using same as regular
- adds the status dropdown for admin edit
- allows the accept terms checkboxes to be disabled for admin
@gparlakov gparlakov force-pushed the admin-list-campaign-appications-actual branch from 6fd5644 to 14cb2cc Compare September 21, 2024 04:21
@sashko9807 sashko9807 added the run tests Allows running the tests workflows for forked repos label Sep 24, 2024
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Sep 24, 2024
@sashko9807 sashko9807 merged commit 3a912bf into podkrepi-bg:master Sep 25, 2024
11 of 12 checks passed
@gparlakov gparlakov deleted the admin-list-campaign-appications-actual branch September 25, 2024 18:14
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.

3 participants