authscape 1.0.428 → 1.0.432
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/index.js +32 -8
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +15 -2
- package/src/components/kanban/Kanban.js +11 -1
package/index.js
CHANGED
|
@@ -31,6 +31,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
31
31
|
function AuthScapeApp(_ref) {
|
|
32
32
|
var Component = _ref.Component,
|
|
33
33
|
layout = _ref.layout,
|
|
34
|
+
loadingLayout = _ref.loadingLayout,
|
|
34
35
|
pageProps = _ref.pageProps,
|
|
35
36
|
_ref$muiTheme = _ref.muiTheme,
|
|
36
37
|
muiTheme = _ref$muiTheme === void 0 ? {} : _ref$muiTheme,
|
|
@@ -42,10 +43,14 @@ function AuthScapeApp(_ref) {
|
|
|
42
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
44
|
frontEndLoadedState = _useState2[0],
|
|
44
45
|
setFrontEndLoadedState = _useState2[1];
|
|
45
|
-
var _useState3 = (0, _react.useState)(
|
|
46
|
+
var _useState3 = (0, _react.useState)(false),
|
|
46
47
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
isLoadingShow = _useState4[0],
|
|
49
|
+
setIsLoadingShow = _useState4[1];
|
|
50
|
+
var _useState5 = (0, _react.useState)(null),
|
|
51
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
52
|
+
signedInUserState = _useState6[0],
|
|
53
|
+
setSignedInUserState = _useState6[1];
|
|
49
54
|
var loadingAuth = (0, _react.useRef)(false);
|
|
50
55
|
var frontEndLoaded = (0, _react.useRef)(false);
|
|
51
56
|
var signedInUser = (0, _react.useRef)(null);
|
|
@@ -185,6 +190,9 @@ function AuthScapeApp(_ref) {
|
|
|
185
190
|
authService().login();
|
|
186
191
|
}
|
|
187
192
|
}, [signedInUserState, enforceLoggedIn, frontEndLoadedState]);
|
|
193
|
+
var setIsLoading = function setIsLoading(isLoading) {
|
|
194
|
+
setIsLoadingShow(isLoading);
|
|
195
|
+
};
|
|
188
196
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_head["default"], null, /*#__PURE__*/_react["default"].createElement("meta", {
|
|
189
197
|
name: "viewport",
|
|
190
198
|
content: "width=device-width, initial-scale=0.86, maximum-scale=5.0, minimum-scale=0.86"
|
|
@@ -202,8 +210,9 @@ function AuthScapeApp(_ref) {
|
|
|
202
210
|
}), layout == null && /*#__PURE__*/_react["default"].createElement(Component, _extends({}, pageProps, {
|
|
203
211
|
currentUser: signedInUser.current,
|
|
204
212
|
toast: _reactToastify.toast,
|
|
205
|
-
loadedUser: frontEndLoadedState
|
|
206
|
-
|
|
213
|
+
loadedUser: frontEndLoadedState,
|
|
214
|
+
setIsLoading: setIsLoading
|
|
215
|
+
}))), /*#__PURE__*/_react["default"].createElement(_reactToastify.ToastContainer, null)), loadingLayout && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, loadingLayout(isLoadingShow)), frontEndLoaded.current && process.env.microsoftClarityTrackingCode != null && process.env.staging == "production" && /*#__PURE__*/_react["default"].createElement("script", {
|
|
207
216
|
dangerouslySetInnerHTML: {
|
|
208
217
|
__html: "\n (function(c,l,a,r,i,t,y){\n c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };\n t=l.createElement(r);\n t.async=1;\n t.src=\"https://www.clarity.ms/tag/\"+i;\n y=l.getElementsByTagName(r)[0];\n y.parentNode.insertBefore(t,y);\n })(window, document, \"clarity\", \"script\", \"" + process.env.microsoftClarityTrackingCode + "\");"
|
|
209
218
|
}
|
|
@@ -2600,6 +2609,8 @@ function Kanban(_ref2) {
|
|
|
2600
2609
|
initialItems = _ref2.items,
|
|
2601
2610
|
containerStyles = _ref2.containerStyles,
|
|
2602
2611
|
itemStyles = _ref2.itemStyles,
|
|
2612
|
+
_ref2$filterBy = _ref2.filterBy,
|
|
2613
|
+
filterBy = _ref2$filterBy === void 0 ? null : _ref2$filterBy,
|
|
2603
2614
|
containerStyle = _ref2.containerStyle,
|
|
2604
2615
|
_ref2$coordinateGette = _ref2.coordinateGetter,
|
|
2605
2616
|
coordinateGetter = _ref2$coordinateGette === void 0 ? multipleContainersCoordinateGetter : _ref2$coordinateGette,
|
|
@@ -2649,10 +2660,23 @@ function Kanban(_ref2) {
|
|
|
2649
2660
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2650
2661
|
while (1) switch (_context.prev = _context.next) {
|
|
2651
2662
|
case 0:
|
|
2652
|
-
|
|
2663
|
+
response = null;
|
|
2664
|
+
if (!(filterBy == null)) {
|
|
2665
|
+
_context.next = 7;
|
|
2666
|
+
break;
|
|
2667
|
+
}
|
|
2668
|
+
_context.next = 4;
|
|
2653
2669
|
return apiService().get("/Kanban/GetKanban");
|
|
2654
|
-
case
|
|
2670
|
+
case 4:
|
|
2655
2671
|
response = _context.sent;
|
|
2672
|
+
_context.next = 10;
|
|
2673
|
+
break;
|
|
2674
|
+
case 7:
|
|
2675
|
+
_context.next = 9;
|
|
2676
|
+
return apiService().get("/Kanban/GetKanban?filterBy=" + filterBy);
|
|
2677
|
+
case 9:
|
|
2678
|
+
response = _context.sent;
|
|
2679
|
+
case 10:
|
|
2656
2680
|
if (response != null && response.status == 200) {
|
|
2657
2681
|
_containers = [];
|
|
2658
2682
|
_initItems = response.data;
|
|
@@ -2672,7 +2696,7 @@ function Kanban(_ref2) {
|
|
|
2672
2696
|
setItems(container);
|
|
2673
2697
|
setContainers(_containers);
|
|
2674
2698
|
}
|
|
2675
|
-
case
|
|
2699
|
+
case 11:
|
|
2676
2700
|
case "end":
|
|
2677
2701
|
return _context.stop();
|
|
2678
2702
|
}
|
package/package.json
CHANGED
|
@@ -8,10 +8,12 @@ import querystring from "query-string";
|
|
|
8
8
|
import { setCookie } from 'nookies'
|
|
9
9
|
// import { authService, apiService, setupOEMProps, OEMStyleSheet } from 'authscape';
|
|
10
10
|
|
|
11
|
-
export function AuthScapeApp ({Component, layout, pageProps, muiTheme = {}, enforceLoggedIn = false, enableAuth = true}) {
|
|
11
|
+
export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiTheme = {}, enforceLoggedIn = false, enableAuth = true}) {
|
|
12
12
|
|
|
13
13
|
const [frontEndLoadedState, setFrontEndLoadedState] = useState(false);
|
|
14
14
|
|
|
15
|
+
const [isLoadingShow, setIsLoadingShow] = useState(false);
|
|
16
|
+
|
|
15
17
|
const [signedInUserState, setSignedInUserState] = useState(null);
|
|
16
18
|
|
|
17
19
|
const loadingAuth = useRef(false);
|
|
@@ -142,6 +144,11 @@ export function AuthScapeApp ({Component, layout, pageProps, muiTheme = {}, enfo
|
|
|
142
144
|
|
|
143
145
|
}, [signedInUserState, enforceLoggedIn, frontEndLoadedState]);
|
|
144
146
|
|
|
147
|
+
|
|
148
|
+
const setIsLoading = (isLoading) => {
|
|
149
|
+
setIsLoadingShow(isLoading);
|
|
150
|
+
}
|
|
151
|
+
|
|
145
152
|
return (
|
|
146
153
|
<>
|
|
147
154
|
<Head>
|
|
@@ -163,7 +170,7 @@ export function AuthScapeApp ({Component, layout, pageProps, muiTheme = {}, enfo
|
|
|
163
170
|
})}
|
|
164
171
|
|
|
165
172
|
{layout == null &&
|
|
166
|
-
<Component {...pageProps} currentUser={signedInUser.current} toast={toast} loadedUser={frontEndLoadedState} />
|
|
173
|
+
<Component {...pageProps} currentUser={signedInUser.current} toast={toast} loadedUser={frontEndLoadedState} setIsLoading={setIsLoading} />
|
|
167
174
|
}
|
|
168
175
|
</>
|
|
169
176
|
}
|
|
@@ -171,6 +178,12 @@ export function AuthScapeApp ({Component, layout, pageProps, muiTheme = {}, enfo
|
|
|
171
178
|
|
|
172
179
|
</ThemeProvider>
|
|
173
180
|
|
|
181
|
+
{loadingLayout &&
|
|
182
|
+
<>
|
|
183
|
+
{loadingLayout(isLoadingShow)}
|
|
184
|
+
</>
|
|
185
|
+
}
|
|
186
|
+
|
|
174
187
|
{(frontEndLoaded.current && process.env.microsoftClarityTrackingCode != null && process.env.staging == "production") &&
|
|
175
188
|
<script
|
|
176
189
|
dangerouslySetInnerHTML={{
|
|
@@ -127,6 +127,7 @@ export function Kanban({
|
|
|
127
127
|
items: initialItems,
|
|
128
128
|
containerStyles,
|
|
129
129
|
itemStyles,
|
|
130
|
+
filterBy = null,
|
|
130
131
|
containerStyle,
|
|
131
132
|
coordinateGetter = multipleContainersCoordinateGetter,
|
|
132
133
|
getItemStyles = () => ({}),
|
|
@@ -153,7 +154,16 @@ export function Kanban({
|
|
|
153
154
|
{
|
|
154
155
|
const fetchData = async () => {
|
|
155
156
|
|
|
156
|
-
let response =
|
|
157
|
+
let response = null;
|
|
158
|
+
if (filterBy == null)
|
|
159
|
+
{
|
|
160
|
+
response = await apiService().get("/Kanban/GetKanban");
|
|
161
|
+
}
|
|
162
|
+
else
|
|
163
|
+
{
|
|
164
|
+
response = await apiService().get("/Kanban/GetKanban?filterBy=" + filterBy);
|
|
165
|
+
}
|
|
166
|
+
|
|
157
167
|
if (response != null && response.status == 200)
|
|
158
168
|
{
|
|
159
169
|
let containers = [];
|