Skip to content

Commit

Permalink
ELEMENTS-1216: allow nuxeo-document-suggester to use route resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabez0r committed Aug 26, 2020
1 parent 7bec6ab commit 1669297
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ui/test/nuxeo-document-suggestion.test.js
Expand Up @@ -41,8 +41,9 @@ function getSuggestions(suggestionWidget, timeout = 1000) {
// Mock router
const router = {
browse: () => '#',
user: () => '#',
group: () => '#',
resolveRoute: () => {
return { route: 'browse', params: [] };
},
};

suite('nuxeo-document-suggestion', () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/widgets/nuxeo-document-suggestion.js
Expand Up @@ -305,7 +305,7 @@ import { escapeHTML } from './nuxeo-selectivity.js';
if (typeof doc === 'string') {
return `<span>${escapeHTML(doc)}</span>`;
}
return `<a href="${this.urlFor('browse', doc.path)}">${escapeHTML(doc.title)}</a>`;
return `<a href="${this.urlFor(doc)}">${escapeHTML(doc.title)}</a>`;
}

_resultFormatter(doc) {
Expand Down

0 comments on commit 1669297

Please sign in to comment.