2019-11-29 05:22:49 +00:00
|
|
|
import {
|
2021-03-30 05:29:03 +00:00
|
|
|
ReduxAction,
|
2019-11-29 05:22:49 +00:00
|
|
|
ReduxActionTypes,
|
|
|
|
|
ReduxActionWithoutPayload,
|
|
|
|
|
} from "constants/ReduxActionConstants";
|
2021-03-30 05:29:03 +00:00
|
|
|
import { PluginFormPayload } from "api/PluginApi";
|
2021-04-26 05:41:32 +00:00
|
|
|
import { DependencyMap } from "utils/DynamicBindingUtils";
|
2019-11-29 05:22:49 +00:00
|
|
|
|
|
|
|
|
export const fetchPlugins = (): ReduxActionWithoutPayload => ({
|
|
|
|
|
type: ReduxActionTypes.FETCH_PLUGINS_REQUEST,
|
|
|
|
|
});
|
2020-04-29 09:23:23 +00:00
|
|
|
|
2021-03-30 05:29:03 +00:00
|
|
|
export const fetchPluginFormConfigs = (): ReduxActionWithoutPayload => ({
|
|
|
|
|
type: ReduxActionTypes.FETCH_PLUGIN_FORM_CONFIGS_REQUEST,
|
|
|
|
|
});
|
2020-10-20 09:00:02 +00:00
|
|
|
|
2021-03-30 05:29:03 +00:00
|
|
|
export type PluginFormsPayload = {
|
|
|
|
|
formConfigs: Record<string, any[]>;
|
|
|
|
|
editorConfigs: Record<string, any[]>;
|
|
|
|
|
settingConfigs: Record<string, any[]>;
|
2021-04-26 05:41:32 +00:00
|
|
|
dependencies: Record<string, DependencyMap>;
|
2020-10-20 09:00:02 +00:00
|
|
|
};
|
2021-03-30 05:29:03 +00:00
|
|
|
|
|
|
|
|
export const fetchPluginFormConfigsSuccess = (
|
|
|
|
|
payload: PluginFormsPayload,
|
|
|
|
|
): ReduxAction<PluginFormsPayload> => ({
|
|
|
|
|
type: ReduxActionTypes.FETCH_PLUGIN_FORM_CONFIGS_SUCCESS,
|
|
|
|
|
payload,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export interface PluginFormPayloadWithId extends PluginFormPayload {
|
|
|
|
|
id: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const fetchPluginFormConfigSuccess = (
|
|
|
|
|
payload: PluginFormPayloadWithId,
|
|
|
|
|
): ReduxAction<PluginFormPayloadWithId> => ({
|
|
|
|
|
type: ReduxActionTypes.FETCH_PLUGIN_FORM_SUCCESS,
|
|
|
|
|
payload,
|
|
|
|
|
});
|