@visns-studio/visns-components 4.5.5 → 4.5.6
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.
|
@@ -31,6 +31,7 @@ function useConfig(setting, tabs, filters, setRowsSelected, tableSetting) {
|
|
|
31
31
|
const [subnav, setSubnav] = useState(filters || []);
|
|
32
32
|
|
|
33
33
|
useEffect(() => {
|
|
34
|
+
console.info(setting);
|
|
34
35
|
setConfig({
|
|
35
36
|
ajaxSetting: setting.ajaxSetting,
|
|
36
37
|
form: setting.form,
|
|
@@ -186,8 +187,10 @@ function GenericIndex({ layout = 'full', setting, userProfile }) {
|
|
|
186
187
|
|
|
187
188
|
const handleCheckboxUpdate = useCallback(async () => {
|
|
188
189
|
try {
|
|
189
|
-
const { data, method, message, url } =
|
|
190
|
-
|
|
190
|
+
const { data, method, message, url } = setting?.functions
|
|
191
|
+
?.checkboxUpdate
|
|
192
|
+
? setting.functions.checkboxUpdate
|
|
193
|
+
: config.form.functions.checkboxUpdate;
|
|
191
194
|
if (!Object.keys(rowsSelected).length) {
|
|
192
195
|
toast.warning(message.warning);
|
|
193
196
|
return;
|
|
@@ -316,6 +319,16 @@ function GenericIndex({ layout = 'full', setting, userProfile }) {
|
|
|
316
319
|
</button>
|
|
317
320
|
</div>
|
|
318
321
|
)}
|
|
322
|
+
{config?.form?.functions?.checkboxUpdate && (
|
|
323
|
+
<div className={styles.polActions}>
|
|
324
|
+
<button
|
|
325
|
+
className={styles.btn}
|
|
326
|
+
onClick={handleCheckboxUpdate}
|
|
327
|
+
>
|
|
328
|
+
{config.form.functions.checkboxUpdate.label || 'Update'}
|
|
329
|
+
</button>
|
|
330
|
+
</div>
|
|
331
|
+
)}
|
|
319
332
|
</>
|
|
320
333
|
);
|
|
321
334
|
}
|
package/package.json
CHANGED