diff --git a/INTRO.md b/INTRO.md index 5a46bc1..012d9df 100644 --- a/INTRO.md +++ b/INTRO.md @@ -1,3 +1,3 @@ # Gsheets `GM_*` Functions -Gapminder-specific custom functions for Google Spreadsheets. +Gapminder-specific custom functions and related menu item actions for Google Spreadsheets. diff --git a/docs/README.md b/docs/README.md index 37cf8d7..5c1a7bf 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,7 @@ Gsheets `GM_*` Functions ======================== -Gapminder-specific custom functions for Google Spreadsheets. +Gapminder-specific custom functions and related menu item actions for Google Spreadsheets. ## Index @@ -20,6 +20,8 @@ Gapminder-specific custom functions for Google Spreadsheets. * [GM_NAME](#gm_name) * [GM_PER_CAP](#gm_per_cap) * [GM_UNPIVOT](#gm_unpivot) +* [menuRefreshDataDependencies](#menurefreshdatadependencies) +* [menuValidateDatasetSpreadsheet](#menuvalidatedatasetspreadsheet) --- @@ -341,4 +343,47 @@ Unpivots a standard pivoted Gapminder table \[geo, name, ...time-values-across-c A two-dimensional array containing the cell/column contents described above in the summary. ___ + + +### menuRefreshDataDependencies + +▸ **menuRefreshDataDependencies**(): `void` + +*Defined in [menuRefreshDataDependencies.ts:21](https://github.com/Gapminder/gsheets-gm-functions/blob/v0.7.0/src/menuRefreshDataDependencies.ts#L21)* + +Menu item action for "Gapminder Data -> Import/refresh data dependencies" + +Imports data sets from the fasttrack catalog to the current spreadsheet, allowing GM\_-functions to reference local data instead of importing data on-the-fly. + +Details: + +* Creates the data-dependencies spreadsheet if it doesn't exist +* Verifies that the first headers of the data-dependencies spreadsheet are as expected +* Does not attempt to import data with bad catalog status +* Communicates import status as the import progresses + +**Returns:** `void` + +___ + + +### menuValidateDatasetSpreadsheet + +▸ **menuValidateDatasetSpreadsheet**(): `void` + +*Defined in [menuValidateDatasetSpreadsheet.ts:36](https://github.com/Gapminder/gsheets-gm-functions/blob/v0.7.0/src/menuValidateDatasetSpreadsheet.ts#L36)* + +Menu item action for "Gapminder Data -> Validate this dataset spreadsheet" + +Validates if the dataset spreadsheet conforms to the comments found in [the template](https://docs.google.com/spreadsheets/d/1ObY2k1SDDEwMfeM5jhQW8hIMcEpo8Oo0qclLZ3L6ByA/edit) and writes the validation results in the Validation table at the bottom of the About sheet. + +Details: + +* Checks the row headers of the output sheets (the so called "data-countries-etc/world/region-by-year") +* Checks the about sheet (to see if it follows the requirements in col A in the template) +* Checks that filter mode is not turned on in data sheets (since it breaks the CSV endpoint) + +**Returns:** `void` + +___ diff --git a/src/menuRefreshDataDependencies.ts b/src/menuRefreshDataDependencies.ts index f2ca27f..8ee1ce9 100644 --- a/src/menuRefreshDataDependencies.ts +++ b/src/menuRefreshDataDependencies.ts @@ -2,7 +2,16 @@ import { getConceptDataCatalogEntry } from "./gsheetsData/conceptData"; import { getFasttrackCatalogDataPointsList } from "./gsheetsData/fastttrackCatalog"; /** - * @hidden + * Menu item action for "Gapminder Data -> Import/refresh data dependencies" + * + * Imports data sets from the fasttrack catalog to the current spreadsheet, + * allowing GM_-functions to reference local data instead of importing data on-the-fly. + * + * Details: + * - Creates the data-dependencies spreadsheet if it doesn't exist + * - Verifies that the first headers of the data-dependencies spreadsheet are as expected + * - Does not attempt to import data with bad catalog status + * - Communicates import status as the import progresses */ export function menuRefreshDataDependencies() { const activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet(); diff --git a/src/menuValidateDatasetSpreadsheet.ts b/src/menuValidateDatasetSpreadsheet.ts index 9a4fc79..eea2e32 100644 --- a/src/menuValidateDatasetSpreadsheet.ts +++ b/src/menuValidateDatasetSpreadsheet.ts @@ -22,7 +22,16 @@ interface DataSheetMetadata { } /** - * @hidden + * Menu item action for "Gapminder Data -> Validate this dataset spreadsheet" + * + * Validates if the dataset spreadsheet conforms to the comments found in + * [the template](https://docs.google.com/spreadsheets/d/1ObY2k1SDDEwMfeM5jhQW8hIMcEpo8Oo0qclLZ3L6ByA/edit) + * and writes the validation results in the Validation table at the bottom of the About sheet. + * + * Details: + * - Checks the row headers of the output sheets (the so called "data-countries-etc/world/region-by-year") + * - Checks the about sheet (to see if it follows the requirements in col A in the template) + * - Checks that filter mode is not turned on in data sheets (since it breaks the CSV endpoint) */ export function menuValidateDatasetSpreadsheet() { const activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();