@nexttylabs/echo 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/app/(dashboard)/dashboard/page.tsx +48 -20
- package/messages/en.json +2 -0
- package/messages/jp.json +2 -0
- package/messages/zh-CN.json +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @nexttylabs/echo
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fc3d8f1: support light/dark theme
|
|
8
|
+
- cc04d9f: Use the organization member role uniformly.
|
|
9
|
+
- 5cfdeb7: feat: support editing user profile
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7dba561: remove legacy changeset files
|
|
14
|
+
- 158b254: show current orgnization
|
|
15
|
+
- 1e798f1: remove unuse tables and published files
|
|
16
|
+
- e3c4e1c: fix workflow errors
|
|
17
|
+
- daf9abb: first release
|
|
18
|
+
|
|
3
19
|
## 0.7.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -18,14 +18,16 @@
|
|
|
18
18
|
import { cookies, headers } from "next/headers";
|
|
19
19
|
import { getTranslations } from "next-intl/server";
|
|
20
20
|
import Link from "next/link";
|
|
21
|
-
import { ExternalLink } from "lucide-react";
|
|
21
|
+
import { ExternalLink, Building2 } from "lucide-react";
|
|
22
22
|
import { auth } from "@/lib/auth/config";
|
|
23
23
|
import { db } from "@/lib/db";
|
|
24
24
|
import { getDashboardStats, type DashboardStats } from "@/lib/dashboard/get-dashboard-stats";
|
|
25
|
-
import { getUserOrganizations } from "@/lib/auth/organization";
|
|
25
|
+
import { getUserOrganizations, type UserOrganization } from "@/lib/auth/organization";
|
|
26
26
|
import { getOrgContext } from "@/lib/auth/org-context";
|
|
27
27
|
import { StatsCards, RecentFeedbackList, StatusChart } from "@/components/dashboard";
|
|
28
28
|
import { Button } from "@/components/ui/button";
|
|
29
|
+
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
30
|
+
import { Badge } from "@/components/ui/badge";
|
|
29
31
|
import type { UserRole } from "@/lib/auth/permissions";
|
|
30
32
|
|
|
31
33
|
interface PageProps {
|
|
@@ -49,8 +51,8 @@ export default async function DashboardPage({ searchParams }: PageProps) {
|
|
|
49
51
|
recentFeedback: [],
|
|
50
52
|
};
|
|
51
53
|
|
|
52
|
-
let
|
|
53
|
-
let organizations:
|
|
54
|
+
let currentOrganization: UserOrganization | null = null;
|
|
55
|
+
let organizations: UserOrganization[] = [];
|
|
54
56
|
let shouldPersistDefaultOrg = false;
|
|
55
57
|
|
|
56
58
|
if (db && session?.user) {
|
|
@@ -81,7 +83,7 @@ export default async function DashboardPage({ searchParams }: PageProps) {
|
|
|
81
83
|
requireMembership: true,
|
|
82
84
|
});
|
|
83
85
|
|
|
84
|
-
|
|
86
|
+
currentOrganization = organizations.find((org) => org.id === context.organizationId) ?? null;
|
|
85
87
|
|
|
86
88
|
stats = await getDashboardStats(db, {
|
|
87
89
|
userId: session.user.id,
|
|
@@ -96,23 +98,49 @@ export default async function DashboardPage({ searchParams }: PageProps) {
|
|
|
96
98
|
|
|
97
99
|
return (
|
|
98
100
|
<div className="p-6 space-y-6">
|
|
99
|
-
<div
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
<p className="text-muted-foreground">{t("pageDescription")}</p>
|
|
103
|
-
</div>
|
|
104
|
-
<div className="flex items-center gap-3">
|
|
105
|
-
{organizationSlug && (
|
|
106
|
-
<Button asChild variant="outline">
|
|
107
|
-
<Link href={`/${organizationSlug}`} target="_blank">
|
|
108
|
-
<ExternalLink className="mr-2 h-4 w-4" />
|
|
109
|
-
{t("visitPortal")}
|
|
110
|
-
</Link>
|
|
111
|
-
</Button>
|
|
112
|
-
)}
|
|
113
|
-
</div>
|
|
101
|
+
<div>
|
|
102
|
+
<h1 className="text-2xl font-bold">{t("pageTitle")}</h1>
|
|
103
|
+
<p className="text-muted-foreground">{t("pageDescription")}</p>
|
|
114
104
|
</div>
|
|
115
105
|
|
|
106
|
+
{/* Current Organization Info Card */}
|
|
107
|
+
{currentOrganization && (
|
|
108
|
+
<Card>
|
|
109
|
+
<CardHeader className="pb-3">
|
|
110
|
+
<CardTitle className="flex items-center gap-2 text-lg">
|
|
111
|
+
<Building2 className="h-5 w-5" />
|
|
112
|
+
{t("currentOrganization")}
|
|
113
|
+
</CardTitle>
|
|
114
|
+
</CardHeader>
|
|
115
|
+
<CardContent>
|
|
116
|
+
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
|
117
|
+
<div className="space-y-1">
|
|
118
|
+
<div className="flex items-center gap-2">
|
|
119
|
+
<span className="font-semibold">{currentOrganization.name}</span>
|
|
120
|
+
<Badge variant="secondary">{currentOrganization.role}</Badge>
|
|
121
|
+
</div>
|
|
122
|
+
{currentOrganization.slug && (
|
|
123
|
+
<p className="text-sm text-muted-foreground">
|
|
124
|
+
{t("slug")}: <code className="rounded bg-muted px-1 py-0.5">{currentOrganization.slug}</code>
|
|
125
|
+
</p>
|
|
126
|
+
)}
|
|
127
|
+
{currentOrganization.description && (
|
|
128
|
+
<p className="text-sm text-muted-foreground">{currentOrganization.description}</p>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
{currentOrganization.slug && (
|
|
132
|
+
<Button asChild variant="outline" size="sm">
|
|
133
|
+
<Link href={`/${currentOrganization.slug}`} target="_blank">
|
|
134
|
+
<ExternalLink className="mr-2 h-4 w-4" />
|
|
135
|
+
{t("visitPortal")}
|
|
136
|
+
</Link>
|
|
137
|
+
</Button>
|
|
138
|
+
)}
|
|
139
|
+
</div>
|
|
140
|
+
</CardContent>
|
|
141
|
+
</Card>
|
|
142
|
+
)}
|
|
143
|
+
|
|
116
144
|
<StatsCards
|
|
117
145
|
totalFeedback={stats.totalFeedback}
|
|
118
146
|
pendingFeedback={stats.pendingFeedback}
|
package/messages/en.json
CHANGED
|
@@ -557,6 +557,8 @@
|
|
|
557
557
|
"pageTitle": "Dashboard",
|
|
558
558
|
"pageDescription": "Feedback management overview",
|
|
559
559
|
"visitPortal": "Visit Web Portal",
|
|
560
|
+
"currentOrganization": "Current Organization",
|
|
561
|
+
"slug": "Slug",
|
|
560
562
|
"stats": {
|
|
561
563
|
"totalFeedback": "Total Feedback",
|
|
562
564
|
"pending": "Pending",
|
package/messages/jp.json
CHANGED
package/messages/zh-CN.json
CHANGED