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: link to strategy edit screens from playground strategy results #4063

Merged

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Jun 22, 2023

This PR adds links from the strategy evaluation results directly to the strategy edit screen.

If the code doesn't find any links, nothing changes.

The link text will be the name of the strategy and the title (if it exists).

image

@vercel
Copy link

vercel bot commented Jun 22, 2023

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

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2023 11:43am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Jun 22, 2023 11:43am

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.

Something is not right with the type

@@ -106,6 +107,13 @@ export const StrategyItemContainer: FC<IStrategyItemContainerProps> = ({
const Icon = getFeatureStrategyIcon(strategy.name);
const { uiConfig } = useUiConfig();

// @ts-expect-error IFeatureStrategy doesn't have links
Copy link
Contributor

Choose a reason for hiding this comment

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

I would solve it without ignoring typechecker. When I checked out your branch none of the union elements had a links field

Copy link
Contributor

Choose a reason for hiding this comment

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

AFter we get the links on one of the union element we can play around with type aliases and ternany operators so that we don't have to opt out of type safety

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair! I'll rebase off main now that the Orval updates have been merged and see if that fixes it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found out that you can use the 'x' in y pattern in d10a54b. Seems like it does just what we want?

Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly!

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.

Very elegant solution together with the backend changes you made before.

@thomasheartman thomasheartman enabled auto-merge (squash) June 22, 2023 11:46
@thomasheartman thomasheartman merged commit e824d83 into main Jun 22, 2023
16 checks passed
@thomasheartman thomasheartman deleted the feat/link-to-strategy-edit-screen-from-playground branch June 22, 2023 11:51
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