@visns-studio/visns-components 4.0.8 → 4.0.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.
package/components/crm/Form.jsx
CHANGED
|
@@ -208,40 +208,45 @@ function Form({
|
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
formSettings.fields.forEach((f) => {
|
|
211
|
-
if (
|
|
212
|
-
f.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
let newDate = moment();
|
|
217
|
-
let add = false;
|
|
211
|
+
if (f.id === id && f.trigger) {
|
|
212
|
+
switch (f.trigger.type) {
|
|
213
|
+
case 'addDays':
|
|
214
|
+
let newDate = moment();
|
|
215
|
+
let add = false;
|
|
218
216
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
217
|
+
if (
|
|
218
|
+
inputValue.no_of_days &&
|
|
219
|
+
parseFloat(inputValue.no_of_days) > 0
|
|
220
|
+
) {
|
|
221
|
+
newDate.add(
|
|
222
|
+
parseFloat(inputValue.no_of_days),
|
|
223
|
+
'days'
|
|
224
|
+
);
|
|
225
|
+
add = true;
|
|
226
|
+
}
|
|
229
227
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
228
|
+
if (
|
|
229
|
+
inputValue.no_of_hours &&
|
|
230
|
+
parseFloat(inputValue.no_of_hours) > 0
|
|
231
|
+
) {
|
|
232
|
+
newDate.add(
|
|
233
|
+
parseFloat(inputValue.no_of_hours),
|
|
234
|
+
'hours'
|
|
235
|
+
);
|
|
236
|
+
add = true;
|
|
237
|
+
}
|
|
240
238
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
if (add) {
|
|
240
|
+
updateFormData({
|
|
241
|
+
[f.trigger.id]: newDate.toDate(),
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
break;
|
|
245
|
+
case 'setContent':
|
|
246
|
+
updateFormData({
|
|
247
|
+
[f.trigger.id]: inputValue[f.trigger.key],
|
|
248
|
+
});
|
|
249
|
+
break;
|
|
245
250
|
}
|
|
246
251
|
}
|
|
247
252
|
});
|
|
@@ -260,7 +265,7 @@ function Form({
|
|
|
260
265
|
e.preventDefault();
|
|
261
266
|
}
|
|
262
267
|
|
|
263
|
-
console.info(userProfile
|
|
268
|
+
console.info(`Debug Mode: ${userProfile}`);
|
|
264
269
|
};
|
|
265
270
|
|
|
266
271
|
const handleChangeToggle = (e) => {
|
|
@@ -235,21 +235,37 @@ function GenericIndex({ layout = 'full', setting, userProfile }) {
|
|
|
235
235
|
if (subnav?.length > 0) {
|
|
236
236
|
return (
|
|
237
237
|
<div className="grid__subrow">
|
|
238
|
-
|
|
239
|
-
className={`
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
238
|
+
{layout === 'simple' ? (
|
|
239
|
+
<div className={`grid__full`}>
|
|
240
|
+
<div className="tabcontent">
|
|
241
|
+
<div className="tabcontent__menu">
|
|
242
|
+
<TableFilter
|
|
243
|
+
filters={subnav}
|
|
244
|
+
setFilters={setSubnav}
|
|
245
|
+
setSettings={setConfig}
|
|
246
|
+
type={layout}
|
|
247
|
+
/>
|
|
248
|
+
</div>
|
|
249
|
+
<div className="tabcontent__main">
|
|
250
|
+
{renderContentBasedOnType()}
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
) : (
|
|
255
|
+
<>
|
|
256
|
+
<div className={`grid__full`}>
|
|
257
|
+
<TableFilter
|
|
258
|
+
filters={subnav}
|
|
259
|
+
setFilters={setSubnav}
|
|
260
|
+
setSettings={setConfig}
|
|
261
|
+
type={layout}
|
|
262
|
+
/>
|
|
263
|
+
</div>
|
|
264
|
+
<div className="grid__subcontent">
|
|
265
|
+
{renderContentBasedOnType()}
|
|
266
|
+
</div>
|
|
267
|
+
</>
|
|
268
|
+
)}
|
|
253
269
|
</div>
|
|
254
270
|
);
|
|
255
271
|
} else {
|
package/package.json
CHANGED