- GccCollection
- GccColor
- GccContainer
- GccEnv
- GccPage
- GccRun
- GccRunGroup
- GccSheet
- GccTest
- GccUi
- GccUiCollection
- GccUiCss
- GccUiDialog
- GccUiLoader
- GccUiRun
- GccUiRunForm
- GccUiSelectDisclosure
- GccUiSelectForm
- getIndefiniteArticle(str) ⇒
string
getIndefiniteArticle
- stringToCapitalised(str) ⇒
string
stringToCapitalised
- stringToId(str) ⇒
string
stringToId
- errorMessage(value, types, identifier)
errorMessage
- isArray(value) ⇒
boolean
isArray
- isBoolean(value) ⇒
boolean
isBoolean
- isNull(value) ⇒
boolean
isNull
- isNumber(value) ⇒
boolean
isNumber
- isObject(value) ⇒
boolean
isObject
- isString(value) ⇒
boolean
isString
- isString1(value) ⇒
boolean
isString1
- isStringNumber(value) ⇒
boolean
isStringNumber
- validate(value, type, identifier, condition) ⇒
*
validate
- doGet(e) ⇒
*
doGet
- gccMiddleware(classMethod, ...args) ⇒
*
gccMiddleware
- gccSheetHandleEdit(e) ⇒
*
gccSheetHandleEdit
- gccSheetHandleOpen() ⇒
*
gccSheetHandleOpen
- getResultsFromServer() ⇒
*
Kind: global class
Summary: Properties and methods related to a collection point on a compost run.
Instances of GccCollection (backend) are converted to objects
and passed to the frontend where they are processed by GccUiCollection (frontend).
Note that GccContainer (backend) has no frontend equivalent
so its instance object is remapped to properties when it reaches GccUiCollection (frontend).
Access: public
- GccCollection
- new GccCollection(config)
- instance
- .abbreviations :
Array
- .address :
string
- .cancelled :
boolean
- .collect :
boolean
- .container :
object
- .dateFlag :
string
- .dateFlags :
Array
- .dateValue :
number
|string
|boolean
- .collectionMapLocale :
string
- .name :
string
- .onHold :
boolean
- .notes :
string
- .pending :
boolean
- .runDate :
string
- .runName :
string
- .type :
string
- .typeDefinition :
string
- .volumesAndDateFlags :
Array
- .abbreviations :
- static
- .getVolumesAndDateFlags(dateFlags, quantity, type, volumes, format) ⇒
Array
|string
- .getVolumesAndDateFlags(dateFlags, quantity, type, volumes, format) ⇒
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.abbreviations | Array |
Abbreviations and their expansions (used to accessibly expand collection types). |
config.address | string |
Street address of collection. |
config.collectionMapLocale | string |
Map locale to append to Google Maps lookups. |
config.container | object |
Instance of GccContainer. |
config.dateFlag | string |
Any special instructions for the collection on a particular collection date (Skip, Drop, etc). |
config.dateFlags | Array |
All available date flags. |
config.dateValue | number | string | boolean |
Recorded collection amount or status or checkbox state for a particular collection date. |
config.name | string |
The name of the customer. |
config.notes | string |
General notes about this collection, such as where to find the container or how to contact the customer. |
config.runDate | string |
The date of the collection. |
config.runName | string |
The name of the parent run. |
config.type | string |
The type of customer. |
abbreviations
Kind: instance property of GccCollection
address
Kind: instance property of GccCollection
cancelled
Kind: instance property of GccCollection
collect
Kind: instance property of GccCollection
container
Kind: instance property of GccCollection
dateFlag
Kind: instance property of GccCollection
dateFlags
Kind: instance property of GccCollection
dateValue
Kind: instance property of GccCollection
collectionMapLocale
Kind: instance property of GccCollection
name
Kind: instance property of GccCollection
onHold
Kind: instance property of GccCollection
notes
Kind: instance property of GccCollection
pending
Kind: instance property of GccCollection
runDate
Kind: instance property of GccCollection
runName
Kind: instance property of GccCollection
type
Kind: instance property of GccCollection
typeDefinition
Kind: instance property of GccCollection
volumesAndDateFlags
Kind: instance property of GccCollection
getVolumesAndDateFlags
Kind: static method of GccCollection
Summary: Generate a series of human-readable labels/options to display in the volumes/date-flags dropdown.
Returns: Array
| string
- volumesAndDateFlags (html: Array | spreadsheet: string)
Param | Type | Description |
---|---|---|
dateFlags | Array |
All available date flags. |
quantity | number | string |
Quantity of containers to collect; can be '' if collection.type === 'X'. |
type | string |
Type of container to collect; can be '' if collection.type === 'X'. |
volumes | Array |
All available date flags. |
format | string |
Format (html or spreadsheet) |
Kind: global class
Summary: Properties and methods relating to the colours used in the app and spreadsheet.
Access: public
Todo
- Refactor colour theming to generic primary, secondary, tertiary etc
- GccColor
- new GccColor(config)
- instance
- .colors :
Array
- .instance :
GccColor
- .colorNamedRangeNames :
Array
- .getColors() ⇒
Array
- .getColorStyles() ⇒
string
- .colors :
- static
- .getInstance(config) ⇒
GccColor
- .hexToRgb(hex) ⇒
object
- .getInstance(config) ⇒
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.colorNamedRangeNames | Array |
Named range names (rather than values, as we use the cell colors) |
colors
Kind: instance property of GccColor
gccColor.instance : GccColor
instance
Kind: instance property of GccColor
colorNamedRangeNames
Kind: instance property of GccColor
getColors
Kind: instance method of GccColor
Summary: Get a structured list of code colours from the GCC Variables sheet.
Returns: Array
- Colors
getColorStyles
Kind: instance method of GccColor
Summary: Create color variables and class attributes using RGBA variations.
Returns: string
- styleHtml
GccColor.getInstance(config) ⇒ GccColor
getInstance
Kind: static method of GccColor
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccColor
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
hexToRgb
Kind: static method of GccColor
Summary: Convert hexidecimal colour notation to RGB for use with the CSS Custom Properties (variables) system.
Returns: object
- rgb
See
- runUnitTests
- https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb#comment107651282_14101452
Param | Type | Description |
---|---|---|
hex | string |
Hexidecimal notation |
Kind: global class
Summary: Properties and methods relating to the containers used on a compost run.
Access: public
Todo
- Resolve duplication of capacities/types/nonVolumes/volumeFractions across instances
- GccContainer
- new GccContainer(config)
- instance
- .capacities :
Array
- .nonVolumes :
Array
- .quantity :
number
|string
- .type :
string
- .types :
Array
- .volumeFractions :
Array
- .volumes :
Array
- .cacheInstance()
- .fractionToValue(fraction, containerIndex, capacity) ⇒
string
- .getCapacity() ⇒
number
- .getVolumeLabel(containerIndex, fraction, fractionNumber) ⇒
string
- .getVolumes() ⇒
Array
- .capacities :
- static
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.capacities | Array |
All available container capacities. |
config.nonVolumes | Array |
All non-volume statuses available in the volume dropdown, e.g. 'No access' |
config.quantity | number | string |
Quantity of containers to collect; can be '' if collection.type === 'X'. |
config.type | string |
Type of container to collect; can be '' if collection.type === 'X'. |
config.types | Array |
All available container types. |
config.volumeFractions | Array |
All volume fractions available in the volume dropdown, e.g. '3/4' |
capacities
Kind: instance property of GccContainer
nonVolumes
Kind: instance property of GccContainer
quantity
Kind: instance property of GccContainer
type
Kind: instance property of GccContainer
types
Kind: instance property of GccContainer
volumeFractions
Kind: instance property of GccContainer
volumes
Kind: instance property of GccContainer
cacheInstance
Kind: instance method of GccContainer
Summary: Cache an instance of GccContainer.
Todo
- This will repeatedly cache identical content, but on the other hand we do need to be able to update the cache.
fractionToValue
Kind: instance method of GccContainer
Summary: Convert a fraction into a number (2dp)
Returns: string
- value
See: runUnitTests
Param | Type | Description |
---|---|---|
fraction | string |
Fraction |
containerIndex | number |
Container index |
capacity | number |
Container capacity |
getCapacity
Kind: instance method of GccContainer
Summary: Get the capacity of a container.
Returns: number
- capacity
getVolumeLabel
Kind: instance method of GccContainer
Summary: Generate a human-readable label/option to display in the volme dropdown.
Note: fractions > 1 are filtered out by getVolumes before they reach getVolumeLabel
and given a label of 'Overfull' for the 'last' bucket (1st bucket if 1 bucket, 2nd bucket if 2 buckets, etc)
otherwise ignored.
Returns: string
- containerVolumeLabel
See: runUnitTests
Param | Type | Description |
---|---|---|
containerIndex | number |
Container index |
fraction | string |
Volume fraction. |
fractionNumber | number |
Volume fraction as a number. |
getVolumes
Kind: instance method of GccContainer
Summary: Generate a series of human-readable labels/options to display in the volume dropdown.
Returns: Array
- options
See: runUnitTests
Todo
- Also cache this with the container
GccContainer.getInstanceFromCache(type, quantity) ⇒ GccContainer
| null
getInstanceFromCache
Kind: static method of GccContainer
Summary: Get a cached instance of GccContainer.
Returns: GccContainer
| null
- Reinstantiated container instance
Todo
- Consider storing quantities as nested objects so there's just one cache per type
Param | Type | Description |
---|---|---|
type | string |
Type of container to collect. |
quantity | number |
Quantity of containers to collect. |
Kind: global class
Summary: Environment methods.
Access: public
- GccEnv
- new GccEnv(config)
- instance
- .containerBoundAppScriptId :
string
- .developerUserEmails :
Array
- .env :
object
- .headDeploymentId :
string
- .instance :
GccEnv
- .pubDeploymentId :
string
- .spreadsheetId :
string
- .standaloneAppScriptId :
string
- .getEnv() ⇒
object
- .isDev() ⇒
boolean
- .isDeveloper() ⇒
boolean
- .isStable() ⇒
boolean
- .containerBoundAppScriptId :
- static
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.developerUserEmails | Array |
Email address of developers who manage this project (used to display UI elements and specify recipients for feedback emails). |
config.env | object |
Environment settings |
config.env.cloudProjectId | object |
Project ID from Google Cloud (used for GCC Help menu item links, see Middleware.js) https://console.cloud.google.com/home/dashboard > Select a project (dropdown menu) > ID (copy) |
config.env.containerBoundAppScriptId | object |
Script ID of the container-bound (spreadsheet-linked) project sheets.google.com > (open spreadsheet) > Extensions > Apps Script > Project Settings (cog icon) > Script ID > Copy |
config.env.headDeploymentId | object |
Head Deployment ID from the container-bound project sheets.google.com > (open spreadsheet) > Extensions > Apps Script > Deploy > Test deployments > Select type > Web app > Head Deployment ID > Copy |
config.env.pubDeploymentId | object |
Deployment ID from the container-bound project sheets.google.com > (open spreadsheet) > Extensions > Apps Script > Deploy > Manage deployments > Initial deployment > Deployment ID > Copy (note: fill this in after created the initial deployment) |
config.env.spreadsheetId | object |
SPREADSHEET_ID from the spreadsheet URL: https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit#gid=0 |
config.env.standaloneAppScriptId | object |
Script ID of the standalone (library) project script.google.com > (open standalone project) > Project Settings (cog icon) > Script ID > Copy (note: this also needs to be set in appsscript.json > dependencies > libraries > libraryId) |
containerBoundAppScriptId
Kind: instance property of GccEnv
developerUserEmails
Kind: instance property of GccEnv
env
Kind: instance property of GccEnv
Summary: Object containing environment properties, set by getEnv();
headDeploymentId
Kind: instance property of GccEnv
gccEnv.instance : GccEnv
instance
Kind: instance property of GccEnv
pubDeploymentId
Kind: instance property of GccEnv
spreadsheetId
Kind: instance property of GccEnv
standaloneAppScriptId
Kind: instance property of GccEnv
getEnv
Kind: instance method of GccEnv
Summary: Get environment variables.
Returns: object
- env
isDev
Kind: instance method of GccEnv
Summary: Determine whether the app is displaying the DEV build.
Returns: boolean
- isDev
isDeveloper
Kind: instance method of GccEnv
Summary: Test whether the current user is a developer.
Returns: boolean
- isDeveloper
isStable
Kind: instance method of GccEnv
Summary: Is the app displaying the STABLE build
Returns: boolean
- isStable
GccEnv.getInstance(config) ⇒ GccEnv
getInstance
Kind: static method of GccEnv
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccEnv
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
Kind: global class
Summary: Properties and methods relating to the HTML templating.
Access: public
Todo
- Use this style of config.namedRangeValues documentation in other classes.
- GccPage
- new GccPage(config)
- instance
- .appName :
string
- .config :
object
- .debug :
boolean
- .developerUserEmails :
Array
- .extraCollectionsLabel :
string
- .feedbackEmailBody :
string
- .helpLinks :
Array
- .imageFavicon :
string
- .imageLogo :
string
- .instance :
GccPage
- .organisationName :
string
- .pageTemplate :
string
- .pageTitle :
string
- .runGroups :
object
- .addMetaTags(tpl) ⇒
object
- .createHtmlTemplate() ⇒
object
- .createUnitTestHtmlTemplate() ⇒
object
- .getHelpLinks() ⇒
Array
- .getFeedbackMailtoLink() ⇒
string
- .getHtmlAndVariablesFromRunDateFormObject(formObj) ⇒
object
- .appName :
- static
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.appName | string |
App name (used in the feedback email). |
config.debug | boolean |
Output debugging messages. |
config.developerUserEmails | Array |
Email address of developers who manage this project (used to display UI elements and specify recipients for feedback emails). |
config.extraCollectionsLabel | string |
Label for the optional pre/post run checkbox. |
config.feedbackEmailBody | string |
Message body for the feedback email. |
config.helpLinks | string |
Help links (used by Quick Start guide link and help dialog links; note that spreadsheet and Feedback links are appended in code; Quick Start guide link must come first.) |
config.imageFavicon | string |
Image displayed when the page is bookmarked. |
config.imageLogo | string |
Image displayed at the bottom of the page and in the background |
config.namedRangeValues | Array |
Values of the various named ranges. |
config.namedRangeValues.runGroups | Array |
Information about each group of runs. |
config.organisationName | string |
Used in web browser page title. |
config.pageTemplate | string |
HTML template file. |
config.pageTitle | string |
Web browser page title. |
appName
Kind: instance property of GccPage
config
Kind: instance property of GccPage
debug
Kind: instance property of GccPage
developerUserEmails
Kind: instance property of GccPage
extraCollectionsLabel
Kind: instance property of GccPage
feedbackEmailBody
Kind: instance property of GccPage
helpLinks
Kind: instance property of GccPage
imageFavicon
Kind: instance property of GccPage
imageLogo
Kind: instance property of GccPage
gccPage.instance : GccPage
instance
Kind: instance property of GccPage
organisationName
Kind: instance property of GccPage
pageTemplate
Kind: instance property of GccPage
pageTitle
Kind: instance property of GccPage
runGroups
Kind: instance property of GccPage
addMetaTags
Kind: instance method of GccPage
Summary: The app runs within a nested iframe. Add meta tags to the parent page.
Returns: object
- tpl - HtmlTemplate object
See
- https://developers.google.com/web/fundamentals/native-hardware/fullscreen/
- https://appcropolis.com/apple-mobile-web-app-capable/
- Add to Home Screen icon for iphone
- htmlOutput - Add support for language attribute
- https://yagisanatode.com/2021/08/18/how-to-isValidUser-specific-users-on-a-web-app-in-google-apps-scripts/
Param | Type | Description |
---|---|---|
tpl | object |
HtmlTemplate object |
createHtmlTemplate
Kind: instance method of GccPage
Summary: Generates an HtmlTemplate object from the HTML file and the supplied template variables
Returns: object
- page Page
See
- https://developers.google.com/apps-script/guides/html/templates#code.gs_3
- https://developers.google.com/apps-script/reference/html/html-template
- https://www.youtube.com/watch?v=VyNJtjH84Aw
createUnitTestHtmlTemplate
Kind: instance method of GccPage
Summary: Generates an HtmlTemplate object from the HTML file
Returns: object
- page Page
getHelpLinks
Kind: instance method of GccPage
Summary: Get links used in Help dialog.
Returns: Array
- helpLinks
getFeedbackMailtoLink
Kind: instance method of GccPage
Summary: Get the URL for the Feedback link in the page footer.
Returns: string
- feedbackMailtoLink
See: runUnitTests
getHtmlAndVariablesFromRunDateFormObject
Kind: instance method of GccPage
Summary: Respond when the user selects a run name or date from the top of the page.
Returns: object
- output Object for processing by GccUiSelectForm.processSelections
Param | Type | Description |
---|---|---|
formObj | object |
Submitted form data as a simple object |
GccPage.getInstance(config) ⇒ GccPage
getInstance
Kind: static method of GccPage
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccPage
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
include
Kind: static method of GccPage
Summary: Import the specified file content into the current file, evaluating any variables that are passed in. Note: nested includes are not supported.
Returns: string
- HTML file contents
See: https://developers.google.com/apps-script/guides/html/best-practices#code.gs
Param | Type | Default | Description |
---|---|---|---|
filename | string |
File name | |
[tplVariables] | object |
|
Template variables |
Kind: global class
Summary: Properties and methods relating to the physical compost run.
Access: public
- GccRun
- new GccRun(config)
- instance
- .abbreviations :
Array
- .collectionDateFlags :
Array
- .collectionMapLocale :
string
- .containerCapacities :
Array
- .containerNonVolumes :
Array
- .containerTypes :
Array
- .containerVolumeFractions :
Array
- .name :
string
- .nextRunName :
string
|null
- .runBlankRowsAfter :
number
- .runBounds :
object
- .runGroup :
object
- .cacheInstance()
- .getBounds() ⇒
object
- .getCollections(runDate) ⇒
Array
- .getCollectionRanges(runDate) ⇒
object
- .getColumnRange(columnHeader, rowCountOverride) ⇒
Range
- .abbreviations :
- static
- .getInstanceFromCache(runName) ⇒
GccRun
|null
- .getRunGroup(runName) ⇒
object
- .getInstanceFromCache(runName) ⇒
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.abbreviations | Array |
Abbreviations and their expansions (used to accessibly expand collection types). |
config.collectionMapLocale | string |
City and country information (passed to Google Maps along with the address). |
config.containerVolumeFractions | string |
Container volume fractions (used in spreadsheet date dropdowns and app collection volume dropdowns). |
config.name | string |
Run name (title). |
config.nextRunName | string | null |
Name of the next run in the sheet (below it). |
config.runBlankRowsAfter | number |
The number of blank rows after a run (used to calculate run bounds). |
config.runBounds | object |
Run position on the sheet: { startRowIndex, rowCount }. |
abbreviations
Kind: instance property of GccRun
collectionDateFlags
Kind: instance property of GccRun
collectionMapLocale
Kind: instance property of GccRun
containerCapacities
Kind: instance property of GccRun
containerNonVolumes
Kind: instance property of GccRun
containerTypes
Kind: instance property of GccRun
containerVolumeFractions
Kind: instance property of GccRun
name
Kind: instance property of GccRun
nextRunName
Kind: instance property of GccRun
runBlankRowsAfter
Kind: instance property of GccRun
runBounds
Kind: instance property of GccRun
runGroup
Kind: instance property of GccRun
cacheInstance
Kind: instance method of GccRun
Summary: Cache an instance of GccRun.
getBounds
Kind: instance method of GccRun
Summary: Multiple runs are stored in the same spreadsheet. Get the cell range used for one run.
Returns: object
- runBounds Run bounds
See: runUnitTests
getCollections
Kind: instance method of GccRun
Summary: Create collection points on the run.
Returns: Array
- collections
See: runIntegrationTests
Todo
- Store runName collection ranges (except date) with run
- Row 19 on "Town Run (FRI)" is still not being processed
Param | Type | Description |
---|---|---|
runDate | string |
Run date |
getCollectionRanges
Kind: instance method of GccRun
Summary: Get row and column range for each element of a run collection.
Returns: object
- ranges
Todo
- Add caching once tested
Param | Type | Description |
---|---|---|
runDate | string |
Run date |
getColumnRange
Kind: instance method of GccRun
Summary: Gets a range of all rows in a specific column of a specific run
Returns: Range
- columnRange
See: runIntegrationTests
Todo
- This appears to be a partial duplicate of GccRun.getCollectionRanges
- getColumnIndex caches each (date) result individually - better to update the cached runGroup
Param | Type | Description |
---|---|---|
columnHeader | string |
Column header |
rowCountOverride | number |
Override for run.rowCount |
GccRun.getInstanceFromCache(runName) ⇒ GccRun
| null
getInstanceFromCache
Kind: static method of GccRun
Summary: Get a cached instance of GccRun.
Returns: GccRun
| null
- Reinstantiated run instance
Param | Type | Description |
---|---|---|
runName | string |
Run name |
getRunGroup
Kind: static method of GccRun
Summary: Each run belongs to a group (sheet) - retrieve that group
Returns: object
- Run group
See: runIntegrationTests
Todo
- Investigate adding preRunExtras, postRunExtras to runs object (getRun)
- Get from cached GccRunGroup instance
Param | Type | Description |
---|---|---|
runName | string |
Run name |
Kind: global class
Summary: Properties and methods relating to the group of Kaicycle compost runs present on a sheet.
Access: public
- GccRunGroup
- new GccRunGroup(config)
- instance
- .columnHeaderIndices :
object
- .columnHeaderRowIndex :
number
- .dateHeaderRangeA1Notation :
string
- .dateHeaders :
Array
- .dateHeadersFormatted :
Array
- .footer :
string
- .id :
string
- .preRunExtras :
string
- .postRunExtras :
string
- .runNames :
Array
- .sheetName :
string
- .cacheInstance()
- .getDates() ⇒
Array
- .getDateHeaders(getDisplayValue) ⇒
Array
- .getDateHeadersRange(format) ⇒
Range
|string
- .getNextRunDate() ⇒
string
- .getNextRunName(runName) ⇒
string
|null
- .columnHeaderIndices :
- static
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.columnHeaderIndices | object |
Index position of each column header. |
config.columnHeaderRowIndex | number |
Index position of the column header row. |
config.dateFormat | string |
Used to load the next run date. |
config.footer | string |
Text in footer row (boundary row at end of runs). |
config.postRunExtras | string |
Name/title of post-run run. |
config.preRunExtras | string |
Name/title of pre-run run. |
config.runNames | Array |
Names of the runs in this group. |
config.sheetName | string |
Name of the sheet. |
columnHeaderIndices
Kind: instance property of GccRunGroup
columnHeaderRowIndex
Kind: instance property of GccRunGroup
dateHeaderRangeA1Notation
Kind: instance property of GccRunGroup
dateHeaders
Kind: instance property of GccRunGroup
dateHeadersFormatted
Kind: instance property of GccRunGroup
footer
Kind: instance property of GccRunGroup
id
Kind: instance property of GccRunGroup
preRunExtras
Kind: instance property of GccRunGroup
postRunExtras
Kind: instance property of GccRunGroup
runNames
Kind: instance property of GccRunGroup
sheetName
Kind: instance property of GccRunGroup
cacheInstance
Kind: instance method of GccRunGroup
Summary: Cache an instance of GccRunGroup.
getDates
Kind: instance method of GccRunGroup
Summary: Gets all run dates header strings from a run sheet (not the column indices).
Returns: Array
- runDates
See
- runIntegrationTests
- https://developers.google.com/apps-script/reference/spreadsheet/range?hl=en#createTextFinder(String)
- https://developers.google.com/apps-script/reference/utilities/utilities#formatDate(Date,String,String)
- https://developers.google.com/apps-script/reference/spreadsheet/sheet?hl=en#getLastColumn()
- https://developers.google.com/apps-script/reference/spreadsheet/sheet?hl=en#getRange(Integer,Integer,Integer,Integer)
getDateHeaders
Kind: instance method of GccRunGroup
Returns: Array
- dateHeaders
Param | Type | Description |
---|---|---|
getDisplayValue | boolean |
Get formatted display value rather than underlying value |
getDateHeadersRange
Kind: instance method of GccRunGroup
Summary: Gets a range of all date column headers for a specific run group
Returns: Range
| string
- dateHeadersRange
Param | Type | Default | Description |
---|---|---|---|
format | string |
"range" |
Format (range |
getNextRunDate
Kind: instance method of GccRunGroup
Summary: Gets the next run date (today or a future run date)
Returns: string
- nextRunDate
getNextRunName
Kind: instance method of GccRunGroup
Summary: Gets the name (title) of the next run in the group
Returns: string
| null
- nextRunName
Param | Type | Description |
---|---|---|
runName | string |
Preceding run name |
GccRunGroup.getInstanceFromCache(runGroupName) ⇒ GccRunGroup
getInstanceFromCache
Kind: static method of GccRunGroup
Summary: Get a cached instance of GccRunGroup.
Returns: GccRunGroup
- Reinstantiated run group instance
Param | Type | Description |
---|---|---|
runGroupName | string |
Run group name (sheet name) |
Kind: global class
Summary: Properties and methods relating to querying of the spreadsheet.
- GccSheet
- new GccSheet(config)
- instance
- .appName :
string
- .computedNamedRangeNames :
Array
- .dateFormat :
string
- .debug :
boolean
- .helplinks :
Array
- .instance :
GccSheet
- .namedRangeItems :
Array
- .namedRangeValues :
object
- .runBlankRowsAfter :
number
- .runGroupCount :
number
- .runGroupRunCount :
number
- .cacheLog() ⇒
*
- .focusNR(namedRangeName)
- .getActiveSpreadsheet() ⇒
object
- .getAllNamedRangeValues() ⇒
object
- .getLastRowIndex(sheetName, footer) ⇒
number
- .getMenu() ⇒
object
- .getNamedRange(name) ⇒
Range
- .getNamedRangeBackgrounds(name) ⇒
Array
- .getNamedRangeFontColors(name) ⇒
Array
- .getNamedRangeValue(name) ⇒
*
- .getNamedRangeValues(name, onlyFirst) ⇒
Array
- .getRangeValues(runName, runDate) ⇒
Array
- .getRunGroups() ⇒
Array
- .getTimeZone() ⇒
string
- .handleOpen()
- .setDateValidationRow(runGroup, [rowIndex]) ⇒
string
- .setDateValidationRows() ⇒
string
- .showLog(log)
- .showNotification(message, title, duration)
- .showSidebarHelp(section)
- .showVersionHistory()
- .appName :
- static
- .getCellByString(sheetName, cellText) ⇒
Range
- .getColumnIndex(sheetName, cellText) ⇒
number
- .getInstance(config) ⇒
GccSheet
- .getRowIndex(sheetName, cellText) ⇒
number
- .getRunSheet(sheetName) ⇒
object
- .handleEdit(e, cbConfig)
- .openLink(linkUrl)
- .openLinkPhoneSize(linkUrl)
- .setConditionalFormatting(runName)
- .setDateValidation(runGroup, [rowIndex])
- .setDateValidationCriteria(sheetName, dateHeadersRange, rowIndex, type, container, lastRow)
- .setRangeValidationCriteria(range, criteriaType, criteriaValues, allowInvalid)
- .validateRangeValues(range, replacementValues) ⇒
object
- .validateValue(criteriaType, criteriaValues, cellRange, cellValue) ⇒
object
- .writeToSheetFromRunFormObject(formObject) ⇒
string
- .getCellByString(sheetName, cellText) ⇒
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.appName | string |
App name (used in the feedback email). |
config.computedNamedRangeNames | Array |
Named ranges which are computed by the app. |
config.containerVolumeFractions | string |
Container volume fractions (used in spreadsheet date dropdowns and app collection volume dropdowns). |
config.dateFormat | string |
Date format (used to locate the next run date) |
config.debug | boolean |
Output debugging messages. |
config.namedRangeItems | Array |
{ name, description, validation } of the named ranges set in the spreadsheet (an array of objects). |
config.runBlankRowsAfter | number |
Number of blank rows after a run (used to calculate run bounds). |
config.runGroupCount | number |
Number of NRRunGroup items to process. |
config.runGroupRunCount | number |
Number of NRRunGroupRunHeader items to process. |
appName
Kind: instance property of GccSheet
computedNamedRangeNames
Kind: instance property of GccSheet
dateFormat
Kind: instance property of GccSheet
debug
Kind: instance property of GccSheet
helplinks
Kind: instance property of GccSheet
gccSheet.instance : GccSheet
instance
Kind: instance property of GccSheet
namedRangeItems
Kind: instance property of GccSheet
namedRangeValues
Kind: instance property of GccSheet
runBlankRowsAfter
Kind: instance property of GccSheet
runGroupCount
Kind: instance property of GccSheet
runGroupRunCount
Kind: instance property of GccSheet
cacheLog
Kind: instance method of GccSheet
Summary: Show the contents of the cache
Returns: *
- Open link
focusNR
Kind: instance method of GccSheet
Summary: Activate a specific sheet/tab in the current spreadsheet and focus a named range in it
(from a custom menu item).
See: https://spreadsheet.dev/navigation-menu-in-google-sheets
Param | Type | Description |
---|---|---|
namedRangeName | string |
Named Range name |
getActiveSpreadsheet
Kind: instance method of GccSheet
Summary: Get the active spreadsheet (container-bound script) or the configured spreadsheet (standalone script)
Returns: object
- activeSheet
getAllNamedRangeValues
Kind: instance method of GccSheet
Summary: Retrieve, validate and cache all named ranges upfront, to mitigate app failure due to bad input.
Note: arguments are passed in rather than retrieved from the instantiated class
as this function is called during instantiation
Returns: object
- namedRangeValues
See: https://stackoverflow.com/questions/35288998/how-to-remove-data-validations
getLastRowIndex
Kind: instance method of GccSheet
Summary: Get the index of the last row in the spreadsheet.
Returns: number
- lastRowIndex
See: runIntegrationTests
Todo
- Replace with footerRowIndex
Param | Type | Description |
---|---|---|
sheetName | string |
Sheet name |
footer | string |
Text in footer row |
getMenu
Kind: instance method of GccSheet
Summary: Get the custom menu which is displayed in the spreadsheet.
Returns: object
- menu
getNamedRange
Kind: instance method of GccSheet
Returns: Range
- namedRange
Param | Type | Description |
---|---|---|
name | string |
Name |
getNamedRangeBackgrounds
Kind: instance method of GccSheet
Summary: Simple wrapper function to support stubbing in unit tests.
Returns: Array
- namedRangeBackgrounds
Param | Type | Description |
---|---|---|
name | string |
Name |
getNamedRangeFontColors
Kind: instance method of GccSheet
Summary: Simple wrapper function to support stubbing in unit tests.
Returns: Array
- namedRangeFontColors
Param | Type | Description |
---|---|---|
name | string |
Name |
getNamedRangeValue
Kind: instance method of GccSheet
Returns: *
- namedRangeValue
Param | Type | Description |
---|---|---|
name | string |
Name |
getNamedRangeValues
Kind: instance method of GccSheet
Returns: Array
- namedRangeValues
See: runIntegrationTests
Param | Type | Default | Description |
---|---|---|---|
name | string |
Name | |
onlyFirst | boolean |
false |
Whether to return only the first value |
getRangeValues
Kind: instance method of GccSheet
Summary: Called by client-side JS on page load to populate the form with the values in the spreadsheet.
Returns: Array
- Range values
See: runIntegrationTests
Param | Type | Description |
---|---|---|
runName | string |
Run name |
runDate | string |
Run date |
getRunGroups
Kind: instance method of GccSheet
Summary: Build runGroups object from named ranges. Called once by GccSheet.getAllNamedRangeValues.
Returns: Array
- runGroups
Todo
- Change postRunExtras to postRunExtrasName
- Change preRunExtras to preRunExtrasName
getTimeZone
Kind: instance method of GccSheet
Returns: string
- timezone Region/City
handleOpen
Kind: instance method of GccSheet
Summary: Add custom menu when the spreadsheet is opened.
For each namedRangeItem there must be a matching function in gsheet-compost-collections/src/Middleware.js, see example below
Todo
- Only show App Links if user has access
- Document how to add the Named Ranges to the spreadsheet
- Add Bitly QR Codes for STABLE/DEV APP in popups
Example
// example of adding a namedRangeItem to gsheet-compost-collections/src/Middleware.js
function gccMiddlewareFocusNRDateFlags() {
return gccMiddleware('GccSheet.focusNR', 'NRDateFlags');
}
setDateValidationRow
Kind: instance method of GccSheet
Summary: Apply data validation rules to all visible date cells in one row.
Returns: string
- Success message
Param | Type | Description |
---|---|---|
runGroup | object |
Run group |
[rowIndex] | number | null |
Row index |
setDateValidationRows
Kind: instance method of GccSheet
Summary: Apply data validation rules to all visible date cells in all rows. Used on handleOpen, rather than when a particular row has been updated.
Returns: string
- Success message
Todo
- Document why preRunExtras and postRunExtras are added below rather than in getRunGroups, e.g. to limit what appears in Run A/B dropdown?
showLog
Kind: instance method of GccSheet
Summary: Show contents of cache in modal (container-bound script) or console (standalone script)
Param | Type | Description |
---|---|---|
log | string |
Cache log |
showNotification ('toast')
Kind: instance method of GccSheet
Summary: Displays a temporary notification within a spreadsheet
See: https://spreadsheet.dev/toast-notifications-in-google-sheets
Param | Type | Default | Description |
---|---|---|---|
message | string |
Message | |
title | string |
"GCC" |
Title |
duration | number |
5 |
Duration (seconds) |
showSidebar
Kind: instance method of GccSheet
Summary: Show the sidebar, which is used to display contextual help.
Param | Type | Description |
---|---|---|
section | string |
Help section |
showVersionHistory
Kind: instance method of GccSheet
Summary: Show version history in a modal
getCellByString
Kind: static method of GccSheet
Summary: Get a reference to spreadsheet cells containing the specified text.
Returns: Range
- Range object
See: runIntegrationTests
Param | Type | Description |
---|---|---|
sheetName | string |
Sheet name |
cellText | string |
Cell text |
getColumnIndex
Kind: static method of GccSheet
Summary: Get the number of the spreadsheet column containing the specified text (to find the column headers).
Note: this is an expensive operation as getCellByString uses createTextFinder to search the entire sheet.
Returns: number
- columnIndex
See
- runIntegrationTests
- https://stackoverflow.com/a/64289303
- https://developers.google.com/apps-script/reference/spreadsheet/range?hl=en#getColumn())
Todo
- For dates follow technique of setDateValidationCriteria - dateHeadersRange.getColumn() + offset
Param | Type | Description |
---|---|---|
sheetName | string |
Sheet name |
cellText | string |
Cell text |
GccSheet.getInstance(config) ⇒ GccSheet
getInstance
Kind: static method of GccSheet
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccSheet
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
getRowIndex
Kind: static method of GccSheet
Summary: Get the number of the spreadsheet row containing the specified text, to find the runs start and end rows.
Returns: number
- rowIndex
See: runIntegrationTests
Param | Type | Description |
---|---|---|
sheetName | string |
Sheet name |
cellText | string |
Cell text |
getRunSheet
Kind: static method of GccSheet
Summary: Get suburbs or town spreadsheet sheet (if the user is allowed to access it).
Returns: object
- runSheet
See: runIntegrationTests
Param | Type | Description |
---|---|---|
sheetName | object |
Sheet name |
handleEdit
Kind: static method of GccSheet
Summary: Run when the spreadsheet is edited.
Todo
- Clear cache if any/specific fields edited
- Determine which field in which run was edited so we can update the UI (#50)
Param | Type | Description |
---|---|---|
e | object |
Event object |
cbConfig | object |
Container-bound config |
openLink
Kind: static method of GccSheet
Summary: Open a URL (from a custom menu item).
See
- https://stackoverflow.com/q/25980008/6850747
- https://gist.github.com/tanaikech/9115c70eb83558d3af2eea656e4d9c67
Param | Type | Description |
---|---|---|
linkUrl | string |
Link URL |
openLinkPhoneSize
Kind: static method of GccSheet
Summary: Open a URL (from a custom menu item).
See
- https://stackoverflow.com/q/25980008/6850747
- https://gist.github.com/tanaikech/9115c70eb83558d3af2eea656e4d9c67
Param | Type | Description |
---|---|---|
linkUrl | string |
Link URL |
setConditionalFormatting
Kind: static method of GccSheet
Param | Type | Description |
---|---|---|
runName | string |
Run name |
setDateValidation
Kind: static method of GccSheet
Summary: Apply data validation rules to all visible date cells in one row or all rows.
Param | Type | Default | Description |
---|---|---|---|
runGroup | object |
|
Run group |
[rowIndex] | number | null |
|
Row index |
setDateValidationCriteria
Kind: static method of GccSheet
Summary: Apply data validation rules to all visible date cells in one row.
This transforms TRUE/FALSE values to checkboxes and volume values to list dropdowns.
Param | Type | Default | Description |
---|---|---|---|
sheetName | string |
Sheet name | |
dateHeadersRange | Range |
Date headers range | |
rowIndex | number |
Row index | |
type | string |
Type (uppercase in range) | |
container | object |
Instance of GccContainer | |
lastRow | boolean |
false |
Last row |
setRangeValidationCriteria
Kind: static method of GccSheet
Summary: Apply validation rules to a range.
Param | Type | Default | Description |
---|---|---|---|
range | Range |
Range to add validation to | |
criteriaType | string |
Criteria type | |
criteriaValues | Array |
Criteria values | |
allowInvalid | boolean |
true |
whether to show a warning when input fails data validation or whether to reject the input entirely |
validateRangeValues
Kind: static method of GccSheet
Summary: Test whether the data in the range is valid according to the validation rules present.
Returns: object
- results Results
See
- runIntegrationTests
- https://developers.google.com/apps-script/reference/spreadsheet/range?hl=en#getdatavalidations
- https://stackoverflow.com/a/64993041
- https://issuetracker.google.com/issues/36764218
- https://issuetracker.google.com/issues/36763134#comment7
Param | Type | Default | Description |
---|---|---|---|
range | Range |
Range | |
replacementValues | Array | null |
|
A two-dimensional array of replacement values, indexed by row, then by column. Prevents a runtime error when using range.setValue() to set a value which does not meet the range's data validation criteria. try .. catch cannot be used to mitigate this. |
validateValue
Kind: static method of GccSheet
Summary: Test whether a value is valid according to the validation rules supplied.
Returns: object
- result
See
- https://developers.google.com/apps-script/reference/spreadsheet/data-validation-criteria?hl=en
- https://stackoverflow.com/a/64993041
- https://issuetracker.google.com/issues/36764218
- https://ui.dev/validate-email-address-javascript
- https://www.freecodecamp.org/news/check-if-a-javascript-string-is-a-url/
Param | Type | Description |
---|---|---|
criteriaType | string |
Criteria type |
criteriaValues | Array |
Criteria values |
cellRange | Range |
Cell range |
cellValue | * |
Value to validate |
writeToSheetFromRunFormObject
Kind: static method of GccSheet
Summary: When the user selects a container volume, write the app data back to the spreadsheet.
Returns: string
- Success message for processing by the success handler in JavaScript.js.html
See: runIntegrationTests
Todo
- Is the key deletion used below still necessary?
- Reference to JavaScript.js.html (??) is incorrect - what should it be?
Param | Type | Description |
---|---|---|
formObject | object |
Submitted form object |
Kind: global class
Summary: Properties and methods relating to testing of the codebase.
- GccTest
- new GccTest(config)
- instance
- .config :
object
- .expectations :
object
- .stubbedMap :
Map
- .getCollectionInstances() ⇒
Array
- .getColorInstances() ⇒
Array
- .getContainerInstances() ⇒
Array
- .getEnvInstances() ⇒
Array
- .getPageInstances() ⇒
Array
- .getRunInstances() ⇒
Array
- .getRunGroupInstances() ⇒
Array
- .getSheetInstances() ⇒
Array
- .getUtilsInstances() ⇒
Array
- .runIntegrationTests(QUnit)
- .runUnitTests(QUnit)
- .stub(classMethod, args, returnValue)
- .stubGccCache()
- .stubGccCollection()
- .stubGccEnv()
- .stubGccRun()
- .stubGccRunGroup()
- .stubGccSheet()
- .config :
- static
- .getQUnitGS2() ⇒
object
- .getQUnitGS2() ⇒
Param | Type | Description |
---|---|---|
config | object |
App configuration. |
config
Kind: instance property of GccTest
expectations
Kind: instance property of GccTest
stubbedMap
Kind: instance property of GccTest
getCollectionInstances
Kind: instance method of GccTest
Returns: Array
- instances of GccCollection
getColorInstances
Kind: instance method of GccTest
Returns: Array
- instances of GccColor
getContainerInstances
Kind: instance method of GccTest
Returns: Array
- instances of GccContainer
getEnvInstances
Kind: instance method of GccTest
Returns: Array
- instances of GccEnv
getPageInstances
Kind: instance method of GccTest
Returns: Array
- instances of GccPage
getRunInstances
Kind: instance method of GccTest
Returns: Array
- instances of GccRun
getRunGroupInstances
Kind: instance method of GccTest
Returns: Array
- instances of GccRunGroup
getSheetInstances
Kind: instance method of GccTest
Returns: Array
- instances of GccSheet
getUtilsInstances
Kind: instance method of GccTest
Returns: Array
- instances of GccUtils
runIntegrationTests
Kind: instance method of GccTest
Summary: Run integration tests
Param | Type | Description |
---|---|---|
QUnit | object |
QUnit |
runUnitTests
Kind: instance method of GccTest
Summary: Run unit tests.
Note: config object is passed into instantiations as unit tests can't access the serverside cache.
See: https://api.qunitjs.com/QUnit/module/ for setup/teardown
Param | Type | Description |
---|---|---|
QUnit | object |
QUnit |
stub
Kind: instance method of GccTest
Summary: Stub a function in order to control its output and prevent calls to the server.
Param | Type | Description |
---|---|---|
classMethod | string |
Class.method |
args | Array |
Args |
returnValue | * |
Return value |
Example
this.stub('GccCache.clearCache', [], 'Deleted cache');
stubGccCache
Kind: instance method of GccTest
stubGccCollection
Kind: instance method of GccTest
stubGccEnv
Kind: instance method of GccTest
stubGccRun
Kind: instance method of GccTest
stubGccRunGroup
Kind: instance method of GccTest
stubGccSheet
Kind: instance method of GccTest
The QUnitGS2 callback function getResultsFromServer() has to reside in the container-bound app as only that has the datasource and configuration information to load the test page. But QUnitGS2 is only a dependency of the standalone app, not of the container-bound app. The solution is to pass QUnitGS2 from the standalone app to the container-bound app.
Kind: static method of GccTest
Summary: Get QUnitGS2
Returns: object
- QUnitGS2 - QUnitGS2 testing framework
Kind: global class
Summary: UI helpers.
Access: public
- GccUi
- new GccUi(config)
- instance
- static
Param | Type | Description |
---|---|---|
config | object |
App configuration. |
config.uiFocusableSelectors | Array |
UI elements which can be focussed by the user. |
focusableSelector
Kind: instance property of GccUi
gccUi.instance : GccUi
instance
Kind: instance property of GccUi
enableActiveStates
Kind: instance method of GccUi
Summary: Fix for iOS which does not apply the active state by default, applied per-element for better performance
See
- https://developers.google.com/web/fundamentals/design-and-ux/input/touch/#enabling_active_state_support_on_ios
- http://stackoverflow.com/a/28771425
- https://codepen.io/dotherightthingnz/pen/bGwaGmM
Param | Type | Description |
---|---|---|
parentSelector | string |
Parent selector |
createCustomEvent
Kind: static method of GccUi
Summary: Create a synthetic event which can be triggered and which will then invoke the element's matching event listener
Returns: *
- CustomEvent
See: https://developer.mozilla.org/en-US/docs/Web/Events/Creating_and_triggering_events
Param | Type | Description |
---|---|---|
eventName | string |
Event name |
GccUi.getInstance(config) ⇒ GccUi
getInstance
Kind: static method of GccUi
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccUi
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
log
Kind: static method of GccUi
Summary: Log a string to the console
Param | Type | Description |
---|---|---|
str | string |
String to log |
Kind: global class
Access: public
- GccUiCollection
- new GccUiCollection(config)
- instance
- .abbreviations :
Array
- .address :
string
- .cancelled :
boolean
- .collect :
boolean
- .collectionMapLocale :
string
- .collectionStatus :
string
- .containerQuantity :
number
- .containerType :
string
- .dateFlag :
string
- .dateValue :
number
|string
|boolean
- .index :
number
- .groupActiveIndex :
number
- .groupTotal :
number
- .name :
string
- .notes :
string
- .onHold :
boolean
- .pending :
boolean
- .runDate :
string
- .runName :
string
- .type :
string
- .typeDefinition :
string
- .volumesAndDateFlags :
null
|Array
- .editNotesStart(element)
- .editNotesEnd(element)
- .getAddressUrl(address, collectionMapLocale) ⇒
string
- .getChecklistItemHtml(collectionId, inputId, targetStateId) ⇒
string
- .getCollectionHtml() ⇒
string
- .getCollectionStatus() ⇒
string
- .getContainerHtml() ⇒
string
- .getDisclosureButtonHtml(disclosureId, targetStateId) ⇒
string
- .getLegendHtml(notesId) ⇒
string
- .getNotesHtml(notesId, targetStateId) ⇒
string
- .getSelectHtml(collectionId, inputId, targetStateId) ⇒
string
- .getSelectionHtml(collectionId) ⇒
string
- .getTargetInput(element) ⇒
HTMLElement
- .getTypeDefinition() ⇒
string
- .linkPhoneNumbers(text) ⇒
string
- .updateCheckedState(element)
- .updateCollectionColor(element)
- .updateCollectionSelection(element)
- .abbreviations :
- static
- .getSourceInput(element) ⇒
HTMLElement
- .isCheckbox(element) ⇒
boolean
- .getSourceInput(element) ⇒
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.abbreviations | Array |
Abbreviations and their expansions (used to accessibly expand collection types). |
config.address | string |
Street address of collection. |
config.cancelled | boolean |
Whether the collection is permanently cancelled. |
config.collect | boolean |
Whether the collection should be collected. |
config.collectionMapLocale | string |
Map locale to append to Google Maps lookups. |
config.containerQuantity | number |
Quantity of containers to collect. |
config.containerType | string |
Type of container to collect. |
config.dateFlag | string |
Any special instructions for the collection on a particular collection date (Skip, Drop, etc). |
config.dateValue | number | string | boolean |
Recorded collection amount or status or checkbox state for a particular collection date. |
config.editableToggleClass | string |
Class selector used by the notes edit buttons. |
config.groupActiveIndex | number |
Index of this instance within a group of collections (the 'active count'). |
config.groupTotal | number |
Total number of instance within a group of collections. |
config.loopIndex | number |
Index of this instance within a group of collections. |
config.name | string |
The name of the customer. |
config.notes | string |
General notes about this collection, such as where to find the container or how to contact the customer. |
config.onHold | boolean |
Whether the collection is temporarily on hold. |
config.pending | boolean |
Whether the collection is yet to begin. |
config.runDate | string |
The date of the collection. |
config.runName | string |
The name of the parent run. |
config.type | string |
The type of customer. |
config.volumesAndDateFlags | Array | null |
Volumes and date flags. |
abbreviations
Kind: instance property of GccUiCollection
address
Kind: instance property of GccUiCollection
cancelled
Kind: instance property of GccUiCollection
collect
Kind: instance property of GccUiCollection
collectionMapLocale
Kind: instance property of GccUiCollection
collectionStatus
Kind: instance property of GccUiCollection
containerQuantity
Kind: instance property of GccUiCollection
containerType
Kind: instance property of GccUiCollection
dateFlag
Kind: instance property of GccUiCollection
dateValue
Kind: instance property of GccUiCollection
index
Kind: instance property of GccUiCollection
groupActiveIndex
Kind: instance property of GccUiCollection
groupTotal
Kind: instance property of GccUiCollection
name
Kind: instance property of GccUiCollection
notes
Kind: instance property of GccUiCollection
onHold
Kind: instance property of GccUiCollection
pending
Kind: instance property of GccUiCollection
runDate
Kind: instance property of GccUiCollection
runName
Kind: instance property of GccUiCollection
type
Kind: instance property of GccUiCollection
typeDefinition
Kind: instance property of GccUiCollection
volumesAndDateFlags
Kind: instance property of GccUiCollection
editNotesStart
Kind: instance method of GccUiCollection
Summary: User starts editing of notes
See: https://stackoverflow.com/a/70565696/6850747
Param | Type | Description |
---|---|---|
element | HTMLElement |
HTML Element |
editNotesEnd
Kind: instance method of GccUiCollection
Summary: User starts editing of notes
Param | Type | Description |
---|---|---|
element | HTMLElement |
HTML Element |
getAddressUrl
Kind: instance method of GccUiCollection
Summary: Generate a link to the collection address using Google Maps.
Returns: string
- URL
See: https://gearside.com/easily-link-to-locations-and-directions-using-the-new-google-maps/
Param | Type | Description |
---|---|---|
address | string |
Address |
collectionMapLocale | string |
Map locale |
getChecklistItemHtml
Kind: instance method of GccUiCollection
Summary: Generate the HTML for the collection checkbox. Checked attribute set by GccUiRunForm.populateForm.
Returns: string
- html
Param | Type | Description |
---|---|---|
collectionId | string |
Collection ID |
inputId | string |
Input ID |
targetStateId | string |
State proxy ID |
getCollectionHtml
Kind: instance method of GccUiCollection
Summary: Generate the HTML for the collection area of the collection.
Returns: string
- html
getCollectionStatus
Kind: instance method of GccUiCollection
Returns: string
- collectionStatus
getContainerHtml
Kind: instance method of GccUiCollection
Summary: Generate the HTML for the container area of the collection.
Returns: string
- html
getDisclosureButtonHtml
Kind: instance method of GccUiCollection
Summary: Generate the HTML for the collection disclosure button
Returns: string
- html
Param | Type | Description |
---|---|---|
disclosureId | string |
Disclosure ID |
targetStateId | string |
State proxy ID |
getLegendHtml
Kind: instance method of GccUiCollection
Summary: Generate the HTML for the collection legend
Returns: string
- html
Param | Type | Description |
---|---|---|
notesId | string |
Notes ID |
getNotesHtml
Kind: instance method of GccUiCollection
Summary: Generate the HTML for the collection notes area.
Returns: string
- html
Todo
- date flag disappears after user input is written to then read from spreadsheet (#193)
Param | Type | Description |
---|---|---|
notesId | string |
Notes ID |
targetStateId | string |
State proxy ID |
getSelectHtml
Kind: instance method of GccUiCollection
Summary: Generate the HTML for the collection volume select. Values are set by GccUiRunForm.populateForm.
Returns: string
- html
Param | Type | Description |
---|---|---|
collectionId | string |
Collection ID |
inputId | string |
Input ID |
targetStateId | string |
State proxy ID |
getSelectionHtml
Kind: instance method of GccUiCollection
Summary: Generate the HTML for the collection selection output area.
Returns: string
- html
Param | Type | Description |
---|---|---|
collectionId | string |
Collection ID |
getTargetInput
Kind: instance method of GccUiCollection
Summary: Get the HTML element which the supplied element targets.
This allows the user to affect element B by interacting with element A.
Returns: HTMLElement
- targetInputEl Target element
Param | Type | Description |
---|---|---|
element | HTMLElement |
HTML Element |
getTypeDefinition
Kind: instance method of GccUiCollection
Summary: Get the expanded form of a type abbreviation used in the spreadsheet.
Returns: string
- definition
See: runUnitTests
linkPhoneNumbers
Kind: instance method of GccUiCollection
Summary: Link phone numbers in a body of text.
Returns: string
- linkedText
See: https://en.wikipedia.org/wiki/Telephone_numbers_in_New_Zealand
Param | Type | Description |
---|---|---|
text | string |
Text |
updateCheckedState
Kind: instance method of GccUiCollection
Summary: Transform the :checked UI state to a :value that the server can understand (true|false)
and so that the value is always submitted to the server irrespective of the :checked state.
Todo
- Does this need to be bidirectional?
Param | Type | Description |
---|---|---|
element | HTMLElement |
HTML Element |
updateCollectionColor
Kind: instance method of GccUiCollection
Summary: Update the collection colour scheme to reflect the current selection
Param | Type | Description |
---|---|---|
element | HTMLElement |
HTML Element |
updateCollectionSelection
Kind: instance method of GccUiCollection
Summary: Update the visible selection output to reflect the current selection
Param | Type | Description |
---|---|---|
element | HTMLElement |
HTML Element |
getSourceInput
Kind: static method of GccUiCollection
Summary: Get the HTML element which targets the supplied element.
This allows the user to affect (hidden) element B by interacting with (visible) element A.
Returns: HTMLElement
- sourceInputEl Target element
Param | Type | Description |
---|---|---|
element | HTMLElement |
HTML Element |
isCheckbox
Kind: static method of GccUiCollection
Summary: Determine whether an element is a checkbox
Returns: boolean
- isCheckbox
Param | Type | Description |
---|---|---|
element | HTMLElement |
HTML Element |
Kind: global class
Summary: Manage dynamic CSS
Access: public
- GccUiCss
- new GccUiCss(config)
- instance
- static
Param | Type | Description |
---|---|---|
config | object |
App configuration. |
config.uiCss | object |
Module configuration. |
config.uiCss.fixedPositionIds | Array |
IDs of elements that use fixed positioning, used to generate CSS variables. |
fixedPositionIds
Kind: instance property of GccUiCss
gccUiCss.instance : GccUiCss
instance
Kind: instance property of GccUiCss
injectHeightVariables
Kind: instance method of GccUiCss
Summary: Store heights of fixed position elements
GccUiCss.getInstance(config) ⇒ GccUiCss
getInstance
Kind: static method of GccUiCss
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccUiCss
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
Kind: global class
Summary: Show a different screen, without triggering a page reload (which would lose the fullscreen effect)
or otherwise affecting the underlying page state.
Access: public
See: https://www.w3.org/TR/wai-aria-practices/#dialog_modal
- GccUiDialog
- new GccUiDialog(config)
- instance
- .cacheClearButtonId :
string
- .cacheLogButtonId :
string
- .closeClass :
string
- .componentClass :
string
- .consoleContainerId :
string
- .endClass :
string
- .erudaScriptId :
string
- .focusableSelector :
string
- .instance :
GccUiDialog
- .parentDataAttr :
string
- .startClass :
string
- .triggerClass :
string
- .updateDateValidationId :
string
- .init()
- .cacheClear()
- .logCache()
- .handleClick(event)
- .handleFocusTrap(event)
- .handleKeyDown(event)
- .hide()
- .injectConsole()
- .setDateValidation()
- .show(triggerEl)
- .cacheClearButtonId :
- static
Param | Type | Description |
---|---|---|
config | object |
App configuration. |
config.uiDialog | object |
Module configuration. |
config.uiDialogCacheClearButtonId | string |
ID selector used to target the Clear Cache button |
config.uiDialogCacheLogButtonId | string |
ID selector used to target the Log Cache button |
config.uiDialogCloseClass | string |
Class selector of button that hides the component |
config.uiDialogComponentClass | string |
Class selector of component |
config.uiDialogConsoleContainerId | string |
ID selector of console container |
config.uiDialogErudaScriptId | string |
ID selector of eruda script element |
config.uiDialogParentDataAttr | string |
Data attribute used to manage state of parent element |
config.uiDialogTriggerClass | string |
Class selector of button that shows the component |
config.uiDialogUpdateDateValidationId | string |
ID selector used to target the Refresh collection inputs button |
config.uiFocusableSelectors | Array |
UI elements which can be focussed by the user. |
cacheClearButtonId
Kind: instance property of GccUiDialog
cacheLogButtonId
Kind: instance property of GccUiDialog
closeClass
Kind: instance property of GccUiDialog
componentClass
Kind: instance property of GccUiDialog
consoleContainerId
Kind: instance property of GccUiDialog
endClass
Kind: instance property of GccUiDialog
erudaScriptId
Kind: instance property of GccUiDialog
focusableSelector
Kind: instance property of GccUiDialog
gccUiDialog.instance : GccUiDialog
instance
Kind: instance property of GccUiDialog
parentDataAttr
Kind: instance property of GccUiDialog
startClass
Kind: instance property of GccUiDialog
triggerClass
Kind: instance property of GccUiDialog
updateDateValidationId
Kind: instance property of GccUiDialog
init
Kind: instance method of GccUiDialog
cacheClear
Kind: instance method of GccUiDialog
Summary: Clear the contents of the cache
logCache
Kind: instance method of GccUiDialog
Summary: Log the contents of the cache
handleClick
Kind: instance method of GccUiDialog
Summary: Handle clicks/touches
Param | Type | Description |
---|---|---|
event | object |
Event object |
handleFocusTrap
Kind: instance method of GccUiDialog
Summary: Prevent user from tabbing outside the dialog
Param | Type | Description |
---|---|---|
event | object |
Event object |
handleKeyDown
Kind: instance method of GccUiDialog
Summary: Handle key presses
Param | Type | Description |
---|---|---|
event | object |
Event object |
hide
Kind: instance method of GccUiDialog
Summary: Hide the dialog.
Inject console
Kind: instance method of GccUiDialog
setDateValidation
Kind: instance method of GccUiDialog
Summary: Apply data validation rules to all visible date cells in all rows.
show
Kind: instance method of GccUiDialog
Summary: Show the dialog.
Param | Type | Description |
---|---|---|
triggerEl | HTMLElement |
The element (button) which triggered the show. |
GccUiDialog.getInstance(config) ⇒ GccUiDialog
getInstance
Kind: static method of GccUiDialog
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccUiDialog
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
Kind: global class
Summary: Toggle a loading animation
Access: public
- GccUiLoader
- new GccUiLoader(config)
- instance
- .instance :
GccUiLoader
- .componentClass :
string
- .dataAttr :
string
- .descriptionClass :
string
- .hideDelay :
number
- .parentDataAttr :
string
- .runLoaderId :
string
- .runSaverId :
string
- .titleClass :
string
- .show(loaderId, isLoading, [title], [description])
- .instance :
- static
Param | Type | Description |
---|---|---|
config | object |
App configuration. |
config.uiLoader | object |
Module configuration. |
config.uiLoader.componentClass | string |
Class selector of the loader element |
config.uiLoader.dataAttr | string |
Data attribute used to manage state |
config.uiLoader.descriptionClass | string |
Class selector of the loader description |
config.uiLoader.hideDelay | number |
Number of milliseconds to wait before hiding the loader |
config.uiLoader.parentDataAttr | string |
Data attribute used to manage state of parent element |
config.uiLoader.runLoaderId | string |
ID selector of the loader component that appears in the overlay |
config.uiLoader.runSaverId | string |
ID selector of the loader component that appears save status bar |
config.uiLoader.titleClass | string |
Class selector of the loader title |
gccUiLoader.instance : GccUiLoader
instance
Kind: instance property of GccUiLoader
componentClass
Kind: instance property of GccUiLoader
dataAttr
Kind: instance property of GccUiLoader
descriptionClass
Kind: instance property of GccUiLoader
hideDelay
Kind: instance property of GccUiLoader
parentDataAttr
Kind: instance property of GccUiLoader
runLoaderId
Kind: instance property of GccUiLoader
runSaverId
Kind: instance property of GccUiLoader
titleClass
Kind: instance property of GccUiLoader
show
Hide or show the loader (icon visibility is set in CSS).
Kind: instance method of GccUiLoader
See: https://loading.io/css/
Param | Type | Default | Description |
---|---|---|---|
loaderId | string |
Loader ID (runLoaderId or runSaverId depending on context) | |
isLoading | string |
Loading state (true | |
[title] | string |
null |
Visible title |
[description] | string |
null |
Visible description |
GccUiLoader.getInstance(config) ⇒ GccUiLoader
getInstance
Kind: static method of GccUiLoader
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccUiLoader
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
Kind: global class
Access: public
- GccUiRun
- new GccUiRun(config)
- .bucketsTotal :
number
|string
- .collections :
Array
- .collectionsActiveTotal :
number
- .date :
string
- .name :
string
- .tubsTotal :
number
- .getTotalActiveCollections() ⇒
number
- .getTotalBuckets() ⇒
number
|string
- .getTotalTubs() ⇒
number
- .getRunHeaderHtml() ⇒
string
Param | Type | Description |
---|---|---|
config | object |
Module configuration. |
config.collections | Array |
Collection points on the run. |
config.date | string |
Date of the run |
config.name | string |
Name of the run |
bucketsTotal
Kind: instance property of GccUiRun
collections
Kind: instance property of GccUiRun
collectionsActiveTotal
Kind: instance property of GccUiRun
date
Kind: instance property of GccUiRun
name
Kind: instance property of GccUiRun
tubsTotal
Kind: instance property of GccUiRun
getTotalActiveCollections
Kind: instance method of GccUiRun
Returns: number
- collectionsActiveTotal
getTotalBuckets
Kind: instance method of GccUiRun
Returns: number
| string
- bucketsTotal
getTotalTubs
Kind: instance method of GccUiRun
Returns: number
- tubsTotal
getRunHeaderHtml
Kind: instance method of GccUiRun
Summary: Generate the HTML for the run header.
Returns: string
- html
Kind: global class
Access: public
- GccUiRunForm
- new GccUiRunForm(config)
- instance
- .collectionsId :
string
- .id :
string
- .instance :
GccUiRunForm
- .placeholderLogoClass :
string
- .runId :
string
- .getCollectionsHtml(data) ⇒
string
- .init()
- .handleChange(event)
- .handleClick(event)
- .handleSubmit(event)
- .handleSubmitFailCb(serverResponse)
- .handleSubmitSuccessCb()
- .injectTemplate(data)
- .populateForm(data)
- .reset()
- .showPlaceholderLogo(show)
- .collectionsId :
- static
Param | Type | Description |
---|---|---|
config | object |
App configuration. |
config.uiRunForm | object |
Module configuration. |
config.uiRunForm.collectionsId | string |
ID selector used to target the collections container |
config.uiRunForm.id | string |
ID selector used to target the run form |
config.uiRunForm.placeholderLogoClass | string |
Class selector which applies the background logo |
config.uiRunForm.runId | string |
ID selector of the run component |
collectionsId
Kind: instance property of GccUiRunForm
id
Kind: instance property of GccUiRunForm
gccUiRunForm.instance : GccUiRunForm
instance
Kind: instance property of GccUiRunForm
placeholderLogoClass
Kind: instance property of GccUiRunForm
runId
Kind: instance property of GccUiRunForm
getCollectionsHtml
Kind: instance method of GccUiRunForm
Summary: Instances of GccCollection (backend) are converted to objects
and passed to the frontend where they are processed by GccUiCollection (frontend)
Returns: string
- html
Param | Type | Description |
---|---|---|
data | object |
Pubsub data |
init
Kind: instance method of GccUiRunForm
Summary: Runs every time a new run form is selected/loaded.
handleChange
Kind: instance method of GccUiRunForm
Param | Type | Description |
---|---|---|
event | object |
Event object |
handleClick
Kind: instance method of GccUiRunForm
Param | Type | Description |
---|---|---|
event | object |
Event object |
handleSubmit
Kind: instance method of GccUiRunForm
See: https://developers.google.com/apps-script/guides/html/communication#index.html_4
Param | Type | Description |
---|---|---|
event | object |
Event object |
handleSubmitFailCb
Kind: instance method of GccUiRunForm
Summary: Message is returned from serverside function
Param | Type | Description |
---|---|---|
serverResponse | string |
Server error message |
handleSubmitSuccessCb
Kind: instance method of GccUiRunForm
Summary: Message is returned from serverside function
injectTemplate
Kind: instance method of GccUiRunForm
Param | Type | Description |
---|---|---|
data | object |
Pubsub data |
populateForm
Kind: instance method of GccUiRunForm
Summary: Apply spreadsheet values to the templated form elements
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/checkbox
Param | Type | Description |
---|---|---|
data | object |
Pubsub data |
reset
Kind: instance method of GccUiRunForm
showPlaceholderLogo
Kind: instance method of GccUiRunForm
Summary: Show the placeholder logo when the run form is not present.
Param | Type | Description |
---|---|---|
show | boolean |
Whether to show the placeholder |
GccUiRunForm.getInstance(config) ⇒ GccUiRunForm
getInstance
Kind: static method of GccUiRunForm
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccUiRunForm
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
Kind: global class
Summary: Expand and collapse a container, and expose the state of the select element contained within.
Access: public
- GccUiSelectDisclosure
- new GccUiSelectDisclosure(config)
- instance
- .closeOnSelect :
boolean
- .closeOnSelectDelay :
number
- .instance :
GccUiSelectDisclosure
- .triggerClass :
string
- .init(formId)
- .toggle(triggerEl)
- .updateTriggerState(triggerEl)
- .closeOnSelect :
- static
Param | Type | Description |
---|---|---|
config | object |
App configuration. |
config.uiSelectDisclosure | object |
Module configuration. |
config.uiSelectDisclosure.closeOnSelect | boolean |
Whether to automatically close the disclosure after a volume option is selected |
config.uiSelectDisclosure.closeOnSelectDelay | number |
Number of milliseconds to wait before automatically closing the disclosure |
config.uiSelectDisclosure.triggerClass | string |
Class selector of button that opens the disclosure |
closeOnSelect
Kind: instance property of GccUiSelectDisclosure
closeOnSelectDelay
Kind: instance property of GccUiSelectDisclosure
gccUiSelectDisclosure.instance : GccUiSelectDisclosure
instance
Kind: instance property of GccUiSelectDisclosure
triggerClass
Kind: instance property of GccUiSelectDisclosure
init
Kind: instance method of GccUiSelectDisclosure
See: https://www.w3.org/TR/wai-aria-practices/#disclosure
Param | Type | Description |
---|---|---|
formId | string |
Form ID |
toggle
Kind: instance method of GccUiSelectDisclosure
Summary: Open or close the disclosure.
Param | Type | Description |
---|---|---|
triggerEl | HTMLElement |
The element (button) which triggered the toggle. |
updateTriggerState
Kind: instance method of GccUiSelectDisclosure
Summary: When a volume option is selected, or a checklist item is checked, change the colour of the disclosure trigger checkbox.
Param | Type | Description |
---|---|---|
triggerEl | HTMLElement |
The element (button) which triggered the toggle. |
GccUiSelectDisclosure.getInstance(config) ⇒ GccUiSelectDisclosure
getInstance
Kind: static method of GccUiSelectDisclosure
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccUiSelectDisclosure
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
Kind: global class
Access: public
- GccUiSelectForm
- new GccUiSelectForm(config)
- instance
- static
Param | Type | Description |
---|---|---|
config | object |
App configuration. |
config.uiSelectForm | object |
Module configuration. |
config.uiSelectForm.id | string |
ID selector of the form element. |
id
Kind: instance property of GccUiSelectForm
gccUiSelectForm.instance : GccUiSelectForm
instance
Kind: instance property of GccUiSelectForm
handleChange
Kind: instance method of GccUiSelectForm
Param | Type | Description |
---|---|---|
event | object |
Event object |
handleFormData
Kind: instance method of GccUiSelectForm
See: https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
Param | Type | Description |
---|---|---|
event | object |
Event object |
handleSubmit
Kind: instance method of GccUiSelectForm
Returns: *
- handleFormData
See: https://developers.google.com/apps-script/guides/html/communication#index.html_4
Param | Type | Description |
---|---|---|
event | object |
Event object |
handleSubmitFailCb
Kind: instance method of GccUiSelectForm
Summary: Message is returned from serverside function
Param | Type | Description |
---|---|---|
serverResponse | string |
Server error message |
handleSubmitSuccessCb
Kind: instance method of GccUiSelectForm
Summary: Callback after the form containing the run and date selects is submitted to the server.
Param | Type | Description |
---|---|---|
serverResponseObj | object |
Server response object |
init
Kind: instance method of GccUiSelectForm
processSelections
Kind: instance method of GccUiSelectForm
Param | Type | Description |
---|---|---|
serverResponseObj | object |
Server response object |
toggleOptgroups
Kind: instance method of GccUiSelectForm
Summary: When an option is selected from an optgroup, limit other selects to choosing from the same optgroup.
This is to prevent runs being chosen from different run sheets / days.
Param | Type | Description |
---|---|---|
element | HTMLElement |
Select element |
GccUiSelectForm.getInstance(config) ⇒ GccUiSelectForm
getInstance
Kind: static method of GccUiSelectForm
Summary: Note: this refers to class instance in prototype methods and class constructor in static methods.
Returns: GccUiSelectForm
- instance of class
See
- https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
- https://stackoverflow.com/a/50285439
Param | Type | Description |
---|---|---|
config | object |
Config |
getIndefiniteArticle
Kind: global function
Summary: Get the appropriate indefinite article for the specified string
Returns: string
- indefiniteArticle
Param | Type | Description |
---|---|---|
str | string |
String |
stringToCapitalised
Kind: global function
Summary: Capitalise a string
Returns: string
- capitalisedStr
Param | Type | Description |
---|---|---|
str | string |
String to convert |
stringToId
Kind: global function
Summary: Convert a string into a form safe for use as an HTML id attribute.
Returns: string
- safeStr
Param | Type | Description |
---|---|---|
str | string |
String to convert |
errorMessage
Kind: global function
Summary: Generate a validation error message.
Param | Type | Description |
---|---|---|
value | * |
Value to validate |
types | Array |
Expected type(s) |
identifier | string |
Label to use in error message |
isArray
Kind: global function
Summary: Validate that a value is an array
Returns: boolean
- valid
Param | Type | Description |
---|---|---|
value | * |
Value to validate |
isBoolean
Kind: global function
Summary: Validate that a value is a boolean
Returns: boolean
- valid
Param | Type | Description |
---|---|---|
value | * |
Value to validate |
isNull
Kind: global function
Summary: Validate that a value is null
Returns: boolean
- valid
Param | Type | Description |
---|---|---|
value | * |
Value to validate |
isNumber
Kind: global function
Summary: Validate that a value is a number
Returns: boolean
- valid
Param | Type | Description |
---|---|---|
value | * |
Value to validate |
isObject
Kind: global function
Summary: Validate that a value is an object
Returns: boolean
- valid
Param | Type | Description |
---|---|---|
value | * |
Value to validate |
isString
Kind: global function
Summary: Validate that a value is a string (even an empty one)
Returns: boolean
- valid
Param | Type | Description |
---|---|---|
value | * |
Value to validate |
isString1
Kind: global function
Summary: Validate that a value is a string of at least one character in length
Returns: boolean
- valid
Param | Type | Description |
---|---|---|
value | * |
Value to validate |
isStringNumber
Kind: global function
Summary: Validate that a value is a number
Returns: boolean
- valid
Param | Type | Description |
---|---|---|
value | * |
Value to validate |
validate
Kind: global function
Summary: Validate a value against a type.
Returns: *
- value
Param | Type | Default | Description |
---|---|---|---|
value | * |
Value to validate | |
type | string |
Expected type | |
identifier | string |
Label to use in error message | |
condition | boolean |
true |
Validate if condition is true |
doGet
Kind: global function
Summary: Function which runs when the web app is visited in a web browser. Do not edit.
Returns: *
- - The GsheetCompostCollections library will load the web page.
Param | Type | Description |
---|---|---|
e | object |
An event parameter that can contain information about any request parameters. |
gccMiddleware
Kind: global function
Summary: Middleware to call standalone scripts from container-bound environment.
Returns: *
- callback - Callable function with args
Param | Type | Description |
---|---|---|
classMethod | string |
Class.method (combined arguments to facilitate find and replace in codebase) |
...args | * |
Args for callable function |
gccSheetHandleEdit
Kind: global function
Summary: Run when the spreadsheet is edited.
'Installable Trigger' (Triggers > Add Trigger)
Differs from a 'Simple Trigger' (i.e. handleEdit in Main.gs) in that it can access services that require authorization.
Returns: *
- callback
Param | Type | Description |
---|---|---|
e | object |
Trigger event object |
gccSheetHandleOpen
Kind: global function
Summary: Run when the spreadsheet is opened.
'Installable Trigger' (Triggers > Add Trigger)
Differs from a 'Simple Trigger' (i.e. handleEdit in Main.gs) in that it can access services that require authorization.
Returns: *
- callback
Kind: global function
Summary: Retrieve test results when ready.
Returns: *
- - Test results