eschutho commented on a change in pull request #15856:
URL: https://github.com/apache/superset/pull/15856#discussion_r676939889
##########
File path: superset-frontend/src/components/ReportModal/index.tsx
##########
@@ -143,6 +126,51 @@ const ReportModal: FunctionComponent<ReportProps> = ({
setCurrentReport({ type, payload } as ReportActionType);
}, []);
const [error, setError] = useState<CronError>();
+ const [hasConnectedReport, setHasConnectedReport] = useState<boolean>(false);
+ const [isLoading, setLoading] = useState<boolean>(false);
+
+ // Report fetch logic
+ // Below is not needed, data will be passed in
+ const { createResource } = useSingleViewResource<ReportObject>(
+ 'report',
+ t('report'),
+ addDangerToast,
+ );
+
+ const onSave = async () => {
+ // Create new Report
+ const newReport: ReportObject = {
+ active: true,
+ crontab: currentReport?.crontab || '0 12 * * 1',
+ dashboard: props.props.dashboardId,
+ description: currentReport?.description || '',
+ log_retention: 90,
+ name: currentReport?.name || 'Weekly Report',
+ owners: [props.props.userId],
+ recipients: [
+ {
+ recipient_config_json: { target: props.props.userEmail },
+ type: 'Email',
+ },
+ ],
+ report_format: 'PNG',
+ type: 'Report',
+ validator_config_json: {},
+ validator_type: 'operator',
+ working_timeout: 3600,
+ creation_method: 'dashboards',
Review comment:
since we're using a reducer it will be easier if we can let the reducer
always hold the state with the correct schema for the api instead of having to
rewrite it here.
--
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]