Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upcoming projects for people #1061

Merged
merged 22 commits into from
Oct 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b5158ae
chore(services/integration): add logging and some general improvements
IgnisDa Oct 10, 2024
263c025
Merge branch 'main' into issue-708
IgnisDa Oct 10, 2024
1579240
chore(providers): do not filter people roles
IgnisDa Oct 10, 2024
2ab2cd9
chore(providers): change order of attribues
IgnisDa Oct 10, 2024
1aeb884
chore(providers): download release date for people
IgnisDa Oct 10, 2024
cdf2bbc
feat(providers): start getting data in a more structured way
IgnisDa Oct 10, 2024
e7170ba
chore(backend): obey new structure
IgnisDa Oct 10, 2024
575c596
chore(backend): change name of field
IgnisDa Oct 10, 2024
35f06e2
chore(providers): remove useless fields
IgnisDa Oct 10, 2024
33b8ea4
fix(frontend): adapt to new gql schema
IgnisDa Oct 10, 2024
05f5b4f
chore(providers): extract into variable
IgnisDa Oct 10, 2024
71c44a4
feat(migrations): delete all metadata to person
IgnisDa Oct 10, 2024
72c3288
feat(providers): get character details for people correctly
IgnisDa Oct 10, 2024
12d4b4c
chore(providers): change order of attributes
IgnisDa Oct 10, 2024
36d8de1
feat(backend): return number of items for each grouped role
IgnisDa Oct 10, 2024
4290e4f
feat(frontend): general cleanup of people page
IgnisDa Oct 10, 2024
eace720
feat(frontend): allow filtering by role
IgnisDa Oct 10, 2024
650cd22
refactor(frontend): extract to component
IgnisDa Oct 10, 2024
51cc882
feat(frontend): add time filter
IgnisDa Oct 10, 2024
f1520fb
feat(frontend): get upcoming filter working
IgnisDa Oct 10, 2024
d495a4a
feat(frontend): set `is_partial` to true for all people
IgnisDa Oct 10, 2024
a778cb0
feat(frontend): beautify page
IgnisDa Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(frontend): general cleanup of people page
  • Loading branch information
IgnisDa committed Oct 10, 2024
commit 4290e4f0e77ba61506b0140935ff8b3f9a6e0736
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
PersonDetailsDocument,
UserPersonDetailsDocument,
} from "@ryot/generated/graphql/backend/graphql";
import { sum } from "@ryot/ts-utils";
import {
IconDeviceTv,
IconInfoCircle,
Expand All @@ -41,7 +42,7 @@ import { useAddEntityToCollection, useReviewEntity } from "~/lib/state/media";
import { serverGqlService } from "~/lib/utilities.server";

const searchParamsSchema = z.object({
defaultTab: z.string().optional().default("media"),
defaultTab: z.string().optional(),
});

export type SearchParams = z.infer<typeof searchParamsSchema>;
Expand All @@ -67,6 +68,9 @@ export default function Page() {
const userPreferences = useUserPreferences();
const [_r, setEntityToReview] = useReviewEntity();
const [_a, setAddEntityToCollectionData] = useAddEntityToCollection();
const totalMetadata = sum(
loaderData.personDetails.contents.map((c) => c.count),
);

return (
<Container>
Expand All @@ -87,9 +91,7 @@ export default function Page() {
</Title>
<Text c="dimmed" fz={{ base: "sm", lg: "md" }}>
{[
`${
loaderData.personDetails.contents.flatMap((c) => c.items).length
} media items`,
`${totalMetadata} media items`,
loaderData.personDetails.details.birthDate &&
`Birth: ${loaderData.personDetails.details.birthDate}`,
loaderData.personDetails.details.deathDate &&
Expand Down Expand Up @@ -126,11 +128,19 @@ export default function Page() {
))}
</Group>
) : null}
<Tabs variant="outline" defaultValue={loaderData.query.defaultTab}>
<Tabs
variant="outline"
defaultValue={
loaderData.query.defaultTab ||
(totalMetadata > 0 ? "media" : "actions")
}
>
<Tabs.List mb="xs">
<Tabs.Tab value="media" leftSection={<IconDeviceTv size={16} />}>
Media
</Tabs.Tab>
{totalMetadata > 0 ? (
<Tabs.Tab value="media" leftSection={<IconDeviceTv size={16} />}>
Media
</Tabs.Tab>
) : null}
{loaderData.personDetails.details.description ? (
<Tabs.Tab
value="overview"
Expand Down