Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Migrate create_report/ to Typescript #17

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,34 @@ import {
EuiRadioGroup,
} from '@elastic/eui';
import { htmlIdGenerator } from '@elastic/eui/lib/services';
import moment from 'moment';
import moment, { Moment } from 'moment';
import { ReportSettings } from './report_settings/report_settings';
import { ReportDelivery } from './delivery/delivery';
import { ReportSchedule } from './schedule/schedule';

const idPrefix = htmlIdGenerator()();

export class CreateReport extends React.Component {
interface RouterHomeProps {
httpClient?: any
}

interface CreateReportState {
reportSettingsRadioIdSelected: string,
reportSettingsSetRadioIdSelected: string,
reportSettingsDashboard: string,
deliveryEmailSubject: string,
deliveryEmailBody: string,
scheduleRadioFutureDateSelected: boolean,
scheduleRadioRecurringSelected: boolean,
scheduleUTCOffset: number,
scheduleRecurringFrequency: string,
scheduleRecurringDailyTime: string,
davidcui1225 marked this conversation as resolved.
Show resolved Hide resolved
scheduleRecurringUTCOffset: number,
scheduleRecurringWeeklyDayOfWeek: string,
scheduleRecurringStartDate: Moment
}

export class CreateReport extends React.Component<RouterHomeProps, CreateReportState> {
davidcui1225 marked this conversation as resolved.
Show resolved Hide resolved
constructor(props) {
super(props);
this.state = {
Expand All @@ -56,10 +76,10 @@ export class CreateReport extends React.Component {
deliveryEmailBody: "",
scheduleRadioFutureDateSelected: false,
scheduleRadioRecurringSelected: false,
scheduleUTCOffset: '',
scheduleUTCOffset: 0,
scheduleRecurringFrequency: 'Daily',
scheduleRecurringDailyTime: '',
scheduleRecurringUTCOffset: '',
scheduleRecurringUTCOffset: 0,
scheduleRecurringWeeklyDayOfWeek: 'Monday',
scheduleRecurringStartDate: moment(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,16 @@
* permissions and limitations under the License.
*/

import React, { useState } from 'react';
import React from 'react';
import {
EuiFieldText,
EuiFormRow,
EuiButton,
EuiPage,
EuiPageHeader,
EuiTitle,
EuiPageBody,
EuiPageContent,
EuiPageContentBody,
EuiInMemoryTable,
EuiHorizontalRule,
EuiSpacer,
EuiSuggest,
EuiTextArea,
EuiRadioGroup,
EuiComboBox,
} from '@elastic/eui';
import { DeliveryRecipientsBox } from './delivery_recipients_box';
import { DeliveryChannelRadio } from './delivery_channel_radio';
Expand Down