1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/components/+custom-resources/custom-resources-route-parameters.injectable.ts
Sebastian Malton 853573afcb Fix cluster connect statuses being intertwined
- Broadcast on a signle channel and add clusterId as data argument

- Make everything else computed based on the current props.cluster value

- Fix view staying on cluster connect screen after disconnect

- Initially clicking on a disconnected cluster should not immediately
  nativate to the Catalog if currently viewing a connected cluster

- Make route-path-parameters more type correct by not using keyedSingleton

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2022-08-18 10:41:52 -04:00

25 lines
962 B
TypeScript

/**
* 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 routePathParametersInjectable from "../../routes/route-path-parameters.injectable";
import customResourcesRouteInjectable from "../../../common/front-end-routing/routes/cluster/custom-resources/custom-resources/custom-resources-route.injectable";
const customResourcesRouteParametersInjectable = getInjectable({
id: "custom-resources-route-parameters",
instantiate: (di) => {
const route = di.inject(customResourcesRouteInjectable);
const pathParameters = di.inject(routePathParametersInjectable)(route);
return {
group: computed(() => pathParameters.get().group),
name: computed(() => pathParameters.get().name),
};
},
});
export default customResourcesRouteParametersInjectable;