@credithub/harlan-components 1.55.1 → 1.55.3
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.
- package/dist/components/liminar/liminar.js +14 -13
- package/lib/cjs/index.js +14 -13
- package/lib/esm/index.js +14 -13
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import ProtestosIcon from '../../assets/icones/protestos';
|
|
13
13
|
import { useGlobalData } from '../../contexts/globalDataContext';
|
|
14
14
|
import { normalizeName, similarNames } from '../../utils/similarNames';
|
|
15
|
-
import React, { useContext, useEffect, useState } from 'react';
|
|
15
|
+
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
16
16
|
import StatusMessage from '../interface/statusMessage';
|
|
17
17
|
import Section from '../section';
|
|
18
18
|
import { Queries, RequestStatus } from '../webservice';
|
|
@@ -23,6 +23,8 @@ var Liminar = function () {
|
|
|
23
23
|
var _c = useState(false), checkCompleted = _c[0], setCheckCompleted = _c[1];
|
|
24
24
|
useEffect(function () {
|
|
25
25
|
var _a, _b, _c, _d, _e;
|
|
26
|
+
if (checkCompleted)
|
|
27
|
+
return;
|
|
26
28
|
var processosJuridicosData = (_a = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) !== null && _a !== void 0 ? _a : {
|
|
27
29
|
isLoaded: true,
|
|
28
30
|
empresa: []
|
|
@@ -64,25 +66,24 @@ var Liminar = function () {
|
|
|
64
66
|
else if (ctx.type === RequestStatus.Success) {
|
|
65
67
|
indiciosDeLiminar_1 = ((_e = ctx.document) === null || _e === void 0 ? void 0 : _e.indiciosDeLiminar) === true;
|
|
66
68
|
}
|
|
67
|
-
var
|
|
68
|
-
var finalStatus_1 = indiciosDeLiminar_1 || hasLiminarFromProcessos
|
|
69
|
+
var finalStatus_1 = indiciosDeLiminar_1 || (processosAtivo && processosAtivo.length > 0)
|
|
69
70
|
? 'Encontrado'
|
|
70
71
|
: 'Não encontrado';
|
|
71
|
-
setData(function (
|
|
72
|
-
indiciosDeLiminar: indiciosDeLiminar_1,
|
|
73
|
-
message: finalStatus_1
|
|
74
|
-
} })); });
|
|
72
|
+
setData(function (prev) { return (__assign(__assign({}, prev), { liminar: { indiciosDeLiminar: indiciosDeLiminar_1, message: finalStatus_1 } })); });
|
|
75
73
|
setCheckCompleted(true);
|
|
76
74
|
}
|
|
77
|
-
}, [
|
|
78
|
-
|
|
75
|
+
}, [checkCompleted, globalData, ctx, setData]);
|
|
76
|
+
var derivedCtx = useMemo(function () {
|
|
77
|
+
if (!checkCompleted) {
|
|
78
|
+
return __assign(__assign({}, ctx), { type: RequestStatus.Loading });
|
|
79
|
+
}
|
|
80
|
+
return __assign(__assign({}, ctx), { type: ctx.type === RequestStatus.Error ? RequestStatus.Success : ctx.type, document: ctx.type === RequestStatus.Error
|
|
81
|
+
? { indiciosDeLiminar: false }
|
|
82
|
+
: ctx.document });
|
|
83
|
+
}, [checkCompleted, ctx]);
|
|
79
84
|
if (checkCompleted && ((_a = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _a === void 0 ? void 0 : _a.message) === 'Não encontrado') {
|
|
80
85
|
return null;
|
|
81
86
|
}
|
|
82
|
-
var derivedCtx = !checkCompleted
|
|
83
|
-
? __assign(__assign({}, ctx), { type: RequestStatus.Loading }) : __assign(__assign({}, ctx), { type: ctx.type === RequestStatus.Error ? RequestStatus.Success : ctx.type, document: ctx.type === RequestStatus.Error
|
|
84
|
-
? { indiciosDeLiminar: false }
|
|
85
|
-
: ctx.document });
|
|
86
87
|
return (React.createElement(Section, { title: "Liminares para Remo\u00E7\u00E3o de Protesto", subtitle: "Ind\u00EDcios de liminares para oculta\u00E7\u00E3o de registros.", icon: ProtestosIcon, ctx: derivedCtx, onSuccess: function (doc) {
|
|
87
88
|
var _a;
|
|
88
89
|
var globalMessage = ((_a = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _a === void 0 ? void 0 : _a.message) || 'Não encontrado';
|