import { Text, TextField } from "office-ui-fabric-react"; import * as React from "react"; import { Areas } from "../../Common/Constants"; import { deleteCollection } from "../../Common/dataAccess/deleteCollection"; import DeleteFeedback from "../../Common/DeleteFeedback"; import { getErrorMessage, getErrorStack } from "../../Common/ErrorHandlingUtils"; import { Collection } from "../../Contracts/ViewModels"; import { DefaultExperienceUtility } from "../../Shared/DefaultExperienceUtility"; import { Action, ActionModifiers } from "../../Shared/Telemetry/TelemetryConstants"; import * as TelemetryProcessor from "../../Shared/Telemetry/TelemetryProcessor"; import { userContext } from "../../UserContext"; import * as NotificationConsoleUtils from "../../Utils/NotificationConsoleUtils"; import Explorer from "../Explorer"; import { PanelFooterComponent } from "./PanelFooterComponent"; import { PanelInfoErrorComponent, PanelInfoErrorProps } from "./PanelInfoErrorComponent"; import { PanelLoadingScreen } from "./PanelLoadingScreen"; export interface DeleteCollectionConfirmationPanelProps { explorer: Explorer; closePanel: () => void; openNotificationConsole: () => void; } export interface DeleteCollectionConfirmationPanelState { formError: string; isExecuting: boolean; } export class DeleteCollectionConfirmationPanel extends React.Component< DeleteCollectionConfirmationPanelProps, DeleteCollectionConfirmationPanelState > { private inputCollectionName: string; private deleteCollectionFeedback: string; constructor(props: DeleteCollectionConfirmationPanelProps) { super(props); this.state = { formError: "", isExecuting: false, }; } render(): JSX.Element { return (
); } private getPanelErrorProps(): PanelInfoErrorProps { if (this.state.formError) { return { messageType: "error", message: this.state.formError, showErrorDetails: true, openNotificationConsole: this.props.openNotificationConsole, }; } return { messageType: "warning", showErrorDetails: false, message: "Warning! The action you are about to take cannot be undone. Continuing will permanently delete this resource and all of its children resources.", }; } private shouldRecordFeedback(): boolean { return this.props.explorer.isLastCollection() && !this.props.explorer.isSelectedDatabaseShared(); } public async submit(event: React.FormEvent