Relocate stuff related to welcome under behaviours

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2022-07-13 11:23:11 +03:00
1 parent 8110c29f4c
commit 31be850aba
13 files changed
+12 -12

No files matched your search

@@ -1,41 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { generalCatalogEntityInjectionToken } from "../general-catalog-entity-injection-token";
import { GeneralEntity } from "../../index";
import { buildURL } from "../../../utils/buildUrl";
import welcomeRouteInjectable from "../../../front-end-routing/routes/welcome/welcome-route.injectable";
const welcomeCatalogEntityInjectable = getInjectable({
id: "general-catalog-entity-for-welcome",
instantiate: (di) => {
const route = di.inject(welcomeRouteInjectable);
const url = buildURL(route.path);
return new GeneralEntity({
metadata: {
uid: "welcome-page-entity",
name: "Welcome Page",
source: "app",
labels: {},
},
spec: {
path: url,
icon: {
material: "meeting_room",
background: "#3d90ce",
},
},
status: {
phase: "active",
},
});
},
injectionToken: generalCatalogEntityInjectionToken,
});
export default welcomeCatalogEntityInjectable;
@@ -1,20 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import welcomeRouteInjectable from "./welcome-route.injectable";
import { navigateToRouteInjectionToken } from "../../navigate-to-route-injection-token";
const navigateToWelcomeInjectable = getInjectable({
id: "navigate-to-welcome",
instantiate: (di) => {
const navigateToRoute = di.inject(navigateToRouteInjectionToken);
const route = di.inject(welcomeRouteInjectable);
return () => navigateToRoute(route);
},
});
export default navigateToWelcomeInjectable;
@@ -1,21 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import { computed } from "mobx";
import { frontEndRouteInjectionToken } from "../../front-end-route-injection-token";
const welcomeRouteInjectable = getInjectable({
id: "welcome-route",
instantiate: () => ({
path: "/welcome",
clusterFrame: false,
isEnabled: computed(() => true),
}),
injectionToken: frontEndRouteInjectionToken,
});
export default welcomeRouteInjectable;