mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Upgrade redux (#86877)
* update packages * fix type errors * upgrade redux toolkit as well * don't need eslint-disable command * remove comment * fix unit tests * call rtk query selector directly * remove unnecessary checks
This commit is contained in:
@@ -155,9 +155,9 @@ export const fetchRemotePlugins = createAsyncThunk<RemotePlugin[], void, { rejec
|
||||
}
|
||||
);
|
||||
|
||||
export const fetchDetails = createAsyncThunk<Update<CatalogPlugin>, string>(
|
||||
export const fetchDetails = createAsyncThunk<Update<CatalogPlugin, string>, string>(
|
||||
`${STATE_PREFIX}/fetchDetails`,
|
||||
async (id: string, thunkApi) => {
|
||||
async (id, thunkApi) => {
|
||||
try {
|
||||
const details = await getPluginDetails(id);
|
||||
|
||||
@@ -191,7 +191,7 @@ export const addLocalAndRemotePlugins = createAction<{ local: LocalPlugin[]; rem
|
||||
|
||||
// We are also using the install API endpoint to update the plugin
|
||||
export const install = createAsyncThunk<
|
||||
Update<CatalogPlugin>,
|
||||
Update<CatalogPlugin, string>,
|
||||
{
|
||||
id: string;
|
||||
version?: string;
|
||||
@@ -222,7 +222,7 @@ export const install = createAsyncThunk<
|
||||
|
||||
export const unsetInstall = createAsyncThunk(`${STATE_PREFIX}/install`, async () => ({}));
|
||||
|
||||
export const uninstall = createAsyncThunk<Update<CatalogPlugin>, string>(
|
||||
export const uninstall = createAsyncThunk<Update<CatalogPlugin, string>, string>(
|
||||
`${STATE_PREFIX}/uninstall`,
|
||||
async (id, thunkApi) => {
|
||||
try {
|
||||
|
||||
@@ -105,7 +105,7 @@ const slice = createSlice({
|
||||
status: RequestStatus.Fulfilled,
|
||||
};
|
||||
})
|
||||
.addMatcher(isRejectedRequest, (state, action) => {
|
||||
.addMatcher(isRejectedRequest, (state, action: PayloadAction) => {
|
||||
state.requests[getOriginalActionType(action.type)] = {
|
||||
status: RequestStatus.Rejected,
|
||||
error: action.payload,
|
||||
|
||||
@@ -288,7 +288,7 @@ export type PluginDetailsTab = {
|
||||
|
||||
// TODO<remove `PluginsState &` when the "plugin_admin_enabled" feature flag is removed>
|
||||
export type ReducerState = PluginsState & {
|
||||
items: EntityState<CatalogPlugin>;
|
||||
items: EntityState<CatalogPlugin, string>;
|
||||
requests: Record<string, RequestInfo>;
|
||||
settings: {
|
||||
displayMode: PluginListDisplayMode;
|
||||
|
||||
Reference in New Issue
Block a user