Skip to content

Commit e51b555

Browse files
author
NarrowsProjects
committed
feat: change the warning message for unknown filters
1 parent 56e45b1 commit e51b555

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/public/components/Filters/common/FilteringModel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ export class FilteringModel extends Observable {
153153
const filterModel = this._filters[key];
154154

155155
if (!filterModel) {
156-
unknownFilters.push(key);
156+
unknownFilters.push(`'${key}'`);
157157
continue;
158158
}
159159

160160
filterModel.normalized = value;
161161
}
162162

163163
if (unknownFilters.length) {
164-
this._warnings.set('Unknown Filters', unknownFilters.join(', '));
164+
this._warnings.set('Unknown Filters', `The filters: [${unknownFilters.join(', ')}]; are not reccognised. Check if they are spelled correctly.`);
165165
} else {
166166
this._warnings.delete('Unknown Filters');
167167
}

test/public/components/warnings.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ module.exports = () => {
3030

3131
it('Should show warning when a filter in the url is not recognised', async () => {
3232
await page.goto('http://localhost:4000/?page=log-overview&filter[fake]=fake', { waitUntil: 'load' });
33-
const warningText = await getInnerText('.alert-warning > ul');
33+
const warningText = await getInnerText(await page.waitForSelector('.alert-warning > ul'));
3434

35-
expect(warningText).to.equal('Unknown Filters: fake');
35+
expect(warningText).to.equal('Unknown Filters:\nThe filters: [\'fake\']; are not reccognised. Check if they are spelled correctly.');
3636
});
3737

3838
it('Should remove warnings entry after clicking the x icon', async () => {

0 commit comments

Comments
 (0)