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(notifications): implement notifications table, use backend types… #679

Merged
merged 8 commits into from
Aug 12, 2024

Conversation

MauserBitfly
Copy link
Contributor

This PR:

  • implements the Network table for the notifications page
  • replaces temp types with api types for the dashboard table on the notifications page

This PR is not:

  • tested with 'real' data, as the backend returns mocked data. So things like dashboard name mapping, type mapping and value formatting are currently a best guess and will be re-evaluated once we have a real backend.
  • use the correct subscriptions count
  • implement the Network Switch for the dashboard table

Copy link

cloudflare-workers-and-pages bot commented Aug 7, 2024

Deploying beaconchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 78c0299
Status: ✅  Deploy successful!
Preview URL: https://bfe30bed.beaconchain.pages.dev
Branch Preview URL: https://beds-163-notification-networ.beaconchain.pages.dev

View logs

Copy link
Contributor

@thib-wien thib-wien left a comment

Choose a reason for hiding this comment

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

LGTM, I only found nitpicks and a question.


defineEmits<{ (e: 'openDialog'): void }>()

const cursor = ref<Cursor>()
const pageSize = ref<number>(10)
const { t: $t } = useTranslation()

// TODO: replace currentNetwork with selection from NETWORK_SWITCHER_COMPONENT that has yet to be implemented
const { currentNetwork } = useNetworkStore()
const networkId = ref<number>(currentNetwork.value ?? 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be more future-proof and consistent with the other .vue files if you write ref<ChainIDs> here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure makes sense

return { data }
},
)

export function useNotificationsDashboardStore() {
export function useNotificationsDashboardStore(networkId: globalThis.Ref<number>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

remark: maybe ...globalThis.Ref<ChainIDs>) { for consistency with the other .vue files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

"participation_rate": "Participation rate < {_value}"
},
"footer": {
"subscriptions": "Network ({count} Subscription) |Validators ({count} Subscriptions)"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can use spaces after the |, so: ... | Validators ({count} Subscriptions).
At least in my use cases it did not make a difference on the UI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a space

return // in case some query params change while loading
}
isLoading.value = false
if (!isStoredQuery(q)) {
Copy link
Contributor

@thib-wien thib-wien Aug 9, 2024

Choose a reason for hiding this comment

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

Can it happen?
You set setStoredQuery(q) above. Can it be changed by some event before we reach line 45?

As I understand JS after 8 months with it: functions are never interrupted. Async does not mean that it runs in parallel but rather it will run as soon as there is nothing else to do (like apps under Windows 3 in the good old century).

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 it could be changed while the webservice request is fetched.

the code at the await waits for the ws to return data ... in the meantime the loadNotificationsDashboards could called in the meantime

)

isLoading.value = false
if (!isStoredQuery(q)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

so same question :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same answer

@MauserBitfly MauserBitfly requested a review from thib-wien August 12, 2024 08:32
@MauserBitfly MauserBitfly merged commit 59c000c into staging Aug 12, 2024
2 checks passed
@MauserBitfly MauserBitfly deleted the BEDS-163/notification-network-table branch August 12, 2024 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants