-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: link partenaire with moissonneur orgnizations and api-depot client
- Loading branch information
Showing
21 changed files
with
1,255 additions
and
789 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,95 @@ | ||
import Badge from "@codegouvfr/react-dsfr/Badge"; | ||
import Button from "@codegouvfr/react-dsfr/Button"; | ||
import Link from "next/link"; | ||
import { | ||
ChefDeFileApiDepotType, | ||
ClientApiDepotType, | ||
MandataireApiDepotType, | ||
} from "types/api-depot"; | ||
import { PartenaireDeLaChartType } from "types/partenaire-de-la-charte"; | ||
|
||
interface ClientItemProps { | ||
client: ClientApiDepotType; | ||
mandataire: MandataireApiDepotType; | ||
chefDeFile: ChefDeFileApiDepotType; | ||
partenaire: PartenaireDeLaChartType; | ||
isDemo: boolean; | ||
} | ||
|
||
const ClientItem = ({ | ||
client, | ||
mandataire, | ||
chefDeFile, | ||
partenaire, | ||
isDemo, | ||
}: ClientItemProps) => ( | ||
<tr> | ||
<td className="fr-col fr-my-1v">{client.nom}</td> | ||
<td className="fr-col fr-my-1v">{mandataire.nom}</td> | ||
<td className="fr-col fr-my-1v">{chefDeFile ? chefDeFile.nom : "-"}</td> | ||
<td className="fr-col fr-my-1v">{client.authorizationStrategy}</td> | ||
<td className="fr-col fr-my-1v"> | ||
<input | ||
type="checkbox" | ||
id="checkbox" | ||
name="checkbox" | ||
checked={client.active} | ||
disabled | ||
/> | ||
</td> | ||
<td className="fr-col fr-my-1v"> | ||
<input | ||
type="checkbox" | ||
id="checkbox" | ||
name="checkbox" | ||
checked={client.options.relaxMode} | ||
disabled | ||
/> | ||
</td> | ||
<td className="fr-col fr-my-1v"> | ||
{partenaire ? ( | ||
<Link | ||
legacyBehavior | ||
passHref | ||
href={{ | ||
pathname: `/partenaires-de-la-charte/${partenaire._id}`, | ||
}} | ||
> | ||
{partenaire.name} | ||
</Link> | ||
) : ( | ||
<Badge severity="warning">Non partenaire</Badge> | ||
)} | ||
</td> | ||
<td className="fr-col fr-my-1v"> | ||
<Link | ||
legacyBehavior | ||
passHref | ||
href={{ | ||
pathname: "/api-depot/client/client-form", | ||
query: { clientId: client._id, demo: isDemo ? 1 : 0 }, | ||
}} | ||
> | ||
<Button iconId="fr-icon-edit-line" iconPosition="right"> | ||
Editer | ||
</Button> | ||
</Link> | ||
</td> | ||
<td className="fr-col fr-my-1v"> | ||
<Link | ||
legacyBehavior | ||
passHref | ||
href={{ | ||
pathname: "/api-depot/client", | ||
query: { clientId: client._id, demo: isDemo ? 1 : 0 }, | ||
}} | ||
> | ||
<Button iconId="fr-icon-arrow-right-line" iconPosition="right"> | ||
Consulter | ||
</Button> | ||
</Link> | ||
</td> | ||
</tr> | ||
); | ||
|
||
export default ClientItem; |
This file was deleted.
Oops, something went wrong.
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,46 @@ | ||
import Link from "next/link"; | ||
import Button from "@codegouvfr/react-dsfr/Button"; | ||
import Badge from "@codegouvfr/react-dsfr/Badge"; | ||
|
||
import CopyToClipBoard from "@/components/copy-to-clipboard"; | ||
import { ClientApiDepotType } from "types/api-depot"; | ||
import { PartenaireDeLaChartType } from "types/partenaire-de-la-charte"; | ||
|
||
interface ClientHeaderProps { | ||
client: ClientApiDepotType; | ||
partenaire: PartenaireDeLaChartType; | ||
} | ||
|
||
const ClientHeader = ({ client, partenaire }: ClientHeaderProps) => ( | ||
<div className="fr-py-4v"> | ||
<h1 className="fr-m-1v">Client</h1> | ||
<div className="fr-container fr-py-4v"> | ||
<div className="fr-grid-row fr-grid-row--gutters"> | ||
<div className="fr-col-10"> | ||
<h2>{client.nom}</h2> | ||
<CopyToClipBoard text={client._id} title="Id" /> | ||
<CopyToClipBoard text={client.token} title="Token" /> | ||
|
||
{partenaire ? ( | ||
<> | ||
<h3>Partenaire de la charte</h3> | ||
<Link | ||
legacyBehavior | ||
passHref | ||
href={{ | ||
pathname: `/partenaires-de-la-charte/${partenaire._id}`, | ||
}} | ||
> | ||
<Button priority="secondary">{partenaire.name}</Button> | ||
</Link> | ||
</> | ||
) : ( | ||
<Badge severity="warning">Non partenaire</Badge> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default ClientHeader; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.