-
Notifications
You must be signed in to change notification settings - Fork 621
[Dashboard] feat: Add allowed operations to partner access control #6478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
joaquim-verges
merged 1 commit into
main
from
_Dashboard_feat_Add_allowed_operations_to_partner_access_control
Mar 18, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
50 changes: 50 additions & 0 deletions
50
...pp/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/add-partner/page.tsx
This file contains hidden or 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,50 @@ | ||
| import {} from "@/components/ui/breadcrumb"; | ||
| import { getAuthToken } from "../../../../../../../../../api/lib/getAuthToken"; | ||
| import { loginRedirect } from "../../../../../../../../../login/loginRedirect"; | ||
| import { AddPartnerForm } from "../components/client/add-partner-form.client"; | ||
| import { fetchEcosystem } from "../hooks/fetchEcosystem"; | ||
|
|
||
| export default async function AddPartnerPage({ | ||
| params, | ||
| }: { | ||
| params: Promise<{ slug: string; team_slug: string }>; | ||
| }) { | ||
| const { slug, team_slug } = await params; | ||
| const authToken = await getAuthToken(); | ||
|
|
||
| if (!authToken) { | ||
| loginRedirect(`/team/${team_slug}/~/ecosystem/${slug}`); | ||
| } | ||
|
|
||
| const teamSlug = team_slug; | ||
| const ecosystemSlug = slug; | ||
|
|
||
| try { | ||
| const ecosystem = await fetchEcosystem({ | ||
| teamIdOrSlug: teamSlug, | ||
| slug: ecosystemSlug, | ||
| authToken, | ||
| }); | ||
|
|
||
| return ( | ||
| <div className="flex flex-col"> | ||
| <div className="container"> | ||
| <h1 className="mb-6 font-semibold text-2xl tracking-tight"> | ||
| Add New Partner | ||
| </h1> | ||
| <AddPartnerForm ecosystem={ecosystem} authToken={authToken} /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } catch (error) { | ||
| console.error("Error fetching ecosystem:", error); | ||
| return ( | ||
| <div className="container py-8"> | ||
| <div className="mx-auto max-w-3xl"> | ||
| <h1 className="mb-6 font-semibold text-2xl tracking-tight">Error</h1> | ||
| <p>Could not load ecosystem. Please try again.</p> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
| } |
40 changes: 10 additions & 30 deletions
40
...m)/~/ecosystem/[slug]/(active)/configuration/components/client/AddPartnerDialogButton.tsx
This file contains hidden or 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 |
|---|---|---|
| @@ -1,43 +1,23 @@ | ||
| "use client"; | ||
|
|
||
| import { Button } from "@/components/ui/button"; | ||
| import { | ||
| Dialog, | ||
| DialogContent, | ||
| DialogHeader, | ||
| DialogTitle, | ||
| DialogTrigger, | ||
| } from "@/components/ui/dialog"; | ||
| import { PlusIcon } from "lucide-react"; | ||
| import { useState } from "react"; | ||
| import Link from "next/link"; | ||
| import type { Ecosystem } from "../../../../../types"; | ||
| import { AddPartnerForm } from "./add-partner-form.client"; | ||
|
|
||
| export function AddPartnerDialogButton(props: { | ||
| teamSlug: string; | ||
| ecosystem: Ecosystem; | ||
| authToken: string; | ||
| }) { | ||
| const [open, setOpen] = useState(false); | ||
| const addPartnerUrl = `/team/${props.teamSlug}/~/ecosystem/${props.ecosystem.slug}/configuration/add-partner`; | ||
|
|
||
| return ( | ||
| <Dialog open={open} onOpenChange={setOpen}> | ||
| <DialogTrigger asChild> | ||
| <Button className="gap-2 max-sm:w-full" variant="outline" size="sm"> | ||
| <PlusIcon className="size-4" /> | ||
| Add Partner | ||
| </Button> | ||
| </DialogTrigger> | ||
| <DialogContent> | ||
| <DialogHeader className="mb-2"> | ||
| <DialogTitle className="font-semibold text-2xl tracking-tight"> | ||
| Add Partner | ||
| </DialogTitle> | ||
| </DialogHeader> | ||
| <AddPartnerForm | ||
| ecosystem={props.ecosystem} | ||
| onPartnerAdded={() => setOpen(false)} | ||
| authToken={props.authToken} | ||
| /> | ||
| </DialogContent> | ||
| </Dialog> | ||
| <Link href={addPartnerUrl} passHref> | ||
| <Button className="gap-2 max-sm:w-full" variant="outline" size="sm"> | ||
| <PlusIcon className="size-4" /> | ||
| Add Partner | ||
| </Button> | ||
| </Link> | ||
| ); | ||
| } |
This file contains hidden or 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
20 changes: 16 additions & 4 deletions
20
...)/~/ecosystem/[slug]/(active)/configuration/components/client/add-partner-form.client.tsx
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.