forked from opendistro-for-elasticsearch/kibana-reports
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extracted loading modal to directory, added to details pages (opendis…
- Loading branch information
1 parent
1dae824
commit ebb2894
Showing
5 changed files
with
157 additions
and
69 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
kibana-reports/public/components/main/loading_modal/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
export { GenerateReportLoadingModal } from './loading_modal'; |
83 changes: 83 additions & 0 deletions
83
kibana-reports/public/components/main/loading_modal/loading_modal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
import { | ||
EuiOverlayMask, | ||
EuiModal, | ||
EuiModalHeader, | ||
EuiTitle, | ||
EuiText, | ||
EuiModalBody, | ||
EuiSpacer, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiLoadingSpinner, | ||
EuiButton | ||
} from "@elastic/eui"; | ||
import React, { useState } from "react"; | ||
|
||
export function GenerateReportLoadingModal(props: { setShowLoading: any; }) { | ||
const { | ||
setShowLoading | ||
} = props; | ||
|
||
const [isModalVisible, setIsModalVisible] = useState(true); | ||
|
||
const closeModal = () => { | ||
setIsModalVisible(false); | ||
setShowLoading(false); | ||
}; | ||
const showModal = () => setIsModalVisible(true); | ||
|
||
return ( | ||
<div> | ||
<EuiOverlayMask> | ||
<EuiModal | ||
onClose={closeModal} | ||
style={{ maxWidth: 350, minWidth: 300 }} | ||
> | ||
<EuiModalHeader> | ||
<EuiTitle> | ||
<EuiText textAlign="right"> | ||
<h2>Generating report</h2> | ||
</EuiText> | ||
</EuiTitle> | ||
</EuiModalHeader> | ||
<EuiModalBody> | ||
<EuiText>Preparing your file for download.</EuiText> | ||
<EuiText> | ||
You can close this dialog while we continue in the background. | ||
</EuiText> | ||
<EuiSpacer /> | ||
<EuiFlexGroup justifyContent="center" alignItems="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiLoadingSpinner | ||
size="xl" | ||
style={{ minWidth: 75, minHeight: 75 }} | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
<EuiSpacer size="l" /> | ||
<EuiFlexGroup alignItems="flexEnd" justifyContent="flexEnd"> | ||
<EuiFlexItem grow={false}> | ||
<EuiButton onClick={closeModal}>Close</EuiButton> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiModalBody> | ||
</EuiModal> | ||
</EuiOverlayMask> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters