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

feat: create embedded superset dashboard #3185

Open
wants to merge 12 commits into
base: feat/embedded-superset-dashboards-DHIS2-17891
Choose a base branch
from

Conversation

HendrikThePendric
Copy link
Contributor

@HendrikThePendric HendrikThePendric commented Jan 16, 2025

This PR add the create flow:

  1. When the user clicks the add button, if the system supports superset dashboards, the create flow will start. If not, the user will be taken straight to the "new internal dashboard view"
  2. The first step is to select the type of dashboard. Id the user selects the internal type, he/she is taken to the "new internal dashboard view". If the external type is chosen, the user goes to the modal form
  3. The only mandatory field in the modal form is the superset embed UUID. If the title is left empty the string "Untitled dashboard" will be used as the dashboard name
Screen.Recording.2025-01-16.at.17.15.00.mov

@dhis2-bot
Copy link
Contributor

dhis2-bot commented Jan 16, 2025

🚀 Deployed on https://pr-3185.dashboard.netlify.dhis2.org

@dhis2-bot dhis2-bot temporarily deployed to netlify January 16, 2025 10:41 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify January 16, 2025 10:58 Inactive
@HendrikThePendric HendrikThePendric force-pushed the feat/create-embedded-superset-dashboard branch from 254d892 to b99c2af Compare January 16, 2025 16:40
@HendrikThePendric HendrikThePendric force-pushed the feat/embedded-superset-dashboards-DHIS2-17891 branch from dd26c38 to 7a8f4cc Compare January 16, 2025 16:41
@HendrikThePendric HendrikThePendric marked this pull request as ready for review January 16, 2025 16:43
}),
}

export const CreateSupersetEmbeddedDashboard = ({
Copy link
Collaborator

@jenniferarnesen jenniferarnesen Jan 17, 2025

Choose a reason for hiding this comment

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

A more intuitive name imho would be something like ConfigureEmbeddedDashboardModal. (point being that this component is a modal). Or, ConfigureSupersetDashboardModal

I'll use this same comment to mention that the name of the folder doesn't really represent the breadth of it contents. Could it be named createDashboard (camelCase)? Very open to discussion.

const FIELD_CHANGE = 'FIELD_CHANGE'
const SUPERSET_FIELD_BLUR = 'SUPERSET_FIELD_BLUR'
const UUID_PATTERN =
/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's not some tiny 3rd party library that could validate the uuid instead? If we intend to use our own like this, then there should be unit tests for it.

<fieldset
ref={autoFocus}
className={styles.dashboardTypeRadioGroup}
tabIndex={0}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is triggering a SonarQube failure.

@dhis2-bot dhis2-bot temporarily deployed to netlify January 17, 2025 09:19 Inactive
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@dhis2-bot dhis2-bot temporarily deployed to netlify January 17, 2025 10:49 Inactive
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.

4 participants