Revert accidental breaking change in Extension API (#4904)

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne SavolainenandMikko Aspiala authored and GitHub committed 2022-02-23 13:26:14 +02:00
1 parent 12a6bd8512
commit 81819dbbe9
2 files changed
+7 -6

No files matched your search

@@ -19,6 +19,7 @@ import namespaceStoreInjectable from "./namespace-store/namespace-store.injectab
import type { AddNamespaceDialogModel } from "./add-namespace-dialog-model/add-namespace-dialog-model";
import addNamespaceDialogModelInjectable
from "./add-namespace-dialog-model/add-namespace-dialog-model.injectable";
import type { NamespaceStore } from "./namespace-store/namespace.store";
interface Props extends DialogProps {
onSuccess?(ns: Namespace): void;
@@ -26,7 +27,7 @@ interface Props extends DialogProps {
}
interface Dependencies {
createNamespace: (params: { name: string }) => Promise<Namespace>;
namespaceStore: NamespaceStore;
model: AddNamespaceDialogModel;
}
@@ -48,7 +49,7 @@ class NonInjectedAddNamespaceDialog extends React.Component<Props & Dependencies
const { onSuccess, onError } = this.props;
try {
const created = await this.props.createNamespace({ name: namespace });
const created = await this.props.namespaceStore.create({ name: namespace });
onSuccess?.(created);
this.props.model.close();
@@ -59,7 +60,7 @@ class NonInjectedAddNamespaceDialog extends React.Component<Props & Dependencies
};
render() {
const { model, createNamespace, ...dialogProps } = this.props;
const { model, namespaceStore, ...dialogProps } = this.props;
const { namespace } = this;
const header = <h5>Create Namespace</h5>;
@@ -97,7 +98,7 @@ export const AddNamespaceDialog = withInjectables<Dependencies, Props>(
{
getProps: (di, props) => ({
createNamespace: di.inject(namespaceStoreInjectable).create,
namespaceStore: di.inject(namespaceStoreInjectable),
model: di.inject(addNamespaceDialogModelInjectable),
...props,