mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Load model within getProps()
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
416ec1fdf8
commit
3bc817f596
@ -111,10 +111,16 @@ const NonInjectedReleaseDetailsContent = observer(({ model }: Dependencies & Rel
|
||||
export const ReleaseDetailsContent = withInjectables<Dependencies, ReleaseDetailsContentProps>(NonInjectedReleaseDetailsContent, {
|
||||
getPlaceholder: () => <Spinner center data-testid="helm-release-detail-content-spinner" />,
|
||||
|
||||
getProps: async (di, props) => ({
|
||||
model: await di.inject(releaseDetailsModelInjectable, props.targetRelease),
|
||||
...props,
|
||||
}),
|
||||
getProps: async (di, props) => {
|
||||
const model = await di.inject(releaseDetailsModelInjectable, props.targetRelease);
|
||||
|
||||
await model.load();
|
||||
|
||||
return {
|
||||
model: await di.inject(releaseDetailsModelInjectable, props.targetRelease),
|
||||
...props,
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
const ResourceGroup = ({
|
||||
|
||||
@ -31,7 +31,6 @@ import assert from "assert";
|
||||
import activeThemeInjectable from "../../../../themes/active.injectable";
|
||||
import type { ToHelmRelease } from "../../to-helm-release.injectable";
|
||||
import toHelmReleaseInjectable from "../../to-helm-release.injectable";
|
||||
import uniqueId from "lodash/uniqueId";
|
||||
|
||||
const releaseDetailsModelInjectable = getInjectable({
|
||||
id: "release-details-model",
|
||||
@ -57,7 +56,7 @@ const releaseDetailsModelInjectable = getInjectable({
|
||||
},
|
||||
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
getInstanceKey: (di, release: TargetHelmRelease) => `${release.namespace}/${release.name}-${uniqueId()}`,
|
||||
getInstanceKey: (di, release: TargetHelmRelease) => `${release.namespace}/${release.name}`,
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user