update dependencies and devDependencies, address lint issues
[squeep-indie-auther] / src / template / admin-maintenance-html.js
index f57a118b371d396d03c62c6e99c0881f1b786ad4..0f4de44ce599fa62b745f1b63dab9d8ec90a2ca4 100644 (file)
@@ -3,6 +3,11 @@
 const th = require('./template-helper');
 const { sessionNavLinks } = require('@squeep/authentication-module');
 
+/**
+ *
+ * @param {object} entry entry
+ * @returns {string} tr
+ */
 function renderAlmanacRow(entry) {
   const { event, date } = entry;
   return `<tr>
@@ -11,21 +16,34 @@ function renderAlmanacRow(entry) {
 </tr>`;
 }
 
+/**
+ *
+ * @param {object[]} almanac entries
+ * @returns {string} section
+ */
 function almanacSection(almanac) {
   return `<section>
 \t<h2>Almanac</h2>
 \t<table>
 \t\t<thead>
-\t\t\t<th>Event</th>
-\t\t\t<th>Date</th>
+\t\t\t\t<tr>
+\t\t\t\t<th scope="col">Event</th>
+\t\t\t\t<th scope="col">Date</th>
+\t\t\t</tr>
 \t\t</thead>
 \t\t<tbody>
 ${almanac.map((entry) => renderAlmanacRow(entry)).join('\n')}
 \t\t</tbody>
-\t<table>
+\t</table>
 </section>`;
 }
 
+/**
+ *
+ * @param {string} choreName name
+ * @param {object} choreDetails details
+ * @returns {string} tr
+ */
 function renderChoreRow(choreName, choreDetails) {
   const { intervalMs, nextSchedule } = choreDetails;
   return `<tr>
@@ -35,33 +53,39 @@ function renderChoreRow(choreName, choreDetails) {
 </tr>`;
 }
 
+/**
+ *
+ * @param {object} chores chores
+ * @returns {string} section
+ */
 function choresSection(chores) {
   return `<section>
 \t<h2>Chores</h2>
 \t<table>
 \t\t<thead>
-\t\t\t<th>Chore</th>
-\t\t\t<th>Frequency</th>
-\t\t\t<th>Next Run</th>
+\t\t\t<tr>
+\t\t\t\t<th scope="col">Chore</th>
+\t\t\t\t<th scope="col">Frequency</th>
+\t\t\t\t<th scope="col">Next Run</th>
+\t\t\t</tr>
 \t\t</thead>
 \t\t<tbody>
 ${Object.entries(chores).map((chore) => renderChoreRow(...chore)).join('\n')}
 \t\t</tbody>
-\t<table>
+\t</table>
 </section>`;
 }
 
 /**
  * 
- * @param {Object} ctx
- * @param {Object[]} ctx.almanac
- * @param {Object} ctx.chores
- * @param {Object} options
- * @param {Object} options.manager
- * @param {String} options.manager.pageTitle
- * @param {String[]} options.manager.footerEntries
- * @param {String} options.adminContactHTML
- * @returns {String}
+ * @param {object} ctx context
+ * @param {object[]} ctx.almanac entries
+ * @param {object} ctx.chores chores
+ * @param {object} options options
+ * @param {object} options.manager manager options
+ * @param {string} options.manager.pageTitle page title
+ * @param {string[]} options.manager.footerEntries footer entires
+ * @returns {string} page
  */
 module.exports = (ctx, options) => {
   const pagePathLevel = 1;