From e9ae1cbe2f24652c8029f79774d765934570a366 Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Fri, 10 Dec 2021 00:43:03 -0800 Subject: [PATCH] see all on search now functional --- resources/cider-ui-tests/index.js | 43 ++++++++++++- resources/cider-ui-tests/views/main.ejs | 2 +- .../views/pages/collection-list.ejs | 60 +++++++++++++++---- .../cider-ui-tests/views/pages/search.ejs | 6 +- 4 files changed, 91 insertions(+), 20 deletions(-) diff --git a/resources/cider-ui-tests/index.js b/resources/cider-ui-tests/index.js index 6d2a39c0..9647d122 100644 --- a/resources/cider-ui-tests/index.js +++ b/resources/cider-ui-tests/index.js @@ -155,7 +155,8 @@ const app = new Vue({ }, collectionList: { response: {}, - title: "" + title: "", + type: "" }, page: "artist-page", pageHistory: [], @@ -280,15 +281,51 @@ const app = new Vue({ }) document.body.removeAttribute("loading") }, - async showCollection (response, title) { + async showCollection (response, title, type) { let self = this this.collectionList.response = response this.collectionList.title = title + this.collectionList.type = type this.page = "collection-list" }, async showArtistView (artist, title, view) { let response = await this.mk.api.artistView(artist, view, {}, {view: view, includeResponseMeta: !0}) - await this.showCollection(response, title) + await this.showCollection(response, title, "artists") + }, + async showSearchView(term, group, title) { + let response = await this.mk.api.search(term, { + platform: "web", + groups: group, + types: "activities,albums,apple-curators,artists,curators,editorial-items,music-movies,music-videos,playlists,songs,stations,tv-episodes,uploaded-videos,record-labels", + limit: 25, + relate: { + editorialItems: ["contents"] + }, + include: { + albums: ["artists"], + songs: ["artists"], + "music-videos": ["artists"] + }, + extend: "artistUrl", + fields: { + artists: "url,name,artwork,hero", + albums: "artistName,artistUrl,artwork,contentRating,editorialArtwork,name,playParams,releaseDate,url" + }, + with: "serverBubbles,lyricHighlights", + art: { + "url": "cf" + }, + omit: { + resource: ["autos"] + } + }, {groups: group, includeResponseMeta: !0}) + console.log(response) + let responseFormat = { + data: response[group].data.data, + next: response[group].next, + groups: group + } + await this.showCollection(responseFormat, title, "search") }, async getPlaylistFromID(id) { const params = {include: "tracks", diff --git a/resources/cider-ui-tests/views/main.ejs b/resources/cider-ui-tests/views/main.ejs index 924a5ffa..379bc433 100644 --- a/resources/cider-ui-tests/views/main.ejs +++ b/resources/cider-ui-tests/views/main.ejs @@ -242,7 +242,7 @@ diff --git a/resources/cider-ui-tests/views/pages/collection-list.ejs b/resources/cider-ui-tests/views/pages/collection-list.ejs index 02fd3b99..18065e64 100644 --- a/resources/cider-ui-tests/views/pages/collection-list.ejs +++ b/resources/cider-ui-tests/views/pages/collection-list.ejs @@ -14,7 +14,7 @@ - + @@ -22,7 +22,21 @@