2020-04-28 06:52:53 +00:00
|
|
|
import { ReduxAction, ReduxActionTypes } from "constants/ReduxActionConstants";
|
|
|
|
|
import { CreateDatasourceConfig, Datasource } from "api/DatasourcesApi";
|
|
|
|
|
|
|
|
|
|
export const createDatasource = (payload: CreateDatasourceConfig) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.CREATE_DATASOURCE_INIT,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-05-07 04:44:52 +00:00
|
|
|
export const createDatasourceFromForm = (payload: CreateDatasourceConfig) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.CREATE_DATASOURCE_FROM_FORM_INIT,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-28 06:52:53 +00:00
|
|
|
export const updateDatasource = (payload: Datasource) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.UPDATE_DATASOURCE_INIT,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-05-19 06:10:59 +00:00
|
|
|
export const changeDatasource = (payload: Datasource) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.CHANGE_DATASOURCE,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
export const switchDatasource = (id: string) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.SWITCH_DATASOURCE,
|
|
|
|
|
payload: { datasourceId: id },
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-28 06:52:53 +00:00
|
|
|
export const testDatasource = (payload: Partial<Datasource>) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.TEST_DATASOURCE_INIT,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-29 10:03:56 +00:00
|
|
|
export const deleteDatasource = (payload: Partial<Datasource>) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.DELETE_DATASOURCE_INIT,
|
|
|
|
|
payload,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-28 06:52:53 +00:00
|
|
|
export const fetchDatasources = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.FETCH_DATASOURCES_INIT,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const selectPlugin = (pluginId: string) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.SELECT_PLUGIN,
|
|
|
|
|
payload: {
|
|
|
|
|
pluginId,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const storeDatastoreRefs = (refsList: {}) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.STORE_DATASOURCE_REFS,
|
|
|
|
|
payload: {
|
|
|
|
|
refsList,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const initDatasourcePane = (
|
|
|
|
|
pluginType: string,
|
|
|
|
|
urlId?: string,
|
|
|
|
|
): ReduxAction<{ pluginType: string; id?: string }> => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.INIT_DATASOURCE_PANE,
|
|
|
|
|
payload: { id: urlId, pluginType },
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-06-03 05:40:48 +00:00
|
|
|
export const storeAsDatasource = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.STORE_AS_DATASOURCE_INIT,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-28 06:52:53 +00:00
|
|
|
export default {
|
|
|
|
|
createDatasource,
|
|
|
|
|
fetchDatasources,
|
|
|
|
|
initDatasourcePane,
|
|
|
|
|
selectPlugin,
|
|
|
|
|
};
|