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

refactor: remove redundant propTypes in ColumnElement #18144

Merged
merged 3 commits into from
Feb 7, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions superset-frontend/src/SqlLab/components/ColumnElement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
import React from 'react';
import PropTypes from 'prop-types';
import React, { FC } from 'react';
import { ClassNames } from '@emotion/react';
import { styled, useTheme } from '@superset-ui/core';

import { Tooltip } from 'src/components/Tooltip';

const propTypes = {
column: PropTypes.object.isRequired,
};

const StyledTooltip = (props: any) => {
const theme = useTheme();
return (
Expand Down Expand Up @@ -64,6 +58,7 @@ const iconMap = {
fk: 'fa-link',
index: 'fa-bookmark',
};

const tooltipTitleMap = {
pk: 'Primary key',
fk: 'Foreign key',
Expand All @@ -80,7 +75,7 @@ interface ColumnElementProps {
};
}

export default function ColumnElement({ column }: ColumnElementProps) {
const ColumnElement: FC<ColumnElementProps> = ({ column }) => {
EugeneTorap marked this conversation as resolved.
Show resolved Hide resolved
let columnName: React.ReactNode = column.name;
let icons;
if (column.keys && column.keys.length > 0) {
Expand Down Expand Up @@ -115,5 +110,6 @@ export default function ColumnElement({ column }: ColumnElementProps) {
</div>
</div>
);
}
ColumnElement.propTypes = propTypes;
};

export default ColumnElement;