mirror of
https://github.com/apache/superset.git
synced 2026-04-26 03:24:53 +00:00
[datasets] new, listview (react) (#9197)
* [datasets] new, react listview * add hidden columns to support filtering by columns not rendered * throw exception if config is incorrect * fix database filter * update endpoints to point to datasets; fix translation strings * move Link into src/components * add add new record button to datasets listview
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import React, { ReactNode } from 'react';
|
||||
// @ts-ignore
|
||||
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
|
||||
|
||||
interface Props {
|
||||
children: ReactNode;
|
||||
className: string;
|
||||
href: string;
|
||||
onClick: () => void;
|
||||
placement: string;
|
||||
style: object;
|
||||
tooltip: string | null;
|
||||
}
|
||||
|
||||
const Link = ({
|
||||
children = null,
|
||||
className = '',
|
||||
href = '#',
|
||||
onClick = () => undefined,
|
||||
placement = 'top',
|
||||
style = {},
|
||||
tooltip = null,
|
||||
}: Props) => {
|
||||
const link = (
|
||||
<a
|
||||
href={href}
|
||||
onClick={onClick}
|
||||
style={style}
|
||||
className={'Link ' + className}
|
||||
>
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
if (tooltip) {
|
||||
return (
|
||||
<OverlayTrigger
|
||||
overlay={<Tooltip id="tooltip">{tooltip}</Tooltip>}
|
||||
placement={placement}
|
||||
delayShow={300}
|
||||
delayHide={150}
|
||||
>
|
||||
{link}
|
||||
</OverlayTrigger>
|
||||
);
|
||||
}
|
||||
return link;
|
||||
};
|
||||
|
||||
export default Link;
|
||||
@@ -23,7 +23,7 @@ import { Table } from 'reactable-arc';
|
||||
import { Label, ProgressBar, Well } from 'react-bootstrap';
|
||||
import { t } from '@superset-ui/translation';
|
||||
|
||||
import Link from './Link';
|
||||
import Link from '../../components/Link';
|
||||
import ResultSet from './ResultSet';
|
||||
import ModalTrigger from '../../components/ModalTrigger';
|
||||
import HighlightedSql from './HighlightedSql';
|
||||
|
||||
@@ -26,7 +26,7 @@ import github from 'react-syntax-highlighter/dist/styles/hljs/github';
|
||||
|
||||
import { t } from '@superset-ui/translation';
|
||||
|
||||
import Link from './Link';
|
||||
import Link from '../../components/Link';
|
||||
import ModalTrigger from '../../components/ModalTrigger';
|
||||
|
||||
registerLanguage('sql', sql);
|
||||
|
||||
@@ -23,7 +23,7 @@ import shortid from 'shortid';
|
||||
import { t } from '@superset-ui/translation';
|
||||
|
||||
import CopyToClipboard from '../../components/CopyToClipboard';
|
||||
import Link from './Link';
|
||||
import Link from '../../components/Link';
|
||||
import ColumnElement from './ColumnElement';
|
||||
import ShowSQL from './ShowSQL';
|
||||
import ModalTrigger from '../../components/ModalTrigger';
|
||||
|
||||
Reference in New Issue
Block a user