-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2506 from airqo-platform/staging
move to production
- Loading branch information
Showing
37 changed files
with
5,311 additions
and
1,004 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
netmanager-app/app/(authenticated)/organizations/[id]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
"use client"; | ||
|
||
import type React from "react"; | ||
import { Suspense } from "react"; | ||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; | ||
import { OrganizationProfile } from "@/components/Organization/organization-profile"; | ||
import { TeamMembers } from "@/components/Organization/team-members"; | ||
import { OrganizationRoles } from "@/components/Organization/organization-roles"; | ||
import { Skeleton } from "@/components/ui/skeleton"; | ||
import { ArrowLeftIcon } from "lucide-react"; | ||
import { useRouter } from "next/navigation"; | ||
import { Button } from "@/components/ui/button"; | ||
import { RouteGuard } from "@/components/route-guard"; | ||
|
||
const LoadingFallback = () => ( | ||
<div className="space-y-4"> | ||
<Skeleton className="h-8 w-3/4" /> | ||
<Skeleton className="h-64 w-full" /> | ||
</div> | ||
); | ||
|
||
const TabContent = ({ | ||
value, | ||
children, | ||
}: { | ||
value: string; | ||
children: React.ReactNode; | ||
}) => ( | ||
<TabsContent value={value}> | ||
<Suspense fallback={<LoadingFallback />}>{children}</Suspense> | ||
</TabsContent> | ||
); | ||
|
||
const OrganizationDetailsPage = ({ params }: { params: { id: string } }) => { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<RouteGuard permission="CREATE_UPDATE_AND_DELETE_NETWORK_USERS"> | ||
<div className="container mx-auto"> | ||
{/* Back button */} | ||
<Button | ||
variant="ghost" | ||
className="flex items-center space-x-2 mb-6" | ||
onClick={() => router.push("/organizations")} | ||
> | ||
<ArrowLeftIcon className="h-4 w-4" /> | ||
<span>Back to Organizations</span> | ||
</Button> | ||
{/* Organization Details */} | ||
<h1 className="text-3xl font-bold mb-6">Organization Details</h1> | ||
<Tabs defaultValue="profile"> | ||
<TabsList className="grid grid-cols-3"> | ||
<TabsTrigger value="profile">Organization Profile</TabsTrigger> | ||
<TabsTrigger value="members">Team Members</TabsTrigger> | ||
<TabsTrigger value="roles">Organization Roles</TabsTrigger> | ||
</TabsList> | ||
<TabContent value="profile"> | ||
<OrganizationProfile organizationId={params.id} /> | ||
</TabContent> | ||
<TabContent value="members"> | ||
<TeamMembers organizationId={params.id} /> | ||
</TabContent> | ||
<TabContent value="roles"> | ||
<OrganizationRoles organizationId={params.id} /> | ||
</TabContent> | ||
</Tabs> | ||
</div> | ||
</RouteGuard> | ||
); | ||
}; | ||
|
||
export default OrganizationDetailsPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"use client"; | ||
|
||
import { OrganizationList } from "@/components/Organization/List"; | ||
import { RouteGuard } from "@/components/route-guard"; | ||
|
||
const OrganizationSettingsPage = () => { | ||
return ( | ||
<RouteGuard permission="CREATE_UPDATE_AND_DELETE_NETWORK_USERS"> | ||
<div className="mx-auto"> | ||
<OrganizationList /> | ||
</div> | ||
</RouteGuard> | ||
); | ||
}; | ||
|
||
export default OrganizationSettingsPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { UserDetails } from "@/app/types/users"; | ||
|
||
export interface Group { | ||
_id: string | ||
grp_status: "ACTIVE" | "INACTIVE" | ||
grp_profile_picture: string | ||
grp_title: string | ||
grp_description: string | ||
grp_website: string | ||
grp_industry: string | ||
grp_country: string | ||
grp_timezone: string | ||
createdAt: string | ||
numberOfGroupUsers: number | ||
grp_users: UserDetails[] | ||
grp_manager: UserDetails | ||
} | ||
|
||
export interface GroupResponse { | ||
success: boolean | ||
message: string | ||
group: Group | ||
} | ||
|
||
interface RolePermission { | ||
_id: string; | ||
permission: string; | ||
}; | ||
|
||
export interface GroupMember { | ||
_id: string; | ||
email: string; | ||
firstName: string; | ||
lastName: string; | ||
userName: string; | ||
profilePicture: string; | ||
jobTitle: string; | ||
isActive: boolean; | ||
lastLogin: string; | ||
createdAt: string; | ||
role_name: string; | ||
role_id: string; | ||
role_permissions: RolePermission[]; | ||
}; | ||
|
||
export interface GroupMembersResponse { | ||
success: boolean; | ||
message: string; | ||
group_members: GroupMember[]; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export interface Permission { | ||
_id: string; | ||
permission: string; | ||
} | ||
|
||
export interface Group { | ||
_id: string; | ||
grp_status: string; | ||
grp_profile_picture: string; | ||
grp_title: string; | ||
grp_description: string; | ||
grp_website: string; | ||
grp_industry: string; | ||
grp_country: string; | ||
grp_timezone: string; | ||
grp_manager: string; | ||
grp_manager_username: string; | ||
grp_manager_firstname: string; | ||
grp_manager_lastname: string; | ||
createdAt: string; | ||
updatedAt: string; | ||
__v: number; | ||
} | ||
|
||
export interface Role { | ||
_id: string; | ||
role_status: string; | ||
role_name: string; | ||
role_permissions: Permission[]; | ||
group?: Group; | ||
} | ||
|
||
export interface RolesResponse { | ||
success: boolean; | ||
message: string; | ||
roles: Role[]; | ||
} | ||
|
Oops, something went wrong.