@fto-consult/expo-ui 6.90.0 → 6.90.2
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/package.json +1 -1
- package/src/layouts/Screen/TableData.js +20 -16
package/package.json
CHANGED
@@ -246,6 +246,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
246
246
|
clone,
|
247
247
|
isArchivable,clonable,isPrintable,print,data:customData,getRowKey,
|
248
248
|
save2newAction,
|
249
|
+
newAction,
|
249
250
|
save2cloneAction,
|
250
251
|
saveAction,
|
251
252
|
save2closeAction,
|
@@ -324,13 +325,15 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
324
325
|
isUpdated,
|
325
326
|
fields,
|
326
327
|
});
|
327
|
-
const
|
328
|
+
const canNew = this.canCreateNew() && newAction !== false;
|
329
|
+
const cCloneAction = this.isClonable() && canNew && clonable !== false && cloneAction !== false && true || false;
|
328
330
|
const rActionsArg = this.currentRenderingProps = {
|
329
331
|
...rest,
|
330
332
|
...formProps,
|
331
333
|
context,
|
334
|
+
newAction,
|
332
335
|
cloneAction : cCloneAction,
|
333
|
-
save2newAction :
|
336
|
+
save2newAction : canNew ? typeof save2newAction =="boolean"? save2newAction : saveAction !== false : false,
|
334
337
|
save2cloneAction : cCloneAction && save2cloneAction !== false ? true : false,
|
335
338
|
isMobile : isMobOrTab,
|
336
339
|
saveAction,
|
@@ -358,15 +361,20 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
358
361
|
archivedPermsFilter : this.archivedPermsFilter.bind(this),
|
359
362
|
onPressCopyToClipboard : this.copyToClipboard.bind(this)
|
360
363
|
}
|
361
|
-
if(
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
364
|
+
if(Object.size(fields,true)){
|
365
|
+
if(isUpdated){
|
366
|
+
fields.approved = this.isApprovable()? {
|
367
|
+
text : 'Approuvé',
|
368
|
+
type : 'switch',
|
369
|
+
defaultValue : 0,
|
370
|
+
checkedTooltip: 'Oui',
|
371
|
+
disabled : Auth.isTableDataAllowed({table:tableName,action:'updateapproved'})? false:true,
|
372
|
+
uncheckedTooltip : 'Non',
|
373
|
+
...Object.assign({},fields.approved)
|
374
|
+
} : null;
|
375
|
+
}
|
376
|
+
} else {
|
377
|
+
formProps.style = [theme.styles.noPadding,formProps.style]
|
370
378
|
}
|
371
379
|
rActionsArg.contentProps = Object.assign({},customContentProps);
|
372
380
|
rActionsArg.containerProps = Object.assign({},customContainerProps);
|
@@ -651,11 +659,7 @@ export default class TableDataScreenComponent extends FormDataScreen{
|
|
651
659
|
return this.doSave(args);
|
652
660
|
}
|
653
661
|
canCreateNew(){
|
654
|
-
|
655
|
-
if("newAction" in editingProps){
|
656
|
-
return !!editingProps.newAction;
|
657
|
-
}
|
658
|
-
return this.props.newAction !== false ? true : false;
|
662
|
+
return this.props.newAction !== false;
|
659
663
|
}
|
660
664
|
isMobileOrTabletMedia(){
|
661
665
|
const r = this.getRenderTabsType();
|