@steedos-widgets/amis-object 1.2.11 → 1.2.12

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.
@@ -2775,7 +2775,14 @@ const getObjectDetailHeaderButtons = (objectSchema, recordId)=>{
2775
2775
  className: `button_${button.name}`
2776
2776
  }
2777
2777
  });
2778
- let dropdownButtons = ___default__default.map(moreButtons, (button) => {
2778
+ let moreButtonsVisibleOn = '';
2779
+ let dropdownButtons = ___default__default.map(moreButtons, (button, index) => {
2780
+ if(index === 0){
2781
+ moreButtonsVisibleOn = getButtonVisibleOn$1(button);
2782
+ }else {
2783
+ moreButtonsVisibleOn = moreButtonsVisibleOn + ' || ' +getButtonVisibleOn$1(button);
2784
+ }
2785
+
2779
2786
  return {
2780
2787
  type: 'steedos-object-button',
2781
2788
  name: button.name,
@@ -2785,12 +2792,13 @@ const getObjectDetailHeaderButtons = (objectSchema, recordId)=>{
2785
2792
  });
2786
2793
  return {
2787
2794
  buttons: amisButtonsSchema,
2788
- moreButtons: dropdownButtons
2795
+ moreButtons: dropdownButtons,
2796
+ moreButtonsVisibleOn
2789
2797
  };
2790
2798
  };
2791
2799
 
2792
2800
  const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
2793
- const { buttons, moreButtons } = getObjectDetailHeaderButtons(objectSchema, recordId);
2801
+ const { buttons, moreButtons, moreButtonsVisibleOn } = getObjectDetailHeaderButtons(objectSchema, recordId);
2794
2802
  if(ctx.formFactor === 'SMALL'){
2795
2803
  return {
2796
2804
  "type": "button",
@@ -2845,7 +2853,8 @@ const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
2845
2853
  type: "steedos-dropdown-button",
2846
2854
  label: "",
2847
2855
  buttons: moreButtons,
2848
- className: 'slds-icon'
2856
+ className: 'slds-icon',
2857
+ visibleOn: moreButtonsVisibleOn
2849
2858
  };
2850
2859
  buttons.push(dropdownButtonsSchema);
2851
2860
  }
@@ -7883,11 +7892,12 @@ async function getObjectDetail(objectSchema, recordId, ctx){
7883
7892
  "expression": "this.__deletedRecord != true"
7884
7893
  },
7885
7894
  {
7886
- "args": {
7887
- "url": "/app/${appId}/${objectName}/grid/${side_listview_id}",
7888
- "blank": false
7889
- },
7890
- "actionType": "link",
7895
+ // "args": {
7896
+ // "url": "/app/${appId}/${objectName}/grid/${side_listview_id}",
7897
+ // "blank": false
7898
+ // },
7899
+ "actionType": "custom",
7900
+ "script": "Steedos.goBack()",
7891
7901
  "expression": "this.__deletedRecord === true"
7892
7902
  }
7893
7903
  ]