@onehat/ui 0.3.45 → 0.3.47

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/ui",
3
- "version": "0.3.45",
3
+ "version": "0.3.47",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -144,7 +144,7 @@ export default function withPdfButton(WrappedComponent) {
144
144
  data.id = selection[0].id;
145
145
 
146
146
  const
147
- url = UiGlobals.baseURL + model + '/viewPdf?',
147
+ url = UiGlobals.baseURL + model + '/viewModelPdf?',
148
148
  queryString = qs.stringify(data);
149
149
 
150
150
  window.open(url + queryString, '_blank');
@@ -72,7 +72,7 @@ function ManagerScreen(props) {
72
72
  <IconButton
73
73
  icon={FullWidth}
74
74
  _icon={{
75
- size: '30px',
75
+ size: '25px',
76
76
  color: mode === MODE_FULL ? 'primary.100' : '#000',
77
77
  }}
78
78
  disabled={mode === MODE_FULL}
@@ -82,7 +82,7 @@ function ManagerScreen(props) {
82
82
  <IconButton
83
83
  icon={SideBySide}
84
84
  _icon={{
85
- size: '30px',
85
+ size: '25px',
86
86
  color: mode === MODE_SIDE ? 'primary.100' : '#000',
87
87
  }}
88
88
  disabled={mode === MODE_SIDE}
@@ -16,6 +16,7 @@ import {
16
16
  FILE_MODE_FILE,
17
17
  } from '../../Constants/File.js';
18
18
  import { Avatar, Dropzone, FileMosaic, FileCard, FileInputButton, } from "@files-ui/react";
19
+ import withAlert from '../../Components/Hoc/withAlert.js';
19
20
  import withData from '../../Components/Hoc/withData.js';
20
21
  import _ from 'lodash';
21
22
 
@@ -40,6 +41,7 @@ function AttachmentsElement(props) {
40
41
  maxFiles = null,
41
42
  disabled = false,
42
43
  clickable = true,
44
+ confirmBeforeDelete = false,
43
45
 
44
46
  // parentContainer
45
47
  selectorSelected,
@@ -47,6 +49,9 @@ function AttachmentsElement(props) {
47
49
  // withData
48
50
  Repository,
49
51
 
52
+ // withAlert
53
+ confirm,
54
+
50
55
  } = props,
51
56
  styles = UiGlobals.styles,
52
57
  model = _.isArray(selectorSelected) && selectorSelected[0] ? selectorSelected[0].repository?.name : selectorSelected?.repository?.name,
@@ -113,6 +118,13 @@ function AttachmentsElement(props) {
113
118
  }
114
119
  },
115
120
  onFileDelete = (id) => {
121
+ if (confirmBeforeDelete) {
122
+ confirm('Are you sure you want to delete?', () => doDelete(id));
123
+ } else {
124
+ doDelete(id);
125
+ }
126
+ },
127
+ doDelete = (id) => {
116
128
  Repository.deleteById(id);
117
129
  };
118
130
 
@@ -263,4 +275,4 @@ function withAdditionalProps(WrappedComponent) {
263
275
  };
264
276
  }
265
277
 
266
- export default withAdditionalProps(withData(AttachmentsElement));
278
+ export default withAdditionalProps(withAlert(withData(AttachmentsElement)));