Skip to content

[WIP][dashboard scoped filter] part 1: scope selector modal - #8557

Merged
graceguo-supercat merged 5 commits into
feature--dashboard-scoped-filterfrom
scope-selector-modal-v2
Nov 13, 2019
Merged

graceguo-supercat merged 5 commits into
feature--dashboard-scoped-filterfrom
scope-selector-modal-v2

Conversation

@graceguo-supercat

Copy link
Copy Markdown

This is PR #8404 rebased onto latest master.

@codecov-io

codecov-io commented Nov 13, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #8557 into feature--dashboard-scoped-filter will increase coverage by 5.1%.
The diff coverage is n/a.

Impacted file tree graph

@@                         Coverage Diff                         @@
##           feature--dashboard-scoped-filter   #8557      +/-   ##
===================================================================
+ Coverage                              66.8%   71.9%    +5.1%     
===================================================================
  Files                                   450     118     -332     
  Lines                                 22733   12467   -10266     
  Branches                               2366       0    -2366     
===================================================================
- Hits                                  15187    8965    -6222     
+ Misses                                 7408    3502    -3906     
+ Partials                                138       0     -138
Impacted Files Coverage Δ
...sets/src/explore/components/ExploreChartHeader.jsx
superset/assets/src/components/Checkbox.jsx
...perset/assets/src/dashboard/util/getEmptyLayout.js
...ts/src/dashboard/util/getComponentWidthFromDrop.js
...erset/assets/src/SqlLab/components/QuerySearch.jsx
...rc/explore/components/controls/AnnotationLayer.jsx
superset/assets/src/welcome/DashboardTable.jsx
...erset/assets/src/dashboard/util/injectCustomCss.js
...ets/src/dashboard/components/dnd/DragDroppable.jsx
.../src/explore/components/AdhocMetricEditPopover.jsx
... and 311 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 90275fe...39182f9. Read the comment docs.

@etr2460 etr2460 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

reviewed again. these are mostly spelling, grammar, and naming nits, so i'm going to approve to unblock. However, I would appreciate you addressing these comments before merging. Thanks!

const propTypes = {
activeKey: PropTypes.oneOfType([null, PropTypes.string]),
nodes: PropTypes.arrayOf(filterScopeSelectorTreeNodePropShape).isRequired,
checked: PropTypes.arrayOf(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I remember your comment from the previous PR, what this really is is checkedIds or checkedList. checked by itself seems very much like a boolean argument. I know that's what the library uses, but can we update to one of the more explicit prop names to make this clearer?

I still don't understand why this needs to allow both numbers and strings too. Can we enforce one or the other coming in so that we don't have this multityped array?

checked: PropTypes.arrayOf(
PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
).isRequired,
expanded: PropTypes.arrayOf(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same comment as on line 36

Comment on lines +70 to +72
nodes = [],
checked = [],
expanded = [],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

all of these are marked as required in proptypes, so i think we don't need these default values

// Node's label matches the search string
node.label.toLocaleLowerCase().indexOf(searchText.toLocaleLowerCase()) >
-1 ||
// Or a children has a matching node

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sp nit: or a child has a matching node

{currentFilterLabels.length === 0 && t('No filter is selected.')}
{currentFilterLabels.length === 1 && t('Editing 1 filter:')}
{currentFilterLabels.length > 1 &&
t('Batch editing %d filters:', currentFilterLabels.length)}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

love the string replacement!

Comment on lines +160 to +166
&.root {
font-weight: 700;
}

&.tab {
font-weight: 700;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think this can be:

&.root, &.tab {
  font-weight: 700;
}

top: 16px;
border-radius: 4px;
border: 1px solid #ccc;
padding: 4px 8px 4px 8px;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can be padding: 4px 8px;

}

// currently filterbox is a chart,
// when define filter scopes, they have to be out pulled out in a few places.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sp nit: when defining filter scopes...


// currently filterbox is a chart,
// when define filter scopes, they have to be out pulled out in a few places.
// after we make filterbox a dashboard build-in component,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: build-in => built-in

Comment on lines +33 to +34
components = {},
filterFields = [],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i don't think we need these defaults since the function below already defaults them

@graceguo-supercat
graceguo-supercat merged commit e36ef96 into feature--dashboard-scoped-filter Nov 13, 2019
graceguo-supercat pushed a commit that referenced this pull request Nov 18, 2019
* [WIP][dashboard scoped filter] part 1: scope selector modal (#8557)

* filter scope selector modal

* add single-field-edit in multi-edit mode switch

* fix code review comments (round 1)

* refactory after design review

* fix a few props initial value

* [WIP][dashboard scoped filter] part 2: add algorithm to convert checked ids to scope object (#8564)

* convert ids to scope object

* use lodash helpers to make code readable

* [WIP][dashboard scoped filter] part 3: merge filter scope settings into dashboard redux state (#8522)

* merge filter scope settings into dashboard redux state

* fix/add unit tests

* minor bug fixes

* fix save filter Scopes behavior

* resolve review comments

* fix save filter scope settings

* minor comments

* [dashboard scoped filter] Improve scrollbar inside modal (#8553)

* improve scroll inside modal

* make left pane and right pane scroll separately

* fix review comments

* force show filter_box as unchecked (#8587)
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
* [WIP][dashboard scoped filter] part 1: scope selector modal (apache#8557)

* filter scope selector modal

* add single-field-edit in multi-edit mode switch

* fix code review comments (round 1)

* refactory after design review

* fix a few props initial value

* [WIP][dashboard scoped filter] part 2: add algorithm to convert checked ids to scope object (apache#8564)

* convert ids to scope object

* use lodash helpers to make code readable

* [WIP][dashboard scoped filter] part 3: merge filter scope settings into dashboard redux state (apache#8522)

* merge filter scope settings into dashboard redux state

* fix/add unit tests

* minor bug fixes

* fix save filter Scopes behavior

* resolve review comments

* fix save filter scope settings

* minor comments

* [dashboard scoped filter] Improve scrollbar inside modal (apache#8553)

* improve scroll inside modal

* make left pane and right pane scroll separately

* fix review comments

* force show filter_box as unchecked (apache#8587)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants