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

feat(medusa,types): create promotion flows #7029

Merged
merged 17 commits into from
Apr 23, 2024
Merged

Conversation

riqwan
Copy link
Contributor

@riqwan riqwan commented Apr 9, 2024

what:

  • create promotion flows

Copy link

changeset-bot bot commented Apr 9, 2024

🦋 Changeset detected

Latest commit: d037de1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@medusajs/medusa Patch
@medusajs/types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2024 9:18am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Apr 23, 2024 9:18am
docs-ui ⬜️ Ignored (Inspect) Visit Preview Apr 23, 2024 9:18am
medusa-docs ⬜️ Ignored (Inspect) Visit Preview Apr 23, 2024 9:18am

@riqwan riqwan marked this pull request as ready for review April 15, 2024 12:33
@riqwan riqwan requested a review from a team as a code owner April 15, 2024 12:33
Copy link
Contributor

@fPolic fPolic left a comment

Choose a reason for hiding this comment

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

Looks pretty good overall 💪

I've added a few comments.

)

return (
<Fragment key={index}>
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: let fieldRile.id be key here

Comment on lines 32 to 35
zod.number().min(1, { message: "Required field" }),
zod.string().min(1, { message: "Required field" }),
zod.array(zod.string()).min(1, { message: "Required field" }),
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: should translate the messages as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you do the translation outside the function? @fPolic

Copy link
Contributor

Choose a reason for hiding this comment

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

yes:

     import i18n from "i18next"

     // ...
     
    zod.string().min(1, { message:  i18n.t("message.key")),

<Form.Item className="mb-2">
{fieldRule.required && (
<p className="text text-ui-fg-muted txt-small">
Required
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: translate

ref={attributeRef}
className="bg-ui-bg-base"
>
<Select.Value placeholder="Select Attribute" />
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: translate

<div className="absolute top-0 bottom-0 left-[40px] z-[-1] border-ui-border-strong w-px bg-[linear-gradient(var(--border-strong)_33%,rgba(255,255,255,0)_0%)] bg-[length:1px_3px] bg-repeat-y"></div>

<Badge size="2xsmall" className=" text-xs">
AND
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: translate

Comment on lines 232 to 238
console.log("subKey - ", subKey)
console.log("subValue - ", subValue)
form.setValue(subKey, subValue)
}
} else {
console.log("key - ", key)
console.log("value - ", value)
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: rm logs

<ProgressTabs
value={tab}
onValueChange={(tab) => handleTabChange(tab as Tab)}
className=""
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: rm

min={0}
onValueChange={onChange}
code={"USD"}
symbol={getCurrencySymbol("USD")}
Copy link
Contributor

Choose a reason for hiding this comment

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

question: why is the amount set in USD...shouldn't this be disabled until currency_code section is selected? If so we can disable the input and add a tooltip to explain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right. This can't be done right now because we're accepting a multi select for currencies. There is a ticket in the followup that makes it just a singular currency, this will be changed when that is done.

targetRules,
buyRules,
campaigns,
}) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: missing prop types

</div>
)}

<RulesFormField
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: add currency codes to currency_code dropdown

@riqwan
Copy link
Contributor Author

riqwan commented Apr 17, 2024

@fPolic good to merge?

Copy link
Contributor

@fPolic fPolic left a comment

Choose a reason for hiding this comment

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

Approved since the rest of the comments will be addressed in follow up tickets.

const { campaigns } = useCampaigns()

return (
<RouteFocusModal>
Copy link
Contributor

Choose a reason for hiding this comment

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

todo: there is x-axis scrollbar visible especially stands out when you turn on dark mode

…edit-rules/edit-rules.tsx

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
Copy link
Contributor

kodiakhq bot commented Apr 23, 2024

This PR currently has a merge conflict. Please resolve this and then re-add the automerge label.

@riqwan riqwan merged commit 93ef94c into develop Apr 23, 2024
24 checks passed
@riqwan riqwan deleted the feat/create-promotion branch April 23, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: admin Created by Linear-GitHub Sync team: medusa
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants