1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Do not show context switcher if no contexts left

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-09-06 10:18:29 +03:00
parent 3c8c45cbaa
commit fe1921bfbe

View File

@ -197,6 +197,8 @@ export class DeleteClusterDialog extends React.Component {
if (!cluster || !config) return null;
const contexts = config.contexts.filter(context => context.name !== cluster.contextName);
return (
<Dialog
className={styles.dialog}
@ -210,6 +212,8 @@ export class DeleteClusterDialog extends React.Component {
</div>
{this.renderWarning()}
<hr className={styles.hr}/>
{contexts.length > 0 && (
<>
<div className="mt-4">
<Checkbox
data-testid="context-switch"
@ -225,6 +229,8 @@ export class DeleteClusterDialog extends React.Component {
/>
</div>
{this.renderCurrentContextSwitch()}
</>
)}
</div>
<div className={styles.dialogButtons}>
<Button