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

🔧 MyOffer & OffersUserTable #6732

Merged
merged 4 commits into from
Aug 17, 2023
Merged

🔧 MyOffer & OffersUserTable #6732

merged 4 commits into from
Aug 17, 2023

Conversation

roiLeo
Copy link
Contributor

@roiLeo roiLeo commented Aug 16, 2023

Screenshot 2023-08-16 at 10-17-24 NFT Artist Profile on KodaDot KodaDot - NFT Market Explorer
Screenshot 2023-08-16 at 10-13-59 KodaDot - NFT Market Explorer

@prury Notification pulse button is out of scope, the feature hasn't been implemented yet

@roiLeo roiLeo requested a review from a team as a code owner August 16, 2023 08:20
@roiLeo roiLeo requested review from vikiival and Jarsen136 and removed request for a team August 16, 2023 08:20
@netlify
Copy link

netlify bot commented Aug 16, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit fd99131
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/64dceae3fd395a0008d82a98
😎 Deploy Preview https://deploy-preview-6732--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 16, 2023

AI-Generated Summary: This pull request includes changes to two Vue files related to the offer feature.

In MyOffer.vue, the label for the price field in NeoTableColumn is changed to display both the offer price and the currency chain symbol. The Money component also had the hide-unit and round attributes added.

Furthermore, a new block of code has been added to OffersUserTable.vue, which introduces a new functionality for calculating the expiration time. This is done by fetching the current block number and comparing it with the expiration block. If the current block number is 0, the indicator returns 'computing'. If it has surpassed the expiration block, it returns 'expired'. Otherwise, the time left for expiration is returned.

Overall, these changes focus on improving the display and readability of price values and the addition of expiration time calculation.

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Aug 16, 2023
@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 16, 2023

Reviewpad Report

⚠️ Warnings

  • Please link an issue to the pull request

Comment on lines +175 to +190
const currentBlock = ref(async () => {
const { apiInstance } = useApi()
const api = await apiInstance.value
const block = await api.rpc.chain.getHeader()
return block.number.toNumber()
})

const calcExpirationTime = (expirationBlock: number): string => {
if (currentBlock.value === 0) {
return 'computing'
}
if (currentBlock.value > expirationBlock) {
return 'expired'
}
return formatSecondsToDuration(calcSecondsToBlock(expirationBlock))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, since I'm starting to duplicate this part of code

@@ -34,9 +34,9 @@
<NeoTableColumn
v-slot="props"
field="formatPrice"
:label="$t('myOffer.price')"
:label="`${$t(`offer.price`)} (${chainSymbol})`"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add that as param of translation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh idk, it's used without chainSymbol in other components

Copy link
Member

@vikiival vikiival left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smol

@yangwao yangwao added the A-basilisk issues related to basilisk parachain label Aug 16, 2023
@roiLeo roiLeo requested a review from prury August 16, 2023 10:40
@prury
Copy link
Member

prury commented Aug 16, 2023

showing Price(unit) here for me on the table title
image

@prury prury added the S-changes-requested-🤞 PR is almost good to go, just some fine tunning label Aug 16, 2023
@roiLeo
Copy link
Contributor Author

roiLeo commented Aug 16, 2023

@kodadot/code-review-guild any idea why I can't fetch chainSymbol on first load? (comes from useAssetsStore().fetchAssetList()) it work after HMR

For now I've hardcoded KSM value until I find a workaround

@Jarsen136
Copy link
Contributor

@kodadot/code-review-guild any idea why I can't fetch chainSymbol on first load? (comes from useAssetsStore().fetchAssetList()) it work after HMR

For now I've hardcoded KSM value until I find a workaround

Changing this line of code could fix this issue. Please also check other places that use it.

// composables/useChain.ts
  const { symbol } = assets(tokenId.value)

Change to

// composables/useChain.ts
  const symbol = computed(() => assets(tokenId.value).symbol)

@roiLeo
Copy link
Contributor Author

roiLeo commented Aug 16, 2023

Changing this line of code could fix this issue. Please also check other places that use it.

Thanks it does work!

@codeclimate
Copy link

codeclimate bot commented Aug 16, 2023

Code Climate has analyzed commit fd99131 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarcloud
Copy link

sonarcloud bot commented Aug 16, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@prury prury added S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked and removed S-changes-requested-🤞 PR is almost good to go, just some fine tunning labels Aug 16, 2023
@yangwao yangwao merged commit 241d53a into kodadot:main Aug 17, 2023
14 checks passed
@roiLeo roiLeo deleted the fix/bsx/offers branch August 17, 2023 09:27
This was referenced Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-basilisk issues related to basilisk parachain S-works-for-me-✅ qa-guild has tested PR from end user perspective and functionality worked small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants