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: report/alert list CRUD view #11802

Merged
merged 6 commits into from
Dec 2, 2020
Merged

Conversation

lilykuang
Copy link
Member

@lilykuang lilykuang commented Nov 24, 2020

SUMMARY

  • implemented list view for Alert and Report use same endpoint /api/v1/report
  • alerts and reports determined by type
  • add new antd component Switch and it to storybook
  • UI feature is behind feature flag SIP_34_ALERTS_UI

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2020-11-24 at 9 27 58 AM
Screen Shot 2020-11-24 at 9 27 21 AM
Screen Shot 2020-11-24 at 9 56 32 AM

TEST PLAN

  • unit test for alert/report list view

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@lilykuang lilykuang changed the title Lily/alert list view feat: report/alert list CRUD view Nov 24, 2020
@lilykuang lilykuang force-pushed the lily/alert-list-view branch from aa16e16 to 549f736 Compare November 24, 2020 17:34
},
{
Header: t('Schedule'),
accessor: 'crontab',
Copy link
Member Author

Choose a reason for hiding this comment

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

This column will be updated later and keeping it as plain text column for now

@lilykuang lilykuang force-pushed the lily/alert-list-view branch 4 times, most recently from b4c85ed to 429cf67 Compare November 24, 2020 19:53
@codecov-io
Copy link

codecov-io commented Nov 24, 2020

Codecov Report

Merging #11802 (009f0ea) into master (ffa32cd) will decrease coverage by 6.84%.
The diff coverage is 20.68%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11802      +/-   ##
==========================================
- Coverage   67.61%   60.76%   -6.85%     
==========================================
  Files         924      880      -44     
  Lines       44833    43135    -1698     
  Branches     4251     3785     -466     
==========================================
- Hits        30313    26213    -4100     
- Misses      14417    16922    +2505     
+ Partials      103        0     -103     
Flag Coverage Δ
cypress 54.86% <8.79%> (-0.30%) ⬇️
javascript ?
python 63.84% <64.00%> (-0.32%) ⬇️

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

Impacted Files Coverage Δ
superset-frontend/src/common/components/index.tsx 100.00% <ø> (ø)
superset-frontend/src/components/Icon/index.tsx 100.00% <ø> (ø)
superset-frontend/src/views/App.tsx 100.00% <ø> (+71.79%) ⬆️
superset/config.py 90.07% <ø> (ø)
superset/reports/api.py 84.21% <ø> (ø)
...perset-frontend/src/views/CRUD/alert/AlertList.tsx 2.38% <2.38%> (ø)
superset/app.py 80.59% <25.00%> (-0.61%) ⬇️
superset-frontend/src/common/components/Switch.tsx 66.66% <66.66%> (ø)
superset/views/alerts.py 79.41% <71.42%> (-3.57%) ⬇️
superset-frontend/src/views/CRUD/hooks.ts 62.04% <100.00%> (-6.49%) ⬇️
... and 339 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ffa32cd...009f0ea. Read the comment docs.

@lilykuang lilykuang force-pushed the lily/alert-list-view branch 2 times, most recently from 0e07dcb to ead0c44 Compare November 25, 2020 18:35
@lilykuang lilykuang marked this pull request as ready for review November 25, 2020 19:04
@lilykuang lilykuang force-pushed the lily/alert-list-view branch 2 times, most recently from 4beb1b3 to 87d21aa Compare November 27, 2020 17:42
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM with one small typing proposal.

Comment on lines 48 to 51
color: ${({ status, theme }) => {
if (status === 'alerting') return '#FBC700';
if (status === 'failed') return theme.colors.error.base;
if (status === 'ok') return theme.colors.success.base;
Copy link
Member

Choose a reason for hiding this comment

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

Could we use enum for status here, potentially with a switch?

@@ -40,6 +41,7 @@ export function useListViewResource<D extends object = any>(
handleErrorMsg: (errorMsg: string) => void,
infoEnable = true,
defaultCollectionValue: D[] = [],
baseFilters: FilterValue[] = [], // must memolize otherwise infinite loop
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
baseFilters: FilterValue[] = [], // must memolize otherwise infinite loop
baseFilters: FilterValue[] = [], // must be memoized

superset/app.py Outdated
Comment on lines 424 to 429
if feature_flag_manager.is_feature_enabled("SIP_34_QUERY_SEARCH_UI"):
appbuilder.add_view_no_menu(AlertReportModelView)
Copy link
Member

Choose a reason for hiding this comment

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

Is this the correct feature flag?

Copy link
Member Author

Choose a reason for hiding this comment

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

ops! nice catch

@lilykuang lilykuang force-pushed the lily/alert-list-view branch from 87d21aa to c2908ef Compare November 30, 2020 19:03
Copy link
Member

@nytai nytai left a comment

Choose a reason for hiding this comment

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

lgtm. needs a rebase before merge though

@lilykuang lilykuang force-pushed the lily/alert-list-view branch from 99ae01d to fca0fb6 Compare December 1, 2020 18:05
@lilykuang lilykuang force-pushed the lily/alert-list-view branch from f9c3349 to 009f0ea Compare December 1, 2020 22:49
@nytai nytai merged commit a76eadd into apache:master Dec 2, 2020
@nytai nytai deleted the lily/alert-list-view branch December 2, 2020 01:57
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.0.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XL 🚢 1.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants