mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-01-21 04:07:54 -05:00
feat: display completed quest name + link
This commit is contained in:
@@ -774,6 +774,14 @@
|
||||
schema: public
|
||||
name: quest_completion
|
||||
object_relationships:
|
||||
- name: completed
|
||||
using:
|
||||
manual_configuration:
|
||||
remote_table:
|
||||
schema: public
|
||||
name: quest
|
||||
column_mapping:
|
||||
quest_id: id
|
||||
- name: player
|
||||
using:
|
||||
foreign_key_constraint_on: completed_by_player_id
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Text } from '@metafam/ds';
|
||||
import { Link, Text } from '@metafam/ds';
|
||||
import { ProfileSection } from 'components/Profile/ProfileSection';
|
||||
import {
|
||||
PlayerFragmentFragment,
|
||||
@@ -44,11 +44,15 @@ export const PlayerCompletedQuests: React.FC<Props> = ({
|
||||
canEdit={canEdit}
|
||||
boxType={BoxType.PLAYER_ACHIEVEMENTS}
|
||||
>
|
||||
{quests.map((quest, i) => (
|
||||
<Text as="span" fontSize="xs">
|
||||
{`${i + 1}. Submission text: ${quest.submission_text}`}
|
||||
</Text>
|
||||
))}
|
||||
{quests.length ? (
|
||||
quests.map((quest, i) => (
|
||||
<Link href={`/quest/${quest.quest_id}`}>{`${i + 1}. ${
|
||||
quest.completed?.title
|
||||
}`}</Link>
|
||||
))
|
||||
) : (
|
||||
<Text>No completed quests yet</Text>
|
||||
)}
|
||||
</ProfileSection>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -180,6 +180,10 @@ export const QuestCompletionFragment = gql`
|
||||
submission_link
|
||||
submission_text
|
||||
submitted_at
|
||||
quest_id
|
||||
completed {
|
||||
title
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
QuestStatus_Enum,
|
||||
} from './autogen/types';
|
||||
import { client as defaultClient } from './client';
|
||||
import { QuestFragment, QuestWithCompletionFragment } from './fragments';
|
||||
import { QuestFragment } from './fragments';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
||||
gql`
|
||||
|
||||
@@ -9912,6 +9912,11 @@ type quest_completion {
|
||||
An object relationship
|
||||
"""
|
||||
QuestCompletionStatus: QuestCompletionStatus!
|
||||
|
||||
"""
|
||||
An object relationship
|
||||
"""
|
||||
completed: quest
|
||||
completed_by_player_id: uuid!
|
||||
id: uuid!
|
||||
|
||||
@@ -9973,6 +9978,7 @@ input quest_completion_bool_exp {
|
||||
_and: [quest_completion_bool_exp]
|
||||
_not: quest_completion_bool_exp
|
||||
_or: [quest_completion_bool_exp]
|
||||
completed: quest_bool_exp
|
||||
completed_by_player_id: uuid_comparison_exp
|
||||
id: uuid_comparison_exp
|
||||
player: player_bool_exp
|
||||
@@ -9999,6 +10005,7 @@ input type for inserting data into table "quest_completion"
|
||||
"""
|
||||
input quest_completion_insert_input {
|
||||
QuestCompletionStatus: QuestCompletionStatus_obj_rel_insert_input
|
||||
completed: quest_obj_rel_insert_input
|
||||
completed_by_player_id: uuid
|
||||
id: uuid
|
||||
player: player_obj_rel_insert_input
|
||||
@@ -10095,6 +10102,7 @@ ordering options when selecting data from "quest_completion"
|
||||
"""
|
||||
input quest_completion_order_by {
|
||||
QuestCompletionStatus: QuestCompletionStatus_order_by
|
||||
completed: quest_order_by
|
||||
completed_by_player_id: order_by
|
||||
id: order_by
|
||||
player: player_order_by
|
||||
|
||||
Reference in New Issue
Block a user