BibliothecaDAO / eternum

onchain eternal game
https://alpha-eternum.realms.world
MIT License
46 stars 34 forks source link

Enh/quests #1033

Closed cwastche closed 3 months ago

cwastche commented 3 months ago

PR Type

Enhancement, Tests


Description


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
13 files
PillageEventQueries.ts
Add function to fetch pillage events                                         

client/src/dojo/events/PillageEventQueries.ts
  • Added a new function getPillageEvents to fetch pillage events.
  • Utilizes client.request to query events.
  • +22/-0   
    useQuestStore.tsx
    Add new quest types and depth attribute                                   

    client/src/hooks/store/useQuestStore.tsx
  • Added new quest types and updated the QuestName enum.
  • Introduced depth attribute to Quest interface.
  • Updated useQuestStore to handle new quest types and depth.
  • Added state management for selected quest.
  • +151/-23
    SelectPreviewBuilding.tsx
    Update quest selection logic in SelectPreviewBuilding       

    client/src/ui/components/construction/SelectPreviewBuilding.tsx
  • Replaced currentQuest with selectedQuest.
  • Updated conditional rendering logic based on selectedQuest.
  • +12/-10 
    HintBox.tsx
    Enhance HintBox with rewards and back button                         

    client/src/ui/components/hints/HintBox.tsx
  • Added QuestRewards component to display quest rewards.
  • Added back button to HintBox.
  • Updated quest claim logic.
  • +120/-58
    ArmyList.tsx
    Update quest selection logic in ArmyList                                 

    client/src/ui/components/military/ArmyList.tsx
  • Replaced currentQuest with selectedQuest.
  • Updated conditional rendering logic based on selectedQuest.
  • +5/-5     
    StructureCard.tsx
    Add className prop to StructureCard                                           

    client/src/ui/components/structures/construction/StructureCard.tsx - Added `className` prop to `StructureCard`.
    +3/-0     
    StructureConstructionMenu.tsx
    Update quest selection logic in StructureConstructionMenu

    client/src/ui/components/structures/construction/StructureConstructionMenu.tsx
  • Replaced currentQuest with selectedQuest.
  • Added conditional class for hyperstructure quest.
  • +7/-0     
    BottomNavigation.tsx
    Update quest selection logic in BottomNavigation                 

    client/src/ui/modules/navigation/BottomNavigation.tsx
  • Replaced currentQuest with selectedQuest.
  • Updated conditional rendering logic based on selectedQuest.
  • +10/-7   
    LeftNavigationModule.tsx
    Update quest selection logic in LeftNavigationModule         

    client/src/ui/modules/navigation/LeftNavigationModule.tsx
  • Replaced currentQuest with selectedQuest.
  • Updated conditional rendering logic based on selectedQuest.
  • +12/-6   
    RightNavigationModule.tsx
    Update quest selection logic in RightNavigationModule       

    client/src/ui/modules/navigation/RightNavigationModule.tsx
  • Replaced currentQuest with selectedQuest.
  • Updated conditional rendering logic based on selectedQuest.
  • +4/-5     
    TopMiddleNavigation.tsx
    Update quest selection logic in TopMiddleNavigation           

    client/src/ui/modules/navigation/TopMiddleNavigation.tsx
  • Replaced currentQuest with selectedQuest.
  • Added conditional class for travel and hyperstructure quests.
  • +9/-4     
    WorldStructuresMenu.tsx
    Add questing prop to EntityList in WorldStructuresMenu     

    client/src/ui/modules/world-structures/WorldStructuresMenu.tsx - Added questing prop to `EntityList` for hyperstructures.
    +4/-0     
    resources.ts
    Add new quest types and rewards                                                   

    sdk/packages/eternum/src/constants/resources.ts
  • Added new quest types to QuestType enum.
  • Updated QUEST_RESOURCES with new quest rewards.
  • +24/-10 
    Formatting
    2 files
    useEntities.tsx
    Fix indentation in useEntities hook                                           

    client/src/hooks/helpers/useEntities.tsx - Fixed indentation for better readability.
    +2/-2     
    tsconfig.json
    Add newline at end of tsconfig.json                                           

    bot/tsconfig.json - Added newline at the end of the file.
    +1/-1     

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    vercel[bot] commented 3 months ago

    The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

    Name Status Preview Comments Updated (UTC)
    eternum โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Jun 28, 2024 9:46pm
    github-actions[bot] commented 3 months ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review [1-5] 4
    ๐Ÿงช Relevant tests No
    ๐Ÿ”’ Security concerns No
    โšก Key issues to review Possible Bug:
    The getPillageEvents function in PillageEventQueries.ts uses a hardcoded query string that includes the realm ID directly in the template string. This could potentially lead to GraphQL injection if not properly sanitized.
    Code Duplication:
    There is noticeable duplication in the useQuests function within useQuestStore.tsx, particularly in the quest definitions. Consider refactoring to a more data-driven approach to reduce redundancy and improve maintainability.
    Inconsistent Naming:
    The use of both currentQuest and selectedQuest across different components could lead to confusion. It would be beneficial to standardize the naming convention across all files.
    github-actions[bot] commented 3 months ago

    Failed to generate code suggestions for PR