mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
go to catalog after importing clusters
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
9e5996b9cb
commit
c9bb183b17
@ -15,7 +15,6 @@ import { ClusterModel, ClusterStore, clusterStore } from "../../../common/cluste
|
||||
import { v4 as uuid } from "uuid";
|
||||
import { navigate } from "../../navigation";
|
||||
import { userStore } from "../../../common/user-store";
|
||||
import { clusterViewURL } from "../cluster-manager/cluster-view.route";
|
||||
import { cssNames } from "../../utils";
|
||||
import { Notifications } from "../notifications";
|
||||
import { Tab, Tabs } from "../tabs";
|
||||
@ -23,6 +22,7 @@ import { ExecValidationNotFoundError } from "../../../common/custom-errors";
|
||||
import { appEventBus } from "../../../common/event-bus";
|
||||
import { PageLayout } from "../layout/page-layout";
|
||||
import { docsUrl } from "../../../common/vars";
|
||||
import { catalogURL } from "../+catalog";
|
||||
|
||||
enum KubeConfigSourceTab {
|
||||
FILE = "file",
|
||||
@ -181,18 +181,11 @@ export class AddCluster extends React.Component {
|
||||
runInAction(() => {
|
||||
clusterStore.addClusters(...newClusters);
|
||||
|
||||
if (newClusters.length === 1) {
|
||||
const clusterId = newClusters[0].id;
|
||||
Notifications.ok(
|
||||
<>Successfully imported <b>{newClusters.length}</b> cluster(s)</>
|
||||
);
|
||||
|
||||
clusterStore.setActive(clusterId);
|
||||
navigate(clusterViewURL({ params: { clusterId } }));
|
||||
} else {
|
||||
if (newClusters.length > 1) {
|
||||
Notifications.ok(
|
||||
<>Successfully imported <b>{newClusters.length}</b> cluster(s)</>
|
||||
);
|
||||
}
|
||||
}
|
||||
navigate(catalogURL());
|
||||
});
|
||||
this.refreshContexts();
|
||||
} catch (err) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user