@credithub/harlan-components 1.97.7 → 1.97.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -84,22 +84,22 @@ var businessTypes = [
|
|
|
84
84
|
'cooperativa'
|
|
85
85
|
];
|
|
86
86
|
var Liminar = function (_a) {
|
|
87
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r
|
|
88
|
-
var
|
|
87
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
88
|
+
var _s = _a.isFinancial, isFinancial = _s === void 0 ? false : _s, hasCredits = _a.hasCredits, _t = _a.tags, tags = _t === void 0 ? [] : _t;
|
|
89
89
|
var ctx = useContext(Queries.LiminarCenprot);
|
|
90
|
-
var
|
|
90
|
+
var _u = useGlobalData(), globalData = _u.data, setData = _u.setData;
|
|
91
91
|
var fetchLiminarProtestosDoPassado = useLiminarProtestosDoPassado({
|
|
92
92
|
documento: ((_c = (_b = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _b === void 0 ? void 0 : _b.carousel) === null || _c === void 0 ? void 0 : _c.document) || ''
|
|
93
93
|
}).fetchLiminarProtestosDoPassado;
|
|
94
|
-
var
|
|
94
|
+
var _v = useState(false), isLoadingLiminarProtestosDoPassado = _v[0], setIsLoadingLiminarProtestosDoPassado = _v[1];
|
|
95
95
|
var processedRef = useRef(false);
|
|
96
96
|
var dataHashRef = useRef('');
|
|
97
97
|
var invertedIdsRef = useRef([]);
|
|
98
|
-
var
|
|
99
|
-
var
|
|
100
|
-
var
|
|
98
|
+
var _w = useState(false), isTooltipVisible = _w[0], setTooltipVisible = _w[1];
|
|
99
|
+
var _x = useState(false), isEmailModalOpen = _x[0], setIsEmailModalOpen = _x[1];
|
|
100
|
+
var _y = useState(''), emailModalMessage = _y[0], setEmailModalMessage = _y[1];
|
|
101
101
|
var liminarMailPrice = 50000;
|
|
102
|
-
var
|
|
102
|
+
var _z = useFetch("SELECT FROM 'LIMINAR'.'SENDMAIL'"), sendIndiciosEmail = _z.fetch, isEmailSending = _z.isLoading, emailError = _z.error;
|
|
103
103
|
var hideTt = useRef();
|
|
104
104
|
/*
|
|
105
105
|
* Extrai e normaliza os tipos de documento presentes em ctx.document, retornando sempre um array de strings em minúsculo.
|
|
@@ -142,7 +142,7 @@ var Liminar = function (_a) {
|
|
|
142
142
|
/*
|
|
143
143
|
* Identifica as origens de liminares detectadas e verifica se existe liminar de protesto invertida
|
|
144
144
|
*/
|
|
145
|
-
var
|
|
145
|
+
var _0 = useMemo(function () {
|
|
146
146
|
var _a, _b;
|
|
147
147
|
var labels = new Set();
|
|
148
148
|
var indiciosApi = ((_a = ctx.document) === null || _a === void 0 ? void 0 : _a.indiciosDeLiminar) === true;
|
|
@@ -178,7 +178,7 @@ var Liminar = function (_a) {
|
|
|
178
178
|
tiposDocumento,
|
|
179
179
|
processosComAssuntoValido,
|
|
180
180
|
(_f = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _f === void 0 ? void 0 : _f.indiciosDeLiminarProtestosDoPassado
|
|
181
|
-
]), origensDetectadas =
|
|
181
|
+
]), origensDetectadas = _0.origensDetectadas, foundBusinessEntity = _0.foundBusinessEntity;
|
|
182
182
|
var protestosIsReady = useMemo(function () { var _a; return (_a = globalData === null || globalData === void 0 ? void 0 : globalData.protestosData) === null || _a === void 0 ? void 0 : _a.isLoaded; }, [globalData]);
|
|
183
183
|
useEffect(function () {
|
|
184
184
|
if (!protestosIsReady)
|
|
@@ -306,6 +306,9 @@ var Liminar = function (_a) {
|
|
|
306
306
|
(_j = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _j === void 0 ? void 0 : _j.indiciosDeLiminarProtestosDoPassado,
|
|
307
307
|
processosComAssuntoValido
|
|
308
308
|
]);
|
|
309
|
+
// Se existem tipos que de fato contribuíram para o indício,
|
|
310
|
+
// então o indício é verdadeiro para fins de histórico.
|
|
311
|
+
var indicioDeLiminarForHistory = typesForHistory.length > 0;
|
|
309
312
|
var protestKeysForHistory = useMemo(function () {
|
|
310
313
|
var _a;
|
|
311
314
|
return (((_a = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _a === void 0 ? void 0 : _a.protestosDoPassadoIds) || '')
|
|
@@ -316,7 +319,9 @@ var Liminar = function (_a) {
|
|
|
316
319
|
// 🔔 grava o histórico assim que todos os dados necessários existirem
|
|
317
320
|
useLiminarHistory({
|
|
318
321
|
documento: ((_m = (_l = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _l === void 0 ? void 0 : _l.carousel) === null || _m === void 0 ? void 0 : _m.document) || '',
|
|
319
|
-
|
|
322
|
+
// Garantimos que o histórico só registra "true" quando houve fonte real,
|
|
323
|
+
// evitando falso-positivos vindos do estado agregado da UI.
|
|
324
|
+
indicioDeLiminar: indicioDeLiminarForHistory,
|
|
320
325
|
types: typesForHistory,
|
|
321
326
|
protestKeys: protestKeysForHistory,
|
|
322
327
|
processIds: processIdsForHistory,
|
|
@@ -338,8 +343,8 @@ var Liminar = function (_a) {
|
|
|
338
343
|
: 'Processos com indícios encontrados:';
|
|
339
344
|
var shouldRender = isLoadingLiminarProtestosDoPassado ||
|
|
340
345
|
(ready &&
|
|
341
|
-
(((
|
|
342
|
-
((
|
|
346
|
+
(((_o = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _o === void 0 ? void 0 : _o.indiciosDeLiminar) ||
|
|
347
|
+
((_r = (_q = (_p = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _p === void 0 ? void 0 : _p.processosComLiminarIds) === null || _q === void 0 ? void 0 : _q.length) !== null && _r !== void 0 ? _r : 0) > 0));
|
|
343
348
|
// Função para disparar o envio do e-mail e configurar a mensagem do modal
|
|
344
349
|
var handleSendEmailIndicios = function (e) { return __awaiter(void 0, void 0, void 0, function () {
|
|
345
350
|
var callback;
|
|
@@ -16,8 +16,6 @@ export function useLiminarHistory(_a) {
|
|
|
16
16
|
useEffect(function () {
|
|
17
17
|
if (!enabled || !documento)
|
|
18
18
|
return;
|
|
19
|
-
if (!indicioDeLiminar)
|
|
20
|
-
return;
|
|
21
19
|
var effectiveTypes = indicioDeLiminar ? types : [];
|
|
22
20
|
var fingerprint = JSON.stringify({
|
|
23
21
|
documento: documento,
|