-
-
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: add push to all button to UI #2969
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
padding: theme.spacing(0), | ||
}, | ||
}, | ||
})); |
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 was thinking and if we want to make it perfect maybe we shouldn't remove the padding from the li
s. It looks very good overall but the hover effect on the items looks a bit weird. Maybe we should remove some of these specifics, clean some of this up, and try to only style a div
for the separator and button below, but I'm not sure.
Something we can run by @NicolaeUnleash and see what he thinks.
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 think we can iterate on the details later, so we can have this ready to be shipped with 4.20. Also, maybe we should have a .styles.ts file as specified here?
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.
Yeah, good point.
We are actually moving away from .styles.ts
files and preferring styled components like you're doing here instead, so this looks good as is.
...ureView/FeatureVariants/FeatureEnvironmentVariants/PushVariantsButton/PushVariantsButton.tsx
Show resolved
Hide resolved
const [pushToAnchorEl, setPushToAnchorEl] = useState<null | HTMLElement>( | ||
null | ||
); | ||
const pushToOpen = Boolean(pushToAnchorEl); |
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.
In terms of code organisation since this is a computation based on a state, maybe it belongs some lines below instead, but it's a tiny nitpick based on preference.
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.
It was some lines below, but I moved it up to keep the related components together... otherwise, you may think you need to use pushToAnchorEl
for reading the state and never realize that there's a pushToOpen
that should be used instead... which is a bit confusing IMO but 🤷
} catch (e) { | ||
throw e; | ||
} | ||
}; |
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 know that this is copy pasted from the other methods, and we always do it like this, me included. Not sure about the original reasoning but the fact is that this could optionally be simplified.
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 believe the try catch throwing an exception without doing anything is pointless... I could just replace:
try {
const res = await makeRequest(req.caller, req.id);
return res;
} catch (e) {
throw e;
}
with
return makeRequest(req.caller, req.id);
and now there's no need to await
because it's the return statement.
But it's specified that way in this ADR. Maybe the intent of the ADR was to say that you should do something with the exception? Or perhaps it's something we carried away from another place... 🤙 @FredrikOseberg who may have more context
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.
Looks great! But since I'm a bit biased from us pairing you may want another pair of eyes just in case 😄
…tureEnvironmentVariants/PushVariantsButton/PushVariantsButton.tsx Co-authored-by: Nuno Góis <github@nunogois.com>
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'm inclined to merge and move fast, then come back if needed, just to be able to release this week. I'm going to share in standup and make a decision there
padding: theme.spacing(0), | ||
}, | ||
}, | ||
})); |
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 think we can iterate on the details later, so we can have this ready to be shipped with 4.20. Also, maybe we should have a .styles.ts file as specified here?
const [pushToAnchorEl, setPushToAnchorEl] = useState<null | HTMLElement>( | ||
null | ||
); | ||
const pushToOpen = Boolean(pushToAnchorEl); |
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.
It was some lines below, but I moved it up to keep the related components together... otherwise, you may think you need to use pushToAnchorEl
for reading the state and never realize that there's a pushToOpen
that should be used instead... which is a bit confusing IMO but 🤷
} catch (e) { | ||
throw e; | ||
} | ||
}; |
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 believe the try catch throwing an exception without doing anything is pointless... I could just replace:
try {
const res = await makeRequest(req.caller, req.id);
return res;
} catch (e) {
throw e;
}
with
return makeRequest(req.caller, req.id);
and now there's no need to await
because it's the return statement.
But it's specified that way in this ADR. Maybe the intent of the ADR was to say that you should do something with the exception? Or perhaps it's something we carried away from another place... 🤙 @FredrikOseberg who may have more context
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.
LGTM
I see there's small detail chatter going on here. Agree some of it makes sense but it also might be worth doing in a separate PR due to time pressure around this one?
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'm concurring with Simon and Nuno here. This looks good. The small nits around catching and rethrowing can be solved in a separate PR; it won't block us moving forward.
This is what I plan to do, and I'll take in all comments in another PR. For others: do comment, I'll check them later |
About the changes
This adds the push to all button to the UI
Relates to roadmap item: #2254
UI