Skip to content

Commit

Permalink
Special warning before delete import branch (#1582)
Browse files Browse the repository at this point in the history
Co-authored-by: johnnyaug <yoni.augarten@treeverse.io>
  • Loading branch information
nopcoder and johnnyaug authored Mar 8, 2021
1 parent b9984e4 commit 9b3ac8e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion webui/src/components/BranchesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import ConfirmationModal from "./ConfirmationModal"
import {Link} from "react-router-dom";


const ImportBranchName = 'import-from-inventory';


const CreateBranchButton = connect(
({ branches }) => ({ status: branches.create }),
Expand Down Expand Up @@ -141,6 +143,10 @@ const BranchesPage = connect(
} else if (!!branches.error) {
body = (<Alert variant="danger">{branches.error}</Alert> );
} else {
let deleteBranchConfirmMsg = <>Are you sure you wish to delete branch <strong>{selectedBranch}</strong> ?</>;
if (selectedBranch === ImportBranchName) {
deleteBranchConfirmMsg = <>{deleteBranchConfirmMsg}<br/><Badge variant="warning">Warning</Badge> this is a system branch used for importing data to lakeFS</>;
}
body = (
<>
<ListGroup className="branches-list pagination-group">
Expand Down Expand Up @@ -182,7 +188,7 @@ const BranchesPage = connect(
</Button>
</OverlayTrigger>
</ButtonGroup>
<ConfirmationModal show={show} onHide={handleClose} msg={`are you sure you wish to delete branch ${selectedBranch}?`} onConfirm={onSubmit}/>
<ConfirmationModal show={show} onHide={handleClose} msg={deleteBranchConfirmMsg} onConfirm={onSubmit}/>
</div>
</div>
</ListGroupItem>
Expand Down

0 comments on commit 9b3ac8e

Please sign in to comment.