Plumber
Plumber copied to clipboard
Comment templates upon submission
Is your feature request related to a problem? Please describe. Not exactly, our client's editors likely need a bit of guidance when submitting content for approval. Providing a comment template (much like creating a new github issue) would greatly aid our client's content approval process.
Describe the solution you'd like When an editor is about to submit a change for approval. It would be nice to provide them with a template.
This could be sourced on a global level or per workflow. Right now a global template would be fine.
Describe alternatives you've considered Modifying the Workflow.js angularjs file with a predefined comment template.
Additional context I'd be happy to implement this feature in given time if this is something you'd likely accept.
That makes sense. Per workflow sounds great, but agree that global would be much easier in the first instance. Issue with per workflow would be were to define that relationship. Open to suggestions.
Would be possible to do it if I set up localization for the comment label, so rather than adding templated text to the textarea it would be a more useful label on the field itself. Text would come from the language file.
I think I'd prefer to do something like that and make it part of the UI - if it was templated text it would be persisted with every comment, which while not a big issue isn't ideal, and would need a means of recognizing when a comment has actually been entered as opposed to submitting a workflow with the default template text only.
If you want to have a crack at it, by all means go ahead.
@nathanwoulfe I really like the idea of using localizationService. I think this approach would work well.
If you mean include it as part of the HTML rather than as default text, I'm not sure that's going to work for our client but it's your call. I think they'd need the rigid template rather than help text above the field or even a placeholder which disappears upon focus.
As for detecting if it has changed. I see we have a watch right now on there which controls the submit button. Would it possible to have an is-dirty-check perhaps? I can look in to that if this helps sway opinion.
Clients are fun hey...
Dirty checking the control would be the way to go. The workflow.commentss directive uses no-dirty-check (not sure why), and isn't used for all comment boxes (also, not sure why). I think my intention was that the initial workflow submission requires a comment, but approval stages do not, to avoid editors having to add pointless comments just to enable the submit button. Need to review that.
I also need to change the db column type for comments, it's varchar(255) but really should be varchar(max), which removes any issue around comment length. Could get clever and remove the template text when persisting it, to just keep the user comment, which might be cleaner for reading through comment trails.
Would be cool to have templates configurable for different groups/workflows/content types too, but that's a whole new layer of complexity, and could probably better be done as a stage 2...
I'm open to anything. Go for it.