diff --git a/src/components/Consents/Consents.tsx b/src/components/Consents/Consents.tsx index 9d459daa8b93f02de713462233ae26febb21a692..f8d2fd3ab55583e172f5db39d07ad73242d26079 100644 --- a/src/components/Consents/Consents.tsx +++ b/src/components/Consents/Consents.tsx @@ -266,6 +266,7 @@ const Consents: React.FC = () => { onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleSearchChange(e.target.value) } + disabled={isShowingSelection} ></input> </div> </div> @@ -304,7 +305,11 @@ const Consents: React.FC = () => { <button className="btnDelete" onClick={isShowingSelection ? continueSelection : resetSelection} - disabled={selectedNodes !== null && selectedNodes.length === 0} + disabled={ + !isShowingSelection && + selectedNodes && + selectedNodes.length === 0 + } > {isShowingSelection ? 'Continuer ma sélection' @@ -315,13 +320,7 @@ const Consents: React.FC = () => { onClick={ !isShowingSelection ? showCurrentSelection : toggleOpenModal } - disabled={ - !isShowingSelection && - selectedNodes && - selectedNodes?.length <= 0 - ? true - : false - } + disabled={selectedNodes && selectedNodes.length <= 0} > {!isShowingSelection ? 'Voir mes sélections' : 'Télécharger'} <span>{selectedNodes?.length}</span> diff --git a/src/components/Consents/consents.module.scss b/src/components/Consents/consents.module.scss index 34fa83372246c736b4a730fcc58571c3b6ebeeea..b2787aa883ca0ad2c5ed3702c11b9bd69721001c 100644 --- a/src/components/Consents/consents.module.scss +++ b/src/components/Consents/consents.module.scss @@ -36,6 +36,10 @@ height: 40px; padding: 0 0.5rem; width: 500px; + &:disabled { + opacity: 0.8; + cursor: not-allowed; + } } } } diff --git a/src/services/consent.service.ts b/src/services/consent.service.ts index 8e46ab84a9e6d6257e40f112bc60a18d1f991581..b06742880732d31bee3fc3b4b94047d6dfdff1a3 100644 --- a/src/services/consent.service.ts +++ b/src/services/consent.service.ts @@ -31,7 +31,7 @@ export class ConsentService { "Unauthorized : You don't have the rights to do this operation" ) } else { - toast.error('Failed to create mail subject') + toast.error('Failed to search consents') } console.error(e) return null @@ -66,7 +66,7 @@ export class ConsentService { "Unauthorized : You don't have the rights to do this operation" ) } else { - toast.error('Failed to create mail subject') + toast.error('Failed to get consents') } console.error(e) return null