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

Remove Getting Started Guide related code from frontend #15209

Closed
wants to merge 13 commits into from

Conversation

kulyk
Copy link
Member

@kulyk kulyk commented Mar 18, 2021

Fixes #15127
Fixes #15130

Problem

Looks like the frontend tries to interact with a removed feature on the Data Reference page (/reference)

Both issues this PR addresses are related to Metric's important_fields property. As I see from the backend's source code, it was used for the Getting Started Guide feature. And it looks like it has been removed in Metabase 0.30.

Also, at #15127 the issue happens because the frontend tries to access a property of the undefined guide object. It has to be retrieved from the backend via GET /api/getting_started request, but the backend route has been removed a few years ago.

Solution

If my understanding of the problem is correct, we can just remove the frontend code related to Getting Started Guide and important_fields. This PR does exactly that. Also, it removes a few fields from the Metric's reference form that were related to important_fields (like at #15130). The screenshots below demonstrate an updated page look

By the way, I'm not sure Fields you can group this metric by section is relevant now. Please help me find out

Screenshot 2021-03-18 at 15 58 55

Screenshot 2021-03-18 at 15 58 34

Copy link
Contributor

@paulrosenzweig paulrosenzweig left a comment

Choose a reason for hiding this comment

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

Looks good! I left two small comments.

I'm not sure Fields you can group this metric by section is relevant now

Good question, but I think it's still used.

frontend/src/metabase/reference/metrics/MetricDetail.jsx Outdated Show resolved Hide resolved
frontend/src/metabase/reference/reference.js Outdated Show resolved Hide resolved
kulyk added a commit to kulyk/metabase that referenced this pull request Mar 23, 2021
For some reason, when running Cypress tests,
the page appears in `cannot read property fields of undefined`
However it works correctly when running Metabase locally

Checking for undefined `fields` explicitly fixes the problem
Anyway, most likely this component is going to be removed in metabase#15209
kulyk and others added 2 commits March 23, 2021 02:34
Co-authored-by: Paul Rosenzweig <paulrosenzweig@users.noreply.github.com>
Co-authored-by: Paul Rosenzweig <paulrosenzweig@users.noreply.github.com>
@paulrosenzweig
Copy link
Contributor

The failing test is failing correctly (that UI shouldn't appear on EE). The issue is that it's running at all. I think that's another quirk with our CI setup with external contributors.

This should be good to merge. I'll ask a Github admin to merge it with the failing tests.

Nice work!

paulrosenzweig added a commit that referenced this pull request Mar 23, 2021
* Add cypress tests for reference/metrics/:id page

* Add metrics/:metricId/edit route

* Use router location for metric's isEditing state

Data Reference keeps `isEditing` state flag in Redux store (it's shared across metrics, segments and DB references)

Metrics page now uses router's path name to distinguish reading and editing states

* Use non-Redux callbacks at MetricDetailContainer

* Add missing prop type definition

* Fix editing callbacks not passed to MetricDetail

* Fix signInAsAdmin test utility usage

* Reorder imports

* Use cy.findByText instead of cy.contains

* Fix Metrics data reference test

For some reason, when running Cypress tests,
the page appears in `cannot read property fields of undefined`
However it works correctly when running Metabase locally

Checking for undefined `fields` explicitly fixes the problem
Anyway, most likely this component is going to be removed in #15209

* Fix metrics test

Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
@paulrosenzweig
Copy link
Contributor

These changes were merged in another PR also (#15309).

Sorry for the PR weirdness, @kulyk! I created an issue for the problem (#15304).

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.

Can't add "important fields" for a metric in the data reference Error saving metric in data reference
2 participants