@gpa-gemstone/common-pages 0.0.130 → 0.0.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/BulkUpload.js CHANGED
@@ -113,10 +113,9 @@ function BulkUpload(props) {
113
113
  }, [rawFileContent, fileName, isFileTypeValid, pipelineErrors, props.Step]);
114
114
  React.useEffect(function () {
115
115
  var _a;
116
- if (props.Step !== 'Complete' || ((_a = props.CompleteOnReview) !== null && _a !== void 0 ? _a : false))
117
- return;
118
- props.OnComplete(data);
119
- }, [props.Step, data, props.OnComplete]);
116
+ if ((props.Step === 'Review' && ((_a = props.CompleteOnReview) !== null && _a !== void 0 ? _a : false)) || props.Step === 'Complete')
117
+ props.OnComplete(data);
118
+ }, [props.Step, props.CompleteOnReview, data]);
120
119
  var handleFileUpload = function (file) {
121
120
  var matchArray = file.name.match(fileExtRegex);
122
121
  var fileExtension = matchArray != null ? matchArray[0].substring(1) : '';
@@ -99,8 +99,8 @@ function CsvPipelineEditStep(props) {
99
99
  var rawDataRef = React.useRef();
100
100
  var _z = React.useState([]), pagedData = _z[0], setPagedData = _z[1];
101
101
  var _0 = React.useState(true), isFileParseable = _0[0], setIsFileParseable = _0[1];
102
- var _1 = React.useState(false), isCSVMissingHeaders = _1[0], setIsCSVMissingHeaders = _1[1];
103
- var _2 = React.useState(false), isCSVMissingDataCells = _2[0], setIsCSVMissingDataCells = _2[1];
102
+ var _1 = React.useState(0), isCSVMissingHeadersCount = _1[0], setIsCSVMissingHeadersCount = _1[1];
103
+ var _2 = React.useState(0), isCSVMissingDataCellsCount = _2[0], setIsCSVMissingDataCellsCount = _2[1];
104
104
  var _3 = React.useState(0), page = _3[0], setPage = _3[1];
105
105
  var _4 = React.useState(1), totalPages = _4[0], setTotalPages = _4[1];
106
106
  var _5 = React.useState(true), showDataHeaderAlert = _5[0], setShowDataHeaderAlert = _5[1];
@@ -183,8 +183,10 @@ function CsvPipelineEditStep(props) {
183
183
  return;
184
184
  }
185
185
  setIsFileParseable(true);
186
- setIsCSVMissingDataCells(parsedData.AddedMissingDataValues);
187
- setIsCSVMissingHeaders(parsedData.AddedMissingHeaders);
186
+ if (parsedData.AddedMissingDataValues)
187
+ setIsCSVMissingDataCellsCount(function (p) { return p + 1; });
188
+ if (parsedData.AddedMissingHeaders)
189
+ setIsCSVMissingHeadersCount(function (p) { return p + 1; });
188
190
  (_a = props.AdditionalProps) === null || _a === void 0 ? void 0 : _a.SetData(parsedData.Data);
189
191
  props.AdditionalProps.SetHeaders(parsedData.Headers);
190
192
  (_b = props.AdditionalProps) === null || _b === void 0 ? void 0 : _b.SetHeaderMap(autoMapHeaders(parsedData.Headers, props.AdditionalProps.Fields.map(function (field) { return field.Field; })));
@@ -320,15 +322,15 @@ function CsvPipelineEditStep(props) {
320
322
  React.createElement("div", { className: 'row h-100' },
321
323
  React.createElement("div", { className: 'col-12 d-flex flex-column h-100' }, pagedData.length !== 0 ?
322
324
  React.createElement(React.Fragment, null,
323
- isCSVMissingDataCells && isCSVMissingHeaders ? (React.createElement("div", { className: 'row' },
325
+ isCSVMissingDataCellsCount > 0 && isCSVMissingHeadersCount > 0 ? (React.createElement("div", { className: 'row' },
324
326
  React.createElement("div", { className: 'col-12' },
325
- React.createElement(react_interactive_1.Alert, { AlertColor: 'alert-info', Show: showDataHeaderAlert, SetShow: setShowDataHeaderAlert },
327
+ React.createElement(react_interactive_1.Alert, { Color: 'alert-info', ReTrigger: isCSVMissingDataCellsCount + isCSVMissingHeadersCount },
326
328
  React.createElement("p", { style: { whiteSpace: 'nowrap' } }, "Missing data cells were added to meet the number of required fields."),
327
329
  React.createElement("hr", null),
328
- React.createElement("p", { style: { whiteSpace: 'nowrap' } }, "Missing headers were added to meet the number of required fields."))))) : isCSVMissingDataCells || isCSVMissingHeaders ? (React.createElement("div", { className: 'row' },
330
+ React.createElement("p", { style: { whiteSpace: 'nowrap' } }, "Missing headers were added to meet the number of required fields."))))) : isCSVMissingDataCellsCount > 0 || isCSVMissingHeadersCount > 0 ? (React.createElement("div", { className: 'row' },
329
331
  React.createElement("div", { className: 'col-12' },
330
- React.createElement(react_interactive_1.Alert, { AlertColor: 'alert-info', Show: showDataOrHeaderAlert, SetShow: setShowDataOrHeaderAlert },
331
- React.createElement("p", { style: { whiteSpace: 'nowrap' } }, isCSVMissingDataCells ? 'Missing data cells were added to meet the number of required fields.' : 'Missing headers were added to meet the number of required fields.'))))) : null,
332
+ React.createElement(react_interactive_1.Alert, { Color: 'alert-info', ReTrigger: isCSVMissingDataCellsCount > 0 ? isCSVMissingDataCellsCount : isCSVMissingHeadersCount },
333
+ React.createElement("p", { style: { whiteSpace: 'nowrap' } }, isCSVMissingDataCellsCount > 0 ? 'Missing data cells were added to meet the number of required fields.' : 'Missing headers were added to meet the number of required fields.'))))) : null,
332
334
  React.createElement("div", { className: 'row flex-grow-1', style: { overflowY: 'hidden' } },
333
335
  React.createElement("div", { className: 'col-12 h-100' },
334
336
  React.createElement(react_table_1.Table, { Data: pagedData, key: (_v = props.AdditionalProps) === null || _v === void 0 ? void 0 : _v.Headers.join(','), SortKey: '', Ascending: false, OnSort: function () { }, KeySelector: function (data) { return data[0]; }, TableClass: 'table', TableStyle: { height: '100%', width: ((_x = (_w = props.AdditionalProps) === null || _w === void 0 ? void 0 : _w.Headers.length) !== null && _x !== void 0 ? _x : 0) * 150 } }, (_y = props.AdditionalProps) === null || _y === void 0 ? void 0 :
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ interface IProps {
3
+ Style?: React.CSSProperties;
4
+ ClassName?: string;
5
+ Logo?: string;
6
+ }
7
+ declare const RoleAccessErrorPage: React.FunctionComponent<IProps>;
8
+ export default RoleAccessErrorPage;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ //******************************************************************************************************
3
+ // RoleAccessErrorPage.tsx - Gbtc
4
+ //
5
+ // Copyright © 2025, Grid Protection Alliance. All Rights Reserved.
6
+ //
7
+ // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
8
+ // the NOTICE file distributed with this work for additional information regarding copyright ownership.
9
+ // The GPA licenses this file to you under the MIT License (MIT), the "License"; you may not use this
10
+ // file except in compliance with the License. You may obtain a copy of the License at:
11
+ //
12
+ // http://opensource.org/licenses/MIT
13
+ //
14
+ // Unless agreed to in writing, the subject software distributed under the License is distributed on an
15
+ // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
16
+ // License for the specific language governing permissions and limitations.
17
+ //
18
+ // Code Modification History:
19
+ // ----------------------------------------------------------------------------------------------------
20
+ // 01/21/2025 - Gabriel Santos
21
+ // Generated original version of source code.
22
+ //
23
+ //******************************************************************************************************
24
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ var desc = Object.getOwnPropertyDescriptor(m, k);
27
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
28
+ desc = { enumerable: true, get: function() { return m[k]; } };
29
+ }
30
+ Object.defineProperty(o, k2, desc);
31
+ }) : (function(o, m, k, k2) {
32
+ if (k2 === undefined) k2 = k;
33
+ o[k2] = m[k];
34
+ }));
35
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
36
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
37
+ }) : function(o, v) {
38
+ o["default"] = v;
39
+ });
40
+ var __importStar = (this && this.__importStar) || function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ var React = __importStar(require("react"));
49
+ var react_interactive_1 = require("@gpa-gemstone/react-interactive");
50
+ var RoleAccessErrorPage = function (props) {
51
+ var _a, _b;
52
+ return (React.createElement("div", { style: (_a = props.Style) !== null && _a !== void 0 ? _a : { width: '100%', height: '100%' }, className: (_b = props.ClassName) !== null && _b !== void 0 ? _b : undefined },
53
+ React.createElement("div", { className: "col", style: { height: "100%", width: "100%" } },
54
+ React.createElement("div", { className: "row", style: { width: "100%", height: "50%", display: "grid", alignItems: "end" } }, props.Logo == null ? React.createElement(React.Fragment, null) :
55
+ React.createElement("img", { src: props.Logo, className: "contain", style: { width: "40%", paddingBottom: "50px", marginLeft: "auto", marginRight: "auto" } })),
56
+ React.createElement("div", { className: "row", style: { alignItems: "top", justifyContent: "center", width: "100%", height: "50%" } },
57
+ React.createElement(react_interactive_1.ServerErrorIcon, { Show: true, Size: 100, Label: 'You do not have permission to view this page.\n Please contact your Administrator if you believe this to be in error.' })))));
58
+ };
59
+ exports.default = RoleAccessErrorPage;
package/lib/index.d.ts CHANGED
@@ -10,7 +10,8 @@ import NavBarFilterButton from './NavBarFilterButton';
10
10
  import { useCSVPipeline } from './Pipelines/CSVPipeline';
11
11
  import * as TimeWindowUtils from './TimeFilter/TimeWindowUtils';
12
12
  import BulkUpload from './BulkUpload';
13
+ import RoleAccessErrorPage from './RoleAcessErrorPage';
13
14
  declare const Pipelines: {
14
15
  CSV: typeof useCSVPipeline;
15
16
  };
16
- export { TimeFilter, TimeWindowUtils, EventTypeFilter, EventCharacteristicFilter, NavBarFilterButton, Note, DefaultSearch, SelectPopup, DefaultSelects, ErrorBoundary, Pipelines, BulkUpload };
17
+ export { TimeFilter, TimeWindowUtils, EventTypeFilter, EventCharacteristicFilter, NavBarFilterButton, Note, DefaultSearch, SelectPopup, DefaultSelects, ErrorBoundary, Pipelines, BulkUpload, RoleAccessErrorPage };
package/lib/index.js CHANGED
@@ -48,7 +48,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
48
48
  return (mod && mod.__esModule) ? mod : { "default": mod };
49
49
  };
50
50
  Object.defineProperty(exports, "__esModule", { value: true });
51
- exports.BulkUpload = exports.Pipelines = exports.ErrorBoundary = exports.DefaultSelects = exports.SelectPopup = exports.DefaultSearch = exports.Note = exports.NavBarFilterButton = exports.EventCharacteristicFilter = exports.EventTypeFilter = exports.TimeWindowUtils = exports.TimeFilter = void 0;
51
+ exports.RoleAccessErrorPage = exports.BulkUpload = exports.Pipelines = exports.ErrorBoundary = exports.DefaultSelects = exports.SelectPopup = exports.DefaultSearch = exports.Note = exports.NavBarFilterButton = exports.EventCharacteristicFilter = exports.EventTypeFilter = exports.TimeWindowUtils = exports.TimeFilter = void 0;
52
52
  var Note_1 = __importDefault(require("./Note"));
53
53
  exports.Note = Note_1.default;
54
54
  var SearchBar_1 = require("./SearchBar");
@@ -72,6 +72,8 @@ var TimeWindowUtils = __importStar(require("./TimeFilter/TimeWindowUtils"));
72
72
  exports.TimeWindowUtils = TimeWindowUtils;
73
73
  var BulkUpload_1 = __importDefault(require("./BulkUpload"));
74
74
  exports.BulkUpload = BulkUpload_1.default;
75
+ var RoleAcessErrorPage_1 = __importDefault(require("./RoleAcessErrorPage"));
76
+ exports.RoleAccessErrorPage = RoleAcessErrorPage_1.default;
75
77
  var Pipelines = {
76
78
  CSV: CSVPipeline_1.useCSVPipeline
77
79
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/common-pages",
3
- "version": "0.0.130",
3
+ "version": "0.0.131",
4
4
  "description": "Common UI pages for GPA products",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -47,9 +47,9 @@
47
47
  "@gpa-gemstone/application-typings": "0.0.81",
48
48
  "@gpa-gemstone/gpa-symbols": "0.0.47",
49
49
  "@gpa-gemstone/helper-functions": "0.0.37",
50
- "@gpa-gemstone/react-forms": "1.1.81",
51
- "@gpa-gemstone/react-interactive": "1.0.142",
52
- "@gpa-gemstone/react-table": "1.2.64",
50
+ "@gpa-gemstone/react-forms": "1.1.82",
51
+ "@gpa-gemstone/react-interactive": "1.0.143",
52
+ "@gpa-gemstone/react-table": "1.2.65",
53
53
  "@reduxjs/toolkit": "1.8.3",
54
54
  "crypto-js": "^4.2.0",
55
55
  "moment": "^2.29.4",