2024-08-06 14:52:22 +00:00
|
|
|
import type { AppState } from "ee/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;
|
|
|
|
|
}
|
|
|
|
|
};
|
2024-07-31 02:54:51 +00:00
|
|
|
|
|
|
|
|
export const getLoadingTokenForDatasourceId = (state: AppState) =>
|
|
|
|
|
state.entities.datasources.loadingTokenForDatasourceId;
|