@gpa-gemstone/common-pages 0.0.41 → 0.0.44

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { GenericSlice, Search } from '@gpa-gemstone/react-interactive';
3
- import { OpenXDA, SystemCenter } from '@gpa-gemstone/application-typings';
3
+ import { OpenXDA, SystemCenter, Application } from '@gpa-gemstone/application-typings';
4
4
  interface U {
5
5
  ID: number | string;
6
6
  }
@@ -27,5 +27,9 @@ export declare namespace DefaultSearch {
27
27
  function Asset(props: IProps<SystemCenter.Types.DetailedAsset>): JSX.Element;
28
28
  /** This Implements a standard AssetGroup Search */
29
29
  function AssetGroup(props: IProps<OpenXDA.Types.AssetGroup>): JSX.Element;
30
+ /** This Implements a standard User Search */
31
+ function User(props: IProps<Application.Types.iUserAccount>): JSX.Element;
32
+ /** This Implements a standard Customer Search */
33
+ function Customer(props: IProps<OpenXDA.Types.Customer>): JSX.Element;
30
34
  }
31
35
  export {};
package/lib/SearchBar.js CHANGED
@@ -133,4 +133,45 @@ var DefaultSearch;
133
133
  return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: flds, sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Asset Group(s)', GetEnum: props.GetEnum }, props.children);
134
134
  }
135
135
  DefaultSearch.AssetGroup = AssetGroup;
136
+ /** This Implements a standard User Search */
137
+ function User(props) {
138
+ var standardSearch = { label: 'Username', key: 'Name', type: 'string', isPivotField: false };
139
+ var _a = React.useState([]), addlFieldCols = _a[0], setAddlFieldCols = _a[1];
140
+ var dispatch = (0, react_redux_1.useDispatch)();
141
+ var searchStatus = (0, react_redux_1.useSelector)(props.Slice.SearchStatus);
142
+ var sortField = (0, react_redux_1.useSelector)(props.Slice.SortField);
143
+ var ascending = (0, react_redux_1.useSelector)(props.Slice.Ascending);
144
+ var data = (0, react_redux_1.useSelector)(props.Slice.SearchResults);
145
+ var defaultSearchcols = [
146
+ { label: 'Username', key: 'Name', type: 'string', isPivotField: false },
147
+ { label: 'Email', key: 'Email', type: 'string', isPivotField: false },
148
+ { label: 'Account Locked', key: 'LockedOut', type: 'boolean', isPivotField: false },
149
+ ];
150
+ React.useEffect(function () {
151
+ return props.GetAddlFields(setAddlFieldCols);
152
+ }, []);
153
+ return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: flds, sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Asset Group(s)', GetEnum: props.GetEnum }, props.children);
154
+ }
155
+ DefaultSearch.User = User;
156
+ /** This Implements a standard Customer Search */
157
+ function Customer(props) {
158
+ var defaultSearchcols = [
159
+ { label: 'Account Name', key: 'CustomerKey', type: 'string', isPivotField: false },
160
+ { label: 'Name', key: 'Name', type: 'string', isPivotField: false },
161
+ { label: 'Phone', key: 'Phone', type: 'string', isPivotField: false },
162
+ { label: 'Description', key: 'Description', type: 'string', isPivotField: false },
163
+ ];
164
+ var standardSearch = defaultSearchcols[0];
165
+ var _a = React.useState([]), addlFieldCols = _a[0], setAddlFieldCols = _a[1];
166
+ var dispatch = (0, react_redux_1.useDispatch)();
167
+ var searchStatus = (0, react_redux_1.useSelector)(props.Slice.SearchStatus);
168
+ var sortField = (0, react_redux_1.useSelector)(props.Slice.SortField);
169
+ var ascending = (0, react_redux_1.useSelector)(props.Slice.Ascending);
170
+ var data = (0, react_redux_1.useSelector)(props.Slice.SearchResults);
171
+ React.useEffect(function () {
172
+ return props.GetAddlFields(setAddlFieldCols);
173
+ }, []);
174
+ return React.createElement(react_interactive_1.SearchBar, { CollumnList: __spreadArray(__spreadArray([], defaultSearchcols, true), addlFieldCols, true), SetFilter: function (flds) { return dispatch(props.Slice.DBSearch({ filter: flds, sortField: sortField, ascending: ascending })); }, Direction: 'left', defaultCollumn: standardSearch, Width: '50%', Label: 'Search', ShowLoading: searchStatus === 'loading', ResultNote: searchStatus === 'error' ? 'Could not complete Search' : 'Found ' + data.length + ' Customer(s)', GetEnum: props.GetEnum }, props.children);
175
+ }
176
+ DefaultSearch.Customer = Customer;
136
177
  })(DefaultSearch = exports.DefaultSearch || (exports.DefaultSearch = {}));
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { Column } from "@gpa-gemstone/react-table";
3
3
  import { GenericSlice, Search } from "@gpa-gemstone/react-interactive";
4
- import { OpenXDA, SystemCenter } from "@gpa-gemstone/application-typings";
4
+ import { Application, OpenXDA, SystemCenter } from "@gpa-gemstone/application-typings";
5
5
  interface U {
6
6
  ID: number | string;
7
7
  }
@@ -31,5 +31,9 @@ export declare namespace DefaultSelects {
31
31
  function Asset(props: IProps<SystemCenter.Types.DetailedAsset>): JSX.Element;
32
32
  /** This Implements a standard Asset Group Selection Modal */
33
33
  function AssetGroup(props: IProps<OpenXDA.Types.AssetGroup>): JSX.Element;
34
+ /** This Implements a standard User Selection Modal */
35
+ function User(props: IProps<Application.Types.iUserAccount>): JSX.Element;
36
+ /** This Implements a standard Customer Selection Modal */
37
+ function Customer(props: IProps<OpenXDA.Types.Customer>): JSX.Element;
34
38
  }
35
39
  export {};
@@ -59,4 +59,14 @@ var DefaultSelects;
59
59
  return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.AssetGroup, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum }, children); } }));
60
60
  }
61
61
  DefaultSelects.AssetGroup = AssetGroup;
62
+ /** This Implements a standard User Selection Modal */
63
+ function User(props) {
64
+ return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.User, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum }, children); } }));
65
+ }
66
+ DefaultSelects.User = User;
67
+ /** This Implements a standard Customer Selection Modal */
68
+ function Customer(props) {
69
+ return React.createElement(StandardSelectPopup_1.default, __assign({}, props, { Searchbar: function (children) { return React.createElement(SearchBar_1.DefaultSearch.Customer, { Slice: props.Slice, GetAddlFields: props.GetAddlFields, GetEnum: props.GetEnum }, children); } }));
70
+ }
71
+ DefaultSelects.Customer = Customer;
62
72
  })(DefaultSelects = exports.DefaultSelects || (exports.DefaultSelects = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/common-pages",
3
- "version": "0.0.41",
3
+ "version": "0.0.44",
4
4
  "description": "Common UI pages for GPA products",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -47,18 +47,18 @@
47
47
  "typescript": "4.4.4"
48
48
  },
49
49
  "dependencies": {
50
- "@gpa-gemstone/application-typings": "0.0.46",
51
- "@gpa-gemstone/gpa-symbols": "0.0.20",
52
- "@gpa-gemstone/helper-functions": "0.0.14",
53
- "@gpa-gemstone/react-forms": "1.1.22",
54
- "@gpa-gemstone/react-interactive": "1.0.52",
55
- "@gpa-gemstone/react-table": "1.2.13",
50
+ "@gpa-gemstone/application-typings": "0.0.48",
51
+ "@gpa-gemstone/gpa-symbols": "0.0.21",
52
+ "@gpa-gemstone/helper-functions": "0.0.16",
53
+ "@gpa-gemstone/react-forms": "1.1.24",
54
+ "@gpa-gemstone/react-interactive": "1.0.55",
55
+ "@gpa-gemstone/react-table": "1.2.16",
56
56
  "@reduxjs/toolkit": "1.6.0",
57
57
  "crypto-js": "4.0.0",
58
- "moment": "^2.29.1",
58
+ "moment": "^2.29.4",
59
59
  "react": "^17.0.2",
60
60
  "react-redux": "7.2.6",
61
- "styled-components": "^5.3.3"
61
+ "styled-components": "5.3.3"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"