PromucFlow_constructor/app/client/src/actions/templateActions.ts

71 lines
1.7 KiB
TypeScript
Raw Normal View History

import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
2022-03-03 10:56:53 +00:00
export const getAllTemplates = () => ({
type: ReduxActionTypes.GET_ALL_TEMPLATES_INIT,
});
export const filterTemplates = (category: string, filterList: string[]) => ({
type: ReduxActionTypes.UPDATE_TEMPLATE_FILTERS,
payload: {
category,
filterList,
},
});
export const setTemplateSearchQuery = (query: string) => ({
type: ReduxActionTypes.SET_TEMPLATE_SEARCH_QUERY,
payload: query,
});
export const importTemplateToWorkspace = (
2022-03-03 10:56:53 +00:00
templateId: string,
workspaceId: string,
2022-03-03 10:56:53 +00:00
) => ({
type: ReduxActionTypes.IMPORT_TEMPLATE_TO_WORKSPACE_INIT,
2022-03-03 10:56:53 +00:00
payload: {
templateId,
workspaceId,
2022-03-03 10:56:53 +00:00
},
});
export const getSimilarTemplatesInit = (templateId: string) => ({
type: ReduxActionTypes.GET_SIMILAR_TEMPLATES_INIT,
payload: templateId,
});
export const setTemplateNotificationSeenAction = (payload: boolean) => ({
type: ReduxActionTypes.SET_TEMPLATE_NOTIFICATION_SEEN,
payload,
});
export const getTemplateNotificationSeenAction = () => ({
type: ReduxActionTypes.GET_TEMPLATE_NOTIFICATION_SEEN,
});
2022-03-31 05:16:04 +00:00
export const getTemplateInformation = (payload: string) => ({
type: ReduxActionTypes.GET_TEMPLATE_INIT,
payload,
});
export const showTemplatesModal = (payload: boolean) => ({
type: ReduxActionTypes.SHOW_TEMPLATES_MODAL,
payload,
});
export const importTemplateIntoApplication = (
templateId: string,
templateName: string,
pageNames?: string[],
) => ({
type: ReduxActionTypes.IMPORT_TEMPLATE_TO_APPLICATION_INIT,
payload: {
templateId,
templateName,
pageNames,
},
});
export const getTemplateFilters = () => ({
type: ReduxActionTypes.GET_TEMPLATE_FILTERS_INIT,
});