@gpa-gemstone/common-pages 0.0.66 → 0.0.67
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/Note.d.ts +2 -0
- package/lib/Note.js +19 -17
- package/package.json +5 -5
package/lib/Note.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { Column } from '@gpa-gemstone/react-table';
|
2
3
|
import { OpenXDA } from '@gpa-gemstone/application-typings';
|
3
4
|
import { IGenericSlice } from './SliceInterfaces';
|
4
5
|
interface IProps {
|
@@ -15,6 +16,7 @@ interface IProps {
|
|
15
16
|
ShowCard?: boolean;
|
16
17
|
DefaultApplication?: OpenXDA.Types.NoteApplication;
|
17
18
|
Filter?: (note: OpenXDA.Types.Note) => boolean;
|
19
|
+
AdditionalCollumns?: Column<OpenXDA.Types.Note>[];
|
18
20
|
}
|
19
21
|
declare function Note(props: IProps): JSX.Element;
|
20
22
|
export default Note;
|
package/lib/Note.js
CHANGED
@@ -54,22 +54,6 @@ function Note(props) {
|
|
54
54
|
{
|
55
55
|
key: 'UserAccount', field: 'UserAccount', label: 'User',
|
56
56
|
headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' }
|
57
|
-
},
|
58
|
-
{
|
59
|
-
key: 'buttons',
|
60
|
-
label: '',
|
61
|
-
headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' },
|
62
|
-
content: function (item) { return React.createElement(React.Fragment, null,
|
63
|
-
allowEdit ? React.createElement("button", { className: "btn btn-sm", onClick: function () { return handleEdit(item); } },
|
64
|
-
React.createElement("span", null,
|
65
|
-
" ",
|
66
|
-
gpa_symbols_1.Pencil,
|
67
|
-
" ")) : null,
|
68
|
-
allowRemove ? React.createElement("button", { className: "btn btn-sm", onClick: function () { return dispatch(props.NoteSlice.DBAction({ verb: 'DELETE', record: item })); } },
|
69
|
-
React.createElement("span", null,
|
70
|
-
" ",
|
71
|
-
gpa_symbols_1.TrashCan,
|
72
|
-
" ")) : null); }
|
73
57
|
}
|
74
58
|
];
|
75
59
|
var allowEdit = props.AllowEdit === undefined ? true : props.AllowEdit;
|
@@ -114,14 +98,32 @@ function Note(props) {
|
|
114
98
|
}, [props.ReferenceTableID]);
|
115
99
|
React.useEffect(function () {
|
116
100
|
var c = standardCollumns;
|
101
|
+
if (props.AdditionalCollumns !== undefined)
|
102
|
+
c.push.apply(c, props.AdditionalCollumns);
|
117
103
|
if (props.NoteTags.length > 1)
|
118
104
|
c.push({ key: 'NoteTagID', field: 'NoteTagID', label: 'Type', headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' },
|
119
105
|
content: function (n) { var _a; return (_a = props.NoteTags.find(function (t) { return t.ID === n.NoteTagID; })) === null || _a === void 0 ? void 0 : _a.Name; } });
|
120
106
|
if (props.NoteApplications.length > 1)
|
121
107
|
c.push({ key: 'NoteApplicationID', field: 'NoteApplicationID', label: 'Application', headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' },
|
122
108
|
content: function (n) { var _a; return (_a = props.NoteApplications.find(function (t) { return t.ID === n.NoteApplicationID; })) === null || _a === void 0 ? void 0 : _a.Name; } });
|
109
|
+
c.push({
|
110
|
+
key: 'buttons',
|
111
|
+
label: '',
|
112
|
+
headerStyle: { width: 'auto' }, rowStyle: { width: 'auto' },
|
113
|
+
content: function (item) { return React.createElement(React.Fragment, null,
|
114
|
+
allowEdit ? React.createElement("button", { className: "btn btn-sm", onClick: function () { return handleEdit(item); } },
|
115
|
+
React.createElement("span", null,
|
116
|
+
" ",
|
117
|
+
gpa_symbols_1.Pencil,
|
118
|
+
" ")) : null,
|
119
|
+
allowRemove ? React.createElement("button", { className: "btn btn-sm", onClick: function () { return dispatch(props.NoteSlice.DBAction({ verb: 'DELETE', record: item })); } },
|
120
|
+
React.createElement("span", null,
|
121
|
+
" ",
|
122
|
+
gpa_symbols_1.TrashCan,
|
123
|
+
" ")) : null); }
|
124
|
+
});
|
123
125
|
setCollumns(c);
|
124
|
-
}, [props.NoteTags, props.NoteApplications]);
|
126
|
+
}, [props.NoteTags, props.NoteApplications, props.AdditionalCollumns]);
|
125
127
|
React.useEffect(function () {
|
126
128
|
setNotes(data.filter(function (n) { return (props.Filter === undefined ? true : props.Filter(n)); }));
|
127
129
|
}, [props.Filter, data]);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gpa-gemstone/common-pages",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.67",
|
4
4
|
"description": "Common UI pages for GPA products",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"types": "lib/index.d.ts",
|
@@ -43,12 +43,12 @@
|
|
43
43
|
"typescript": "4.4.4"
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
|
-
"@gpa-gemstone/application-typings": "0.0.
|
46
|
+
"@gpa-gemstone/application-typings": "0.0.57",
|
47
47
|
"@gpa-gemstone/gpa-symbols": "0.0.26",
|
48
48
|
"@gpa-gemstone/helper-functions": "0.0.20",
|
49
|
-
"@gpa-gemstone/react-forms": "1.1.
|
50
|
-
"@gpa-gemstone/react-interactive": "1.0.
|
51
|
-
"@gpa-gemstone/react-table": "1.2.
|
49
|
+
"@gpa-gemstone/react-forms": "1.1.38",
|
50
|
+
"@gpa-gemstone/react-interactive": "1.0.82",
|
51
|
+
"@gpa-gemstone/react-table": "1.2.24",
|
52
52
|
"@reduxjs/toolkit": "1.8.3",
|
53
53
|
"crypto-js": "4.0.0",
|
54
54
|
"moment": "^2.29.4",
|