-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
feat: link to strategy edit screens from playground strategy results #4063
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly!
26cc9ff
to
d10a54b
Compare
There was a problem hiding this 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.
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).