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

[Composable template] Preview composite template #72598

Merged
merged 23 commits into from
Jul 24, 2020

Conversation

sebelga
Copy link
Contributor

@sebelga sebelga commented Jul 21, 2020

This PR adds the "Preview template" functionality to composable templates.

The user can preview the final composite template in 3 places

  • In the details flyout

Screenshot 2020-07-21 at 11 42 17

  • At any time during the creation/editing wizard flow (clicking on the "Preview template" button)

Screenshot 2020-07-21 at 11 05 34

  • In the final "Review" step of the wizard, under the "Preview" tab

Screenshot 2020-07-21 at 11 45 03

How to test

  • Click on a composable template in the table and verify that the preview tab renders correctly in the flyout
  • In the wizard (creation or editing), there should be a button to open the "Preview" flyout. If you are on the "Component templates" step or the "Mappings" step, you should be able to switch the flyout content (by clicking on a Component template name or by clicking the "edit" icon on a mappings field).

If you want to test the back and forth between flyouts you might need to set the zoom level to 50% in order to see the "Preview template" button all the time. See the image below

Screenshot 2020-07-21 at 11 05 23

Notes for the mappings editor

I had to lift the <StateProvider /> up and wrap the app with it so we consume its component anywhere in the app. For this PR we needed to be able to open the <EditField /> flyout content inside the global Flyout.

This change implied a big refactor, with logic that got moved in new files but that hasn't been touched.

Note for reviewer

I would recommend to follow the commits history for the review as it builds incrementally the feature and changes made.

Release notes

We have added the possibility to preview the final composite of a composable template. The user will be able to see this preview from the creation or editing wizard flow, or when looking at the details of a composable template.

TODO

In follow-up PRs I will

  • Add tests for the FlyoutMultiContent
  • Add a README.md for the FlyoutMultiContent
  • Text copy review
  • Add UI component that lets the user select which part of the preview he wants to see
  • Improve UX around the "Update" button

@sebelga sebelga requested a review from a team as a code owner July 21, 2020 09:56
@sebelga sebelga requested a review from jloleysens July 21, 2020 09:58
@sebelga sebelga added Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.10.0 v8.0.0 labels Jul 21, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@apmmachine
Copy link
Contributor

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #72598 updated]

  • Start Time: 2020-07-21T13:50:27.356+0000

  • Duration: 2 min 8 sec

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

@sebelga Great work!

I think the preview tab is going to be super helpful to users and really helps solidify how component templates and templates fit together 🤓!

Overall I only found one bug that I think we should look into, but otherwise I think this is good to go!

UI/UX

  • I noticed the flyout has an "Update" button, but it didn't look I needed to ever press it. Is there a case in which you think this button will be needed? If not, perhaps we can remove it.

Screenshot 2020-07-21 at 17 11 38

  • As mentioned in the code comments, it would be good to get es-docs@ to take a look at the new copy.

Screenshot 2020-07-21 at 17 13 10

Bugs

  • When editing a mapping in the mappings editor, selecting "Field type" and pressing backspace resulted in the UI crashing with:

Screenshot 2020-07-21 at 17 07 29

Screenshot 2020-07-21 at 17 09 38

@cjcenizal
Copy link
Contributor

@sebelga I love how we're making the interaction between index templates and component templates more transparent to users with this feature! At the same time I have some UX concerns. Can you help me understand a couple things?

What's the thinking behind exposing the user to the entire set of composed configurations at every step?

For example, let's say I'm looking at the component templates step:

image

At this step, I'm asking myself, "How do these component templates combine?" In the current UX, the preview shows the final output, so if a configuration from a later step overrides the configuration of the component templates I see here, then I will be confused about the connection between the information on the screen. If we show the user just the result of the component templates they've selected (which can be implemented with a special simulate call) then we can avoid this confusion. I'd assume the user would go to the Review step any time they want to see the end result.

Similarly, let's say I'm editing settings:

image

At this point the question I'm asking myself is, "How do these settings override those of the component templates?" But if the preview is full of mappings information, I need to hunt through the preview to find the information I need. This is really frustrating when the object is large. This UX pain point applies to the mappings and aliases tabs too.

Did you consider a UX in which we only show the user pertinent information at every step? I think there are some interesting UX benefits we could provide if we explored this approach. For example, we could render errors that are specific to a step by building step-specific simulate requests that exclude configurations from the other steps. I'm picturing the error below rendered next to the Settings JSON editor:

image

Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
@sebelga
Copy link
Contributor Author

sebelga commented Jul 22, 2020

Thanks for the review @jloleysens and @cjcenizal !

I noticed the flyout has an "Update" button, but it didn't look I needed to ever press it. Is there a case in which you think this button will be needed? If not, perhaps we can remove it.

I haven't noticed that, I will check 👍 Do you remember in which flyout this occurs? I guess it is not the mappings editor "edit field" one 😊

When editing a mapping in the mappings editor, selecting "Field type" and pressing backspace resulted in the UI crashing with

I will look into that. I wonder if that is in master already or not... I (almost) never use backpack! 😊

@cjcenizal I hear your concerns. I personally prefer not to think for our users. Some might want to see the full template, some might be bothered by too much information. I don't think that we are (yet) in a position to decide for them and narrow what they see and don't see. I prefer to leave them the choice of that decision.

I suggest to have either a filter dropdown select that lets the user do the narrowing himself with the following options:

Preview

  • v Components
  • v Mappings
  • v Settings
  • x Aliases

or the same but in a horizontal line of checkboxes (if they fit in one line)

Would that help alleviate your concerns?

@sebelga
Copy link
Contributor Author

sebelga commented Jul 22, 2020

I noticed the flyout has an "Update" button, but it didn't look I needed to ever press it.

@jloleysens This is needed if you have the flyout open and for example you add a component template or you edit the index settings. At that moment you need to click the "Update" button to see the changes reflected.

@cjcenizal
Copy link
Contributor

@sebelga I think a UI component that lets you select which part of the preview you want to see is a great solution!

To the discussion about the "Update" button, I noticed that there isn't any feedback about whether it needs to be pressed or not. This would contribute to the confusion JL experienced (I experienced this too). I've seen this solved in other apps by disabling the button and showing some kind of message, e.g. "Up to date", when the preview is up-to-date. I also suggest setting isLoading={true} and replacing the preview with some sort of loading state when the preview request is in flight.

@sebelga
Copy link
Contributor Author

sebelga commented Jul 23, 2020

@jloleysens I've addressed all your feedback, do you mind having another look? Cheers!

@sebelga sebelga requested a review from jloleysens July 23, 2020 06:42
@sebelga
Copy link
Contributor Author

sebelga commented Jul 23, 2020

@cjcenizal For the improved UX of the filtering of the preview and the "Update" button I will address them in a separate PR. I want to make sure that this PR gets merged today.

For the "Update" button improvement this will require some work as currently the mappings editor sends change update on each keystroke of the forms. Here we only want to be alerted when a new property has been added or deleted. So the onChange handler has to be revisited.
I had that issue when I tried to add the "Live update" toggle I had envisioned. I had too many updates from the mappings editor and thus making loads of unnecessary HTTP requests.

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

@sebelga Thanks for addressing those points! I read the code for the bug fix (not allowing empty types) and am satisfied that it is fixed - did not re-test locally.

@sebelga
Copy link
Contributor Author

sebelga commented Jul 23, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
esUiShared 177 +2 175
indexManagement 175 +3 172
total - +5 -

async chunks size

id value diff baseline
indexManagement 1.5MB +23.2KB 1.5MB

page load bundle size

id value diff baseline
esUiShared 1009.1KB +7.5KB 1001.7KB
indexManagement 256.8KB +1.3KB 255.5KB
total - +8.8KB -

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@sebelga sebelga merged commit 1329b68 into elastic:master Jul 24, 2020
@sebelga sebelga deleted the feature/simulate-composable-template branch July 24, 2020 05:50
sebelga added a commit that referenced this pull request Jul 24, 2020
Co-authored-by: Jean-Louis Leysens <jloleysens@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jul 27, 2020
* master: (111 commits)
  Remove flaky note from gauge tests (elastic#73240)
  Convert functional vega tests to ts and unskip tests (elastic#72238)
  [Graph] Unskip graph tests (elastic#72291)
  Add default Elasticsearch credentials to docs (elastic#72617)
  [APM] Read body from indicesStats in upload-telemetry-data (elastic#72732)
  The directory in the command was missing the /generated directory and would cause all definitions to be regenerated in the wrong place. (elastic#72766)
  [KP] use new ES client in SO service (elastic#72289)
  [Security Solution][Exceptions] Prevents value list entries from co-existing with non value list entries (elastic#72995)
  Return EUI CSS to Shareable Runtime (elastic#72990)
  Removed useless karma test (elastic#73190)
  [INGEST_MANAGER] Make package config name blank for endpoint on Package Config create (elastic#73082)
  [Ingest Manager] Support DEGRADED state in fleet agent event (elastic#73104)
  [Security Solution][Detections] Change detections breadcrumb title (elastic#73059)
  [ML] Fixing unnecessary deleting job polling (elastic#73087)
  [ML] Fixing recognizer wizard create job button (elastic#73025)
  [Composable template] Preview composite template (elastic#72598)
  [Uptime] Use manual intervals for ping histogram (elastic#72928)
  [Security Solution][Endpoint] Task/policy save modal text change, remove duplicate policy details text (elastic#73130)
  [Maps] fix tile layer attibution text and attribution link validation errors (elastic#73160)
  skip ingest pipeline api tests
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Index Management Index and index templates UI release_note:enhancement Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants