From fb82749447887f922d61633bdcc60a66c2e94feb Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 6 Jan 2020 00:16:16 +0100 Subject: [PATCH] Frontend: Change sort order defaults See https://twitter.com/browseyourlife/status/1213498860133343234 Signed-off-by: Michael Mayer --- frontend/src/component/p-photo-search.vue | 8 ++++---- frontend/src/pages/album/photos.vue | 2 +- frontend/src/pages/photos.vue | 21 +-------------------- frontend/tests/acceptance/filter.js | 2 +- frontend/tests/acceptance/search.js | 2 +- 5 files changed, 8 insertions(+), 27 deletions(-) diff --git a/frontend/src/component/p-photo-search.vue b/frontend/src/component/p-photo-search.vue index a94533675..171479b32 100644 --- a/frontend/src/component/p-photo-search.vue +++ b/frontend/src/component/p-photo-search.vue @@ -57,7 +57,7 @@ :items="countryOptions"> - + - + - + - + - @@ -54,10 +50,6 @@ this.filter.year = query['year'] ? parseInt(query['year']) : 0; this.filter.color = query['color'] ? query['color'] : ''; this.filter.label = query['label'] ? query['label'] : ''; - - // this.filter.before = query['before'] ? query['before'] : ''; - // this.filter.after = query['after'] ? query['after'] : ''; - this.settings.view = this.viewType(); this.lastFilter = {}; this.routeName = this.$route.name; @@ -67,13 +59,9 @@ data() { const query = this.$route.query; const routeName = this.$route.name; - const order = query['order'] ? query['order'] : 'imported'; + const order = query['order'] ? query['order'] : 'newest'; const camera = query['camera'] ? parseInt(query['camera']) : 0; const q = query['q'] ? query['q'] : ''; - - // const before = query['before'] ? query['before'] : ''; - // const after = query['after'] ? query['after'] : ''; - const country = query['country'] ? query['country'] : ''; const lens = query['lens'] ? parseInt(query['lens']) : 0; const year = query['year'] ? parseInt(query['year']) : 0; @@ -237,18 +225,11 @@ } }).catch(() => this.loading = false); }, - onKeypress(event) { - /* if (event.key === "Escape") { - this.$clipboard.clear(); - } */ - }, }, created() { this.search(); - // window.addEventListener('keydown', this.onKeypress); }, destroyed() { - // window.removeEventListener('keydown', this.onKeypress); } }; diff --git a/frontend/tests/acceptance/filter.js b/frontend/tests/acceptance/filter.js index edf283ff2..d5006b0fb 100644 --- a/frontend/tests/acceptance/filter.js +++ b/frontend/tests/acceptance/filter.js @@ -18,7 +18,7 @@ test('Test camera filter', async t => { await t .click('button.p-expand-search'); logger.clear(); - await page.setFilter('camera', 'iPhone 6'); + await page.setFilter('camera', 'iPhone SE'); const request = await logger.requests[0].responseBody; await t .expect(logger.requests[0].response.statusCode).eql(200) diff --git a/frontend/tests/acceptance/search.js b/frontend/tests/acceptance/search.js index fc998f902..4c8270194 100644 --- a/frontend/tests/acceptance/search.js +++ b/frontend/tests/acceptance/search.js @@ -22,7 +22,7 @@ test('Test search object', async t => { .expect(Selector('div.v-image__image').visible).ok(); }), test('Test search color', async t => { - await page.search('color:pink'); + await page.search('color:red'); const request2 = await logger.requests[1].responseBody; await t .expect(logger.requests[1].response.statusCode).eql(200)