dce-reactkit 3.7.17 → 3.7.18
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/dist/cjs/index.js +28 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/stylesheets/shared.css.d.ts +6 -0
- package/dist/esm/index.js +28 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/stylesheets/shared.css.d.ts +6 -0
- package/package.json +1 -1
- package/src/components/AppWrapper.tsx +7 -0
- package/src/helpers/genRouteHandler.ts +7 -1
- package/src/stylesheets/shared.css.ts +18 -0
package/dist/cjs/index.js
CHANGED
|
@@ -873,6 +873,23 @@ const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
873
873
|
});
|
|
874
874
|
});
|
|
875
875
|
|
|
876
|
+
/**
|
|
877
|
+
* Universal stylesheet
|
|
878
|
+
* @author Gabe Abrams
|
|
879
|
+
*/
|
|
880
|
+
const shared = `
|
|
881
|
+
/* Button with no style */
|
|
882
|
+
.btn-nostyle {
|
|
883
|
+
border: 0 !important;
|
|
884
|
+
background: transparent !important;
|
|
885
|
+
outline: 0 !important;
|
|
886
|
+
font-size: inherit !important;
|
|
887
|
+
color: inherit !important;
|
|
888
|
+
padding: 0 !important;
|
|
889
|
+
margin: 0 !important;
|
|
890
|
+
}
|
|
891
|
+
`;
|
|
892
|
+
|
|
876
893
|
/**
|
|
877
894
|
* A wrapper for the entire React app that adds global functionality like
|
|
878
895
|
* handling for fatal error messages, adds bootstrap support
|
|
@@ -1138,6 +1155,8 @@ const style$9 = `
|
|
|
1138
1155
|
opacity: 1;
|
|
1139
1156
|
}
|
|
1140
1157
|
}
|
|
1158
|
+
|
|
1159
|
+
${shared}
|
|
1141
1160
|
`;
|
|
1142
1161
|
/*------------------------------------------------------------------------*/
|
|
1143
1162
|
/* ------------------------------ Component ----------------------------- */
|
|
@@ -14753,10 +14772,16 @@ const genRouteHandler = (opts) => {
|
|
|
14753
14772
|
* @param [renderOpts.status=500] http status code
|
|
14754
14773
|
*/
|
|
14755
14774
|
const renderErrorPage = (renderOpts = {}) => {
|
|
14756
|
-
var _a, _b;
|
|
14775
|
+
var _a, _b, _c;
|
|
14757
14776
|
const html = genErrorPage(renderOpts);
|
|
14758
14777
|
send(html, (_a = renderOpts.status) !== null && _a !== void 0 ? _a : 500);
|
|
14759
|
-
// Log
|
|
14778
|
+
// Log server-side error if not a session expired error or 404
|
|
14779
|
+
if (renderOpts.status && renderOpts.status === 404) {
|
|
14780
|
+
return;
|
|
14781
|
+
}
|
|
14782
|
+
if ((_b = renderOpts.title) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('session expired')) {
|
|
14783
|
+
return;
|
|
14784
|
+
}
|
|
14760
14785
|
logServerEvent({
|
|
14761
14786
|
context: LogBuiltInMetadata.Context.ServerRenderedErrorPage,
|
|
14762
14787
|
error: {
|
|
@@ -14768,7 +14793,7 @@ const genRouteHandler = (opts) => {
|
|
|
14768
14793
|
description: renderOpts.description,
|
|
14769
14794
|
code: renderOpts.code,
|
|
14770
14795
|
pageTitle: renderOpts.pageTitle,
|
|
14771
|
-
status: (
|
|
14796
|
+
status: (_c = renderOpts.status) !== null && _c !== void 0 ? _c : 500,
|
|
14772
14797
|
},
|
|
14773
14798
|
});
|
|
14774
14799
|
};
|