forked from DebaucheryLibrarian/traxxx
Merge branch 'experimental' into master
This commit is contained in:
commit
dcaaa4e689
|
@ -407,7 +407,7 @@ export default {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: var(--lighten-extreme);
|
color: var(--lighten-extreme);
|
||||||
background: var(--profile);
|
background: var(--profile);
|
||||||
padding: .75rem 1rem;
|
padding: .5rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-name {
|
.header-name {
|
||||||
|
@ -716,10 +716,6 @@ export default {
|
||||||
margin: 1rem 0 0 0;
|
margin: 1rem 0 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.actor-header {
|
|
||||||
padding: .5rem 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-name {
|
.header-name {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<div slot="popover">
|
<div slot="popover">
|
||||||
<router-link
|
<router-link
|
||||||
class="filter-clear"
|
class="filter-clear"
|
||||||
:to="{ query: { ...$route.query, channels: undefined } }"
|
:to="{ query: { ...$route.query, channels: undefined, networks: undefined } }"
|
||||||
:class="{ active: selectedChannels.length > 0 }"
|
:class="{ active: selectedChannels.length > 0 }"
|
||||||
>clear all<Icon icon="cross2" /></router-link>
|
>clear all<Icon icon="cross2" /></router-link>
|
||||||
|
|
||||||
|
@ -29,7 +29,8 @@
|
||||||
:class="{
|
:class="{
|
||||||
[channel.type]: true,
|
[channel.type]: true,
|
||||||
independent: channel.independent,
|
independent: channel.independent,
|
||||||
selected: selectedChannels.includes(channel.slug),
|
selected: channel.type === 'network' ? selectedNetworks.includes(channel.slug) : selectedChannels.includes(channel.slug),
|
||||||
|
disabled: channel.parent && selectedNetworks.includes(channel.parent.slug),
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<router-link
|
<router-link
|
||||||
|
@ -37,7 +38,6 @@
|
||||||
...$route.query,
|
...$route.query,
|
||||||
[channel.type === 'network' ? 'networks' : 'channels']: channel.slug,
|
[channel.type === 'network' ? 'networks' : 'channels']: channel.slug,
|
||||||
[channel.type === 'network' ? 'channels' : 'networks']: undefined,
|
[channel.type === 'network' ? 'channels' : 'networks']: undefined,
|
||||||
mode,
|
|
||||||
}, params: { pageNumber: 1 } }"
|
}, params: { pageNumber: 1 } }"
|
||||||
class="filter-name"
|
class="filter-name"
|
||||||
>
|
>
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ query: { ...$route.query, ...getNewRange(channel), mode }, params: { pageNumber: 1 } }"
|
:to="{ query: { ...$route.query, ...getNewRange(channel) }, params: { pageNumber: 1 } }"
|
||||||
class="filter-include"
|
class="filter-include"
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
|
@ -71,19 +71,31 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function getNewRange(channel) {
|
function getNewRange(entity) {
|
||||||
console.log(channel);
|
if (entity.type === 'network' && this.selectedNetworks.includes(entity.slug)) {
|
||||||
|
|
||||||
if (this.selectedChannels.includes(channel.slug)) {
|
|
||||||
return {
|
return {
|
||||||
channels: this.selectedChannels.filter(selectedTag => selectedTag !== channel.slug).join(',') || undefined,
|
channels: this.selectedChannels.join(',') || undefined,
|
||||||
networks: undefined,
|
networks: this.selectedNetworks.filter(selectedTag => selectedTag !== entity.slug).join(',') || undefined,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.type === 'network') {
|
||||||
|
return {
|
||||||
|
channels: this.selectedChannels.join(',') || undefined,
|
||||||
|
networks: this.selectedNetworks.concat(entity.slug).join(','),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.selectedChannels.includes(entity.slug)) {
|
||||||
|
return {
|
||||||
|
channels: this.selectedChannels.filter(selectedTag => selectedTag !== entity.slug).join(',') || undefined,
|
||||||
|
networks: this.selectedNetworks.join(',') || undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
channels: this.selectedChannels.concat(channel.slug).join(','),
|
channels: this.selectedChannels.concat(entity.slug).join(','),
|
||||||
networks: undefined,
|
networks: this.selectedNetworks.join(',') || undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,6 +103,10 @@ function selectedChannels() {
|
||||||
return this.$route.query.channels ? this.$route.query.channels.split(',') : [];
|
return this.$route.query.channels ? this.$route.query.channels.split(',') : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function selectedNetworks() {
|
||||||
|
return this.$route.query.networks ? this.$route.query.networks.split(',') : [];
|
||||||
|
}
|
||||||
|
|
||||||
function channelsPerNetwork() {
|
function channelsPerNetwork() {
|
||||||
const networks = this.availableChannels.reduce((acc, channel) => {
|
const networks = this.availableChannels.reduce((acc, channel) => {
|
||||||
if (channel.independent || !channel.parent) {
|
if (channel.independent || !channel.parent) {
|
||||||
|
@ -125,14 +141,10 @@ export default {
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mode: this.$route.query.mode || 'all',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
channelsPerNetwork,
|
channelsPerNetwork,
|
||||||
selectedChannels,
|
selectedChannels,
|
||||||
|
selectedNetworks,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getNewRange,
|
getNewRange,
|
||||||
|
|
|
@ -202,9 +202,23 @@ export default {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.selected .filter-include .filter-add {
|
&.selected {
|
||||||
|
.filter-include {
|
||||||
|
.filter-add {
|
||||||
fill: var(--success);
|
fill: var(--success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.filter-add {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-remove {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-include {
|
.filter-include {
|
||||||
|
@ -222,14 +236,6 @@ export default {
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
&.selected .filter-add {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.selected .filter-remove {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ query: { ...$route.query, ...getNewRange(tag.slug), mode }, params: { pageNumber: 1 } }"
|
:to="{ query: { ...$route.query, ...getNewRange(tag.slug), mode }, params: { pageNumber: 1 } }"
|
||||||
class="filter-include"
|
class="filter-include"
|
||||||
:class="{ selected: selectedTags.includes(tag.slug) }"
|
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
icon="checkmark"
|
icon="checkmark"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import config from 'config';
|
import config from 'config';
|
||||||
import { graphql, get } from '../api';
|
import { graphql, get } from '../api';
|
||||||
import { releaseFields } from '../fragments';
|
import { releaseFields, getIncludedEntities } from '../fragments';
|
||||||
import { curateActor, curateRelease } from '../curate';
|
import { curateActor, curateRelease } from '../curate';
|
||||||
import getDateRange from '../get-date-range';
|
import getDateRange from '../get-date-range';
|
||||||
|
|
||||||
|
@ -12,8 +12,7 @@ function initActorActions(store, router) {
|
||||||
range = 'latest',
|
range = 'latest',
|
||||||
}) {
|
}) {
|
||||||
const { before, after, orderBy } = getDateRange(range);
|
const { before, after, orderBy } = getDateRange(range);
|
||||||
const includeChannels = router.currentRoute.query.channels ? router.currentRoute.query.channels.split(',') : [];
|
const includedTags = router.currentRoute.query.tags ? router.currentRoute.query.tags.split(',') : [];
|
||||||
const includeTags = router.currentRoute.query.tags ? router.currentRoute.query.tags.split(',') : [];
|
|
||||||
const mode = router.currentRoute.query.mode || 'all';
|
const mode = router.currentRoute.query.mode || 'all';
|
||||||
|
|
||||||
const { actor } = await graphql(`
|
const { actor } = await graphql(`
|
||||||
|
@ -25,9 +24,9 @@ function initActorActions(store, router) {
|
||||||
$before:Datetime = "2100-01-01",
|
$before:Datetime = "2100-01-01",
|
||||||
$orderBy:[ReleasesOrderBy!]
|
$orderBy:[ReleasesOrderBy!]
|
||||||
$selectableTags: [String],
|
$selectableTags: [String],
|
||||||
$includeTags: [String!],
|
$includedTags: [String!],
|
||||||
$mode: String!,
|
$mode: String!,
|
||||||
${includeChannels.length > 0 ? '$includeChannels: [String!]' : ''}
|
$includedEntities: [ReleaseFilter!]
|
||||||
) {
|
) {
|
||||||
actor(id: $actorId) {
|
actor(id: $actorId) {
|
||||||
id
|
id
|
||||||
|
@ -167,14 +166,9 @@ function initActorActions(store, router) {
|
||||||
lessThan: $before,
|
lessThan: $before,
|
||||||
greaterThan: $after,
|
greaterThan: $after,
|
||||||
}
|
}
|
||||||
${includeChannels.length > 0 ? `
|
or: $includedEntities
|
||||||
entity: {
|
|
||||||
slug: {
|
|
||||||
in: $includeChannels
|
|
||||||
}
|
}
|
||||||
}` : ''}
|
selectedTags: $includedTags
|
||||||
}
|
|
||||||
selectedTags: $includeTags
|
|
||||||
mode: $mode
|
mode: $mode
|
||||||
first: $limit
|
first: $limit
|
||||||
offset: $offset
|
offset: $offset
|
||||||
|
@ -196,8 +190,8 @@ function initActorActions(store, router) {
|
||||||
selectableTags: config.selectableTags,
|
selectableTags: config.selectableTags,
|
||||||
orderBy,
|
orderBy,
|
||||||
excludeTags: store.state.ui.filter,
|
excludeTags: store.state.ui.filter,
|
||||||
includeTags,
|
includedTags,
|
||||||
includeChannels,
|
includedEntities: getIncludedEntities(router),
|
||||||
mode,
|
mode,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -319,6 +319,48 @@ const releaseFragment = `
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
function getIncludedEntities(router) {
|
||||||
|
const includedChannels = router.currentRoute.query.channels ? router.currentRoute.query.channels.split(',') : [];
|
||||||
|
const includedNetworks = router.currentRoute.query.networks ? router.currentRoute.query.networks.split(',') : [];
|
||||||
|
|
||||||
|
if (includedChannels.length === 0 && includedNetworks.length === 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
entity: {
|
||||||
|
slug: {
|
||||||
|
in: includedChannels,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
entity: {
|
||||||
|
parent: {
|
||||||
|
type: {
|
||||||
|
equalTo: 'network',
|
||||||
|
},
|
||||||
|
slug: {
|
||||||
|
in: includedNetworks,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
entity: {
|
||||||
|
type: {
|
||||||
|
equalTo: 'network',
|
||||||
|
},
|
||||||
|
slug: {
|
||||||
|
in: includedNetworks,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
releaseActorsFragment,
|
releaseActorsFragment,
|
||||||
releaseFields,
|
releaseFields,
|
||||||
|
@ -330,4 +372,5 @@ export {
|
||||||
releaseFragment,
|
releaseFragment,
|
||||||
siteFragment,
|
siteFragment,
|
||||||
sitesFragment,
|
sitesFragment,
|
||||||
|
getIncludedEntities,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue