Merge pull request #137 from bipproduction/cookies/fix

Cookies/fix
This commit is contained in:
Bagasbanuna02
2024-11-21 17:37:13 +08:00
committed by GitHub
4 changed files with 164 additions and 89 deletions

64
CHANGELOG.md Normal file
View File

@@ -0,0 +1,64 @@
# Changelog
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
## [1.2.1](https://github.com/bipproduction/hipmi/compare/v1.2.0...v1.2.1) (2024-11-21)
## 1.2.0 (2024-11-21)
### Features
* **app / dev / login:** membuat page login ([91333b5](https://github.com/bipproduction/hipmi/commit/91333b5c00b87da35a0d965f0678ff971484825b))
* **app / dev / page:** modified file ([90c32b3](https://github.com/bipproduction/hipmi/commit/90c32b345c1099c943a9b8f67b8aa257941484d9))
* **app / dev / register:** membuat page register ([1e06aeb](https://github.com/bipproduction/hipmi/commit/1e06aeb6998f00d77fa74849de11be182a0be676))
* **dashboard admin:** membuat dashboard admin ([46da772](https://github.com/bipproduction/hipmi/commit/46da772f3895bde770942c3d9044e6da0620ef1c))
* **dashboard super admin:** membuat dashboard super admin ([c363736](https://github.com/bipproduction/hipmi/commit/c3637366f9ebf24507c470714952ad2e572a0b0d))
* **image:** menambahkan gambar logo ([c74bb6e](https://github.com/bipproduction/hipmi/commit/c74bb6eceb401c55c3c297889fe43181406f3a22))
* **landing page:** buat komponen landing page ([38cb10d](https://github.com/bipproduction/hipmi/commit/38cb10da4ac8d68f1abd0163a0671036c15e1743))
* **login:** - Membuat login page - Membuat register page ([b6cc83c](https://github.com/bipproduction/hipmi/commit/b6cc83c004cacb2289c51491fce7ebc2b29e126f))
* **src/app/page:** mengedit page ([ca66fde](https://github.com/bipproduction/hipmi/commit/ca66fde1dc6751f3749cb1d582f7bbd299241318))
* tambah dependensi 'jose' versi 5.9.2 pada package.json ([6ee43ed](https://github.com/bipproduction/hipmi/commit/6ee43ed20faa273cbca0be948295e95d36bbd760))
### Bug Fixes
* admin ([604077c](https://github.com/bipproduction/hipmi/commit/604077cc8dda568951fa1cd1b8ddfe862e1d321d))
* Admin ([74108c3](https://github.com/bipproduction/hipmi/commit/74108c30969bd2c607b51f302209de91430e7792))
* admin donasi ([d624d61](https://github.com/bipproduction/hipmi/commit/d624d61a33069a9c578a1af780bc2229dd3bad96))
* admin investasi ([9b4a6fd](https://github.com/bipproduction/hipmi/commit/9b4a6fdc1c49ea982bb5e166aa8b3f4f40b3a392))
* admin job ([3aea046](https://github.com/bipproduction/hipmi/commit/3aea0460462e87c30b0e7a939a24aaf5d9ce6978))
* admin map ([8cedf7d](https://github.com/bipproduction/hipmi/commit/8cedf7db61702dc67300fdd11570022d84b1d857))
* Bug ([7e9dfce](https://github.com/bipproduction/hipmi/commit/7e9dfce293bda5a4577ea16a4867e340b9883b3f))
* Cookies ([abaec2c](https://github.com/bipproduction/hipmi/commit/abaec2c1c3be2a54975246e89cfe7047c962f2a8))
* dashboard admin ([ac432d1](https://github.com/bipproduction/hipmi/commit/ac432d1eb7b975d621889b0d2e13e366e806cf56))
* Db Profile ([cf9355e](https://github.com/bipproduction/hipmi/commit/cf9355e91f623171e7708d37a9ce8590ff473a44))
* Donasi ([a798f9a](https://github.com/bipproduction/hipmi/commit/a798f9a3bc9996811ca55e70ea407297e1f939d8))
* Event ([1f8bfcb](https://github.com/bipproduction/hipmi/commit/1f8bfcbed924ec1b53cdcc42393884f554299c5b))
* Event ([8f76067](https://github.com/bipproduction/hipmi/commit/8f760673804d114c3f04ce65a648fa0ff5962822))
* Event ([81543d6](https://github.com/bipproduction/hipmi/commit/81543d678cb515b36f8393ee257b8a6a6c4a0834))
* File view ([84b7b38](https://github.com/bipproduction/hipmi/commit/84b7b381f62d2f69d8b1e9d7c2411175e5d48e38))
* Image donasi ([0371ca5](https://github.com/bipproduction/hipmi/commit/0371ca5e0137354bb0d7a89300aa112112cf194d))
* Investasi ([5ff74b0](https://github.com/bipproduction/hipmi/commit/5ff74b00f55751cc951b959f2d9bccda403158dc))
* Job ([1b58ba7](https://github.com/bipproduction/hipmi/commit/1b58ba7d905f490fdba9e1d90e722faf251b2ae3))
* Job ([aa612d2](https://github.com/bipproduction/hipmi/commit/aa612d24bc7cb729db66841bd3a48379cf875f70))
* Job ([30743b0](https://github.com/bipproduction/hipmi/commit/30743b02ae0c2d0a83310af05711ed255000c7ce))
* Map ([56548b4](https://github.com/bipproduction/hipmi/commit/56548b425876a7fa9be49f2a290de6a1916609a1))
* Middlerawe/1 ([cc690ee](https://github.com/bipproduction/hipmi/commit/cc690eec0686e4306a440a8b38fffacb2c2b78c6))
* Middlerawe/2 ([ac749f3](https://github.com/bipproduction/hipmi/commit/ac749f3d9d348162a2b8e8c88091dce97f9cca27))
* Middlerawe/3 ([10dee19](https://github.com/bipproduction/hipmi/commit/10dee19f98b011de19a21e9ef4a5282e37ffdf38))
* Middlerawe/4 ([0a03b05](https://github.com/bipproduction/hipmi/commit/0a03b05d4e0d9c369844859cac8879ba5505efa7))
* Middlerawe/5 ([6e5a9f7](https://github.com/bipproduction/hipmi/commit/6e5a9f785a06f6b31b6010f8b89dfd146112a44a))
* Navbar admin ([6b8ace7](https://github.com/bipproduction/hipmi/commit/6b8ace772c54aa00eebf9228da0d1543ed593d2d))
* Navbar admin ([5fcb09b](https://github.com/bipproduction/hipmi/commit/5fcb09b88906e74c2f2be76f5fd325daa48f5ae5))
* Notifikasi ([82f5b23](https://github.com/bipproduction/hipmi/commit/82f5b237ae52dc087711452f4bd6baa7acce8a1f))
* Profile ([b13110b](https://github.com/bipproduction/hipmi/commit/b13110be6f475df7d5b36909cdc8f92f80a62d57))
* update version ([3d6ec14](https://github.com/bipproduction/hipmi/commit/3d6ec1410d0a54bad35dea2740101aaad589fdd7))
* update version in package.json ([ca99de7](https://github.com/bipproduction/hipmi/commit/ca99de7dd5a48dca66f33b3d63b6c278e0367c9d))
* Upload image ([360ba26](https://github.com/bipproduction/hipmi/commit/360ba267ec69404dd45bb7d6510fe6113d9087ab))
* Upload image ([370e3ec](https://github.com/bipproduction/hipmi/commit/370e3ec4e4c6e1f342c966feb7a65b62a09d2945))
* User search & Event ([ca5c304](https://github.com/bipproduction/hipmi/commit/ca5c30499a2630e5d8a8c87f569f2b50fa88ad6e))
* validasi ([a6548f7](https://github.com/bipproduction/hipmi/commit/a6548f7b364e403d5265a0015003021b5c11f004))
* Voting ([e65a8d3](https://github.com/bipproduction/hipmi/commit/e65a8d30a2a70593f3e4268518ae4c0c542a02dd))
* voting status ([9bb68b2](https://github.com/bipproduction/hipmi/commit/9bb68b216fc444e390fccf7131af886bc6d12d60))
* voting status ([e5e36a3](https://github.com/bipproduction/hipmi/commit/e5e36a38893f21037688cd3153a57dc29ce1347e))

View File

@@ -1,6 +1,6 @@
{
"name": "hipmi",
"version": "1.1.4-3",
"version": "1.2.1",
"private": true,
"prisma": {
"seed": "npx tsx prisma/seed.ts"
@@ -9,7 +9,8 @@
"dev": "next dev --experimental-https",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"ver": "npx commit-and-tag-version -- --prerelease"
},
"dependencies": {
"@bounceapp/iframe": "^0.3.0",

View File

@@ -44,11 +44,12 @@ export default async function RootLayout({
// if (!token) return <>Require Token Storage</>;
const userLoginId = await funGetUserIdByToken();
return (
<RootStyleRegistry>
{/* <MqttLoader />
<TokenProvider token={token} envObject={envObject} /> */}
{/* <RealtimeProvider userLoginId={userLoginId as string} /> */}
<RealtimeProvider userLoginId={userLoginId as string} />
{children}
</RootStyleRegistry>
);

View File

@@ -23,7 +23,8 @@ export type TypeNotification = {
userLoginId?: string;
};
const WIBU_REALTIME_TOKEN: any = process.env.NEXT_PUBLIC_WIBU_REALTIME_TOKEN;
const WIBU_REALTIME_TOKEN: string | undefined =
process.env.NEXT_PUBLIC_WIBU_REALTIME_TOKEN;
export default function RealtimeProvider({
userLoginId,
}: {
@@ -57,101 +58,109 @@ export default function RealtimeProvider({
);
useShallowEffect(() => {
WibuRealtime.init({
onData(data: TypeNotification) {
if (data.type == "notification" && data.pushNotificationTo == "ADMIN") {
setNewAdminNtf((e) => e + 1);
}
if (WIBU_REALTIME_TOKEN === undefined) return alert("gak dapet key");
try {
WibuRealtime.init({
onData(data: TypeNotification) {
if (
data.type == "notification" &&
data.pushNotificationTo == "ADMIN"
) {
setNewAdminNtf((e) => e + 1);
}
// Notifikasi ke semua user , yang datanya di acc admin
if (
data.type == "notification" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.userId == userLoginId
) {
setNewUserNtf((e) => e + 1);
setDataRealtime(data.dataMessage as any);
}
// Notifikasi ke semua user , yang datanya di acc admin
if (
data.type == "notification" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.userId == userLoginId
) {
setNewUserNtf((e) => e + 1);
setDataRealtime(data.dataMessage as any);
}
// ---------------------- JOB ------------------------- //
if (
data.type == "trigger" &&
data.pushNotificationTo == "ADMIN" &&
data.dataMessage?.kategoriApp == "JOB"
) {
setIsAdminJob_TriggerReview(true);
}
// ---------------------- JOB ------------------------- //
if (
data.type == "trigger" &&
data.pushNotificationTo == "ADMIN" &&
data.dataMessage?.kategoriApp == "JOB"
) {
setIsAdminJob_TriggerReview(true);
}
if (
data.type == "trigger" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.kategoriApp == "JOB" &&
data.dataMessage.status == "Publish"
) {
setIsTriggerJobBeranda(true);
}
// ---------------------- JOB ------------------------- //
if (
data.type == "trigger" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.kategoriApp == "JOB" &&
data.dataMessage.status == "Publish"
) {
setIsTriggerJobBeranda(true);
}
// ---------------------- JOB ------------------------- //
// ---------------------- EVENT ------------------------- //
if (
data.type == "trigger" &&
data.pushNotificationTo == "ADMIN" &&
data.dataMessage?.kategoriApp == "EVENT"
) {
setIsAdminEvent_TriggerReview(true);
}
// ---------------------- EVENT ------------------------- //
if (
data.type == "trigger" &&
data.pushNotificationTo == "ADMIN" &&
data.dataMessage?.kategoriApp == "EVENT"
) {
setIsAdminEvent_TriggerReview(true);
}
if (
data.type == "trigger" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.kategoriApp == "EVENT" &&
data.dataMessage.status == "Publish"
) {
setIsTriggerEventBeranda(true);
}
if (
data.type == "trigger" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.kategoriApp == "EVENT" &&
data.dataMessage.status == "Publish"
) {
setIsTriggerEventBeranda(true);
}
if (
data.type == "notification" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.status == "Peserta Event" &&
userLoginId !== data.dataMessage?.userId
) {
setNewUserNtf((e) => e + 1);
}
// ---------------------- EVENT ------------------------- //
if (
data.type == "notification" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.status == "Peserta Event" &&
userLoginId !== data.dataMessage?.userId
) {
setNewUserNtf((e) => e + 1);
}
// ---------------------- EVENT ------------------------- //
// ---------------------- VOTING ------------------------- //
if (
data.type == "trigger" &&
data.pushNotificationTo == "ADMIN" &&
data.dataMessage?.kategoriApp == "VOTING"
) {
setIsAdminVoting_TriggerReview(true);
}
// ---------------------- VOTING ------------------------- //
if (
data.type == "trigger" &&
data.pushNotificationTo == "ADMIN" &&
data.dataMessage?.kategoriApp == "VOTING"
) {
setIsAdminVoting_TriggerReview(true);
}
if (
data.type == "trigger" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.kategoriApp == "VOTING" &&
data.dataMessage.status == "Publish"
) {
setIsTriggerVotingBeranda(true);
}
if (
data.type == "trigger" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.kategoriApp == "VOTING" &&
data.dataMessage.status == "Publish"
) {
setIsTriggerVotingBeranda(true);
}
if (
data.type == "notification" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.status == "Voting Masuk" &&
userLoginId !== data.dataMessage?.userId
) {
setNewUserNtf((e) => e + 1);
}
// ---------------------- VOTING ------------------------- //
},
if (
data.type == "notification" &&
data.pushNotificationTo == "USER" &&
data.dataMessage?.status == "Voting Masuk" &&
userLoginId !== data.dataMessage?.userId
) {
setNewUserNtf((e) => e + 1);
}
// ---------------------- VOTING ------------------------- //
},
project: "hipmi",
WIBU_REALTIME_TOKEN: WIBU_REALTIME_TOKEN,
});
project: "hipmi",
WIBU_REALTIME_TOKEN: WIBU_REALTIME_TOKEN,
});
} catch (error) {
alert("error realtime");
}
}, []);
return null;