rusackas commented on a change in pull request #17427:
URL: https://github.com/apache/superset/pull/17427#discussion_r750949615
##########
File path: superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
##########
@@ -726,22 +737,27 @@ const AlertReportModal:
FunctionComponent<AlertReportModalProps> = ({
}, [getChartData, noChartLabel]);
const loadChartOptions = useMemo(
- () => (input = '', page: number, pageSize: number) => {
- const query = rison.encode({ filter: input, page, page_size: pageSize });
- return SupersetClient.get({
- endpoint: `/api/v1/report/related/chart?q=${query}`,
- }).then(response => {
- const list = response.json.result.map(
- (item: { value: number; text: string }) => ({
- value: item.value,
- label: item.text,
- }),
- );
-
- setChartOptions(list);
- return { data: list, totalCount: response.json.count };
- });
- },
+ () =>
Review comment:
Sorry I'm noting a lot of things not related to your PR, but this block
is repeated a few times, and we could DRY it up later.
--
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]