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: suggest strategy from template #2340

Merged
merged 8 commits into from Nov 9, 2022
Merged

Conversation

Tymek
Copy link
Member

@Tymek Tymek commented Nov 8, 2022

About the changes

Add "change request" to buttons in empty environment - adding with "Use template".

Closes 1-348/add-strategy-to-draft-with-use-template

Important files

frontend/src/component/feature/FeatureStrategy/FeatureStrategyEmpty/FeatureStrategyEmpty.tsx

Discussion points

  • Maybe we should refactor how we use "Dialog" confirmations, for example to use React Portals? This can make frontend logic more self-contained.

@vercel
Copy link

vercel bot commented Nov 8, 2022

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

Name Status Preview Comments Updated
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Nov 9, 2022 at 8:25AM (UTC)
1 Ignored Deployment
Name Status Preview Comments Updated
unleash-docs ⬜️ Ignored (Inspect) Nov 9, 2022 at 8:25AM (UTC)

Copy link
Contributor

@kwasniew kwasniew left a comment

Choose a reason for hiding this comment

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

Works fine in manual testing, however I'd consider "slots not props" approach to avoid prop drilling and pass children instead.

onAfterAddStrategy: () => void;
}

export const AddFromTemplateCard: FC<IAddFromTemplateCardProps> = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd consider adding PresetCard as {children} to avoid prop-drilling title, children, stretegy, Icon, onAfterAddStrategy. More info about this technique: https://www.youtube.com/watch?v=3XaXKiXtNjw&ab_channel=ReactTraining

Copy link
Member Author

@Tymek Tymek Nov 9, 2022

Choose a reason for hiding this comment

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

I got rid of PresetCard, embedded the code in parent. At this point it was just styling. I couldn't entirely move it to {children} because of onClick action handler.

@Tymek Tymek enabled auto-merge (squash) November 9, 2022 08:29
@Tymek Tymek merged commit d998f4c into main Nov 9, 2022
@Tymek Tymek deleted the feat/suggest-strategy-from-template branch November 9, 2022 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants