feat: browser push notifications (#14888)

* feat: web push notifications feature

* Revert yarn.lock changes

* added new env variables requirement in .env.example

* moved useNotifications hook in packages/lib/hooks

* fix: bug

* use i18n

* chore: move to new file

* chore: add yarn.lock

* Update .env.example

Co-authored-by: Amit Sharma <[email protected]>

* chore: add instruction for brave browser

* fix: tooltip

* chore: use enum

* chore

* small update

---------

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Amit Sharma <[email protected]>
Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: unknown <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
17 files changed
+465 -11

No files matched your search

@@ -0,0 +1,14 @@
-- CreateTable
CREATE TABLE "NotificationsSubscriptions" (
"id" SERIAL NOT NULL,
"userId" INTEGER NOT NULL,
"subscription" TEXT NOT NULL,
CONSTRAINT "NotificationsSubscriptions_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "NotificationsSubscriptions_userId_subscription_idx" ON "NotificationsSubscriptions"("userId", "subscription");
-- AddForeignKey
ALTER TABLE "NotificationsSubscriptions" ADD CONSTRAINT "NotificationsSubscriptions_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
+13 -3
View File
@@ -331,9 +331,10 @@ model User {
secondaryEmails SecondaryEmail[]
isPlatformManaged Boolean @default(false)
OutOfOfficeReasons OutOfOfficeReason[]
smsLockState SMSLockState @default(UNLOCKED)
smsLockReviewedByAdmin Boolean @default(false)
OutOfOfficeReasons OutOfOfficeReason[]
smsLockState SMSLockState @default(UNLOCKED)
smsLockReviewedByAdmin Boolean @default(false)
NotificationsSubscriptions NotificationsSubscriptions[]
@@unique([email])
@@unique([email, username])
@@ -346,6 +347,15 @@ model User {
@@map(name: "users")
}
model NotificationsSubscriptions {
id Int @id @default(autoincrement())
userId Int
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
subscription String
@@index([userId, subscription])
}
// It holds Organization Profiles as well as User Profiles for users that have been added to an organization
model Profile {
id Int @id @default(autoincrement())