From 42f227c39dca3c997a2602af9ba39fd02194e97b Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Thu, 30 Jan 2020 23:41:10 +0100 Subject: [PATCH] Restored rudimentary tag filtering. --- assets/js/actors/actions.js | 11 +++++++++++ assets/js/fragments.js | 9 +++++++++ assets/js/networks/actions.js | 11 +++++++++++ assets/js/releases/actions.js | 4 +++- assets/js/sites/actions.js | 2 ++ 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/assets/js/actors/actions.js b/assets/js/actors/actions.js index d8c8774e..1bb32013 100644 --- a/assets/js/actors/actions.js +++ b/assets/js/actors/actions.js @@ -53,6 +53,7 @@ function initActorActions(store, _router) { $after:Date = "1900-01-01", $before:Date = "2100-01-01", $orderBy:[ReleasesActorsOrderBy!] + $exclude: [String!] ) { actor: actorBySlug(slug: $actorSlug) { id @@ -119,6 +120,15 @@ function initActorActions(store, _router) { date: { lessThan: $before, greaterThan: $after, + }, + releasesTags: { + none: { + tag: { + slug: { + in: $exclude + } + } + } } } }, @@ -155,6 +165,7 @@ function initActorActions(store, _router) { after: store.getters.after, before: store.getters.before, orderBy: store.state.ui.range === 'upcoming' ? 'RELEASE_BY_RELEASE_ID__DATE_ASC' : 'RELEASE_BY_RELEASE_ID__DATE_DESC', + exclude: store.state.ui.filter, }); return curateActor(actor); diff --git a/assets/js/fragments.js b/assets/js/fragments.js index c86d2ca4..5b250f9f 100644 --- a/assets/js/fragments.js +++ b/assets/js/fragments.js @@ -121,6 +121,15 @@ const releasesFragment = ` lessThan: $before, greaterThan: $after, } + releasesTags: { + none: { + tag: { + slug: { + in: $exclude + } + } + } + } }, first: $limit, orderBy: $orderBy, diff --git a/assets/js/networks/actions.js b/assets/js/networks/actions.js index 636ffa24..f4efed14 100644 --- a/assets/js/networks/actions.js +++ b/assets/js/networks/actions.js @@ -11,6 +11,7 @@ function initNetworksActions(store, _router) { $after:Date = "1900-01-01", $before:Date = "2100-01-01", $orderBy: [ReleasesOrderBy!] + $exclude: [String!] ) { network: networkBySlug(slug: $networkSlug) { id @@ -46,6 +47,15 @@ function initNetworksActions(store, _router) { lessThan: $before, greaterThan: $after, } + releasesTags: { + none: { + tag: { + slug: { + in: $exclude + } + } + } + } } ) { ${releaseFields} @@ -57,6 +67,7 @@ function initNetworksActions(store, _router) { after: store.getters.after, before: store.getters.before, orderBy: store.state.ui.range === 'upcoming' ? 'DATE_ASC' : 'DATE_DESC', + exclude: store.state.ui.filter, }); return curateNetwork(network, releases); diff --git a/assets/js/releases/actions.js b/assets/js/releases/actions.js index 2c78571a..e26c2efe 100644 --- a/assets/js/releases/actions.js +++ b/assets/js/releases/actions.js @@ -11,7 +11,8 @@ function initReleasesActions(store, _router) { $limit:Int = 1000, $after:Date = "1900-01-01", $before:Date = "2100-01-01", - $orderBy:[ReleasesOrderBy!] + $orderBy:[ReleasesOrderBy!], + $exclude: [String!] ) { ${releasesFragment} } @@ -20,6 +21,7 @@ function initReleasesActions(store, _router) { after: store.getters.after, before: store.getters.before, orderBy: store.state.ui.range === 'upcoming' ? 'DATE_ASC' : 'DATE_DESC', + exclude: store.state.ui.filter, }); return releases.map(release => curateRelease(release)); diff --git a/assets/js/sites/actions.js b/assets/js/sites/actions.js index 954dae28..20d3d6c4 100644 --- a/assets/js/sites/actions.js +++ b/assets/js/sites/actions.js @@ -11,6 +11,7 @@ function initSitesActions(store, _router) { $after:Date = "1900-01-01", $before:Date = "2100-01-01", $orderBy:[ReleasesOrderBy!] + $exclude: [String!] ) { site: siteBySlug(slug: $siteSlug) { name @@ -38,6 +39,7 @@ function initSitesActions(store, _router) { after: store.getters.after, before: store.getters.before, orderBy: store.state.ui.range === 'upcoming' ? 'DATE_ASC' : 'DATE_DESC', + exclude: store.state.ui.filter, }); return curateSite(site);