Skip to content

[WIP] style: inconsistent button styles in antD confirmation modal#22367

Closed
josephsawaya wants to merge 1 commit into
apache:masterfrom
josephsawaya:fix-modal-confirm-style
Closed

[WIP] style: inconsistent button styles in antD confirmation modal#22367
josephsawaya wants to merge 1 commit into
apache:masterfrom
josephsawaya:fix-modal-confirm-style

Conversation

@josephsawaya
Copy link
Copy Markdown

SUMMARY

This PR changes the confirmation modal button styling to match the button styling in the datasource modal. It achieves this by hiding the default buttons in the confirmation modal and creating two buttons with the correct styling that make the function calls on click as the default buttons. Fixes: #16775

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

From the original issue:

With the changes in this PR applied:
image

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Co-authored-by: Joseph Sawaya <josephsawaya938@gmail.com>
Co-authored-by: Vedant Prajapati <vedant.prajapati@outlook.com>
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️
We hope to see you in our Slack community too!

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 8, 2022

Codecov Report

Merging #22367 (4538137) into master (04b7a26) will increase coverage by 0.00%.
The diff coverage is 75.86%.

❗ Current head 4538137 differs from pull request most recent head 60f063d. Consider uploading reports for the commit 60f063d to get more accurate results

@@           Coverage Diff           @@
##           master   #22367   +/-   ##
=======================================
  Coverage   66.86%   66.87%           
=======================================
  Files        1846     1847    +1     
  Lines       70510    70560   +50     
  Branches     7723     7737   +14     
=======================================
+ Hits        47144    47184   +40     
- Misses      21364    21374   +10     
  Partials     2002     2002           
Flag Coverage Δ
javascript 53.83% <80.95%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rontend/src/components/DropdownContainer/index.tsx 72.83% <ø> (ø)
superset-frontend/src/components/Loading/index.tsx 100.00% <ø> (ø)
superset-frontend/src/components/Select/styles.tsx 82.60% <ø> (ø)
...ts/nativeFilters/FilterBar/ActionButtons/index.tsx 78.57% <ø> (ø)
...ers/FilterBar/FilterBarOrientationSelect/index.tsx 92.85% <ø> (ø)
...Filters/FilterBar/FilterControls/FilterDivider.tsx 96.00% <ø> (+12.00%) ⬆️
...Filters/FilterBar/FiltersDropdownContent/index.tsx 25.00% <ø> (ø)
...s/FilterBar/FiltersOutOfScopeCollapsible/index.tsx 20.00% <ø> (ø)
...ols/DndColumnSelectControl/ColumnSelectPopover.tsx 3.37% <0.00%> (ø)
...rontend/src/views/CRUD/dashboard/DashboardList.tsx 56.60% <ø> (ø)
... and 31 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rusackas
Copy link
Copy Markdown
Member

I have to assume there are many other locations in Superset that are exhibiting this inconsistency if they Modal component itself isn't already styled this way.

In general, patching up a singular instantiation of something is more difficult to maintain, since the approach will be copied/pasted in numerous locations.

Have you tried taking the approach of modifying the Modal component (which is essentially a decorated version of the AntD modal, with a layer of Emotion styling) so that the correct styles can be added at the root, rather than overriding/bypassing things for a singular instance of the modal?

CC @michael-s-molina @eric-briscoe @geido in case either of them have looked at the Modal component lately.

@rusackas rusackas added the requires:design-review Requires input/approval from a Designer label Dec 12, 2022
@geido
Copy link
Copy Markdown
Member

geido commented Dec 13, 2022

Sure I can help with some guidance here anytime

@rusackas
Copy link
Copy Markdown
Member

@josephsawaya let me know if my comments make sense, and if we can help further. If you happen to join the Slack workgroup, we can certainly chat there, too!

@rusackas
Copy link
Copy Markdown
Member

cc @eric-briscoe regarding getting to the root of the inconsistency in the design system.

@michael-s-molina
Copy link
Copy Markdown
Member

michael-s-molina commented Jan 18, 2023

@rusackas @josephsawaya I recently merged a PR that changes the style of Modal's pre-defined functions. I think we can close this PR given that confirm will use the new style definitions.

@josephsawaya
Copy link
Copy Markdown
Author

josephsawaya commented Jan 25, 2023

Sorry, I got caught up in exams after making this PR.

@rusackas @josephsawaya I recently merged a PR that changes the style of Modal's pre-defined functions. I think we can close this PR given that confirm will use the new style definitions.

Based on the above I can close the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires:design-review Requires input/approval from a Designer size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Explore] Inconsistent button styles in AntD confirmation modal

4 participants