Skip to content

Commit 78681ff

Browse files
committed
fix (tasks, settings, onboarding, notifications): minor changes
chore (deployment): ci cd (WIP)
1 parent 1f5b57b commit 78681ff

File tree

11 files changed

+377
-353
lines changed

11 files changed

+377
-353
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Backend to Development
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
paths:
8+
- "src/server/**"
9+
- ".github/workflows/deploy-dev-backend.yaml"
10+
11+
jobs:
12+
deploy:
13+
name: Deploy Backend to Dev VM
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Deploy over SSH
17+
uses: appleboy/ssh-action@v1.0.3
18+
with:
19+
host: ${{ secrets.DEV_SERVER_VM_HOST }}
20+
username: ${{ secrets.DEV_SERVER_VM_USER }}
21+
key: ${{ secrets.DEV_SERVER_VM_SSH_PRIVATE_KEY }}
22+
script: |
23+
set -e
24+
cd ~/sentient
25+
git pull origin development
26+
cd src/server
27+
echo "Building and deploying the backend..."
28+
docker compose down
29+
docker compose up --build -d
30+
echo "Cleaning up old Docker images..."
31+
docker image prune -f
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Frontend to Development
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
paths:
8+
- "src/client/**"
9+
- ".github/workflows/deploy-dev-frontend.yaml"
10+
11+
jobs:
12+
deploy:
13+
name: Deploy Frontend to Dev VM
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Deploy over SSH
17+
uses: appleboy/ssh-action@v1.0.3
18+
with:
19+
host: ${{ secrets.DEV_CLIENT_VM_HOST }}
20+
username: ${{ secrets.DEV_CLIENT_VM_USER }}
21+
key: ${{ secrets.DEV_CLIENT_VM_SSH_PRIVATE_KEY }}
22+
script: |
23+
set -e
24+
cd ~/sentient
25+
git pull origin development
26+
cd src/client
27+
echo "Building and deploying the frontend..."
28+
docker compose down
29+
docker compose up --build -d
30+
echo "Cleaning up old Docker images..."
31+
docker image prune -f

.github/workflows/deploy-dev.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Backend to Staging
2+
3+
on:
4+
push:
5+
branches:
6+
- staging
7+
paths:
8+
- "src/server/**"
9+
- ".github/workflows/deploy-stag-backend.yaml"
10+
11+
jobs:
12+
deploy:
13+
name: Deploy Backend to Staging VM
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Deploy over SSH
17+
uses: appleboy/ssh-action@v1.0.3
18+
with:
19+
host: ${{ secrets.STAG_SERVER_VM_HOST }}
20+
username: ${{ secrets.STAG_SERVER_VM_USER }}
21+
key: ${{ secrets.STAG_SERVER_VM_SSH_PRIVATE_KEY }}
22+
script: |
23+
set -e
24+
cd ~/sentient
25+
git pull origin staging
26+
cd src/server
27+
echo "Building and deploying the backend..."
28+
docker compose down
29+
docker compose up --build -d
30+
echo "Cleaning up old Docker images..."
31+
docker image prune -f
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy Frontend to Staging
2+
3+
on:
4+
push:
5+
branches:
6+
- staging
7+
paths:
8+
- "src/client/**"
9+
- ".github/workflows/deploy-stag-frontend.yaml"
10+
11+
jobs:
12+
deploy:
13+
name: Deploy Frontend to Staging VM
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Deploy over SSH
17+
uses: appleboy/ssh-action@v1.0.3
18+
with:
19+
host: ${{ secrets.STAG_CLIENT_VM_HOST }}
20+
username: ${{ secrets.STAG_CLIENT_VM_USER }}
21+
key: ${{ secrets.STAG_CLIENT_VM_SSH_PRIVATE_KEY }}
22+
script: |
23+
set -e
24+
cd ~/sentient
25+
git pull origin staging
26+
cd src/client
27+
echo "Building and deploying the frontend..."
28+
docker compose down
29+
docker compose up --build -d
30+
echo "Cleaning up old Docker images..."
31+
docker image prune -f

.github/workflows/deploy-stag.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/client/app/api/notifications/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const GET = withAuth(async function GET(request, { authHeader }) {
77
const response = await fetch(
88
`${process.env.NEXT_PUBLIC_APP_SERVER_URL}/notifications`,
99
{
10-
method: "GET",
10+
method: "POST",
1111
headers: { "Content-Type": "application/json", ...authHeader }
1212
}
1313
)

src/client/app/home/page.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,16 @@ const HomePage = () => {
291291

292292
const fetchUserDetails = useCallback(async () => {
293293
try {
294-
const response = await fetch("/api/user/profile")
294+
const response = await fetch("/api/user/data")
295295
if (!response.ok) throw new Error("Failed to fetch user details")
296-
setUserDetails(await response.json())
296+
const result = await response.json()
297+
const userName =
298+
result?.data?.personalInfo?.name ||
299+
result?.data?.onboardingAnswers?.["user-name"]
300+
setUserDetails({ given_name: userName || "User" })
297301
} catch (error) {
298302
toast.error(`Error fetching user details: ${error.message}`)
303+
setUserDetails({ given_name: "User" })
299304
}
300305
}, [])
301306

src/client/app/settings/page.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ import {
3030
} from "@tabler/icons-react"
3131
import { useState, useEffect, useCallback, useRef } from "react"
3232
import { Tooltip } from "react-tooltip"
33-
import React from "react"
34-
import { useSmoothScroll } from "@hooks/useSmoothScroll"
3533

3634
const integrationIcons = {
3735
gmail: IconMail,
@@ -445,9 +443,6 @@ const Settings = () => {
445443
const [loadingIntegrations, setLoadingIntegrations] = useState(true)
446444
const [activeManualIntegration, setActiveManualIntegration] = useState(null)
447445
const [processingIntegration, setProcessingIntegration] = useState(null)
448-
const scrollRef = useRef(null)
449-
450-
useSmoothScroll(scrollRef)
451446

452447
// --- CORRECTED: Specific list of Google services ---
453448
const googleServices = [
@@ -639,10 +634,7 @@ const Settings = () => {
639634
Settings
640635
</h1>
641636
</header>
642-
<main
643-
ref={scrollRef}
644-
className="flex-1 overflow-y-auto p-4 sm:p-6 md:p-10 custom-scrollbar"
645-
>
637+
<main className="flex-1 overflow-y-auto p-4 sm:p-6 md:p-10 custom-scrollbar">
646638
<div className="w-full max-w-5xl mx-auto space-y-10">
647639
<WhatsAppSettings />
648640
<PrivacySettings />

0 commit comments

Comments
 (0)