Problem/Motivation
When answering several issues a day it would be nice to have a generic stock response method.
Stock response contain both templates for comment as well as macros capable to change the issue state.
By providing an open structure to edit or add stock responses this could help all d.o projects by providing each project to add their own templates and macros.
One good example is http://drupal.org/node/1280562 which contains drupal core specific Stock Responses. Currently only the D8CI-DOCS gates.
Proposed resolution
![]()
Use the drupal.org book structure for managing the Template and Macro stock responses.
We define a top level page.
Every childpage is considered Stock Response page. The structure is laid out by definition list DL/DT/DD tags.
The sandbox project dreditor_clemens implements this.
The patch adds macro's capable to read and manipulate the issue state like tags, comment, status.
It can insert project or issue references within the comment.
It provides for a browser cache with stock responses.
Remaining tasks
It depends on
#1136342: It's impossible to run unit tests due to return statement
#1345614: Merging toggle buttons to a more consistent UX
A better demo video as the demo from http://www.youtube.com/watch?v=vpyZu9467yc is a little speedy.
User interface changes
Another row above the issue comment which can take a lot of space depending on how many top level items are defined.
API changes
Drupal.storage.cache : we need caches for all triage pages
Drupal.dreditor.macro : Provide for templates and macros
Drupal.dreditor.triage : The whole management for the issue comment regarding Stock Response
A tests/ directory for qunit tests.
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | dreditor-triage-20111214.png | 41.13 KB | clemens.tolboom |
| #24 | dreditor-triage-1115636-24.patch | 25.7 KB | clemens.tolboom |
| #23 | dreditor-triage-20110921- 112723.png | 59.75 KB | clemens.tolboom |
| #16 | issue-triage-1115636-16.patch | 88.13 KB | clemens.tolboom |
| #1 | triage-1115636-1.patch | 1.32 KB | clemens.tolboom |
Comments
Comment #1
clemens.tolboom[Edit]
Please watch my http://drupal.org/sandbox/clemenstolboom/1125712
[Edit]
The attached patch makes a ajax request to
http://drupal.org/node/467548childpages of http://drupal.org/node/1120672 to get to our definition list.It is not ready yet but it works a little ;)
Things to solve:
- caching of the dd items into local storage
- make it a tree of items so a duplicate has more reasons
- better ui ? The list appears now above the 'Create triage message'
Comment #2
clemens.tolboomSee also #651834: Git applications queue support for more ideas.
This is how it works right now.
Comment #3
clemens.tolboomThis patch now uses http://drupal.org/node/1118110 as it's source document.
It is now possible to have several reasons for each issue Status.
When there is no DD in the source document for a particular DT the link is not active.
See the attached screenshot of this particular issue ;)
Comment #4
clemens.tolboomAdded a banner to get this up to speed.
Powered by dreditor (triage patch) and Triage transitions
Comment #5
clemens.tolboomChanged the title to make it more attractive for irc
Comment #6
sunHeh. Ok, that's quite a creative solution. ;)
Thanks for working on it!
Considerations on this topic, in random order:
In other words, this feature should integrate more deeply and intelligently with my user workflow/actions, instead of simply exposing a list of everything.
Zendesk solves this by using :: in labels; i.e.,
Project applications::Missing .info file, leading to:btw, Zendesk calls this "macros" instead of templates. Not sure whichever is a more proper term...
Comment #7
clemens.tolboom@sun remarks:
1. Caching and source control
Caching See #2 (how store settings)
Source control? What do you mean by that?
2. It's possible to have multiple sources but I need UI feedback to make this nicer.
The new patch has now two sources for triage. So it's possible to have more.
But for that I need to know how to store settings ... it's in dreditor somewhere?
3. How is this current working in dreditor?
My ideas are related to this current state ... dim items not related to current state, assign to, etc.
Where is this in dreditor code?
4. Is this mere UI or context based?
I want to add config settings to filter out / dim categories based on 'whatever'
5. macros
Sounds ok to me ... a macro is at least not a .tpl.php
Anyway ... I want this patch useable asap for the project application issues.
Known issues are:
- toggle is not working properly ... needs get fixed asap
- caching is not done
- no config
I would like to have a workable first then do 'config' and 'caching' in different tickets although it doesn't sound to complicated.
What do you think how to implement this feature quickest?
Comment #8
clemens.tolboomAdded definition list DL bug #1120618: CSS misses layout of nested definition lists to help displaying http://drupal.org/node/1119350 correctly.
Comment #9
clemens.tolboomCurrent version:
- moved triage items into separate div
- using storage but having issues with global storage (is this due to greasemonkey?) ... using local storage
Known issues:
- toggle is not working yet
- the code is placed somewhat in the wrong place (Drupal.behaviors.dreditorCommitMessage)
- there is no user customization. My guess is global storage is prohibited by greasemonkey which means we need a real firefox plugin. What do you think?
the attached patch needs review
Powered by dreditor (triage patch) and Triage transitions
Comment #10
clemens.tolboomBlast and testing ...
Whitespace
Powered by Dreditor.
The code contains whitespace problems. The code contains whitespace problems. Please use http://drupal.org/project/coder to check your code.
Powered by dreditor (triage patch) and Triage transitions
Comment #11
clemens.tolboomThe attached patch:
- cache implemented: local cache is working fine ... 'local' means site bound
- banner replaced with a source link
Known issues:
- toggle is not working yet
- the code is placed somewhat in the wrong place (Drupal.behaviors.dreditorCommitMessage)
Features still needed:
- auto discovery through http://drupal.org/node/1120672 by grabbing it's child pages
- setting status (and other issue values)
-- develop a macro language suitable for d.o page structures
--- is a @fieldname(new-value) and @old-fieldname a good start?
Comment #12
clemens.tolboomI moved this over to http://drupal.org/sandbox/clemenstolboom/1125712 which makes it way easier to follow all features in a working state.
Please take over the good parts asap ;)
Comment #13
clemens.tolboomAs I have now a sandbox we can best test over there first and then mergeback into dreditor.git
Comment #14
clemens.tolboomThis issue is waiting for #1136342: It's impossible to run unit tests due to return statement to get completed
Powered by Dreditor (triage sandbox) and Triage transitions
Comment #15
clemens.tolboomShould I add a patch here (It's functional without #1136342: It's impossible to run unit tests due to return statement)
or
expect people to use my sandbox version http://drupal.org/sandbox/clemenstolboom/1125712 which is runable?
Comment #16
clemens.tolboomAttached the latest version. Features are:
- Settings issue fields like status, tags, comment
- Getting issue fields
- Getting prompts for duplicate_issue, duplicate_project, depends_on_issue, blocks_issue
the attached patch needs review
Powered by Dreditor (triage sandbox) and Triage transitions
Added cache support
Added macro
Added triage UI
Powered by Dreditor.
Comment #17
clemens.tolboomWatch the video on http://www.youtube.com/watch?v=vpyZu9467yc
Comment #18
sunSorry, didn't have time to look into the code yet.
However, I did wonder about the macro/token syntax, and asked myself why we're not using a syntax like tokens in D7 core?
Aside from that, the UI/UX still looks a bit confusing/clumsy to me...? Can we attempt to do something along the lines of #6? :)
Comment #19
clemens.tolboomFor the macro's we need get/set/old/query constructs. I skipped that at first and did my own construct as I was afraid of token clashes. But on second thought ...
Tokens are (D7) just
[$type:$name]for get/old constructs and[$type:$name _VALUE_]for set and[$type:$name ?]for query.Get/oldGet
[issue:tags] [issue:comment] [issue:oldTags]Set
[issue:status 3] [issue:tags -D8CI]Query
[issue:reference] [project:reference]Regarding the UI/UX
I hate mouse move so for me the current UI is fine (one big blob) but we can do both I guess. I'll try to consult bohjan.
Comment #20
sunoh, I didn't really think of the token-with-actual-value, so I take that back. The token syntax is only suitable for replacement tokens, not really for specifying values.
The next best thing that comes to mind is, actually, pure JSON - along the lines of:
When: {project:"drupal",issue:{status:"active"}}
Do: {issue:{status:"duplicate"}}
However, guess I have to look into this some more first...
Comment #21
clemens.tolboomThe puzzle I solved with the @oldX() construct like (taken from http://drupal.org/node/1118110)
is to indicate Fixed is only relevant for 'Active' or 'needs review' issues (a state transition). It is easy to parse by using 'old' for current state. My guess is the setters are easier to read compared to json as they are separated as strings.
A query like (taken from Stock response on http://drupal.org/node/1118110)
Depends on @depends_on_issue(?)would be better readable with a token construct likeComment #22
clemens.tolboomI just tried to start fixing my sandbox #1280412: Tags are inserted multiple times and first added a test for that.
@sun: Please have a look at my test for macro's in action at http://drupalcode.org/sandbox/clemenstolboom/1125712.git/blob_plain/refs... or visit http://drupalcode.org/sandbox/clemenstolboom/1125712.git/blob_plain/refs...
There is a lot of effort done in the tests. I'd opt for leaving macros as is and focus on template for token.
About macro versus template
- templates are what is inserted into the issue comment
- macros are manipulating the issue state. (I know comment is part of the state)
What do you think?
Comment #23
clemens.tolboomApart from the macro construct I think this is now ready for review :-)
See #1141242: The query macro @field(?) seems a little duplicate
[edit]The image below is the current state.
[edit] end of image
Comment #24
clemens.tolboomThe attached patch has 3 chunks
#1 is for my unit tests ... see #1136342: It's impossible to run unit tests due to return statement
#2 is the triage patch
#3 is for my unit tests to have the buttons visible
See http://drupal.org/project/1125712/git-instructions or run the unit tests straight from http://drupalcode.org/sandbox/clemenstolboom/1125712.git/tree/refs/heads...
For open issues see http://drupal.org/project/issues/1125712
Comment #24.0
clemens.tolboomChanged the whole text and added the demo video.
Comment #24.1
clemens.tolboomImplemented the Issue Template
Comment #24.2
clemens.tolboomAdded link to D8CI-DOCS gates as an useful example
Comment #24.3
clemens.tolboomFixed close tag on link
Comment #24.4
clemens.tolboomUpdated issue summary.
Comment #25
clemens.tolboomComment #25.0
clemens.tolboomAdded image
Comment #25.1
clemens.tolboomUpdate image
Comment #26
clemens.tolboomThe sandbox is active. It contains #1345614: Merging toggle buttons to a more consistent UX which is bad. Anyway it looks like this

==== image begin
==== image end
Comment #27
helmo commentedI've just done a rebase of this branch based on master.
It's now known as dreditor-1115636-rebased, but needs work to get it functional again.
Comment #27.0
helmo commentedUpdated issue summary.
Comment #28
helmo commentedContinuing in https://github.com/dreditor/dreditor/pull/93