Skip to content

Commit b90c128

Browse files
committed
Make reports use ReportLayout (XI: Releases II)
1 parent b138143 commit b90c128

12 files changed

+202
-375
lines changed

root/report/PartOfSetRelationships.js

+19-36
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99

1010
import * as React from 'react';
1111

12-
import Layout from '../layout';
13-
import formatUserDate from '../utility/formatUserDate';
14-
1512
import ReleaseList from './components/ReleaseList';
16-
import FilterLink from './FilterLink';
13+
import ReportLayout from './components/ReportLayout';
1714
import type {ReportDataT, ReportReleaseT} from './types';
1815

1916
const PartOfSetRelationships = ({
@@ -23,42 +20,28 @@ const PartOfSetRelationships = ({
2320
generated,
2421
items,
2522
pager,
26-
}: ReportDataT<ReportReleaseT>): React.Element<typeof Layout> => (
27-
<Layout
23+
}: ReportDataT<ReportReleaseT>): React.Element<typeof ReportLayout> => (
24+
<ReportLayout
2825
$c={$c}
29-
fullWidth
26+
canBeFiltered={canBeFiltered}
27+
description={exp.l(
28+
`This report shows releases that still have the deprecated "part
29+
of set" relationship and should probably be merged. For
30+
instructions on how to fix them, please see the documentation
31+
about {how_to_merge_releases|how to merge releases}. If the
32+
releases are not really part of a set (for example, if they are
33+
independently-released volumes in a series) just remove the
34+
relationship.`,
35+
{how_to_merge_releases: '/doc/How_to_Merge_Releases'},
36+
)}
37+
entityType="release"
38+
filtered={filtered}
39+
generated={generated}
3040
title={l('Releases with “part of set” relationships')}
41+
totalEntries={pager.total_entries}
3142
>
32-
<h1>{l('Releases with “part of set” relationships')}</h1>
33-
34-
<ul>
35-
<li>
36-
{exp.l(
37-
`This report shows releases that still have the deprecated "part
38-
of set" relationship and should probably be merged. For
39-
instructions on how to fix them, please see the documentation
40-
about {how_to_merge_releases|how to merge releases}. If the
41-
releases are not really part of a set (for example, if they are
42-
independently-released volumes in a series) just remove the
43-
relationship.`,
44-
{how_to_merge_releases: '/doc/How_to_Merge_Releases'},
45-
)}
46-
</li>
47-
<li>
48-
{texp.l('Total releases found: {count}',
49-
{count: pager.total_entries})}
50-
</li>
51-
<li>
52-
{texp.l('Generated on {date}',
53-
{date: formatUserDate($c, generated)})}
54-
</li>
55-
56-
{canBeFiltered ? <FilterLink $c={$c} filtered={filtered} /> : null}
57-
</ul>
58-
5943
<ReleaseList items={items} pager={pager} />
60-
61-
</Layout>
44+
</ReportLayout>
6245
);
6346

6447
export default PartOfSetRelationships;

root/report/ReleaseLabelSameArtist.js

+18-34
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@
99

1010
import * as React from 'react';
1111

12-
import Layout from '../layout';
13-
import formatUserDate from '../utility/formatUserDate';
1412
import PaginatedResults from '../components/PaginatedResults';
1513
import loopParity from '../utility/loopParity';
1614
import EntityLink from '../static/scripts/common/components/EntityLink';
1715
import ArtistCreditLink
1816
from '../static/scripts/common/components/ArtistCreditLink';
1917

20-
import FilterLink from './FilterLink';
18+
import ReportLayout from './components/ReportLayout';
2119
import type {ReportDataT, ReportReleaseLabelT} from './types';
2220

2321
const ReleaseLabelSameArtist = ({
@@ -27,38 +25,25 @@ const ReleaseLabelSameArtist = ({
2725
generated,
2826
items,
2927
pager,
30-
}: ReportDataT<ReportReleaseLabelT>): React.Element<typeof Layout> => (
31-
<Layout
28+
}: ReportDataT<ReportReleaseLabelT>): React.Element<typeof ReportLayout> => (
29+
<ReportLayout
3230
$c={$c}
33-
fullWidth
31+
canBeFiltered={canBeFiltered}
32+
description={exp.l(
33+
`This report lists releases where the label name is the same as the
34+
artist name. Often this means the release is self-released, and the
35+
label {SpecialPurposeLabel|should be "[no label]" instead}.`,
36+
{
37+
SpecialPurposeLabel:
38+
'/doc/Style/Unknown_and_untitled/Special_purpose_label',
39+
},
40+
)}
41+
entityType="release"
42+
filtered={filtered}
43+
generated={generated}
3444
title={l('Releases where artist name and label name are the same')}
45+
totalEntries={pager.total_entries}
3546
>
36-
<h1>{l('Releases where artist name and label name are the same')}</h1>
37-
38-
<ul>
39-
<li>
40-
{exp.l(
41-
`This report lists releases where the label name is the same as the
42-
artist name. Often this means the release is self-released, and the
43-
label {SpecialPurposeLabel|should be "[no label]" instead}.`,
44-
{
45-
SpecialPurposeLabel:
46-
'/doc/Style/Unknown_and_untitled/Special_purpose_label',
47-
},
48-
)}
49-
</li>
50-
<li>
51-
{texp.l('Total releases found: {count}',
52-
{count: pager.total_entries})}
53-
</li>
54-
<li>
55-
{texp.l('Generated on {date}',
56-
{date: formatUserDate($c, generated)})}
57-
</li>
58-
59-
{canBeFiltered ? <FilterLink $c={$c} filtered={filtered} /> : null}
60-
</ul>
61-
6247
<PaginatedResults pager={pager}>
6348
<table className="tbl">
6449
<thead>
@@ -97,8 +82,7 @@ const ReleaseLabelSameArtist = ({
9782
</tbody>
9883
</table>
9984
</PaginatedResults>
100-
101-
</Layout>
85+
</ReportLayout>
10286
);
10387

10488
export default ReleaseLabelSameArtist;

root/report/ReleaseRgDifferentName.js

+15-30
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99

1010
import * as React from 'react';
1111

12-
import Layout from '../layout';
13-
import formatUserDate from '../utility/formatUserDate';
1412
import PaginatedResults from '../components/PaginatedResults';
1513
import loopParity from '../utility/loopParity';
1614
import EntityLink from '../static/scripts/common/components/EntityLink';
1715

18-
import FilterLink from './FilterLink';
16+
import ReportLayout from './components/ReportLayout';
1917
import type {ReportDataT, ReportReleaseReleaseGroupT} from './types';
2018

2119
const ReleaseRgDifferentName = ({
@@ -25,34 +23,22 @@ const ReleaseRgDifferentName = ({
2523
generated,
2624
items,
2725
pager,
28-
}: ReportDataT<ReportReleaseReleaseGroupT>): React.Element<typeof Layout> => (
29-
<Layout
26+
}: ReportDataT<ReportReleaseReleaseGroupT>):
27+
React.Element<typeof ReportLayout> => (
28+
<ReportLayout
3029
$c={$c}
31-
fullWidth
30+
canBeFiltered={canBeFiltered}
31+
description={l(
32+
`This report shows releases which are the only ones in their release
33+
group, yet have a different name than the group. This might mean
34+
one of the two needs to be renamed to match the other.`,
35+
)}
36+
entityType="release"
37+
filtered={filtered}
38+
generated={generated}
3239
title={l('Releases with a different name than their release group')}
40+
totalEntries={pager.total_entries}
3341
>
34-
<h1>{l('Releases with a different name than their release group')}</h1>
35-
36-
<ul>
37-
<li>
38-
{l(
39-
`This report shows releases which are the only ones in their release
40-
group, yet have a different name than the group. This might mean
41-
one of the two needs to be renamed to match the other.`,
42-
)}
43-
</li>
44-
<li>
45-
{texp.l('Total releases found: {count}',
46-
{count: pager.total_entries})}
47-
</li>
48-
<li>
49-
{texp.l('Generated on {date}',
50-
{date: formatUserDate($c, generated)})}
51-
</li>
52-
53-
{canBeFiltered ? <FilterLink $c={$c} filtered={filtered} /> : null}
54-
</ul>
55-
5642
<PaginatedResults pager={pager}>
5743
<table className="tbl">
5844
<thead>
@@ -87,8 +73,7 @@ const ReleaseRgDifferentName = ({
8773
</tbody>
8874
</table>
8975
</PaginatedResults>
90-
91-
</Layout>
76+
</ReportLayout>
9277
);
9378

9479
export default ReleaseRgDifferentName;

root/report/ReleasedTooEarly.js

+19-30
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99

1010
import * as React from 'react';
1111

12-
import Layout from '../layout';
13-
import formatUserDate from '../utility/formatUserDate';
14-
1512
import ReleaseList from './components/ReleaseList';
16-
import FilterLink from './FilterLink';
13+
import ReportLayout from './components/ReportLayout';
1714
import type {ReportDataT, ReportReleaseT} from './types';
1815

1916
const ReleasedTooEarly = ({
@@ -23,33 +20,25 @@ const ReleasedTooEarly = ({
2320
generated,
2421
items,
2522
pager,
26-
}: ReportDataT<ReportReleaseT>): React.Element<typeof Layout> => (
27-
<Layout $c={$c} fullWidth title={l('Releases released too early')}>
28-
<h1>{l('Releases released too early')}</h1>
29-
30-
<ul>
31-
<li>
32-
{l(`This report shows releases which have disc IDs even though they
33-
were released too early to have disc IDs, where one of the medium
34-
formats didn't exist at the time the release was released or
35-
where a disc ID is attached to a medium whose format does not
36-
have disc IDs.`)}
37-
</li>
38-
<li>
39-
{texp.l('Total releases found: {count}',
40-
{count: pager.total_entries})}
41-
</li>
42-
<li>
43-
{texp.l('Generated on {date}',
44-
{date: formatUserDate($c, generated)})}
45-
</li>
46-
47-
{canBeFiltered ? <FilterLink $c={$c} filtered={filtered} /> : null}
48-
</ul>
49-
23+
}: ReportDataT<ReportReleaseT>): React.Element<typeof ReportLayout> => (
24+
<ReportLayout
25+
$c={$c}
26+
canBeFiltered={canBeFiltered}
27+
description={l(
28+
`This report shows releases which have disc IDs even though they
29+
were released too early to have disc IDs, where one of the medium
30+
formats didn't exist at the time the release was released or
31+
where a disc ID is attached to a medium whose format does not
32+
have disc IDs.`,
33+
)}
34+
entityType="release"
35+
filtered={filtered}
36+
generated={generated}
37+
title={l('Releases released too early')}
38+
totalEntries={pager.total_entries}
39+
>
5040
<ReleaseList items={items} pager={pager} />
51-
52-
</Layout>
41+
</ReportLayout>
5342
);
5443

5544
export default ReleasedTooEarly;

root/report/ReleasesConflictingDiscIds.js

+17-29
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99

1010
import * as React from 'react';
1111

12-
import Layout from '../layout';
13-
import formatUserDate from '../utility/formatUserDate';
14-
1512
import ReleaseList from './components/ReleaseList';
16-
import FilterLink from './FilterLink';
13+
import ReportLayout from './components/ReportLayout';
1714
import type {ReportDataT, ReportReleaseT} from './types';
1815

1916
const ReleasesConflictingDiscIds = ({
@@ -23,32 +20,23 @@ const ReleasesConflictingDiscIds = ({
2320
generated,
2421
items,
2522
pager,
26-
}: ReportDataT<ReportReleaseT>): React.Element<typeof Layout> => (
27-
<Layout $c={$c} fullWidth title={l('Releases with conflicting disc IDs')}>
28-
<h1>{l('Releases with conflicting disc IDs')}</h1>
29-
30-
<ul>
31-
<li>
32-
{l(`This report shows releases that have conflicting disc IDs on the
33-
same medium with significant differences in duration. This usually
34-
means a disc ID was applied to the wrong medium or the wrong
35-
release.`)}
36-
</li>
37-
<li>
38-
{texp.l('Total releases found: {count}',
39-
{count: pager.total_entries})}
40-
</li>
41-
<li>
42-
{texp.l('Generated on {date}',
43-
{date: formatUserDate($c, generated)})}
44-
</li>
45-
46-
{canBeFiltered ? <FilterLink $c={$c} filtered={filtered} /> : null}
47-
</ul>
48-
23+
}: ReportDataT<ReportReleaseT>): React.Element<typeof ReportLayout> => (
24+
<ReportLayout
25+
$c={$c}
26+
canBeFiltered={canBeFiltered}
27+
description={l(
28+
`This report shows releases that have conflicting disc IDs on the
29+
same medium with significant differences in duration. This usually
30+
means a disc ID was applied to the wrong medium or the wrong release.`,
31+
)}
32+
entityType="release"
33+
filtered={filtered}
34+
generated={generated}
35+
title={l('Releases with conflicting disc IDs')}
36+
totalEntries={pager.total_entries}
37+
>
4938
<ReleaseList items={items} pager={pager} subPath="discids" />
50-
51-
</Layout>
39+
</ReportLayout>
5240
);
5341

5442
export default ReleasesConflictingDiscIds;

0 commit comments

Comments
 (0)