From 7657e42cff23d4721d1df223da4e06cfe8e71914 Mon Sep 17 00:00:00 2001
From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com>
Date: Tue, 3 May 2022 15:08:10 -0300
Subject: [PATCH] chore: Adds a storybook to FilterableTable (#19897)
---
.../components/ResultSet/ResultSet.test.jsx | 2 +-
.../src/SqlLab/components/ResultSet/index.tsx | 2 +-
.../FilterableTable.stories.tsx | 73 +++++++++++++++++++
.../FilterableTable/FilterableTable.test.tsx | 2 +-
.../{FilterableTable.tsx => index.tsx} | 67 +++++++++++------
5 files changed, 119 insertions(+), 27 deletions(-)
create mode 100644 superset-frontend/src/components/FilterableTable/FilterableTable.stories.tsx
rename superset-frontend/src/components/FilterableTable/{FilterableTable.tsx => index.tsx} (93%)
diff --git a/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.jsx b/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.jsx
index 7822810e97..c04e236133 100644
--- a/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.jsx
+++ b/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.jsx
@@ -28,7 +28,7 @@ import Loading from 'src/components/Loading';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import fetchMock from 'fetch-mock';
-import FilterableTable from 'src/components/FilterableTable/FilterableTable';
+import FilterableTable from 'src/components/FilterableTable';
import ExploreResultsButton from 'src/SqlLab/components/ExploreResultsButton';
import ResultSet from 'src/SqlLab/components/ResultSet';
import ErrorMessageWithStackTrace from 'src/components/ErrorMessage/ErrorMessageWithStackTrace';
diff --git a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx
index b81b471462..d2c4b41ff7 100644
--- a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx
+++ b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx
@@ -39,7 +39,7 @@ import ProgressBar from 'src/components/ProgressBar';
import Loading from 'src/components/Loading';
import FilterableTable, {
MAX_COLUMNS_FOR_TABLE,
-} from 'src/components/FilterableTable/FilterableTable';
+} from 'src/components/FilterableTable';
import CopyToClipboard from 'src/components/CopyToClipboard';
import { prepareCopyToClipboardTabularData } from 'src/utils/common';
import { exploreChart } from 'src/explore/exploreUtils';
diff --git a/superset-frontend/src/components/FilterableTable/FilterableTable.stories.tsx b/superset-frontend/src/components/FilterableTable/FilterableTable.stories.tsx
new file mode 100644
index 0000000000..3b774f4f4d
--- /dev/null
+++ b/superset-frontend/src/components/FilterableTable/FilterableTable.stories.tsx
@@ -0,0 +1,73 @@
+/**
+ * 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 from 'react';
+import FilterableTable, { FilterableTableProps } from '.';
+
+export default {
+ title: 'FilterableTable',
+ component: FilterableTable,
+};
+
+export const InteractiveTable = (args: FilterableTableProps) => (
+