-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust grid validation logic to run in spreadsheet
The event data can now be validated from within the spreadsheet. One caveat: the appscript runtime has no support for the URL primitive, so URL validation is minimal. Still todo: - Validation results are reported as a JSON dump for now. Next step is to report them in the grid sheet itself. - The W3C_ID variable isn't stored anywhere for now so validation of chairs who haven't connected their GitHub and W3C accounts currently fails.
- Loading branch information
Showing
9 changed files
with
150 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,42 @@ | ||
import reportError from './report-error.mjs'; | ||
import { getProject } from './project.mjs'; | ||
import { validateGrid } from '../common/validate.mjs'; | ||
|
||
/** | ||
* Export the event data as JSON | ||
*/ | ||
export default async function () { | ||
const project = getProject(SpreadsheetApp.getActiveSpreadsheet()); | ||
try { | ||
console.log('Read data from spreadsheet...'); | ||
const project = getProject(SpreadsheetApp.getActiveSpreadsheet()); | ||
if ((project.metadata.type === 'tpac-breakouts') || | ||
(project.metadata.type === 'breakouts-day')) { | ||
// Only two types of events from an internal perspective | ||
project.metadata.type = 'breakouts'; | ||
} | ||
console.log('Read data from spreadsheet... done'); | ||
|
||
const res = await validateGrid(project, { what: 'everything' }); | ||
console.log('Validate the grid...'); | ||
const res = await validateGrid(project, { what: 'everything' }); | ||
console.log('Validate the grid... done'); | ||
|
||
const htmlOutput = HtmlService | ||
.createHtmlOutput( | ||
'<pre>' + JSON.stringify(res, null, 2) + '</pre>' | ||
) | ||
.setWidth(300) | ||
.setHeight(400); | ||
SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Validation result'); | ||
console.log('Refresh grid view, with validation result...'); | ||
console.log('- TODO: re-generate grid'); | ||
console.log('- TODO: report validation result'); | ||
console.log('Refresh grid view, with validation result... done'); | ||
|
||
console.log('Report validation result...'); | ||
const htmlOutput = HtmlService | ||
.createHtmlOutput( | ||
'<pre>' + JSON.stringify(res, null, 2) + '</pre>' | ||
) | ||
.setWidth(300) | ||
.setHeight(400); | ||
SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Validation result'); | ||
console.log('Report validation result... done'); | ||
} | ||
catch(err) { | ||
reportError(err.toString()); | ||
return; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters