@gpa-gemstone/common-pages 0.0.66 → 0.0.68

Sign up to get free protection for your applications and to get access to all the features.
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]);
@@ -156,7 +158,7 @@ function Note(props) {
156
158
  if (dataStatus === "error")
157
159
  return (React.createElement("div", { style: { width: '100%', height: '100%' } },
158
160
  React.createElement("div", { style: { height: '40px', margin: 'auto', marginTop: 'calc(50% - 20 px)' } },
159
- React.createElement(react_interactive_1.ServerErrorIcon, { Show: true, Size: 40, Label: 'A Server Error Occured. Please Reload the Application' }))));
161
+ React.createElement(react_interactive_1.ServerErrorIcon, { Show: true, Size: 40 }))));
160
162
  return (React.createElement("div", { className: showCard ? "card" : "", style: { marginBottom: 10, maxHeight: props.MaxHeight, width: '100%' } },
161
163
  React.createElement(react_interactive_1.LoadingScreen, { Show: dataStatus === 'loading' }),
162
164
  React.createElement("div", { className: props.ShowCard === undefined || props.ShowCard ? "card-header" : "" },
package/lib/SearchBar.js CHANGED
@@ -42,12 +42,13 @@ var DefaultSearch;
42
42
  /** This Implements a standard Meter Search */
43
43
  function Meter(props) {
44
44
  var defaultSearchcols = [
45
- { label: 'AssetKey', key: 'AssetKey', type: 'string', isPivotField: false },
45
+ { label: 'Key', key: 'AssetKey', type: 'string', isPivotField: false },
46
46
  { label: 'Name', key: 'Name', type: 'string', isPivotField: false },
47
- { label: 'Location', key: 'Location', type: 'string', isPivotField: false },
47
+ { label: 'Substation', key: 'Location', type: 'string', isPivotField: false },
48
48
  { label: 'Make', key: 'Make', type: 'string', isPivotField: false },
49
49
  { label: 'Model', key: 'Model', type: 'string', isPivotField: false },
50
50
  { label: 'Number of Assets', key: 'MappedAssets', type: 'number', isPivotField: false },
51
+ { label: 'Description', key: 'Description', type: 'string', isPivotField: false },
51
52
  ];
52
53
  var dispatch = (0, react_redux_1.useDispatch)();
53
54
  var _a = React.useState([]), addlFieldCols = _a[0], setAddlFieldCols = _a[1];
@@ -78,7 +79,7 @@ var DefaultSearch;
78
79
  { label: 'Meter', key: 'Meter', type: 'string', isPivotField: false },
79
80
  { label: 'Number of Transmission Assets', key: 'Assets', type: 'integer', isPivotField: false },
80
81
  { label: 'Number of Meters', key: 'Meters', type: 'integer', isPivotField: false },
81
- { label: 'Description', key: 'Description', type: 'string', isPivotField: false }
82
+ { label: 'Description', key: 'Description', type: 'string', isPivotField: false },
82
83
  ];
83
84
  React.useEffect(function () {
84
85
  return props.GetAddlFields(setAddlFieldCols);
@@ -98,12 +99,13 @@ var DefaultSearch;
98
99
  var defaultSearchcols = [
99
100
  { label: 'Key', key: 'AssetKey', type: 'string', isPivotField: false },
100
101
  { label: 'Name', key: 'AssetName', type: 'string', isPivotField: false },
101
- { label: 'Voltage (kV)', key: 'VoltageKV', type: 'number', isPivotField: false },
102
+ { label: 'Nominal Voltage (L-L kV)', key: 'VoltageKV', type: 'number', isPivotField: false },
102
103
  { label: 'Type', key: 'AssetType', type: 'enum', isPivotField: false },
103
104
  { label: 'Meter Key', key: 'Meter', type: 'string', isPivotField: false },
104
105
  { label: 'Substation Key', key: 'Location', type: 'string', isPivotField: false },
105
106
  { label: 'Number of Meters', key: 'Meters', type: 'integer', isPivotField: false },
106
107
  { label: 'Number of Substations', key: 'Locations', type: 'integer', isPivotField: false },
108
+ { label: 'Description', key: 'Description', type: 'string', isPivotField: false },
107
109
  ];
108
110
  React.useEffect(function () {
109
111
  return props.GetAddlFields(setAddlFieldCols);
@@ -122,10 +124,11 @@ var DefaultSearch;
122
124
  var data = (0, react_redux_1.useSelector)(props.Slice.SearchResults);
123
125
  var defaultSearchcols = [
124
126
  { label: 'Name', key: 'Name', type: 'string', isPivotField: false },
125
- { label: 'Number of Meter', key: 'Meters', type: 'integer', isPivotField: false },
127
+ { label: 'Number of Meters', key: 'Meters', type: 'integer', isPivotField: false },
126
128
  { label: 'Number of Transmission Assets', key: 'Assets', type: 'integer', isPivotField: false },
127
- { label: 'Number of Users', key: 'Users', type: 'integer', isPivotField: false },
129
+ { label: 'Number of Asset Groups', key: 'AssetGroups', type: 'integer', isPivotField: false },
128
130
  { label: 'Show in PQ Dashboard', key: 'DisplayDashboard', type: 'boolean', isPivotField: false },
131
+ { label: 'Show in Email Subscription', key: 'DisplayEmail', type: 'boolean', isPivotField: false },
129
132
  ];
130
133
  React.useEffect(function () {
131
134
  return props.GetAddlFields(setAddlFieldCols);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/common-pages",
3
- "version": "0.0.66",
3
+ "version": "0.0.68",
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.56",
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.37",
50
- "@gpa-gemstone/react-interactive": "1.0.81",
51
- "@gpa-gemstone/react-table": "1.2.23",
49
+ "@gpa-gemstone/react-forms": "1.1.39",
50
+ "@gpa-gemstone/react-interactive": "1.0.83",
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",