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

🚀 feat(server.ts): change port variable case from lowercase port to u… #224

Conversation

sebpalluel
Copy link
Contributor

@sebpalluel sebpalluel commented Dec 22, 2023

Type

enhancement


Description

  • Added a new function revealDelayedContract that uses the NftClaimable SDK to reveal a delayed contract.
  • Updated EventPassCardFooter.tsx to render the EventPassContractRevealButtonClient if the event pass type is DelayedReveal and not yet revealed.
  • Added a new file EventPassContractRevealButtonClient.tsx to handle the action of revealing a delayed contract.
  • Added isDelayedRevealed property to eventPassNftVIPWithContract and eventWithDelayedPasses examples.
  • Updated GetEventWithPassesOrganizerQuery type and query to include isDelayedRevealed field in eventPassNftContract.
  • Added translations for EventPassContractRevealButtonClient component in English and French.

PR changes walkthrough

Relevant files                                                                                                                                 
Enhancement
8 files
revealDelayedContract.ts                                                                       
    libs/features/back-office/events/src/lib/actions/revealDelayedContract.ts

    Added a new function revealDelayedContract that uses the
    NftClaimable SDK to reveal a delayed contract.

+7/-0
EventPassCardFooter.tsx                                                                         
    libs/features/back-office/events/src/lib/molecules/EventPassCardFooter/EventPassCardFooter.tsx

    Imported EventPassNftContractType_Enum and
    EventPassContractRevealButtonClient. Added a new condition
    to render the EventPassContractRevealButtonClient if the
    event pass type is DelayedReveal and not yet revealed.

+20/-5
EventPassContractRevealButtonClient.tsx                                         
    libs/features/back-office/events/src/lib/molecules/EventPassCardFooter/EventPassContractRevealButtonClient.tsx

    Added a new file EventPassContractRevealButtonClient.tsx
    to handle the action of revealing a delayed contract. It
    includes a button for revealing the contract and error
    handling.

+55/-0
examples.tsx                                                                                               
    libs/features/back-office/events/src/lib/molecules/EventPassNftFilesTable/examples.tsx

    Added isDelayedRevealed property to
    eventPassNftVIPWithContract example.

+1/-0
examples.tsx                                                                                               
    libs/features/back-office/events/src/lib/organisms/EventSheet/examples.tsx

    Added isDelayedRevealed property to
    eventWithDelayedPasses example.

+1/-0
index.ts                                                                                                       
    libs/gql/admin/api/src/generated/index.ts

    Added isDelayedRevealed field to eventPass object in
    GetEventWithPassesOrganizerQuery.

+1/-0
index.ts                                                                                                       
    libs/gql/admin/types/src/generated/index.ts

    Updated GetEventWithPassesOrganizerQuery type to include
    isDelayedRevealed field in eventPassNftContract.

+1/-1
event.query.gql                                                                                         
    libs/gql/admin/api/src/queries/organizer/event/event.query.gql

    Added isDelayedRevealed field to eventPassNftContract in
    the GetEventWithPassesOrganizer query.

+1/-0
Tests
1 files
EventSheet.stories.tsx                                                                           
    libs/features/back-office/events/src/lib/organisms/EventSheet/EventSheet.stories.tsx

    Imported revealDelayedContract action and added a mock for
    it. Added a new story WithEventPassDelayedRevealToReveal
    to test the reveal button functionality.

+48/-1
Documentation
2 files
en.json                                                                                                         
    libs/next/i18n/src/messages/en.json

    Added translations for EventPassContractRevealButtonClient
    component in English.

+6/-0
fr.json                                                                                                         
    libs/next/i18n/src/messages/fr.json

    Added translations for EventPassContractRevealButtonClient
    component in French.

+7/-1

User description

…ppercase PORT to improve semantics

🚀 feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port

🚀 feat(revealDelayedContract.ts): add new file revealDelayedContract.ts to handle the action of revealing a delayed contract

🚀 feat(EventPassCardFooter.tsx): import EventPassNftContractType_Enum from @gql/shared/types to use in the component

🚀 feat(EventPassCardFooter.tsx): add EventPassContractRevealButtonClient component to render a button for revealing the contract if it's of type DelayedReveal and not yet revealed

🚀 feat(EventPassContractRevealButtonClient.tsx): add new file EventPassContractRevealButtonClient.tsx to handle the action of revealing a delayed contract

🚀 feat(EventPassNftFilesTable/examples.tsx): add isDelayedRevealed property to eventPassNftVIPWithContract example

🚀 feat(EventSheet.stories.tsx): import revealDelayedContract action and add mock for it, add WithEventPassDelayedRevealToReveal story to test the reveal button functionality

🚀 feat(EventSheet/examples.tsx): add isDelayedRevealed property to eventWithDelayedPasses example

🚀 feat(event.query.gql): add isDelayedRevealed field to eventPass object in GetEventWithPassesOrganizer query

🚀 feat(en.json): add translations for EventPassContractRevealButtonClient component

🚀 feat(fr.json): add translations for EventPassContractRevealButtonClient component

…ppercase PORT to improve semantics

🚀 feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port

🚀 feat(revealDelayedContract.ts): add new file revealDelayedContract.ts to handle the action of revealing a delayed contract

🚀 feat(EventPassCardFooter.tsx): import EventPassNftContractType_Enum from @gql/shared/types to use in the component

🚀 feat(EventPassCardFooter.tsx): add EventPassContractRevealButtonClient component to render a button for revealing the contract if it's of type DelayedReveal and not yet revealed

🚀 feat(EventPassContractRevealButtonClient.tsx): add new file EventPassContractRevealButtonClient.tsx to handle the action of revealing a delayed contract

🚀 feat(EventPassNftFilesTable/examples.tsx): add isDelayedRevealed property to eventPassNftVIPWithContract example

🚀 feat(EventSheet.stories.tsx): import revealDelayedContract action and add mock for it, add WithEventPassDelayedRevealToReveal story to test the reveal button functionality

🚀 feat(EventSheet/examples.tsx): add isDelayedRevealed property to eventWithDelayedPasses example

🚀 feat(event.query.gql): add isDelayedRevealed field to eventPass object in GetEventWithPassesOrganizer query

🚀 feat(en.json): add translations for EventPassContractRevealButtonClient component

🚀 feat(fr.json): add translations for EventPassContractRevealButtonClient component
Copy link

vercel bot commented Dec 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
back-office ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 22, 2023 2:21pm
marketplace ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 22, 2023 2:21pm

@codiumai-pr-agent-free codiumai-pr-agent-free bot added the enhancement New feature or request label Dec 22, 2023
Copy link

PR Description updated to latest commit (fe859a1)

Copy link

PR Analysis

  • 🎯 Main theme: Adding functionality to reveal delayed contracts for NFTs
  • 📝 PR summary: This PR introduces a new feature that allows users to reveal delayed contracts for NFTs. It includes the addition of a new function revealDelayedContract, updates to the EventPassCardFooter component to render a new button for revealing the contract if it's of type DelayedReveal and not yet revealed, and updates to several other files to support this new functionality.
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: No
  • ⏱️ Estimated effort to review [1-5]: 4, because the PR involves changes in multiple files and introduces new functionality which requires understanding of the existing codebase and the new feature being introduced.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The PR seems to be well-structured and the code changes are logically grouped. However, it would be beneficial to add unit tests to verify the new functionality. Also, it would be good to handle the case where eventPass.eventPassNftContract?.contractAddress is undefined in revealDelayedContract function.

  • 🤖 Code feedback:
    relevant filelibs/features/back-office/events/src/lib/actions/revealDelayedContract.ts
    suggestion      Add error handling for the case where `contractAddress` is undefined. [important]
    relevant lineexport async function revealDelayedContract(contractAddress: string) {

    relevant filelibs/features/back-office/events/src/lib/molecules/EventPassCardFooter/EventPassContractRevealButtonClient.tsx
    suggestion      Consider disabling the 'Reveal Contract' button while the reveal operation is in progress to prevent multiple clicks. [medium]
    relevant line} onClick={revealContract}>

    relevant filelibs/features/back-office/events/src/lib/molecules/EventPassCardFooter/EventPassContractRevealButtonClient.tsx
    suggestion      It would be good to handle the case where `eventPass.eventPassNftContract?.contractAddress` is undefined in `revealContract` function. [important]
    relevant lineasync function revealContract() {

    relevant filelibs/features/back-office/events/src/lib/organisms/EventSheet/EventSheet.stories.tsx
    suggestion      Add tests to verify the new functionality of revealing delayed contracts. [important]
    relevant lineexport const WithEventPassDelayedRevealToReveal: Story = {

How to use

Instructions

To invoke the PR-Agent, add a comment using one of the following commands:
/review: Request a review of your Pull Request.
/describe: Update the PR title and description based on the contents of the PR.
/improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
/ask <QUESTION>: Ask a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.
/add_docs: Generate docstring for new components introduced in the PR.
/generate_labels: Generate labels for the PR based on the PR's contents.
see the tools guide for more details.

To edit any configuration parameter from the configuration.toml, add --config_path=new_value.
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, add a /config comment.

…s undefined to prevent unexpected behavior

🐛 fix(nft-thirdweb-api.ts): throw an error if event pass NFT contract is not found for the given address to handle the case when the contract does not exist or is not accessible
… improve code cleanliness and readability

🔧 fix(index.spec.ts): mock isBackOffice function to return the correct value in test cases to ensure accurate testing
🔧 fix(index.spec.ts): remove unnecessary environment variable assignment in test case to improve test clarity and accuracy
… for consistency with nx.json

🔧 chore(nx.json): update cacheDirectory value to /tmp/nx-cache for consistency with .env.local
…_size to 8192 for better memory allocation during build and e2e tests
…prove readability and remove unnecessary file creation
@sebpalluel sebpalluel merged commit ec9ba09 into staging Dec 22, 2023
3 of 4 checks passed
@sebpalluel sebpalluel deleted the 223-ticket-dr-07-2-add-reveal-your-nft-collection-cta-in-back-office-as-well-as-both-deploy-cta branch December 22, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ticket DR-07-2: Add Reveal your NFT collection CTA in Back-office as well as both deploy CTA
1 participant