After a few days of testing, your Notes view can become a bit cluttered. Although we are already discussing how to fix this for future releases in this blog post we will see what can be done about it.
So image that you currently have something like this:

It is difficult to make some sense out of that mess. It would be nice if we could filter the Text shown for each issue and display just the Title field:

We are going to do this using a renderer function for our Text column. Fire up your editor and open
./server/public/javascripts/dx/dradis.notes.NotesBrowserPanel.js
At around line#170, replace the existing renderer line with the following function:
// ./server/public/javascripts/dx/dradis.notes.NotesBrowserPanel.js | |
// […] | |
columns: [ | |
{ | |
id:’text’, | |
header: ‘Text’, | |
width: 180, | |
sortable: true, | |
dataIndex: ‘text’, | |
//renderer: Ext.util.Format.htmlEncode | |
renderer: function(value, metaData, record, rowIndex, colIndex, store) { | |
var re = /#\[Title\]#/; | |
if (re.test(value)) | |
{ | |
value = value.substring(9, value.indexOf(“#”, 10)) + ” [more…]”; | |
} | |
return Ext.util.Format.htmlEncode(value); | |
} | |
}, | |
{ | |
header: ‘Category’, | |
width: 40, | |
sortable: true, | |
dataIndex: ‘category_id’, | |
scope: this.categories, | |
renderer: this.categoryRenderer, | |
editor: this.categories.editor() | |
}, | |
// […] |
view rawgistfile1.js hosted with ❤ by GitHub
What the new renderer does is look for notes that have a #[Title]# field defined and then extract the value of that title. Feel free to adjust the regular expression / extraction code to suit your needs.
After making the change, you need to delete the JavaScript bundle (autogenerated) and reload your browser:
$ rm ./server/public/javascripts/all.js
That’s it, nice an easy. Now we have a much cleaner notes grid.