ktmud commented on a change in pull request #13277:
URL: https://github.com/apache/superset/pull/13277#discussion_r580856411



##########
File path: superset-frontend/src/components/Pagination/index.ts
##########
@@ -0,0 +1,26 @@
+/**
+ * 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 { Next } from './Next';
+import { Prev } from './Prev';
+import { Item } from './Item';
+import { Ellipsis } from './Ellipsis';
+import { PaginationWrapper } from './PaginationWrapper';

Review comment:
       I think you can just `export default Pagination` here and do assign 
`Next, Prev, Item, Ellipsis` to the functional component, as the original 
component name `Pagination` is more natural than `PaginationWrapper`.
   
   ```ts
   type PaginationChild = Next | Prev | Item | Ellipsis;
   
   function Pagination({
     children
   } : {
     children: PaginationChild | PaginationChild[]
   }) {
     return <PaginationList role="navigation">{children}</PaginationList>;
   }
   
   Pagination.Next = Next;
   Pagination.Prev = Prev;
   Pagination.Item = Item;
   Pagination.Ellipsis = Ellipsis;
   
   export default Pagination;
   ```

##########
File path: superset-frontend/src/components/Pagination/PaginationButton.types.ts
##########
@@ -0,0 +1,23 @@
+/**
+ * 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.
+ */
+
+export interface PaginationButton {

Review comment:
       I think you can just call this file `./components/Pagination/types.ts`. 
I haven't seen this filename pattern (`ComponentName.types.ts`) in Superset.
   
   Maybe also call the type `PaginationButtonProps` to avoid being confused 
with it being an actual React component.

##########
File path: 
superset-frontend/src/components/Pagination/PaginationWrapper.test.tsx
##########
@@ -0,0 +1,36 @@
+/**
+ * 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 '@testing-library/jest-dom';
+import { render, screen } from '@testing-library/react';
+import { supersetTheme, ThemeProvider } from '@superset-ui/core';
+import { PaginationWrapper } from './PaginationWrapper';
+
+test('PaginationWrapper rendering correctly', () => {
+  render(
+    <ThemeProvider theme={supersetTheme}>

Review comment:
       `ThemProvider` and `import '@testing-library/jest-dom'` would not be 
needed if you just `import { render } from 'spec/helpers/testing-library'`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to