-
Notifications
You must be signed in to change notification settings - Fork 44
Notifications step in installer #2121
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
Notifications step in installer #2121
Conversation
|
Dappnode bot has built and pinned the built packages to an IPFS node, for commit: 2c4eca1 This is a development version and should only be installed for testing purposes.
Hash: (by dappnodebot/build-action) |
|
|
||
| const dnpsRequest = useApi.packagesGet(); | ||
| const installedDnps = dnpsRequest.data; | ||
| const isNotificationsPkgInstalled = installedDnps?.some((dnp) => dnp.dnpName === "notifications.dnp.dappnode.eth"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldnt be used find instead? also is there a better place to define the notifications dnpName in a params file in the admin-ui module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since only a boolean is needed, its better to use some
packages/admin-ui/src/pages/installer/components/Steps/Notifications.tsx
Outdated
Show resolved
Hide resolved
| const onInstallThrottle = throttle(onInstall, 1000); | ||
|
|
||
| const setNotifications = async () => { | ||
| if (!manifest.notifications) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be reduced to:
if (!manifest.notifications || endpointsGatus.length === 0) return
await api.notificationsUpdateEndpoints({
dnpName,
notificationsConfig: { endpoints: endpointsGatus, customEndpoints: endpointCustom},
isCore
});There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since endpoints can be an empty array, to prevent unexpected backend errors, passing undefined instead of empty array. This ensures the backend correctly skips updates when no data is provided,
packages/admin-ui/src/pages/installer/components/InstallDnpView.tsx
Outdated
Show resolved
Hide resolved
packages/admin-ui/src/pages/installer/components/InstallDnpView.tsx
Outdated
Show resolved
Hide resolved
372e58f
into
pablo-mateu/refactor-notifications
* Implement new release file notifications.yaml * Implement backend API calls * bump ajv and fix import issue * Implement notifications file and json schema * fix import * fix import * Root notifications tab (#2105) * fix `gatusConfig` urls (#2107) * remove uri * remove temperature daemon * add type for custom endpoints * add validation for custom endpoints * Implement notifications module (#2112) * implement notifications module * add notifications module * add missing dependencies * Add `notifications.yaml` to dappmanager (#2113) * Update custom endpoint types * add notifications yaml * remove unused exports * use dappmanager dnpname * Check is enabled before sending notification * fix tests * Implement notifications `inbox` subpath (#2106) * Implement `Inbox` subpath * inbox fix * Searchbar component in Inbox * inbox notifications filtering * remove unnecesary asyn-await * Check is core package before updating notifications settings (#2114) * Check is core * use is core in write too --------- Co-authored-by: Pablo Mendez <pablo@dappnode.io> * Return is core to in getEndpoints from notifications (#2115) Co-authored-by: Pablo Mendez <pablo@dappnode.io> * fix getEndpoints method (#2116) * improve code redability * Add `notifications/settings` subpath (#2117) * Implament `Settings` subpath * setting subtab fixes * refactor EndpointItem component to be reusable * Reuse `EndpointItem` component * Ensure notificationsEndpoints by package is initalized (#2118) * Initialize in single line (#2119) Co-authored-by: Pablo Mendez <pablo@dappnode.io> * Return avatarUrl in `/package-manifest` (#2120) * return avatar in package-manifest api * improve getIsCore * fix add missing return * add avatarurl setter --------- Co-authored-by: Pablo Mendez <pablo@dappnode.io> * Ensure directory exists (#2124) Co-authored-by: Pablo Mendez <pablo@dappnode.io> * Notifications step in installer (#2121) * Notifications step v1 * set Notifications config on installer * installer styles * review fixes * Prevent endpoints autoupdate (#2125) * Revert "Prevent endpoints autoupdate (#2125)" This reverts commit 22b05bf. * filter error notifications on `Inbox` (#2128) * Retrieve notification icon from the notification itself (#2129) * get notification icon from itself * icon in NotificationPayload interface * optional icon * ensure state update (#2132) * Persist user settings in notifications (#2134) * apply user settings in notifications * fix typo * fix merge conditions * Add unit testing to nofiications merge userr settings (#2135) * update not name * fix NotificationCategory enum * fix NotificationCategory ref * Merge endpoints config on installer (#2136) * Merge endpoints config on installer * add mock-backend response * Update "pkg updates" endpoint desc * Deprecate old push notifications (#2138) * Deprecate old push notifications * Track notifictions count * Request to mark notifications as seen (#2142) * Deprecate old push notifications * Track notifictions count * Request notifications to seen * Merge branch 'pablo-mateu/refactor-notifications' into mateu/set-notis-to-seen * fix format * Add priority field (#2149) * Add priority field * fix unit test * add priority * Relocating Legacy Notifications Tab (#2143) * Move Legacy notifications tab * Legacy deprecation banner * update deprecation legacy modal * fix notifications unnecessary re-renders * Add status field to notification (#2153) * Add status field * fix test * add comment * Notifications inbox UI fixes (#2156) * notifications inbox UI fixes * notifications inbox UI fixes * priority and category labels * prettified notification body * utils * category label improved * support MD in notifications card * fix resolved label * Notifications general switch (#2155) * Notifications general switch * remove logs * Welcome notifications modal (#2144) * Welcome notifications modal * welcome dark styles * modal copy updated * start stop notifications on welcome * typo fix * Add pagination to history (#2160) * Add pagination * fix comparison * remove priority * Display alerts component (#2164) * Implement getInternetConnection cron * implement reboot required script * remove initial calls for reboot required * rebase * Implement password is secure notification * fix password is secure mssg * implemented core update notif * remove wifi notif from notifications view * remove unused import * use get is password secure from backend * Implement wifi as notification high * implement repository health daemon * set maximum listener to 12 * remove log true from notification endpoints. logs are too heavy * update prios * Implement call to action button in notifications card (#2157) * call2action in notifications card * fixing mobile styles * is banner prop * prio label fix * getBannerNotifications call * WIP: Notifications Banner component * Alerts copies review (#2159) * package updates notification * disk usage notification * host reboot notification * internet connection notification * repository notifications * host password notification * staticIp notification * wifi password * notifications banner update * set notifications as seen by ID * Collapsable banners and improved filtering * set resolved-banner notifications as seen * timestamp fix * add correlationId * schemas and types update * update schemas with latest changes * remove unused fields --------- Co-authored-by: pablomendezroyo <mendez4a@gmail.com> Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com> Co-authored-by: Pablo Mendez <pablo@dappnode.io> * remove triggered filter in banner component * fix linter * update eth repository not copy * pagination fix * fix types & schemas * isBanner in custom shcemas * update avatar * Update set seen by correlationId endpoint (#2167) * start-stop notifications services fix * scrollable categories mobile view * update CTA urls * resolved banner notifications fix * validate notifications and setupwizard schemas too (#2168) Co-authored-by: Pablo Mendez <pablo@dappnode.io> * condition operator fix * be more flexible in url notifications schema pattern * Filter banner by correlationId * external cta urls * more flexibility on regex url notifications * fix lint * schemas url fix * add failure treeshold of 3 * Implement notifications settings allDnps (#2170) * Implement notifications settings allDnps * merge user settings in dnp request * apply user notifications settings on install * props fix * fix test --------- Co-authored-by: Pablo Mendez <pablo@dappnode.io> Co-authored-by: mateumiralles <mateumiralles714@gmail.com> * add correlationid prop * fix merging notifications settings * Allow MD in endpoint descr * fix schema test * Notifications settings tooltip (#2169) * notifications settings tooltip * Package tooltip in notification settings * using every * use correlation id in dappmanager * add /dnp to installer url * onboarding link opens new tab * internet notification fix (#2172) * Improve notifications onboarding (#2171) * onboarding installs notis pkg * keeping track of installation * fix notifications pkg calls * typo * notifications CTA button fix * toast feedback on settings update * fix notifications update toast * remove hardcoded ipfs * add missing patterns --------- Co-authored-by: Mateu Miralles <52827122+mateumiralles@users.noreply.github.com> Co-authored-by: Pablo Mendez <pablo@dappnode.io> Co-authored-by: mateumiralles <mateumiralles714@gmail.com>
Implementing the "Notifications" step in the installer to configure package notifications during installation.