| 617 | } |
| 618 | |
| 619 | constructor () { |
| 620 | super(...arguments) |
| 621 | this.search = this.search.bind(this) |
| 622 | |
| 623 | // to dynamically build the search url, inspect the links url that should be included |
| 624 | const links = this.workingSchema.links || [] |
| 625 | const link = (Array.from(links).filter((l) => l.rel === 'db'))[0] |
| 626 | if (!link) { return } |
| 627 | const parts = (Array.from(link.href.split('/')).filter((p) => p.length)) |
| 628 | this.url = `/db/${parts[1]}` |
| 629 | this.model = require('models/' + (link.model || _.string.classify(parts[1]))) |
| 630 | } |
| 631 | |
| 632 | buildValueForDisplay (valEl, data) { |
| 633 | const val = data ? this.formatDocument(data) : 'None' |