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

Update UI dependencies #33

Merged
merged 24 commits into from
Sep 13, 2022

Conversation

deadlycoconuts
Copy link
Contributor

@deadlycoconuts deadlycoconuts commented Sep 2, 2022

Context

With the update of mlp-ui dependencies in caraml-dev/mlp#54 and caraml-dev/mlp#55 (in particular the update of Node.js 14 → 16, React 16 → 17, @elastic/eui 32.3.0 → 66.0.0 and react-scripts to 5.0.1), there is a need to similarly update XP UI, as it uses components from and is dependent on the mlp-ui package.

Main Modifications

  • Replacement of the existing Empty component with the new Page404 component
  • Extensive adoption of the new EuiPageTemplate (see https://elastic.github.io/eui/#/templates/page-template) to manage page layouts; this replaces the existing usage of EuiPage, EuiPageHeader, EuiPageSection, etc. components
  • Update of the existing colour palette manually specified to align with those of v66 of @elastic/eui (see https://eui.elastic.co/#/theming/colors/values)
  • Removal of redundant CSS styling used to accommodate EuiFlyouts
  • Replacement of the caret toggle used inn Segmenter cards with a gear
    Screenshot 2022-09-05 at 6 39 43 PM

Fixes

Inconsistent spacing between page title and MLP bar

Before

Experiment/Treatment/Segment Details View:                       Experiment/Treatment/Segment Edit View:
.

After

Experiment/Treatment/Segment Details View:                       Experiment/Treatment/Segment Edit View:
.

Known Issues (Unable to be addressed in this PR)

  • To follow up on mlp-ui to fix the StepsWizardHorizontal component as it does not seem to be highlighting as users progress through the timeline steps:
    Screenshot 2022-09-05 at 9 37 21 AM

@deadlycoconuts deadlycoconuts self-assigned this Sep 2, 2022
@deadlycoconuts deadlycoconuts marked this pull request as ready for review September 7, 2022 06:27
@deadlycoconuts deadlycoconuts requested a review from a team September 7, 2022 06:27
@krithika369
Copy link
Collaborator

This PR is larger than the one for Turing. 😱 😅

@terryyylim could you have the first pass at this when you get to it? I'll be the second set of eyes this time.

Copy link
Contributor

@terryyylim terryyylim left a comment

Choose a reason for hiding this comment

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

Largely LGTM, just some small comments to address. Thank you for the PR, @deadlycoconuts!

</EuiCallOut>
) : (
<Fragment>
{!(props["*"] === "edit") ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we do {!(props["*"] === "edit") && (...) here instead so we can be more concise and remove <></>?

</EuiPanel>
</ConfigSection>
<Fragment>
<EuiSpacer size="m" />
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if this EuiSpacer gets removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This happens

Screenshot 2022-09-12 at 12 31 47 AM

vs

Screenshot 2022-09-12 at 12 31 10 AM


const ExperimentHistoryDetailsView = ({ projectId, experimentId, version }) => {
const { appConfig } = useConfig();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we standardise with other files, to just extract variables we need? i.e restrictWidth and paddingSize in this case.

@@ -78,14 +76,14 @@ const SearchExperimentFilters = ({ onChange }) => {

return (
<>
<EuiFlyoutHeader hasBorder className="searchPanelFlyoutHeader">
Copy link
Contributor

Choose a reason for hiding this comment

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

It just works? 🎉 Just curious, was this somehow fixed in some version of EUI which was after our current version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea it just does. I don't know why the original header's margin was stretched by an additional 20px to the right; maybe it's to enable the 'Reset' button to lie further right than could be done normally?
Screenshot 2022-09-12 at 12 45 59 AM

The same effect is now achieved by making the EuiFlexItem containing the button not grow, which causes the EuiFlexGroup to allocate more space for the 'Filters' header instead:
Screenshot 2022-09-12 at 12 43 08 AM

ui/src/experiments/list/search/SearchExperimentsPanel.js Outdated Show resolved Hide resolved
ui/src/segments/create/CreateSegmentView.js Outdated Show resolved Hide resolved
ui/src/segments/details/SegmentDetailsView.js Outdated Show resolved Hide resolved
ui/src/settings/edit/EditSettingsView.js Outdated Show resolved Hide resolved
ui/src/settings/segmenters/details/SegmenterDetailsView.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@krithika369 krithika369 left a comment

Choose a reason for hiding this comment

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

I've partially reviewed this PR and left a few small comments. Will complete it on Monday.

@@ -34,7 +34,7 @@ export const BasicTable = ({
iconType="alert">
<p>{error.message}</p>
</EuiCallOut>
) : !!onPaginationChange && !!totalItemCount & !!page ? (
) : !!onPaginationChange && !!totalItemCount && !!page ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for catching this. 😅

ui/src/experiments/list/search/SearchExperimentsPanel.js Outdated Show resolved Hide resolved
Copy link
Contributor

@terryyylim terryyylim left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the changes @deadlycoconuts 👍🏻 We can merge it once @krithika369 has another look.

Copy link
Collaborator

@krithika369 krithika369 left a comment

Choose a reason for hiding this comment

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

LGTM too. Thanks for this PR and refactoring some of the components along the way. I left some small comments. Please feel free to merge once they have been addressed.

ui/src/experiments/list/search/SearchExperimentsPanel.scss Outdated Show resolved Hide resolved
@@ -2,11 +2,11 @@ export const getSegmenterScope = (scope) => {
const status = {
project: {
label: "Project",
color: "primary",
color: "#07C",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do primary / success no longer work for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I made a mistake with the changes here; I thought the primary colours weren't working with primary/success specified because they seemed to be of a paler shade (so I changed them manually to the brighter ones we see in other parts of the new EUI theme):

Screenshot 2022-09-13 at 10 40 40 AM

But after checking out the docs again for EuiBadge, it seems like they are indeed of the intended shade:

Screenshot 2022-09-13 at 10 47 16 AM

I'll change these values back to primary/success in this case then 😅

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah the default color palette is fine. Not sure why the Eui team decided to keep the old colors for some components like Text and this one..

@@ -19,19 +19,19 @@ export const getExperimentStatus = (experiment) => {
},
Completed: {
label: "Completed",
color: "#017D73",
color: "#00BFB3",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we replace the color values here with the healthColor values (and replace the property name healthColor with color in the app)? The current color values are only used in the Eui badge from what I see and they should be able to accept primary / success / ...

Copy link
Contributor Author

@deadlycoconuts deadlycoconuts Sep 13, 2022

Choose a reason for hiding this comment

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

Similar issue here as the above - it seems like EuiHealth also uses a darker shade (kind of like in the older versions of the theme) of all the colours instead of the more exciting ones we've been seeing. I should checked this more thoroughly before I guess 👀 In any case, I've replaced the color values with the healthColor values (subdued/success/warning/primary) and removed the healthColor values completely. Any component that used to consume healthColor values now consume the new (reverted) color values.
Screenshot 2022-09-13 at 10 55 49 AM

ui/src/services/segmenter/SegmenterStatus.js Outdated Show resolved Hide resolved
initialIsOpen={variables.length > 1}
buttonContent={buttonContent}
arrowDisplay="none"
extraAction={
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! Thanks for this.

@deadlycoconuts
Copy link
Contributor Author

Thank you @terryyylim and @krithika369 for the detailed review! I should've addressed all (if not most 👀) of all the comments that both of you have left 🙂 I'll be merging this soon once the CI pipeline passes 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants