yardz commented on a change in pull request #13787:
URL: https://github.com/apache/superset/pull/13787#discussion_r602352771
##########
File path:
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx
##########
@@ -32,17 +32,19 @@ import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
import { noOp } from 'src/utils/common';
import { AGGREGATES_OPTIONS } from 'src/explore/constants';
-import columnType from './columnType';
-import savedMetricType from './savedMetricType';
-import AdhocMetric, { EXPRESSION_TYPES } from './AdhocMetric';
+import columnType from
'src/explore/components/controls/MetricControl/columnType';
+import savedMetricType from
'src/explore/components/controls/MetricControl/savedMetricType';
+import AdhocMetric, {
+ EXPRESSION_TYPES,
+} from 'src/explore/components/controls/MetricControl/AdhocMetric';
const propTypes = {
- adhocMetric: PropTypes.instanceOf(AdhocMetric).isRequired,
onChange: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired,
onResize: PropTypes.func.isRequired,
getCurrentTab: PropTypes.func,
getCurrentLabel: PropTypes.func,
+ adhocMetric: PropTypes.instanceOf(AdhocMetric).isRequired,
Review comment:
In typescript when I declare the input of a function I put it all
"values" together and the "functions: all together (first the required ones
then the optional ones). Something like:
```ts
interface Props{
param1: string;
param2: string;
param3: string;
param4?: string;
param5? string;
func1: Function;
func2: Function;
func3?: Function;
func4?: Function;
}
```
When we are reading we do not mix what are values of what are
functions/callbacks. Basically I just did this organicization. I put the
functions together (required first) and then the values (required first).
--
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]