Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
Signed-off-by: suzhou <[email protected]>
  • Loading branch information
SuZhou-Joe committed Jan 3, 2023
1 parent e457cc8 commit dcdfd22
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import React, { useCallback, useContext, useEffect, useState } from "react";
import {
EuiButton,
EuiButtonEmpty,
EuiCallOut,
EuiFieldText,
EuiModal,
EuiModalBody,
Expand All @@ -16,9 +17,11 @@ import {
EuiSpacer,
EuiText,
} from "@elastic/eui";
import { CoreStart } from "opensearch-dashboards/public";
import { ServicesContext } from "../../../../services";
import { CoreServicesContext } from "../../../../components/core_services";
import { CoreStart } from "opensearch-dashboards/public";
import { filterByMinimatch } from "../../../../../utils/helper";
import { SYSTEM_ALIAS } from "../../../../../utils/constants";

interface DeleteAliasModalProps {
selectedItems: string[];
Expand Down Expand Up @@ -60,13 +63,21 @@ export default function DeleteAliasModal(props: DeleteAliasModalProps) {
return null;
}

const hasSystemIndex = props.selectedItems.some((index) => filterByMinimatch(index, SYSTEM_ALIAS));

return (
<EuiModal onClose={onClose}>
<EuiModalHeader>
<EuiModalHeaderTitle>Delete aliases</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
{hasSystemIndex ? (
<>
<EuiCallOut color="warning">You are trying to delete system-like alias, please be careful.</EuiCallOut>
<EuiSpacer />
</>
) : null}
<div style={{ lineHeight: 1.5 }}>
<p>The following alias will be permanently deleted. This action cannot be undone.</p>
<ul style={{ listStyleType: "disc", listStylePosition: "inside" }}>
Expand Down

0 comments on commit dcdfd22

Please sign in to comment.