Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/apache/superset into fix/…
Browse files Browse the repository at this point in the history
…issue_16254_tab_title
  • Loading branch information
geido committed Aug 19, 2021
2 parents b6a07c3 + c5c2861 commit 285cfe3
Show file tree
Hide file tree
Showing 24 changed files with 606 additions and 723 deletions.
3 changes: 2 additions & 1 deletion RESOURCES/INTHEWILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Join our growing community!
- [Tails.com](https://tails.com) [@alanmcruickshank]
- [THE ICONIC](http://theiconic.com.au/) [@ksaagariconic]
- [Utair](https://www.utair.ru) [@utair-digital]
- [VkusVill](https://www.vkusvill.ru) [@ETselikov]
- [Zalando](https://www.zalando.com) [@dmigo]
- [Zalora](https://www.zalora.com) [@ksaagariconic]

Expand Down Expand Up @@ -96,6 +97,7 @@ Join our growing community!
- [Showmax](https://tech.showmax.com) [@bobek]
- [source{d}](https://www.sourced.tech) [@marnovo]
- [Steamroot](https://streamroot.io/)
- [TechAudit](https://www.techaudit.info) [@ETselikov]
- [Tenable](https://www.tenable.com) [@dflionis]
- [timbr.ai](https://timbr.ai/) [@semantiDan]
- [Tobii](http://www.tobii.com/) [@dwa]
Expand All @@ -104,7 +106,6 @@ Join our growing community!
- [Windsor.ai](https://www.windsor.ai/) [@octaviancorlade]
- [Zeta](https://www.zeta.tech/) [@shaikidris]


### Entertainment
- [6play](https://www.6play.fr) [@CoryChaplin]
- [bilibili](https://www.bilibili.com) [@Moinheart]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ combine_as_imports = true
include_trailing_comma = true
line_length = 88
known_first_party = superset
known_third_party =alembic,apispec,backoff,bleach,cachelib,celery,click,colorama,cron_descriptor,croniter,cryptography,dateutil,deprecation,flask,flask_appbuilder,flask_babel,flask_caching,flask_compress,flask_jwt_extended,flask_login,flask_migrate,flask_sqlalchemy,flask_talisman,flask_testing,flask_wtf,freezegun,geohash,geopy,graphlib,holidays,humanize,isodate,jinja2,jwt,markdown,markupsafe,marshmallow,marshmallow_enum,msgpack,numpy,pandas,parameterized,parsedatetime,pgsanity,pkg_resources,polyline,prison,progress,pyarrow,pyhive,pyparsing,pytest,pytest_mock,pytz,redis,requests,selenium,setuptools,simplejson,slack,sqlalchemy,sqlalchemy_utils,sqlparse,tabulate,typing_extensions,urllib3,werkzeug,wtforms,wtforms_json,yaml
known_third_party =alembic,apispec,backoff,bleach,cachelib,celery,click,colorama,cron_descriptor,croniter,cryptography,dateutil,deprecation,flask,flask_appbuilder,flask_babel,flask_caching,flask_compress,flask_jwt_extended,flask_login,flask_migrate,flask_sqlalchemy,flask_talisman,flask_testing,flask_wtf,freezegun,geohash,geopy,graphlib,holidays,humanize,isodate,jinja2,jwt,markdown,markupsafe,marshmallow,marshmallow_enum,msgpack,numpy,pandas,parameterized,parsedatetime,pgsanity,pkg_resources,polyline,prison,progress,pyarrow,pyhive,pyparsing,pytest,pytest_mock,pytz,redis,requests,selenium,setuptools,simplejson,slack,sqlalchemy,sqlalchemy_utils,sqlparse,typing_extensions,urllib3,werkzeug,wtforms,wtforms_json,yaml
multi_line_output = 3
order_by_type = false

Expand Down
483 changes: 241 additions & 242 deletions superset-frontend/package-lock.json

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,35 +67,35 @@
"@emotion/babel-preset-css-prop": "^11.2.0",
"@emotion/cache": "^11.1.3",
"@emotion/react": "^11.1.5",
"@superset-ui/chart-controls": "^0.17.84",
"@superset-ui/chart-controls": "^0.17.85",
"@superset-ui/core": "^0.17.81",
"@superset-ui/legacy-plugin-chart-calendar": "^0.17.84",
"@superset-ui/legacy-plugin-chart-chord": "^0.17.84",
"@superset-ui/legacy-plugin-chart-country-map": "^0.17.84",
"@superset-ui/legacy-plugin-chart-event-flow": "^0.17.84",
"@superset-ui/legacy-plugin-chart-force-directed": "^0.17.84",
"@superset-ui/legacy-plugin-chart-heatmap": "^0.17.84",
"@superset-ui/legacy-plugin-chart-histogram": "^0.17.84",
"@superset-ui/legacy-plugin-chart-horizon": "^0.17.84",
"@superset-ui/legacy-plugin-chart-map-box": "^0.17.84",
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.84",
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.84",
"@superset-ui/legacy-plugin-chart-partition": "^0.17.84",
"@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.84",
"@superset-ui/legacy-plugin-chart-rose": "^0.17.84",
"@superset-ui/legacy-plugin-chart-sankey": "^0.17.84",
"@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.84",
"@superset-ui/legacy-plugin-chart-sunburst": "^0.17.84",
"@superset-ui/legacy-plugin-chart-treemap": "^0.17.84",
"@superset-ui/legacy-plugin-chart-world-map": "^0.17.84",
"@superset-ui/legacy-preset-chart-big-number": "^0.17.84",
"@superset-ui/legacy-plugin-chart-calendar": "^0.17.85",
"@superset-ui/legacy-plugin-chart-chord": "^0.17.85",
"@superset-ui/legacy-plugin-chart-country-map": "^0.17.85",
"@superset-ui/legacy-plugin-chart-event-flow": "^0.17.85",
"@superset-ui/legacy-plugin-chart-force-directed": "^0.17.85",
"@superset-ui/legacy-plugin-chart-heatmap": "^0.17.85",
"@superset-ui/legacy-plugin-chart-histogram": "^0.17.85",
"@superset-ui/legacy-plugin-chart-horizon": "^0.17.85",
"@superset-ui/legacy-plugin-chart-map-box": "^0.17.85",
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.85",
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.85",
"@superset-ui/legacy-plugin-chart-partition": "^0.17.85",
"@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.85",
"@superset-ui/legacy-plugin-chart-rose": "^0.17.85",
"@superset-ui/legacy-plugin-chart-sankey": "^0.17.85",
"@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.85",
"@superset-ui/legacy-plugin-chart-sunburst": "^0.17.85",
"@superset-ui/legacy-plugin-chart-treemap": "^0.17.85",
"@superset-ui/legacy-plugin-chart-world-map": "^0.17.85",
"@superset-ui/legacy-preset-chart-big-number": "^0.17.85",
"@superset-ui/legacy-preset-chart-deckgl": "^0.4.10",
"@superset-ui/legacy-preset-chart-nvd3": "^0.17.84",
"@superset-ui/plugin-chart-echarts": "^0.17.84",
"@superset-ui/plugin-chart-pivot-table": "^0.17.84",
"@superset-ui/plugin-chart-table": "^0.17.84",
"@superset-ui/plugin-chart-word-cloud": "^0.17.84",
"@superset-ui/preset-chart-xy": "^0.17.84",
"@superset-ui/legacy-preset-chart-nvd3": "^0.17.85",
"@superset-ui/plugin-chart-echarts": "^0.17.85",
"@superset-ui/plugin-chart-pivot-table": "^0.17.85",
"@superset-ui/plugin-chart-table": "^0.17.85",
"@superset-ui/plugin-chart-word-cloud": "^0.17.85",
"@superset-ui/preset-chart-xy": "^0.17.85",
"@vx/responsive": "^0.0.195",
"abortcontroller-polyfill": "^1.1.9",
"antd": "^4.9.4",
Expand Down
11 changes: 6 additions & 5 deletions superset-frontend/src/components/ReportModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,23 @@ const reportReducer = (
action: ReportActionType,
): Partial<ReportObject> | null => {
const initialState = {
name: state?.name || 'Weekly Report',
...(state || {}),
name: 'Weekly Report',
};

switch (action.type) {
case ActionType.inputChange:
return {
...initialState,
...state,
[action.payload.name]: action.payload.value,
};
case ActionType.fetched:
return {
...initialState,
...action.payload,
};
case ActionType.reset:
return null;
return { ...initialState };
default:
return state;
}
Expand All @@ -178,7 +179,7 @@ const ReportModal: FunctionComponent<ReportProps> = ({
: NOTIFICATION_FORMATS.PNG;
const [currentReport, setCurrentReport] = useReducer<
Reducer<Partial<ReportObject> | null, ReportActionType>
>(reportReducer, { report_format: defaultNotificationFormat });
>(reportReducer, null);
const onChange = useCallback((type: any, payload: any) => {
setCurrentReport({ type, payload });
}, []);
Expand Down Expand Up @@ -224,7 +225,7 @@ const ReportModal: FunctionComponent<ReportProps> = ({
type: 'Report',
creation_method: props.props.creationMethod,
active: true,
report_format: currentReport?.report_format,
report_format: currentReport?.report_format || defaultNotificationFormat,
timezone: currentReport?.timezone,
};

Expand Down
7 changes: 3 additions & 4 deletions superset-frontend/src/components/TableView/TableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ const EmptyWrapper = styled.div`
`;

const TableViewStyles = styled.div<{
hasPagination?: boolean;
isPaginationSticky?: boolean;
scrollTable?: boolean;
small?: boolean;
}>`
${({ hasPagination, scrollTable, theme }) =>
${({ scrollTable, theme }) =>
scrollTable &&
`
height: ${hasPagination ? '300px' : '380px'};
flex: 1 1 auto;
margin-bottom: ${theme.gridUnit * 4}px;
overflow: auto;
`}
Expand Down Expand Up @@ -196,7 +195,7 @@ const TableView = ({

return (
<>
<TableViewStyles hasPagination={hasPagination} {...props}>
<TableViewStyles {...props}>
<TableCollection
getTableProps={getTableProps}
getTableBodyProps={getTableBodyProps}
Expand Down
11 changes: 9 additions & 2 deletions superset-frontend/src/datasource/ChangeDatasourceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ interface ChangeDatasourceModalProps {
show: boolean;
}

const Modal = styled(StyledModal)`
.ant-modal-body {
display: flex;
flex-direction: column;
}
`;

const ConfirmModalStyled = styled.div`
.btn-container {
display: flex;
Expand Down Expand Up @@ -239,7 +246,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
};

return (
<StyledModal
<Modal
show={show}
onHide={onHide}
responsive
Expand Down Expand Up @@ -307,7 +314,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
)}
{confirmChange && <>{CONFIRM_WARNING_MESSAGE}</>}
</>
</StyledModal>
</Modal>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ export const DndFilterSelect = (props: DndFilterSelectProps) => {
visible={newFilterPopoverVisible}
togglePopover={togglePopover}
closePopover={closePopover}
createNew
>
<div />
</AdhocFilterPopoverTrigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ export const DndMetricSelect = (props: any) => {
visible={newMetricPopoverVisible}
togglePopover={togglePopover}
closePopover={closePopover}
createNew
>
<div />
</AdhocMetricPopoverTrigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import React, { useMemo, useRef } from 'react';
import React, { useRef } from 'react';
import {
useDrag,
useDrop,
Expand Down Expand Up @@ -63,15 +63,11 @@ export default function OptionWrapper(
const ref = useRef<HTMLDivElement>(null);
const labelRef = useRef<HTMLDivElement>(null);

const item: OptionItemInterface = useMemo(
() => ({
dragIndex: index,
type,
}),
[index, type],
);
const [{ isDragging }, drag] = useDrag({
item,
item: {
type,
dragIndex: index,
},
collect: (monitor: DragSourceMonitor) => ({
isDragging: monitor.isDragging(),
}),
Expand Down Expand Up @@ -99,8 +95,8 @@ export default function OptionWrapper(
// Determine mouse position
const clientOffset = monitor.getClientOffset();
// Get pixels to the top
const hoverClientY = clientOffset?.y
? clientOffset?.y - hoverBoundingRect.top
const hoverClientY = clientOffset
? clientOffset.y - hoverBoundingRect.top
: 0;
// Only perform the move when the mouse has crossed half of the items height
// When dragging downwards, only move when the cursor is below 50%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ class AdhocFilterControl extends React.Component {
options={this.state.options}
onFilterEdit={this.onNewFilter}
partitionColumn={this.state.partitionColumn}
createNew
>
{trigger}
</AdhocFilterPopoverTrigger>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ interface AdhocFilterPopoverTriggerProps {
datasource: Record<string, any>;
onFilterEdit: (editedFilter: AdhocFilter) => void;
partitionColumn?: string;
createNew?: boolean;
isControlledComponent?: boolean;
visible?: boolean;
togglePopover?: (visible: boolean) => void;
Expand Down Expand Up @@ -104,7 +103,7 @@ class AdhocFilterPopoverTrigger extends React.PureComponent<
defaultVisible={visible}
visible={visible}
onVisibleChange={togglePopover}
destroyTooltipOnHide={this.props.createNew}
destroyTooltipOnHide
>
{this.props.children}
</Popover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export type AdhocMetricPopoverTriggerProps = {
savedMetric: savedMetricType;
datasourceType: string;
children: ReactNode;
createNew?: boolean;
isControlledComponent?: boolean;
visible?: boolean;
togglePopover?: (visible: boolean) => void;
Expand Down Expand Up @@ -232,7 +231,7 @@ class AdhocMetricPopoverTrigger extends React.PureComponent<
visible={visible}
onVisibleChange={togglePopover}
title={popoverTitle}
destroyTooltipOnHide={this.props.createNew}
destroyTooltipOnHide
>
{this.props.children}
</Popover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ const MetricsControl = ({
datasource={datasource}
savedMetric={emptySavedMetric}
datasourceType={datasourceType}
createNew
>
{trigger}
</AdhocMetricPopoverTrigger>
Expand Down
5 changes: 1 addition & 4 deletions superset/charts/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,7 @@ def send_chart_response(
# Post-process the data so it matches the data presented in the chart.
# This is needed for sending reports based on text charts that do the
# post-processing of data, eg, the pivot table.
if (
result_type == ChartDataResultType.POST_PROCESSED
and result_format == ChartDataResultFormat.CSV
):
if result_type == ChartDataResultType.POST_PROCESSED:
result = apply_post_process(result, form_data)

if result_format == ChartDataResultFormat.CSV:
Expand Down
Loading

0 comments on commit 285cfe3

Please sign in to comment.