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

[Dataset Quality] Migrate Dataset Quality Flyout to a Dedicated Page #184572

Closed
achyutjhunjhunwala opened this issue May 31, 2024 · 5 comments · Fixed by #190584
Closed

[Dataset Quality] Migrate Dataset Quality Flyout to a Dedicated Page #184572

achyutjhunjhunwala opened this issue May 31, 2024 · 5 comments · Fixed by #190584
Assignees
Labels
Feature:Dataset Health Team:obs-ux-logs Observability Logs User Experience Team

Comments

@achyutjhunjhunwala
Copy link
Contributor

achyutjhunjhunwala commented May 31, 2024

📓 Summary

The Dataset Quality currently offers a Flyout which displays quite some data about specific DataStream.
Goal of this ticket is to migrate this Flyout into a Dedicated Page. This would help us to add more features especially to another flyout for the Fiy It flow to the Degraded Fields.

Designs

Figma Link

image

Technical Tasks

  1. The page would live on a sub-route of Stack management > Data > Data Quality
  2. The page should respect the Time Range selected in the DataSet Quality Page.
  3. The state machines must be split to support this.
  4. A New URL state would be required. This means appropriate URL Schemes would require updates.
  5. Update all Tests (Functional, API and Integration) if available

Nice to have

  • Create a controller for the page content to be able to instantiated from outside dataset-quality plugin, this will allow us to reuse the page in places like Datastreams > Quality or Docs flyout > Quality
@achyutjhunjhunwala achyutjhunjhunwala added Team:obs-ux-logs Observability Logs User Experience Team Feature:Dataset Health labels May 31, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

@gbamparop
Copy link
Contributor

@achyutjhunjhunwala
Copy link
Contributor Author

@achyutjhunjhunwala is this a prereq for https://github.com/elastic/observability-dev/issues/3232?

Yes

@isaclfreire
Copy link

Issue updated with the latest Figma link + latest screenshots

@yngrdyn
Copy link
Contributor

yngrdyn commented Jul 8, 2024

I've been trying to play around with this idea, basically we have a plugin that needs to be consumed from others.

image

Consumers have different needs in relation to dataset quality plugin offering

image

there are two generalist solutions:

Decouple components

Since the components could be individually included in different parts of the platforms, e.g. DataQuality Plugin vs UnifiedDocViewer, it seems more natural to keep the components as standalone components, not generating dependencies between them. In this sense we could have DatasetQualityPlugin exporting these two different components and others plugin consuming/initialising just what they need.

This require multiple changes:

  1. Dedicated controllers. A consumer would need to initialise as many controllers as standalone components they are consuming. This will help keeping states contained and consumers could subscribe to individual state changes and manage the changes as they please in their contexts, e.g. syncing with URL services.
  2. Dedicated public types. The components will be independent and it’s likely that the internal states differ from one another. e.g keeping the filters for Main components vs knowing which fix it flow is active in Dataset details.
  3. Dedicated wrapper components. These are the components that set the context for the individual components, e.g. setting the needed providers for each case.
  4. Dedicated state machines. As of now we only have a big machine handling our main component + dataset details (through the flyout), splitting the components would also mean factor out the flyout logic to a new machine that will handle specific flows for the details, e.g changes in the degradedDocs table.

The DataQuality consumer would also need to keep pace with the changes:

  1. New route and URL schema for dataset details (?). Maintaining both states in the same URL schema could be challenging and confusing. In any case, if we decide to go this route we need to make sure we create a new version for the routes so old versions still work.
  2. Initialisation of the new controller and subscription to state changes.

Keep components together

This could be achieved extending the current controller, but while trying to replay it in my head it became very confusing very quickly, for doing this we would need to either extend the current public state or transformed into a big wrapper where you can define Main state, dataset details state or both. I find this very confusing from the consumer side, also since we are not in version 4.7+ (adhoc spawning actors) regarding xState the implementation will became messy as well, basically we would still need to decouple both big components from our current state machine, but we would need to initialise both of them using the same controller. The main problem with it is that there is no clear mechanism to do that, we would need to treat machines following parent/child relationship which will implicate one of the machines (parent) will be waiting until the second one finished (child), also communication will flow only in that direction parent -> child.

Let's imagine a practical case: unified doc viewer. This consumer would need to initialise a controller with a big state in which mostly of the properties will be undefined, this consumer is not interested in the main component only the dataset details. What if this consumer sets properties outside dataset details piece of state? Maybe nothing will happen or maybe it will get into undesired effects (depending on the implementation).

Conclusion

As far as I see it, our cleanest option is to decouple components. Disadvantages I see, when a consumer needs a 1:1 relationship between all the components offered and needed, they will need to initialise all of them and take care of the status changes, but at the same time this brings flexibility to them to control and decide what to do with each piece of the puzzle.

WDYT?

achyutjhunjhunwala added a commit that referenced this issue Aug 14, 2024
…ponent (#189532)

## Summary

Relates to - #184572
Figma Design -
https://www.figma.com/design/8WVWLeVn8mvoUm0VGgbSbB/Data-set-quality-V2?node-id=3564-73485&t=KADTdNFiiOBJ7rOS-0

**NOTE: This PR is part of a multi series PRs. Hence expect it to not do
everything.**

### What are we going to do?

1. The content of the flyout, henceforth will be known as Dataset
Quality Details is being copied to a component with the same name.
2. This component can be initialised as page, like in Management app or
used as an individual component in a flyout in Unified Doc Viewer for
example. As scope of this PR, a page in Management app has been created
which will load this detailed component. A new route will be created
with breadcrumb.
3. This page will co-live with the Flyout for now, accessible only via
direct URL. In subsequent PR, when we remove the Flyout completely, we
will change the action in Dataset Quality to instead of opening a Flyout
to navigating to this new page.

### What's in this PR ?

1. As part of this change, i have created a complete new State Machine,
Controller for Dataset Quality Details component which is responsible
for replicating the Flyout.
2. A dedicated route registered under `/details` where this component
will live at the moment. Sample URL will look like this

`http://localhost:5601/pfd/app/management/data/data_quality/details?pageState=(dataStream:logs-synth.1-default,v:1)`
3. The individual components which currently load inside the flyout may
be duplicated for time being.
4. Validation when no data stream provided.
5. Breadcrumb for the Management page

### What's not in this PR

1. Tests needs to be migrated, they will be done as part of the Next PR
2. Telemetry for Flyout has been removed. It will be added as part of
next PR.
3. Existing Flyout code has not be removed. That needs to be removed and
the old state machine needs to be meticulously cleaned.
6. Swapping the Click to Open Flyout to Page needs to be done when the
above 3 are ready.

## Screenshot

### Good scenario

<img width="1482" alt="image"
src="https://github.com/user-attachments/assets/4409eb57-89d5-477c-a946-1b7a45df074c">

### When datastream does not exist

<img width="1527" alt="image"
src="https://github.com/user-attachments/assets/66d735aa-8f0f-4fb8-b57c-4d22cecad2c7">

### When invalid state is provided by the page, it redirects to parent
Dataset Quality Page

![Aug-09-2024
13-55-54](https://github.com/user-attachments/assets/ea8379c5-0642-458c-8164-f50a17818895)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
achyutjhunjhunwala added a commit that referenced this issue Aug 27, 2024
)

## Summary

closes #184572

After the merge of the 1st
[PR](#189532) around Flyout
migration, this PR covers the remaining bits.

- [x] Adding same telemetry to the page which was present in the flyout
- [x] Create a Locator and use it in the Table to connect the main page
with Details page
- [x] Update locator in Unified Doc Viewer
- [x] Migrate all kind of tests which were present for flyout to the
page
- [x] Remove everything which was once called Dataset Quality Flyout.
- [x] Make build green - Yellow is also acceptable

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Dataset Health Team:obs-ux-logs Observability Logs User Experience Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants