@gpa-gemstone/common-pages 0.0.42 → 0.0.43

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,6 +27,8 @@ 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;
30
32
  /** This Implements a standard Customer Search */
31
33
  function Customer(props: IProps<OpenXDA.Types.Customer>): JSX.Element;
32
34
  }
package/lib/SearchBar.js CHANGED
@@ -133,6 +133,26 @@ 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;
136
156
  /** This Implements a standard Customer Search */
137
157
  function Customer(props) {
138
158
  var defaultSearchcols = [
@@ -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,7 +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 Asset Group Selection Modal */
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 */
35
37
  function Customer(props: IProps<OpenXDA.Types.Customer>): JSX.Element;
36
38
  }
37
39
  export {};
@@ -59,7 +59,12 @@ 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 Asset Group Selection Modal */
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 */
63
68
  function Customer(props) {
64
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); } }));
65
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/common-pages",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "Common UI pages for GPA products",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -47,15 +47,15 @@
47
47
  "typescript": "4.4.4"
48
48
  },
49
49
  "dependencies": {
50
- "@gpa-gemstone/application-typings": "0.0.47",
50
+ "@gpa-gemstone/application-typings": "0.0.48",
51
51
  "@gpa-gemstone/gpa-symbols": "0.0.21",
52
52
  "@gpa-gemstone/helper-functions": "0.0.15",
53
53
  "@gpa-gemstone/react-forms": "1.1.23",
54
- "@gpa-gemstone/react-interactive": "1.0.53",
55
- "@gpa-gemstone/react-table": "1.2.14",
54
+ "@gpa-gemstone/react-interactive": "1.0.54",
55
+ "@gpa-gemstone/react-table": "1.2.15",
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
61
  "styled-components": "5.3.3"