2023-04-26 07:18:16 +00:00
|
|
|
import type { AppState } from "@appsmith/reducers";
|
2023-04-13 11:09:24 +00:00
|
|
|
|
|
|
|
|
export const getGsheetSpreadsheets =
|
|
|
|
|
(id = "") =>
|
|
|
|
|
(state: AppState) => {
|
|
|
|
|
return state.entities.datasources.gsheetStructure.spreadsheets[id];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const getIsFetchingGsheetSpreadsheets = (state: AppState) =>
|
|
|
|
|
state.entities.datasources.gsheetStructure.isFetchingSpreadsheets;
|
|
|
|
|
|
|
|
|
|
export const getGsheetsSheets =
|
|
|
|
|
(id = "") =>
|
|
|
|
|
(state: AppState) => {
|
|
|
|
|
return state.entities.datasources.gsheetStructure.sheets[id];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const getisFetchingGsheetsSheets = (state: AppState) =>
|
|
|
|
|
state.entities.datasources.gsheetStructure.isFetchingSheets;
|
|
|
|
|
|
|
|
|
|
export const getGsheetsColumns =
|
|
|
|
|
(id = "") =>
|
|
|
|
|
(state: AppState) => {
|
|
|
|
|
return state.entities.datasources.gsheetStructure.columns[id];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const getIsFetchingGsheetsColumns = (state: AppState) => {
|
|
|
|
|
return state.entities.datasources.gsheetStructure.isFetchingColumns;
|
|
|
|
|
};
|
2023-10-24 09:58:21 +00:00
|
|
|
|
|
|
|
|
export const getFirstDatasourceId = (state: AppState) => {
|
|
|
|
|
const { list } = state.entities.datasources;
|
|
|
|
|
if (list.length) {
|
|
|
|
|
return list[0].id;
|
|
|
|
|
}
|
|
|
|
|
};
|