Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Convert FieldSidebar to TypeScript (#69087)

Fraser4336e7bc1c79
diff --git a/frontend/src/metabase/reference/databases/FieldSidebar.jsx b/frontend/src/metabase/reference/databases/FieldSidebar.tsx
similarity index 81%
rename from frontend/src/metabase/reference/databases/FieldSidebar.jsx
rename to frontend/src/metabase/reference/databases/FieldSidebar.tsx
index d4789215389..322ac8a5c40 100644
--- a/frontend/src/metabase/reference/databases/FieldSidebar.jsx
+++ b/frontend/src/metabase/reference/databases/FieldSidebar.tsx
@@ -1,6 +1,4 @@
-/* eslint "react/prop-types": "warn" */
import cx from "classnames";
-import PropTypes from "prop-types";
import { memo } from "react";
import { t } from "ttag";
@@ -9,11 +7,18 @@ import S from "metabase/common/components/Sidebar.module.css";
import { SidebarItem } from "metabase/common/components/SidebarItem";
import CS from "metabase/css/core/index.css";
import MetabaseSettings from "metabase/lib/settings";
+import type { Database, Field, Table } from "metabase-types/api";
import { trackReferenceXRayClicked } from "../analytics";
-const FieldSidebar = ({ database, table, field, style, className }) => (
- <div className={cx(S.sidebar, className)} style={style}>
+interface FieldSidebarProps {
+ database: Database;
+ table: Table;
+ field: Field;
+}
+
+const FieldSidebar = ({ database, table, field }: FieldSidebarProps) => (
+ <div className={S.sidebar}>
<ul>
<div>
<Breadcrumbs
@@ -52,13 +57,5 @@ const FieldSidebar = ({ database, table, field, style, className }) => (
</div>
);
-FieldSidebar.propTypes = {
- database: PropTypes.object,
- table: PropTypes.object,
- field: PropTypes.object,
- className: PropTypes.string,
- style: PropTypes.object,
-};
-
// eslint-disable-next-line import/no-default-export -- deprecated usage
export default memo(FieldSidebar);