Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of github.com:trashtrack-team/trashtrack
Browse files Browse the repository at this point in the history
  • Loading branch information
NotHydra committed Feb 29, 2024
2 parents 75bfb37 + 5b94d89 commit 83fffca
Show file tree
Hide file tree
Showing 20 changed files with 232 additions and 1,369 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
dist
tmp
/out-tsc
apps/iot/build

# dependencies
node_modules
Expand Down
23 changes: 11 additions & 12 deletions apps/app/src/components/operator-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import { IonRouterOutlet, IonTabs, IonTabBar, IonTabButton, IonLabel } from "@io
import { Icons, OperatorContext } from "@trashtrack/ui";

import OperatorDashboard from "../pages/operator/dashboard";
import OperatorUserDisplay from "../pages/operator/user/display";
import { useContext } from "react";
import OperatorUserEdit from "../pages/operator/user/edit-user";
import OperatorUserEditPassword from "../pages/operator/user/edit-password-user";
import { UsersPage } from "../pages/operator/user/users.page";
import { DetailedUserPage } from "../pages/operator/user/detailed-user.page";
import { ChangeUserPage } from "../pages/operator/user/change-user.page";
import { CreateUserPage } from "../pages/operator/user/create-user.page";

const OperatorTabs: React.FC = () => {
const operator = useContext(OperatorContext);
Expand All @@ -19,13 +20,11 @@ const OperatorTabs: React.FC = () => {
<IonRouterOutlet animated={false} mode="ios">
<Route path="/operator/tabs/dashboard" render={() => <OperatorDashboard />} exact={true} />

<Route path="/operator/tabs/user" render={() => <OperatorUserDisplay />} exact={true} />
<Route path="/operator/tabs/user/edit/:user_id" render={() => <OperatorUserEdit />} exact={true} />
<Route
path="/operator/tabs/user/edit-password/:id"
render={() => <OperatorUserEditPassword />}
exact={true}
/>
<Route path="/operator/tabs/user" render={() => <UsersPage />} exact={true} />
<Route path="/operator/tabs/user/create" render={() => <CreateUserPage />} exact={true} />
<Route path="/operator/tabs/user/details/:user-id" render={() => <DetailedUserPage />} exact={true} />
<Route path="/operator/tabs/user/update/:user-id" render={() => <ChangeUserPage />} exact={true} />

<Route path="/operator/tabs" render={() => <Redirect to="/operator/tabs/dashboard" />} exact={true} />
</IonRouterOutlet>
<IonTabBar slot="bottom" mode="ios" translucent className="pb-4 pt-4 border-t bg-card shadow-sm">
Expand All @@ -37,12 +36,12 @@ const OperatorTabs: React.FC = () => {
<Icons.trash strokeWidth={1} className="pt-2 w-[32px] h-[30px]" />
<IonLabel className="pt-2 pb-2">{t("tabs.trashbin")}</IonLabel>
</IonTabButton>
{/* {isAdmin && (
{isAdmin && (
<IonTabButton tab="userOperatorTab" href="/operator/tabs/user">
<Icons.user strokeWidth={1} className="pt-2 w-[32px] h-[30px]" />
<IonLabel className="pt-2 pb-2">User</IonLabel>
</IonTabButton>
)} */}
)}
</IonTabBar>
</IonTabs>
);
Expand Down
74 changes: 74 additions & 0 deletions apps/app/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,80 @@
"login": "Back to Login",
"home": "Back to Home"
},
"user": {
"subtitle": "User",
"search": "Search User",
"create": "Create a new user",
"noResults": "No user found for the search.",
"view_details": "View Details",
"not_active": "Not Active",
"is_active": "Active",
"detailed": {
"name": "Name",
"username": "Username",
"phoneNumber": "Phone Number",
"role": "Role",
"active": "Active",
"description": "Description",
"edit": "Change",
"change_password": "Change Password",
"delete": "Delete",
"back": "Back",
"action": "Actions",
"dialog_delete": {
"title": "Are you sure you want to delete this user?",
"subtitle": "This action cannot be undone.",
"pending": "Pending...",
"delete": "Delete",
"cancel": "Cancel"
}
},
"create_user": {
"subtitle": "Create User",
"name": "Name",
"password": "Password",
"username": "Username",
"phoneNumber": "Phone Number",
"description": "Description",
"role": "Role",
"submit": "Create User",
"back": "Back",
"validation": {
"name": "Name must be at least 8 characters long.",
"username": "Username must be at least 8 characters long.",
"phoneNumber": "Phone number must be at least 8 characters long.",
"description": "Description must be at least 8 characters long."
}
},
"change_user": {
"subtitle": "Change User",
"name": "Name",
"username": "Username",
"phoneNumber": "Phone Number",
"description": "Description",
"role": "Role",
"active": "Active",
"submit": "Update User",
"back": "Back",
"validation": {
"name": "Name must be at least 8 characters long.",
"username": "Username must be at least 8 characters long.",
"phoneNumber": "Phone number must be at least 8 characters long.",
"description": "Description must be at least 8 characters long."
}
},
"change_password": {
"subtitle": "Change Password",
"oldPassword": "Old Password",
"newPassword": "New Password",
"submit": "Change Password",
"back": "Back",
"validation": {
"old_password": "Old password must be at least 8 characters long.",
"new_password": "New password must be at least 8 characters long."
}
}
},
"trashbin": {
"subtitle": "Trash Bin",
"create": "Create a new trash bin",
Expand Down
75 changes: 75 additions & 0 deletions apps/app/src/locales/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,81 @@
"login": "Kembali ke Login",
"home": "Kembali ke Home"
},
"user": {
"subtitle": "Pengguna",
"search": "Cari Pengguna",
"create": "Buat Pengguna",
"noResults": "Tidak ada pengguna ditemukan.",
"view_details": "Lihat Detail",
"not_active": "Tidak Aktif",
"is_active": "Aktif",
"detailed": {
"name": "Nama",
"username": "Username",
"phoneNumber": "Nomor Telepon",
"role": "Role",
"active": "Status Aktif",
"description": "Deskripsi",
"edit": "Ubah",
"change_password": "Ubah Kata Sandi",
"delete": "Hapus",
"back": "Kembali",
"action": "Aksi",
"dialog_delete": {
"title": "Apakah Anda yakin ingin menghapus pengguna ini?",
"subtitle": "Tindakan ini tidak dapat dibatalkan.",
"pending": "Memproses...",
"delete": "Hapus",
"cancel": "Batal"
}
},
"create_user": {
"subtitle": "Buat Pengguna",
"name": "Name",
"password": "Kata Sandi",
"username": "Username",
"phoneNumber": "Nomor Telepon",
"description": "Deskripsi",
"role": "Role",
"submit": "Buat Pengguna",
"back": "Kembali",
"validation": {
"name": "Nama harus minimal 8 karakter.",
"username": "Username harus minimal 8 karakter.",
"password": "Kata sandi harus minimal 8 karakter.",
"phoneNumber": "Nomor telepon harus minimal 8 karakter.",
"description": "Deskripsi harus minimal 8 karakter."
}
},
"change_user": {
"subtitle": "Ubah Pengguna",
"name": "Nama",
"username": "Nama Pengguna",
"phoneNumber": "Nomor Telepon",
"description": "Deskripsi",
"role": "Peran",
"active": "Aktif",
"submit": "Perbarui Pengguna",
"back": "Kembali",
"validation": {
"name": "Nama harus memiliki setidaknya 8 karakter.",
"username": "Nama pengguna harus memiliki setidaknya 8 karakter.",
"phoneNumber": "Nomor telepon harus memiliki setidaknya 8 karakter.",
"description": "Deskripsi harus memiliki setidaknya 8 karakter."
}
},
"change_password": {
"subtitle": "Ubah Kata Sandi",
"oldPassword": "Kata Sandi Lama",
"newPassword": "Kata Sandi Baru",
"submit": "Ubah Kata Sandi",
"back": "Kembali",
"validation": {
"old_password": "Kata sandi lama harus memiliki setidaknya 8 karakter.",
"new_password": "Kata sandi baru harus memiliki setidaknya 8 karakter."
}
}
},
"trashbin": {
"subtitle": "Tempat Sampah",
"create": "Buat Tempat Sampah",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,28 +143,32 @@ export function FeedbackPage() {
</CardContent>
</Card>
)}
{isLoading ? (
<Card className="flex flex-col mt-4">
<CardContent className="pt-4">
<CardHeader>
<Skeleton className="h-4 w-40" />
</CardHeader>
<CardContent className="flex flex-col gap-2">
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-full" />
<div className="flex flex-col gap-4">
{isLoading ? (
<Card className="flex flex-col mt-4">
<CardContent className="pt-4">
<CardHeader>
<Skeleton className="h-4 w-40" />
</CardHeader>
<CardContent className="flex flex-col gap-2">
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-full" />
</CardContent>
</CardContent>
</CardContent>
</Card>
) : (
<Card className="flex flex-col mt-4">
<CardContent className="pt-4">
{filteredData.length === 0 ? (
</Card>
) : filteredData.length === 0 ? (
<Card className="flex flex-col mt-4">
<CardContent className="pt-4">
<p className="text-center text-xs">
{t("operator.reports.feedback.delete.noResults")}
</p>
) : (
filteredData.map((feedback: InterfaceFeedback) => (
</CardContent>
</Card>
) : (
filteredData.map((feedback: InterfaceFeedback) => (
<Card className="flex flex-col mt-4">
<CardContent className="pt-4">
<div key={feedback.id} className="flex flex-col gap-2">
<p className="text-xs">{feedback.title}</p>
<p className="text-xs">{feedback.description}</p>
Expand All @@ -188,11 +192,11 @@ export function FeedbackPage() {
queryClient={queryClient}
/>
</div>
))
)}
</CardContent>
</Card>
)}
</CardContent>
</Card>
))
)}
</div>
</div>
</IonContent>
</IonPage>
Expand Down
7 changes: 7 additions & 0 deletions apps/app/src/pages/operator/user/change-user.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function ChangeUserPage() {
return (
<div>
<div></div>
</div>
);
}
7 changes: 7 additions & 0 deletions apps/app/src/pages/operator/user/create-user.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function CreateUserPage() {
return (
<div>
<div></div>
</div>
);
}
7 changes: 7 additions & 0 deletions apps/app/src/pages/operator/user/detailed-user.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function DetailedUserPage() {
return (
<div>
<div></div>
</div>
);
}
Loading

0 comments on commit 83fffca

Please sign in to comment.