@etsoo/react 1.4.82 → 1.4.83

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.
@@ -32,6 +32,8 @@ const formatValue = (value) => {
32
32
  export function AuditDisplay(props) {
33
33
  // Theme
34
34
  const theme = useTheme();
35
+ // Label
36
+ const dataComparisonLabel = getLabel('dataComparison');
35
37
  // Show data comparison
36
38
  const showDataComparison = (data) => {
37
39
  if (typeof globalApp === 'undefined')
@@ -55,7 +57,7 @@ export function AuditDisplay(props) {
55
57
  React.createElement(TableCell, null, getLabel(row.field)),
56
58
  React.createElement(TableCell, { align: "right" }, formatValue(row.oldValue)),
57
59
  React.createElement(TableCell, { align: "right" }, formatValue(row.newValue))))))));
58
- globalApp.notifier.alert(undefined, undefined, NotificationMessageType.Info, { fullScreen: globalApp.smDown, inputs });
60
+ globalApp.notifier.alert(undefined, undefined, NotificationMessageType.Info, { fullScreen: globalApp.smDown, inputs, title: dataComparisonLabel });
59
61
  };
60
62
  // Destruct
61
63
  const { getItemStyle = (index, theme) => ({
@@ -65,12 +67,15 @@ export function AuditDisplay(props) {
65
67
  : theme.palette.grey[50]
66
68
  }), itemRenderer = (data) => {
67
69
  return (React.createElement(React.Fragment, null,
70
+ data.changes != null && (React.createElement(Button, { variant: "outlined", size: "small", onClick: () => showDataComparison(data.changes), sx: {
71
+ marginLeft: theme.spacing(1),
72
+ float: 'right'
73
+ } }, dataComparisonLabel)),
68
74
  formatDate(data.creation) +
69
75
  ', [' +
70
76
  getLabel(data.action) +
71
77
  '], ' +
72
- data.user,
73
- data.changes != null && (React.createElement(Button, { variant: "outlined", size: "small", onClick: () => showDataComparison(data.changes), sx: { marginLeft: theme.spacing(1) } }, getLabel('dataComparison')))));
78
+ data.user));
74
79
  }, headerTitle = (React.createElement(React.Fragment, null,
75
80
  getLabel('audits'),
76
81
  React.createElement(Divider, null))), ...rest } = props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.4.82",
3
+ "version": "1.4.83",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "@emotion/react": "^11.7.1",
51
51
  "@emotion/style": "^0.8.0",
52
52
  "@emotion/styled": "^11.6.0",
53
- "@etsoo/appscript": "^1.2.31",
53
+ "@etsoo/appscript": "^1.2.32",
54
54
  "@etsoo/notificationbase": "^1.1.0",
55
55
  "@etsoo/shared": "^1.1.9",
56
56
  "@mui/icons-material": "^5.3.1",
@@ -78,6 +78,9 @@ export function AuditDisplay(props: AuditDisplayProps) {
78
78
  // Theme
79
79
  const theme = useTheme();
80
80
 
81
+ // Label
82
+ const dataComparisonLabel = getLabel('dataComparison');
83
+
81
84
  // Show data comparison
82
85
  const showDataComparison = (data: AuditLineUpdateData) => {
83
86
  if (typeof globalApp === 'undefined') return;
@@ -126,7 +129,7 @@ export function AuditDisplay(props: AuditDisplayProps) {
126
129
  undefined,
127
130
  undefined,
128
131
  NotificationMessageType.Info,
129
- { fullScreen: globalApp.smDown, inputs }
132
+ { fullScreen: globalApp.smDown, inputs, title: dataComparisonLabel }
130
133
  );
131
134
  };
132
135
 
@@ -142,21 +145,24 @@ export function AuditDisplay(props: AuditDisplayProps) {
142
145
  itemRenderer = (data) => {
143
146
  return (
144
147
  <React.Fragment>
145
- {formatDate(data.creation) +
146
- ', [' +
147
- getLabel(data.action) +
148
- '], ' +
149
- data.user}
150
148
  {data.changes != null && (
151
149
  <Button
152
150
  variant="outlined"
153
151
  size="small"
154
152
  onClick={() => showDataComparison(data.changes!)}
155
- sx={{ marginLeft: theme.spacing(1) }}
153
+ sx={{
154
+ marginLeft: theme.spacing(1),
155
+ float: 'right'
156
+ }}
156
157
  >
157
- {getLabel('dataComparison')}
158
+ {dataComparisonLabel}
158
159
  </Button>
159
160
  )}
161
+ {formatDate(data.creation) +
162
+ ', [' +
163
+ getLabel(data.action) +
164
+ '], ' +
165
+ data.user}
160
166
  </React.Fragment>
161
167
  );
162
168
  },