Skip to content
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

feat: mise à jour affichage encart administrateur #3868

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 15 additions & 32 deletions ui/modules/admin/InfosTransmissionEtParametrageOFA.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,31 @@ const InfosTransmissionEtParametrageOFA = ({ organisme, ...props }) => {
const apiKeyDisplay = parametrage?.api_key
? showFullApiKey
? parametrage.api_key
: parametrage.api_key.replace(/(?<=.{3})[^-]/g, "")
: parametrage.api_key.replace(/(?<=.{3})./g, "*")
: "Aucune clé API disponible";

console.log("CONSOLE LOG ~ InfosTransmissionEtParametrageOFA ~ parametrage:", parametrage);
return (
<Stack borderColor="#0063CB" borderWidth="2px" w="100%" p="2w" {...props}>
<Stack borderColor="#0063CB" borderWidth="2px" w="100%" p="2w" gap={3} {...props}>
<Box color="#0063CB" display="flex" alignItems="center">
<Box as="i" className="ri-eye-fill" />
<Text fontSize="zeta" fontWeight="bold" ml="2">
Encart réservé aux administrateurs
</Text>
</Box>
<HStack spacing="1w">
<Text>Transmission API :</Text>
{parametrage?.transmission_api_active ? (
<Box display="flex" alignItems="center">
<Text>Transmission :</Text>
{parametrage?.transmission_api_active || parametrage?.transmission_manuelle_active ? (
<Box display="flex" alignItems="center" gap={3}>
<BadgeYes />
{parametrage.transmission_api_version && (
{(parametrage.transmission_api_version || parametrage.erps?.length > 0) && (
<Tag
fontSize="epsilon"
textColor="grey.800"
textTransform="none"
paddingX="1w"
paddingY="2px"
backgroundColor="#ECEAE3"
primaryText={parametrage.transmission_api_version}
variant="badge"
colorScheme="grey_tag"
size="md"
borderRadius={0}
primaryText={`${parametrage.erps?.map((erp) => erp.toUpperCase()).join(", ")} ${parametrage.transmission_api_version || ""}`}
/>
)}
<Text>
Expand Down Expand Up @@ -96,27 +96,10 @@ const InfosTransmissionEtParametrageOFA = ({ organisme, ...props }) => {
</HStack>
</HStack>
)}
<HStack spacing="1w">
<Text>Transmission manuelle :</Text>
{parametrage?.transmission_manuelle_active ? (
<Box display="flex" alignItems="center">
<BadgeYes />
<Text>
(
{parametrage.transmission_date
? new Date(parametrage.transmission_date).toLocaleDateString()
: "Date non disponible"}
)
</Text>
</Box>
) : (
<BadgeNo />
)}
</HStack>
<HStack spacing="1w">
<Text>Paramétrage :</Text>
{parametrage?.parametrage_erp_active ? (
<HStack spacing="1w">
<HStack spacing="1w" gap={3}>
<BadgeYes />
{parametrage.erps?.map((erp, index) => (
<Tag
Expand All @@ -142,7 +125,7 @@ const InfosTransmissionEtParametrageOFA = ({ organisme, ...props }) => {
)}
</HStack>
{parametrage?.organisme_transmetteur ? (
<Box display="flex" alignItems="center">
<HStack alignItems="center" gap={3}>
<Text>Dernier organisme transmetteur des effectifs : </Text>
<Link
key={parametrage?.organisme_transmetteur._id}
Expand All @@ -156,7 +139,7 @@ const InfosTransmissionEtParametrageOFA = ({ organisme, ...props }) => {
parametrage?.organisme_transmetteur.raison_sociale ??
"Organisme inconnu"}
</Link>
</Box>
</HStack>
) : null}
<Button
variant="secondary"
Expand Down
Loading