Undebate Self Service Portal- Web portal where election administrators of democratically run organizations create undebates for their candidates and voters
Need to add parentId of electionObjId to the viewer.
After the election Object is created, the undebate api undebateFromTemplateAndRows shall be called with the viewer-recorder-object from above, and the moderator info manipulated into a rowObjs array with one row.
server side:
app/socket_apis/create-moderator-recorder.js
import undebatesFromTemplateAndRows from "civil-server"
createModeratorRecorder(electionObjId,callback){
}
[ ] create a jest test for this API call
create an interactive/visual dev test for the api
[ ] create a prototype doc electionObj in iotas.json
use node node_modules/civil-server/dist/tools/mongo-id.js in your shell to get a unique objectId to use.
[ ] create a webComponent for the test in /app/web-components
see app/web-components/home.js for a start the web component should show a button to click on. When it's clicked on, the client side emit is called, to create the recorder.
after the call completes, the path to the viewer and recorder should be shown.
When user clicks on the viewer url and recorder url a new window pops up and they can see the result
npm run dev must be run after creating this component, or the server won't find it
[ ] create a doc in iotas.json for the testing component
start with this as a model, but you will need to add more to it:
{
"_id": {
"$oid": "620abd7b94a51f0a28a8b9d4" // this is a unique
},
"path": "/qa/create-moderator-record",
"subject": "Create Moderator Record Test",
"description": "Create Moderator Record in Undebate Test",
"webComponent": {
"webComponent": "QaCreateModeratorRecordTest",
"electionObjId", "xxxxx" // the unique Id you create for the election obj iota above
''' // you can put other properties here and they will appear and props to the react component above
}
},
You will need to go through the steps here to create a mongo database on mongodb.com (free) and get a MONGODB_URI and put it into your environment. I hear that the steps in the slides are out of date so ask if there are problems.
After you have a MONGODB_URI in your environment, you can npm run dev and then browse to localhost:3011/qa/create-moderator-record
you can also brows to localhost:3011/home , localhost:3011/qa/ccwrapper and localhost:3011/qa/ccwrapper-recorder
Create the API l that will cause the moderator undebate recorder to be created.
client side:
the call back should return undefined if there is an error, or { moderator: {viewerPath: "/path/to/viewer", recorderPath: "/path/to/recorder"} }
The API call should result in a side effect where all browsers subscribing to the electionObj should get an update.
Note: references to undebate that follow are to the civ-serv branch of the undebate repo, not the main branch.
When the API is called, a viewer-recorder object needs to be created from the information in the electionObj.
Use undebate: app/tools/2021-nac-viewer-recorder.js as a template for creating the moderator recorder for the election.
Need to add parentId of electionObjId to the viewer.
After the election Object is created, the undebate api undebateFromTemplateAndRows shall be called with the viewer-recorder-object from above, and the moderator info manipulated into a rowObjs array with one row.
see the test file for an example /app/lib/tests/undebates-from-template-and-rows.js
Here is the main code but hopefully it won't be needed: /app/lib/undebates-from-template-and-rows.js and
server side: app/socket_apis/create-moderator-recorder.js
create an interactive/visual dev test for the api
[ ] create a prototype doc electionObj in iotas.json use
node node_modules/civil-server/dist/tools/mongo-id.js
in your shell to get a unique objectId to use.[ ] create a webComponent for the test in /app/web-components see app/web-components/home.js for a start the web component should show a button to click on. When it's clicked on, the client side emit is called, to create the recorder. after the call completes, the path to the viewer and recorder should be shown. When user clicks on the viewer url and recorder url a new window pops up and they can see the result
npm run dev
must be run after creating this component, or the server won't find it[ ] create a doc in iotas.json for the testing component start with this as a model, but you will need to add more to it:
You will need to go through the steps here to create a mongo database on mongodb.com (free) and get a MONGODB_URI and put it into your environment. I hear that the steps in the slides are out of date so ask if there are problems.
After you have a MONGODB_URI in your environment, you can
npm run dev
and then browse tolocalhost:3011/qa/create-moderator-record
you can also brows to
localhost:3011/home
,localhost:3011/qa/ccwrapper
andlocalhost:3011/qa/ccwrapper-recorder