mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove all uses of legacy global Notification functions
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
2aa9fc972e
commit
b86eb3d8db
40 files changed
+418
-369
No files matched your search
@@ -18,13 +18,14 @@ import type { IResourceQuotaValues, ResourceQuotaApi } from "../../../../common/
|
||||
import { Select } from "../../select";
|
||||
import { Icon } from "../../icon";
|
||||
import { Button } from "../../button";
|
||||
import { Notifications } from "../../notifications";
|
||||
import { NamespaceSelect } from "../../+namespaces/namespace-select";
|
||||
import { SubTitle } from "../../layout/sub-title";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
import closeAddQuotaDialogInjectable from "./close.injectable";
|
||||
import isAddQuotaDialogOpenInjectable from "./is-open.injectable";
|
||||
import resourceQuotaApiInjectable from "../../../../common/k8s-api/endpoints/resource-quota.api.injectable";
|
||||
import type { ShowCheckedErrorNotification } from "../../notifications/show-checked-error.injectable";
|
||||
import showCheckedErrorNotificationInjectable from "../../notifications/show-checked-error.injectable";
|
||||
|
||||
export interface AddQuotaDialogProps extends DialogProps {
|
||||
}
|
||||
@@ -33,6 +34,7 @@ interface Dependencies {
|
||||
resourceQuotaApi: ResourceQuotaApi;
|
||||
isAddQuotaDialogOpen: IComputedValue<boolean>;
|
||||
closeAddQuotaDialog: () => void;
|
||||
showCheckedErrorNotification: ShowCheckedErrorNotification;
|
||||
}
|
||||
|
||||
const defaultQuotas = JSON.stringify({
|
||||
@@ -128,7 +130,7 @@ class NonInjectedAddQuotaDialog extends React.Component<AddQuotaDialogProps & De
|
||||
});
|
||||
this.close();
|
||||
} catch (err) {
|
||||
Notifications.checkedError(err, "Unknown error occured while creating ResourceQuota");
|
||||
this.props.showCheckedErrorNotification(err, "Unknown error occured while creating ResourceQuota");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -250,5 +252,6 @@ export const AddQuotaDialog = withInjectables<Dependencies, AddQuotaDialogProps>
|
||||
closeAddQuotaDialog: di.inject(closeAddQuotaDialogInjectable),
|
||||
isAddQuotaDialogOpen: di.inject(isAddQuotaDialogOpenInjectable),
|
||||
resourceQuotaApi: di.inject(resourceQuotaApiInjectable),
|
||||
showCheckedErrorNotification: di.inject(showCheckedErrorNotificationInjectable),
|
||||
}),
|
||||
});
|
||||
Reference in new issue
Block a user