@gpa-gemstone/common-pages 0.0.64 → 0.0.66

Sign up to get free protection for your applications and to get access to all the features.
package/lib/Note.d.ts CHANGED
@@ -14,6 +14,7 @@ interface IProps {
14
14
  AllowAdd?: boolean;
15
15
  ShowCard?: boolean;
16
16
  DefaultApplication?: OpenXDA.Types.NoteApplication;
17
+ Filter?: (note: OpenXDA.Types.Note) => boolean;
17
18
  }
18
19
  declare function Note(props: IProps): JSX.Element;
19
20
  export default Note;
package/lib/Note.js CHANGED
@@ -87,6 +87,7 @@ function Note(props) {
87
87
  var sortField = (0, react_redux_1.useSelector)(props.NoteSlice.SortField);
88
88
  var ascending = (0, react_redux_1.useSelector)(props.NoteSlice.Ascending);
89
89
  var _d = React.useState(CreateNewNote()), note = _d[0], setNote = _d[1];
90
+ var _e = React.useState([]), notes = _e[0], setNotes = _e[1];
90
91
  React.useEffect(function () {
91
92
  if (dataStatus === 'unintiated' || dataStatus === 'changed' || parentID !== props.ReferenceTableID)
92
93
  dispatch(props.NoteSlice.Fetch(props.ReferenceTableID));
@@ -121,6 +122,9 @@ function Note(props) {
121
122
  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; } });
122
123
  setCollumns(c);
123
124
  }, [props.NoteTags, props.NoteApplications]);
125
+ React.useEffect(function () {
126
+ setNotes(data.filter(function (n) { return (props.Filter === undefined ? true : props.Filter(n)); }));
127
+ }, [props.Filter, data]);
124
128
  function CreateNewNote() {
125
129
  var newNote = { ID: -1, ReferenceTableID: -1, NoteTagID: -1, NoteTypeID: -1, NoteApplicationID: -1, Timestamp: '', UserAccount: '', Note: '' };
126
130
  if (props.ReferenceTableID !== undefined)
@@ -177,7 +181,7 @@ function Note(props) {
177
181
  gpa_symbols_1.CrossMark,
178
182
  " The note field is already empty. ")))) : null,
179
183
  React.createElement("div", null,
180
- React.createElement(react_table_1.default, { cols: collumns, tableClass: "table table-hover", data: data, sortKey: sortField, ascending: ascending, onSort: function (d) {
184
+ React.createElement(react_table_1.default, { cols: collumns, tableClass: "table table-hover", data: notes, sortKey: sortField, ascending: ascending, onSort: function (d) {
181
185
  if (d.colField === undefined)
182
186
  return;
183
187
  if (d.colField === sortField)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/common-pages",
3
- "version": "0.0.64",
3
+ "version": "0.0.66",
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.55",
47
- "@gpa-gemstone/gpa-symbols": "0.0.25",
48
- "@gpa-gemstone/helper-functions": "0.0.19",
49
- "@gpa-gemstone/react-forms": "1.1.36",
50
- "@gpa-gemstone/react-interactive": "1.0.79",
51
- "@gpa-gemstone/react-table": "1.2.22",
46
+ "@gpa-gemstone/application-typings": "0.0.56",
47
+ "@gpa-gemstone/gpa-symbols": "0.0.26",
48
+ "@gpa-gemstone/helper-functions": "0.0.20",
49
+ "@gpa-gemstone/react-forms": "1.1.37",
50
+ "@gpa-gemstone/react-interactive": "1.0.81",
51
+ "@gpa-gemstone/react-table": "1.2.23",
52
52
  "@reduxjs/toolkit": "1.8.3",
53
53
  "crypto-js": "4.0.0",
54
54
  "moment": "^2.29.4",