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

[SHEP-2] UI Created to Split a Single Campaign into Multiple Campaigns #268

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

akhan-mozilla
Copy link
Contributor

@akhan-mozilla akhan-mozilla commented Sep 30, 2024

References

SHEP-2

Problem Statement

With the automatic creation of a child campaign when new booster deals are imported, we need a UI that allows to split a single campaign into multiple campaigns.

Proposed Changes

Split Campaign Form Added to Allow Users to Split a Single Campaign into Multiple Campaigns.

Verification Steps

  1. Click on the "Split Campaign" icon on the Campaigns list page.
  2. Click on the plus icon to split the campaign into multiple campaigns.
  3. Add details for the newly created campaign.
  4. Ensure the total net spend for the campaigns matches the actual value of the campaign before the split.

Visuals

Split_Campaign_feature.mov

@akhan-mozilla akhan-mozilla requested a review from a team as a code owner September 30, 2024 18:40
@kauana
Copy link
Contributor

kauana commented Sep 30, 2024

Hey @akhan-mozilla how to run the app locally? I've run docker compose up --build inside dashboard and then access it at 0.0.0.0:5173. I'm getting this error:
image

Have you seen this before?

@@ -14,6 +18,31 @@ export const useGetCampaignsQuery = () => {

return getCampaigns;
};

export const useSplitCampaignMutation = () => {
Copy link
Contributor

@cyptm cyptm Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we plan on defining return types for some of these functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we already have types defined for all the mutate return functions used in there, we don't have to define the type here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

toast.error("An unexpected error occurred");
}
},
onSuccess: (data) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we define the type for data?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the data returned in onSuccess here isn't being used, so I removed it. I'll check for any other missing return types and add them.

@akhan-mozilla
Copy link
Contributor Author

Hey @akhan-mozilla how to run the app locally? I've run docker compose up --build inside dashboard and then access it at 0.0.0.0:5173. I'm getting this error: image

Have you seen this before?

It seems the boostrProducts table is empty for you. However, I've updated the dashboard page to prevent errors when no product data is available.

@kauana
Copy link
Contributor

kauana commented Oct 1, 2024

Ok new error when I click on Campaign and "Add Data"

(Note that I've run the boostr script to populate the boostr product table)

image

@akhan-mozilla
Copy link
Contributor Author

Ok new error when I click on Campaign and "Add Data"

(Note that I've run the boostr script to populate the boostr product table)

image

This doesn't seem to be related to the Boostr products since you are creating the campaigns. I just added a quick update; could you please try creating the new campaign again?

@kauana
Copy link
Contributor

kauana commented Oct 2, 2024

Can we please add the Jira story to the PR title so once we squash and merge it we can keep track of it?

@akhan-mozilla akhan-mozilla changed the title UI Created to Split a Single Campaign into Multiple Campaigns [SHEP-2] UI Created to Split a Single Campaign into Multiple Campaigns Oct 2, 2024
@kauana kauana self-assigned this Oct 3, 2024
@mashalifshin
Copy link
Contributor

mashalifshin commented Oct 4, 2024

@akhan-mozilla Just popping in to make a quick reminder to manually run make eslint on these changes, since the CI checks don't do that for you yet.

(Just to be clear, not saying you should address any lint issues that aren't related to this PR, there are some on main already as you captured in SHEP-91(https://mozilla-hub.atlassian.net/browse/SHEP-91, but just wanted to make the reminder because it's so hard to remember when it doesn't happen automatically)

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.

4 participants