-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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(Alerts and Reports): Modal redesign #26202
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #26202 +/- ##
==========================================
+ Coverage 67.15% 69.52% +2.36%
==========================================
Files 1902 1905 +3
Lines 74441 74500 +59
Branches 8306 8324 +18
==========================================
+ Hits 49994 51795 +1801
+ Misses 22393 20649 -1744
- Partials 2054 2056 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
/testenv up FEATURE_ALERT_REPORTS=true |
@lilykuang Ephemeral environment spinning up at http://35.93.128.126:8080. Credentials are |
c5ea629
to
eb69c23
Compare
89281a6
to
1d031d8
Compare
/testenv up |
@yousoph Ephemeral environment spinning up at http://34.219.202.1:8080. Credentials are |
/testenv up FEATURE_ALERT_REPORTS=true |
@yousoph Ephemeral environment spinning up at http://35.92.61.181:8080. Credentials are |
3478a6a
to
2c76c37
Compare
/testenv up FEATURE_ALERT_REPORTS=true |
@kgabryje Ephemeral environment spinning up at http://35.88.169.129:8080. Credentials are |
superset-frontend/src/features/alerts/components/NotificationMethod.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/features/alerts/components/ValidatedPanelHeader.tsx
Show resolved
Hide resolved
superset-frontend/src/features/alerts/AlertReportModal.test.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/features/alerts/AlertReportModal.test.tsx
Outdated
Show resolved
Hide resolved
) => { | ||
expect(element).toBeInTheDocument(); | ||
userEvent.type(element, `${value}{enter}`); | ||
await waitFor(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try with findBy
rather than waitFor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for instances where we are awaiting a unique element to be rendered; however, it doesn't work for tests in which we are awaiting the creation of a duplicate item such as when adding a second notification method.
await comboboxSelect( screen.getAllByRole('combobox', { name: /delivery method/i, })[1], 'Slack', () => screen.getAllByRole('textbox')[1], );
describe('properly renders the modal', () => { | ||
it('properly renders add alert text', () => { | ||
const addAlertProps = generateMockedProps(); | ||
render(<AlertReportModal {...addAlertProps} />, { useRedux: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeated in a bunch of places. Let's create a setup
function that renders the modal and let's refer to that in every test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For each of the tests in this section, the AlertReportModal is rerendered with different mocked props. Does it still make sense to use a setup function in this scenario?
9b2db6c
to
266ad29
Compare
superset-frontend/src/features/alerts/AlertReportModal.test.tsx
Outdated
Show resolved
Hide resolved
onChange: (event: ChangeEvent<HTMLInputElement>) => void; | ||
} | ||
|
||
export default function NumberInput({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering why are we introducing a component for a number input rather than using the one provided by Antdesign? Is there any particular case that cannot be handled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fisjac you might want to look at this one
Scheduling section looks a bit different than on the designs EDIT: looks like |
/testenv up FEATURE_ALERT_REPORTS=true |
@geido Ephemeral environment spinning up at http://35.93.119.155:8080. Credentials are |
</StyledInputContainer> | ||
{isScreenshot && ( | ||
<StyledInputContainer | ||
css={!isReport && contentType === 'chart' && noMarginBottom} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: instead of all that logic for adding noMarginBottom
styles, could we maybe just use something like :last-child
in StyledInputContainer
? That would simplify the logic and we could get rid of noMarginBottom
everywhere.
If you agree, I'm ok with doing that as a cleanup follow up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for your great work @fisjac @rtexelm and @CorbinBullard and addressing many rounds of reviews
|
Ephemeral environment shutdown and build artifacts deleted. |
…-to-the-embedded-dashboard * master: (1182 commits) fix(ci): mypy pre-commit issues (apache#27161) feat(Alerts and Reports): Modal redesign (apache#26202) refactor: Migrate ErrorBoundary to typescript (apache#27143) chore(tests): Remove unnecessary explicit Flask-SQLAlchemy session expunges (apache#27136) fix(plugins): Apply dashboard filters to comparison query in BigNumber with Time Comparison chart (apache#27138) fix: Duplicated toast messages (apache#27135) docs: add Geotab to users list (apache#27134) fix: Plain error message when visiting a dashboard via permalink without permissions (apache#27132) fix: ID param for DELETE ssh_tunnel endpoint (apache#27130) chore(hail mary): Update package-lock.json via npm-audit-fix (apache#26693) chore: lower cryptography min version to 41.0.2 (apache#27129) docs(miscellaneous): Export Datasoruces: export datasources exports to ZIP (apache#27120) fix(pivot-table-v2): Added forgotten translation pivot table v2 (apache#22840) fix: RLS modal overflow (apache#27128) refactor: Updates some database columns to MediumText (apache#27119) fix: gevent upgrade to 23.9.1 (apache#27112) fix: removes old deprecated sqllab endpoints (apache#27117) feat(storybook): Co-habitating/Upgrading Storybooks to v7 (dependency madness ensues) (apache#26907) fix: bump grpcio, urllib3 and paramiko (apache#27124) chore(internet_port): added new ports and removed unnecessary string class (apache#27078) ...
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: fisjac <jfisher9882@gmail.com> Co-authored-by: Corbin <corbindbullard@gmail.com> Co-authored-by: Lily Kuang <lily@preset.io> Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: fisjac <jfisher9882@gmail.com> Co-authored-by: Corbin <corbindbullard@gmail.com> Co-authored-by: Lily Kuang <lily@preset.io> Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
SUMMARY
This combines changes from cobrafish (CorbinBullard, rtexelm, fisjac) into one branch allowing for tests of the full redesign.
No changes have been made to the functioning purpose of the modal and no additional features have been included.
Design Proposal
Contributing PR
Contributing PR
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE:
AFTER:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION