feat(workflows): add "attribute action" action
This action lets users perform several actions on threads, such as
(un)lock, (un)set as trending, (un)pin, set as non-issue, obsolete, etc.
The action selector shows the action with the codename it has in the
Protobuf enum. We will show a friendly string when we localize the
feature.
Bug: twpowertools:74
Change-Id: I95f9f1904ffe559c92a786cbdb327613c8ca32ca
diff --git a/src/workflows/manager/components/ActionEditor.js b/src/workflows/manager/components/ActionEditor.js
index 9a57509..cdcb85a 100644
--- a/src/workflows/manager/components/ActionEditor.js
+++ b/src/workflows/manager/components/ActionEditor.js
@@ -1,5 +1,5 @@
+import './actions/Attribute.js';
import './actions/ReplyWithCR.js';
-
import '@material/mwc-circular-progress/mwc-circular-progress.js';
import {html, LitElement, nothing} from 'lit';
@@ -61,6 +61,14 @@
</wf-action-reply-with-cr>
`;
+ case pb.workflows.Action.ActionCase.ATTRIBUTE_ACTION:
+ return html`
+ <wf-action-attribute
+ ?readOnly=${this.readOnly}
+ .action=${this.action.getAttributeAction()}>
+ </wf-action-attribute>
+ `;
+
case pb.workflows.Action.ActionCase.MARK_AS_READ_ACTION:
case pb.workflows.Action.ActionCase.MARK_AS_UNREAD_ACTION:
return nothing;
@@ -216,6 +224,9 @@
case pb.workflows.Action.ActionCase.REPLY_WITH_CR_ACTION:
return this.renderRoot.querySelector('wf-action-reply-with-cr');
+ case pb.workflows.Action.ActionCase.ATTRIBUTE_ACTION:
+ return this.renderRoot.querySelector('wf-action-attribute');
+
default:
return null;
}