forked from DebaucheryLibrarian/traxxx
Hiding scenes with missing dates from network overview. Using computed effective date column.
This commit is contained in:
parent
681db02784
commit
a484396db4
|
@ -22,8 +22,6 @@ function initEntitiesActions(store, router) {
|
||||||
$offset: Int = 0,
|
$offset: Int = 0,
|
||||||
$after: Datetime = "1900-01-01",
|
$after: Datetime = "1900-01-01",
|
||||||
$before: Datetime = "2100-01-01",
|
$before: Datetime = "2100-01-01",
|
||||||
$afterTime: Datetime = "1900-01-01",
|
|
||||||
$beforeTime: Datetime = "2100-01-01",
|
|
||||||
$orderBy: [ReleasesOrderBy!]
|
$orderBy: [ReleasesOrderBy!]
|
||||||
$exclude: [String!]
|
$exclude: [String!]
|
||||||
$hasAuth: Boolean!
|
$hasAuth: Boolean!
|
||||||
|
@ -91,20 +89,19 @@ function initEntitiesActions(store, router) {
|
||||||
or: [
|
or: [
|
||||||
{
|
{
|
||||||
date: {
|
date: {
|
||||||
lessThan: $before,
|
isNull: ${entityType === 'channel'}
|
||||||
greaterThan: $after
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
{
|
||||||
date: {
|
date: {
|
||||||
isNull: true
|
isNull: false
|
||||||
},
|
|
||||||
createdAt: {
|
|
||||||
lessThan: $beforeTime,
|
|
||||||
greaterThan: $afterTime,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
effectiveDate: {
|
||||||
|
lessThan: $before,
|
||||||
|
greaterThan: $after
|
||||||
|
}
|
||||||
releasesTagsConnection: {
|
releasesTagsConnection: {
|
||||||
none: {
|
none: {
|
||||||
tag: {
|
tag: {
|
||||||
|
@ -131,8 +128,6 @@ function initEntitiesActions(store, router) {
|
||||||
after,
|
after,
|
||||||
before,
|
before,
|
||||||
orderBy,
|
orderBy,
|
||||||
afterTime: store.getters.after,
|
|
||||||
beforeTime: store.getters.before,
|
|
||||||
exclude: store.state.ui.tagFilter,
|
exclude: store.state.ui.tagFilter,
|
||||||
hasAuth: !!store.state.auth.user,
|
hasAuth: !!store.state.auth.user,
|
||||||
userId: store.state.auth.user?.id,
|
userId: store.state.auth.user?.id,
|
||||||
|
|
|
@ -3,30 +3,6 @@ import dayjs from 'dayjs';
|
||||||
|
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
|
|
||||||
const dateRanges = {
|
|
||||||
latest: () => ({
|
|
||||||
after: '1900-01-01',
|
|
||||||
before: dayjs.utc().toDate(),
|
|
||||||
orderBy: ['DATE_DESC', 'CREATED_AT_DESC'],
|
|
||||||
}),
|
|
||||||
upcoming: () => ({
|
|
||||||
after: dayjs.utc().toDate(),
|
|
||||||
before: '2100-01-01',
|
|
||||||
orderBy: ['DATE_ASC', 'CREATED_AT_ASC'],
|
|
||||||
}),
|
|
||||||
new: () => ({
|
|
||||||
after: '1900-01-01 00:00:00',
|
|
||||||
before: '2100-01-01',
|
|
||||||
orderBy: ['CREATED_AT_DESC', 'DATE_ASC'],
|
|
||||||
}),
|
|
||||||
all: () => ({
|
|
||||||
after: '1900-01-01',
|
|
||||||
before: '2100-01-01',
|
|
||||||
orderBy: ['DATE_DESC', 'CREATED_AT_DESC'],
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
|
|
||||||
/* requires PostgreSQL 12.x> not available in production yet
|
|
||||||
const dateRanges = {
|
const dateRanges = {
|
||||||
latest: () => ({
|
latest: () => ({
|
||||||
after: '1900-01-01',
|
after: '1900-01-01',
|
||||||
|
@ -49,7 +25,6 @@ const dateRanges = {
|
||||||
orderBy: ['EFFECTIVE_DATE_DESC'],
|
orderBy: ['EFFECTIVE_DATE_DESC'],
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
|
||||||
function getDateRange(range) {
|
function getDateRange(range) {
|
||||||
return (dateRanges[range] || dateRanges.all)();
|
return (dateRanges[range] || dateRanges.all)();
|
||||||
|
|
Loading…
Reference in New Issue