geido commented on code in PR #27030:
URL: https://github.com/apache/superset/pull/27030#discussion_r1484075434
##########
superset-frontend/src/components/AlteredSliceTag/index.tsx:
##########
@@ -17,63 +17,92 @@
* under the License.
*/
import React from 'react';
-import PropTypes from 'prop-types';
import { isEqual, isEmpty } from 'lodash';
-import { styled, t } from '@superset-ui/core';
+import { QueryFormData, styled, t } from '@superset-ui/core';
import { sanitizeFormData } from 'src/explore/exploreUtils/formData';
import getControlsForVizType from 'src/utils/getControlsForVizType';
import { safeStringify } from 'src/utils/safeStringify';
import { Tooltip } from 'src/components/Tooltip';
import ModalTrigger from '../ModalTrigger';
import TableView from '../TableView';
-const propTypes = {
- origFormData: PropTypes.object.isRequired,
- currentFormData: PropTypes.object.isRequired,
-};
+interface AlteredSliceTagProps {
+ origFormData: QueryFormData;
+ currentFormData: QueryFormData;
+}
+
+export interface ControlMap {
+ [key: string]: {
+ label?: string;
+ type?: string;
+ };
+}
+
+interface Diff {
+ before: [];
+ after: [];
+}
+
+export interface Row {
+ control: string;
+ before: string | number;
+ after: string | number;
+}
+interface FilterItem {
Review Comment:
```suggestion
interface FilterItem {
```
##########
superset-frontend/src/components/AlteredSliceTag/index.tsx:
##########
@@ -17,63 +17,92 @@
* under the License.
*/
import React from 'react';
-import PropTypes from 'prop-types';
import { isEqual, isEmpty } from 'lodash';
-import { styled, t } from '@superset-ui/core';
+import { QueryFormData, styled, t } from '@superset-ui/core';
import { sanitizeFormData } from 'src/explore/exploreUtils/formData';
import getControlsForVizType from 'src/utils/getControlsForVizType';
import { safeStringify } from 'src/utils/safeStringify';
import { Tooltip } from 'src/components/Tooltip';
import ModalTrigger from '../ModalTrigger';
import TableView from '../TableView';
-const propTypes = {
- origFormData: PropTypes.object.isRequired,
- currentFormData: PropTypes.object.isRequired,
-};
+interface AlteredSliceTagProps {
+ origFormData: QueryFormData;
+ currentFormData: QueryFormData;
+}
+
+export interface ControlMap {
Review Comment:
`Diff`, `Row`, and `FilterItem` could be better suited as type aliases. They
define straightforward object structures without taking advantage of
interfaces' capabilities for extension or declaration merging
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]