Workflows: add mark as read/unread actions

Fixed: twpowertools:147
Change-Id: I6bb2363256cfd2a0ff3aafb4df71f24561576b27
diff --git a/src/workflows/manager/components/ActionEditor.js b/src/workflows/manager/components/ActionEditor.js
index c4b3faf..9a57509 100644
--- a/src/workflows/manager/components/ActionEditor.js
+++ b/src/workflows/manager/components/ActionEditor.js
@@ -61,6 +61,10 @@
           </wf-action-reply-with-cr>
         `;
 
+      case pb.workflows.Action.ActionCase.MARK_AS_READ_ACTION:
+      case pb.workflows.Action.ActionCase.MARK_AS_UNREAD_ACTION:
+        return nothing;
+
       default:
         return html`<p>This action has not yet been implemented.</p>`;
     }
@@ -97,6 +101,10 @@
 
   checkValidity() {
     if (this.readOnly || !kSupportedActions.has(this._actionCase)) return true;
+
+    const s = this._specificActionEditor();
+    if (!s) return true;
+
     return this._specificActionEditor().checkValidity();
   }
 
@@ -167,6 +175,14 @@
         value = new pb.workflows.Action.ReportAction;
         this.action.setReportAction(value);
         break;
+      case pb.workflows.Action.ActionCase.MARK_AS_READ_ACTION:
+        value = new pb.workflows.Action.MarkAsReadAction;
+        this.action.setMarkAsReadAction(value);
+        break;
+      case pb.workflows.Action.ActionCase.MARK_AS_UNREAD_ACTION:
+        value = new pb.workflows.Action.MarkAsUnreadAction;
+        this.action.setMarkAsUnreadAction(value);
+        break;
       default:
         this.action.clearReplyAction();
         this.action.clearMoveAction();
@@ -178,6 +194,8 @@
         this.action.clearSubscribeAction();
         this.action.clearVoteAction();
         this.action.clearReportAction();
+        this.action.clearMarkAsReadAction();
+        this.action.clearMarkAsUnreadAction();
     }
 
     this.requestUpdate();