Skip to content

Create campaign page redesign #583

Description

@KavikaPalletenne

TLDR: Change the flow of this page.
Image

This should be the new flow:

  1. Only show this stuff first, and a create button. No tabs for roles & review.
Image
  1. When you create a campaign on this page, it should default to not published. Then in the /organisation/{organisation_id}/campaign/{campaign_id}/edit page, there should be another tab called "Review" and a "Publish" button.

  2. After backend returns a successful creation message with new campaign id, redirect to a /organisation/{organisation_id}/campaign/{campaign_id}/edit page that will contain sections (different tabs) for roles & questions (not the same tab for both like currently). We need two tabs like this:

Image
  1. For the roles section, it should support inputs for all variables in the RoleUpdate struct in the backend.

  2. For the questions section, look at Peter's form creation component under /frontend/src/pages/create_question/index.tsx. For each of the roles + "General", create tabs within this section, and add a question editor component. So you will have Tab for Questions -> Tab for the Role -> question creation component. You might need to update component/backend to accept the format. Format of new questions that the backend understands:

{
    "title": "What languages do you know?",
    "description": "This is important",
    "common": true,
    "roles": [123123123, 123456],
    "required": true
    "question_type": "MultiChoice",
    "data": {
        "options": [
            {
                "id": JUST DO SOME ARBITRARY NUMBER LIKE 1,
                "display_order": 1,
                "text": "Rust"
            },
            {
                "id": JUST DO SOME ARBITRARY NUMBER LIKE 1,
                "display_order": 2,
                "text": "JavaScript"
            }
        ]
    }
}

NOTES:

  • Don't worry about attaching questions to multiple roles.
  • Send each question one at a time when they click "Save" button at bottom.
  • Make sure you add loading states for buttons with lockouts. Add asterisks for mandatory inputs (only input without one will be role description)

Metadata

Metadata

Assignees

Labels

A: BackendBackend related issuesA: FrontendFrontend related issues

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions