mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
fix: On empêche la sauvegarde d'un document à signer tant qu'aucun
dossier d'inscription n'est sélectionné
This commit is contained in:
@ -69,7 +69,6 @@ export default function FileUploadDocuSeal({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleLoad = (detail) => {
|
const handleLoad = (detail) => {
|
||||||
const templateId = detail?.id;
|
|
||||||
logger.debug('loading template id : ', detail);
|
logger.debug('loading template id : ', detail);
|
||||||
setTemplateMaster(detail);
|
setTemplateMaster(detail);
|
||||||
};
|
};
|
||||||
@ -138,39 +137,62 @@ export default function FileUploadDocuSeal({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col mt-4 space-y-4">
|
<div className="h-full flex flex-col mt-4 space-y-6">
|
||||||
<div className="grid grid-cols-10 gap-4 items-start">
|
{/* Contenu principal */}
|
||||||
<div className="col-span-2">
|
<div className="grid grid-cols-10 gap-6 items-start">
|
||||||
|
{/* Sélection des groupes */}
|
||||||
|
<div className="col-span-2 bg-white p-4 rounded-lg shadow-md border border-gray-200">
|
||||||
|
<h3 className="text-lg font-medium text-gray-800 mb-4">
|
||||||
|
Dossiers d'inscription
|
||||||
|
</h3>
|
||||||
<MultiSelect
|
<MultiSelect
|
||||||
name="groups"
|
name="groups"
|
||||||
label="Sélection de groupes de fichiers"
|
label="Sélection de dossier(s) d'inscription"
|
||||||
options={groups}
|
options={groups}
|
||||||
selectedOptions={selectedGroups}
|
selectedOptions={selectedGroups}
|
||||||
onChange={handleGroupChange}
|
onChange={handleGroupChange}
|
||||||
errorMsg={null}
|
errorMsg={null}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-span-8">
|
|
||||||
{token && (
|
{/* Zone de configuration des documents */}
|
||||||
<DocusealBuilder
|
<div className="col-span-8 bg-white p-6 rounded-lg shadow-md border border-gray-200">
|
||||||
token={token}
|
{selectedGroups.length === 0 ? (
|
||||||
headers={{
|
<div className="flex flex-col items-center justify-center h-full text-center space-y-4">
|
||||||
Authorization: `Bearer ${token}`,
|
{/* Icône circulaire modernisée */}
|
||||||
}}
|
<div className="bg-emerald-100 p-6 rounded-full flex items-center justify-center shadow-md">
|
||||||
withSendButton={false}
|
<div className="w-12 h-12 bg-emerald-200 rounded-full flex items-center justify-center">
|
||||||
withSaveButton={false}
|
<span className="text-emerald-600 font-bold text-2xl">+</span>
|
||||||
withSignYourselfButton={false}
|
</div>
|
||||||
autosave={false}
|
</div>
|
||||||
language={'fr'}
|
|
||||||
onLoad={handleLoad}
|
{/* Message d'information */}
|
||||||
onUpload={handleUpload}
|
<p className="text-gray-600 text-sm font-medium">
|
||||||
onChange={handleChange}
|
Veuillez sélectionner au moins un groupe pour continuer.
|
||||||
onSave={handleSubmit}
|
</p>
|
||||||
className="h-full overflow-auto" // Ajouter overflow-auto pour permettre le défilement
|
</div>
|
||||||
style={{ maxHeight: '70vh' }} // Limiter la hauteur maximale du composant
|
) : (
|
||||||
// Il faut auter l'host correspondant (une fois passé en HTTPS)
|
token && (
|
||||||
//host="docuseal:3001"
|
<div className="h-full overflow-auto">
|
||||||
/>
|
<DocusealBuilder
|
||||||
|
token={token}
|
||||||
|
headers={{
|
||||||
|
Authorization: `Bearer ${token}`,
|
||||||
|
}}
|
||||||
|
withSendButton={false}
|
||||||
|
withSignYourselfButton={false}
|
||||||
|
autosave={false}
|
||||||
|
withDocumentsList={false}
|
||||||
|
language={'fr'}
|
||||||
|
onLoad={handleLoad}
|
||||||
|
onUpload={handleUpload}
|
||||||
|
onChange={handleChange}
|
||||||
|
onSave={handleSubmit}
|
||||||
|
className="h-full overflow-auto"
|
||||||
|
style={{ maxHeight: '65vh' }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user