dce-reactkit 4.3.4 → 5.0.0
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 +338 -2316
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/LogReviewer.d.ts +1 -1
- package/dist/cjs/types/helpers/logClientEvent.d.ts +1 -1
- package/dist/cjs/types/html/genErrorPage.d.ts +1 -1
- package/dist/cjs/types/index.d.ts +2 -64
- package/dist/cjs/types/types/IntelliTableColumn.d.ts +1 -1
- package/dist/esm/index.js +78 -2223
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/LogReviewer.d.ts +1 -1
- package/dist/esm/types/helpers/logClientEvent.d.ts +1 -1
- package/dist/esm/types/html/genErrorPage.d.ts +1 -1
- package/dist/esm/types/index.d.ts +2 -64
- package/dist/esm/types/types/IntelliTableColumn.d.ts +1 -1
- package/dist/index.d.ts +3 -835
- package/package.json +4 -3
- package/src/components/AppWrapper.tsx +12 -10
- package/src/components/AutoscrollToBottomContainer.tsx +5 -3
- package/src/components/CopiableBox.tsx +5 -1
- package/src/components/DBEntryManagerPanel/helpers/generateEndpointPath.ts +2 -2
- package/src/components/ErrorBox.tsx +6 -2
- package/src/components/IntelliTable.tsx +7 -5
- package/src/components/LogReviewer.tsx +23 -21
- package/src/components/Modal/index.tsx +5 -3
- package/src/components/MultiSwitch.tsx +5 -1
- package/src/components/Shimmer.tsx +4 -2
- package/src/components/SimpleDateChooser.tsx +11 -13
- package/src/components/SimpleTimeChooser.tsx +4 -2
- package/src/helpers/canReviewLogs.test.ts +5 -3
- package/src/helpers/canReviewLogs.ts +5 -3
- package/src/helpers/initClient.tsx +8 -8
- package/src/helpers/isMobileOrTablet.tsx +2 -1
- package/src/helpers/isSelectAdmin.ts +4 -2
- package/src/helpers/logClientEvent.tsx +7 -5
- package/src/helpers/stubServerEndpoint.tsx +1 -1
- package/src/helpers/visitServerEndpoint.tsx +10 -7
- package/src/html/genErrorPage.ts +6 -4
- package/src/index.ts +105 -98
- package/src/types/IntelliTableColumn.ts +4 -1
- package/dist/cjs/types/constants/DAY_IN_MS.d.ts +0 -6
- package/dist/cjs/types/constants/HOUR_IN_MS.d.ts +0 -6
- package/dist/cjs/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +0 -6
- package/dist/cjs/types/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.d.ts +0 -6
- package/dist/cjs/types/constants/LOG_REVIEW_STATUS_ROUTE.d.ts +0 -7
- package/dist/cjs/types/constants/LOG_ROUTE_PATH.d.ts +0 -6
- package/dist/cjs/types/constants/MINUTE_IN_MS.d.ts +0 -6
- package/dist/cjs/types/constants/ROUTE_PATH_PREFIX.d.ts +0 -6
- package/dist/cjs/types/constants/SELECT_ADMIN_CHECK_ROUTE.d.ts +0 -6
- package/dist/cjs/types/errors/ErrorWithCode.d.ts +0 -9
- package/dist/cjs/types/helpers/abbreviate.d.ts +0 -10
- package/dist/cjs/types/helpers/abbreviate.test.d.ts +0 -5
- package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.d.ts +0 -13
- package/dist/cjs/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.d.ts +0 -13
- package/dist/cjs/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +0 -10
- package/dist/cjs/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.d.ts +0 -11
- package/dist/cjs/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.d.ts +0 -13
- package/dist/cjs/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +0 -1
- package/dist/cjs/types/helpers/avg.d.ts +0 -8
- package/dist/cjs/types/helpers/avg.test.d.ts +0 -5
- package/dist/cjs/types/helpers/capitalize.d.ts +0 -7
- package/dist/cjs/types/helpers/ceilToNumDecimals.d.ts +0 -9
- package/dist/cjs/types/helpers/ceilToNumDecimals.test.d.ts +0 -5
- package/dist/cjs/types/helpers/cloneDeep.d.ts +0 -8
- package/dist/cjs/types/helpers/compareArraysByProp.d.ts +0 -13
- package/dist/cjs/types/helpers/compareArraysByProp.test.d.ts +0 -5
- package/dist/cjs/types/helpers/extractProp.d.ts +0 -12
- package/dist/cjs/types/helpers/extractProp.test.d.ts +0 -5
- package/dist/cjs/types/helpers/floorToNumDecimals.d.ts +0 -9
- package/dist/cjs/types/helpers/floorToNumDecimals.test.d.ts +0 -5
- package/dist/cjs/types/helpers/forceNumIntoBounds.d.ts +0 -10
- package/dist/cjs/types/helpers/forceNumIntoBounds.test.d.ts +0 -5
- package/dist/cjs/types/helpers/genCSV.d.ts +0 -18
- package/dist/cjs/types/helpers/genCSV.test.d.ts +0 -5
- package/dist/cjs/types/helpers/genCommaList.d.ts +0 -12
- package/dist/cjs/types/helpers/genCommaList.test.d.ts +0 -1
- package/dist/cjs/types/helpers/getHumanReadableDate.d.ts +0 -8
- package/dist/cjs/types/helpers/getHumanReadableDate.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getLocalTimeInfo.d.ts +0 -19
- package/dist/cjs/types/helpers/getLocalTimeInfo.test.d.ts +0 -6
- package/dist/cjs/types/helpers/getMonthName.d.ts +0 -14
- package/dist/cjs/types/helpers/getMonthName.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getOrdinal.d.ts +0 -8
- package/dist/cjs/types/helpers/getOrdinal.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getPartOfDay.d.ts +0 -7
- package/dist/cjs/types/helpers/getPartOfDay.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getTimeInfoInET.d.ts +0 -21
- package/dist/cjs/types/helpers/getTimeInfoInET.test.d.ts +0 -5
- package/dist/cjs/types/helpers/getTimestampFromTimeInfoInET.d.ts +0 -20
- package/dist/cjs/types/helpers/getWordCount.d.ts +0 -10
- package/dist/cjs/types/helpers/idify.d.ts +0 -9
- package/dist/cjs/types/helpers/onlyKeepLetters.d.ts +0 -8
- package/dist/cjs/types/helpers/padDecimalZeros.d.ts +0 -10
- package/dist/cjs/types/helpers/padZerosLeft.d.ts +0 -9
- package/dist/cjs/types/helpers/parallelLimit.d.ts +0 -12
- package/dist/cjs/types/helpers/prefixWithAOrAn.d.ts +0 -10
- package/dist/cjs/types/helpers/roundToNumDecimals.d.ts +0 -9
- package/dist/cjs/types/helpers/shuffleArray.d.ts +0 -8
- package/dist/cjs/types/helpers/startMinWait.d.ts +0 -9
- package/dist/cjs/types/helpers/stringsToHumanReadableList.d.ts +0 -10
- package/dist/cjs/types/helpers/sum.d.ts +0 -8
- package/dist/cjs/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
- package/dist/cjs/types/helpers/validators/shared/constants/ERROR_MESSAGES.d.ts +0 -10
- package/dist/cjs/types/helpers/validators/shared/helpers/validateRegex.d.ts +0 -19
- package/dist/cjs/types/helpers/validators/shared/types/ValidationResult.d.ts +0 -12
- package/dist/cjs/types/helpers/validators/validURL.d.ts +0 -8
- package/dist/cjs/types/helpers/validators/validateEmail.d.ts +0 -11
- package/dist/cjs/types/helpers/validators/validateEmail.test.d.ts +0 -1
- package/dist/cjs/types/helpers/validators/validatePhoneNumber.d.ts +0 -11
- package/dist/cjs/types/helpers/validators/validatePhoneNumber.test.d.ts +0 -1
- package/dist/cjs/types/helpers/validators/validateString.d.ts +0 -22
- package/dist/cjs/types/helpers/validators/validateString.test.d.ts +0 -1
- package/dist/cjs/types/helpers/waitMs.d.ts +0 -7
- package/dist/cjs/types/types/DayOfWeek.d.ts +0 -14
- package/dist/cjs/types/types/Log/LogMainInfo.d.ts +0 -39
- package/dist/cjs/types/types/Log/LogSourceSpecificInfo.d.ts +0 -13
- package/dist/cjs/types/types/Log/LogTypeSpecificInfo.d.ts +0 -17
- package/dist/cjs/types/types/Log/index.d.ts +0 -10
- package/dist/cjs/types/types/LogAction.d.ts +0 -29
- package/dist/cjs/types/types/LogBuiltInMetadata.d.ts +0 -16
- package/dist/cjs/types/types/LogFunction.d.ts +0 -24
- package/dist/cjs/types/types/LogLevel.d.ts +0 -10
- package/dist/cjs/types/types/LogMetadataContextMap.d.ts +0 -11
- package/dist/cjs/types/types/LogMetadataTagMap.d.ts +0 -8
- package/dist/cjs/types/types/LogMetadataTargetMap.d.ts +0 -8
- package/dist/cjs/types/types/LogMetadataType.d.ts +0 -13
- package/dist/cjs/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +0 -17
- package/dist/cjs/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +0 -21
- package/dist/cjs/types/types/LogReviewerFilterState/ContextFilterState.d.ts +0 -10
- package/dist/cjs/types/types/LogReviewerFilterState/DateFilterState.d.ts +0 -17
- package/dist/cjs/types/types/LogReviewerFilterState/TagFilterState.d.ts +0 -8
- package/dist/cjs/types/types/LogReviewerFilterState/index.d.ts +0 -17
- package/dist/cjs/types/types/LogSource.d.ts +0 -9
- package/dist/cjs/types/types/LogType.d.ts +0 -9
- package/dist/cjs/types/types/ParamType.d.ts +0 -17
- package/dist/cjs/types/types/ReactKitErrorCode.d.ts +0 -14
- package/dist/esm/types/constants/DAY_IN_MS.d.ts +0 -6
- package/dist/esm/types/constants/HOUR_IN_MS.d.ts +0 -6
- package/dist/esm/types/constants/LOG_REVIEW_GET_LOGS_ROUTE.d.ts +0 -6
- package/dist/esm/types/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.d.ts +0 -6
- package/dist/esm/types/constants/LOG_REVIEW_STATUS_ROUTE.d.ts +0 -7
- package/dist/esm/types/constants/LOG_ROUTE_PATH.d.ts +0 -6
- package/dist/esm/types/constants/MINUTE_IN_MS.d.ts +0 -6
- package/dist/esm/types/constants/ROUTE_PATH_PREFIX.d.ts +0 -6
- package/dist/esm/types/constants/SELECT_ADMIN_CHECK_ROUTE.d.ts +0 -6
- package/dist/esm/types/errors/ErrorWithCode.d.ts +0 -9
- package/dist/esm/types/helpers/abbreviate.d.ts +0 -10
- package/dist/esm/types/helpers/abbreviate.test.d.ts +0 -5
- package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.d.ts +0 -13
- package/dist/esm/types/helpers/asyncArrayFunctions/everyAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.d.ts +0 -13
- package/dist/esm/types/helpers/asyncArrayFunctions/filterAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.d.ts +0 -10
- package/dist/esm/types/helpers/asyncArrayFunctions/forEachAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.d.ts +0 -11
- package/dist/esm/types/helpers/asyncArrayFunctions/mapAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.d.ts +0 -13
- package/dist/esm/types/helpers/asyncArrayFunctions/someAsync.test.d.ts +0 -1
- package/dist/esm/types/helpers/avg.d.ts +0 -8
- package/dist/esm/types/helpers/avg.test.d.ts +0 -5
- package/dist/esm/types/helpers/capitalize.d.ts +0 -7
- package/dist/esm/types/helpers/ceilToNumDecimals.d.ts +0 -9
- package/dist/esm/types/helpers/ceilToNumDecimals.test.d.ts +0 -5
- package/dist/esm/types/helpers/cloneDeep.d.ts +0 -8
- package/dist/esm/types/helpers/compareArraysByProp.d.ts +0 -13
- package/dist/esm/types/helpers/compareArraysByProp.test.d.ts +0 -5
- package/dist/esm/types/helpers/extractProp.d.ts +0 -12
- package/dist/esm/types/helpers/extractProp.test.d.ts +0 -5
- package/dist/esm/types/helpers/floorToNumDecimals.d.ts +0 -9
- package/dist/esm/types/helpers/floorToNumDecimals.test.d.ts +0 -5
- package/dist/esm/types/helpers/forceNumIntoBounds.d.ts +0 -10
- package/dist/esm/types/helpers/forceNumIntoBounds.test.d.ts +0 -5
- package/dist/esm/types/helpers/genCSV.d.ts +0 -18
- package/dist/esm/types/helpers/genCSV.test.d.ts +0 -5
- package/dist/esm/types/helpers/genCommaList.d.ts +0 -12
- package/dist/esm/types/helpers/genCommaList.test.d.ts +0 -1
- package/dist/esm/types/helpers/getHumanReadableDate.d.ts +0 -8
- package/dist/esm/types/helpers/getHumanReadableDate.test.d.ts +0 -5
- package/dist/esm/types/helpers/getLocalTimeInfo.d.ts +0 -19
- package/dist/esm/types/helpers/getLocalTimeInfo.test.d.ts +0 -6
- package/dist/esm/types/helpers/getMonthName.d.ts +0 -14
- package/dist/esm/types/helpers/getMonthName.test.d.ts +0 -5
- package/dist/esm/types/helpers/getOrdinal.d.ts +0 -8
- package/dist/esm/types/helpers/getOrdinal.test.d.ts +0 -5
- package/dist/esm/types/helpers/getPartOfDay.d.ts +0 -7
- package/dist/esm/types/helpers/getPartOfDay.test.d.ts +0 -5
- package/dist/esm/types/helpers/getTimeInfoInET.d.ts +0 -21
- package/dist/esm/types/helpers/getTimeInfoInET.test.d.ts +0 -5
- package/dist/esm/types/helpers/getTimestampFromTimeInfoInET.d.ts +0 -20
- package/dist/esm/types/helpers/getWordCount.d.ts +0 -10
- package/dist/esm/types/helpers/idify.d.ts +0 -9
- package/dist/esm/types/helpers/onlyKeepLetters.d.ts +0 -8
- package/dist/esm/types/helpers/padDecimalZeros.d.ts +0 -10
- package/dist/esm/types/helpers/padZerosLeft.d.ts +0 -9
- package/dist/esm/types/helpers/parallelLimit.d.ts +0 -12
- package/dist/esm/types/helpers/prefixWithAOrAn.d.ts +0 -10
- package/dist/esm/types/helpers/roundToNumDecimals.d.ts +0 -9
- package/dist/esm/types/helpers/shuffleArray.d.ts +0 -8
- package/dist/esm/types/helpers/startMinWait.d.ts +0 -9
- package/dist/esm/types/helpers/stringsToHumanReadableList.d.ts +0 -10
- package/dist/esm/types/helpers/sum.d.ts +0 -8
- package/dist/esm/types/helpers/validators/ChicagoTitleCase.d.ts +0 -9
- package/dist/esm/types/helpers/validators/shared/constants/ERROR_MESSAGES.d.ts +0 -10
- package/dist/esm/types/helpers/validators/shared/helpers/validateRegex.d.ts +0 -19
- package/dist/esm/types/helpers/validators/shared/types/ValidationResult.d.ts +0 -12
- package/dist/esm/types/helpers/validators/validURL.d.ts +0 -8
- package/dist/esm/types/helpers/validators/validateEmail.d.ts +0 -11
- package/dist/esm/types/helpers/validators/validateEmail.test.d.ts +0 -1
- package/dist/esm/types/helpers/validators/validatePhoneNumber.d.ts +0 -11
- package/dist/esm/types/helpers/validators/validatePhoneNumber.test.d.ts +0 -1
- package/dist/esm/types/helpers/validators/validateString.d.ts +0 -22
- package/dist/esm/types/helpers/validators/validateString.test.d.ts +0 -1
- package/dist/esm/types/helpers/waitMs.d.ts +0 -7
- package/dist/esm/types/types/DayOfWeek.d.ts +0 -14
- package/dist/esm/types/types/Log/LogMainInfo.d.ts +0 -39
- package/dist/esm/types/types/Log/LogSourceSpecificInfo.d.ts +0 -13
- package/dist/esm/types/types/Log/LogTypeSpecificInfo.d.ts +0 -17
- package/dist/esm/types/types/Log/index.d.ts +0 -10
- package/dist/esm/types/types/LogAction.d.ts +0 -29
- package/dist/esm/types/types/LogBuiltInMetadata.d.ts +0 -16
- package/dist/esm/types/types/LogFunction.d.ts +0 -24
- package/dist/esm/types/types/LogLevel.d.ts +0 -10
- package/dist/esm/types/types/LogMetadataContextMap.d.ts +0 -11
- package/dist/esm/types/types/LogMetadataTagMap.d.ts +0 -8
- package/dist/esm/types/types/LogMetadataTargetMap.d.ts +0 -8
- package/dist/esm/types/types/LogMetadataType.d.ts +0 -13
- package/dist/esm/types/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +0 -17
- package/dist/esm/types/types/LogReviewerFilterState/AdvancedFilterState.d.ts +0 -21
- package/dist/esm/types/types/LogReviewerFilterState/ContextFilterState.d.ts +0 -10
- package/dist/esm/types/types/LogReviewerFilterState/DateFilterState.d.ts +0 -17
- package/dist/esm/types/types/LogReviewerFilterState/TagFilterState.d.ts +0 -8
- package/dist/esm/types/types/LogReviewerFilterState/index.d.ts +0 -17
- package/dist/esm/types/types/LogSource.d.ts +0 -9
- package/dist/esm/types/types/LogType.d.ts +0 -9
- package/dist/esm/types/types/ParamType.d.ts +0 -17
- package/dist/esm/types/types/ReactKitErrorCode.d.ts +0 -14
- package/src/constants/DAY_IN_MS.ts +0 -7
- package/src/constants/HOUR_IN_MS.ts +0 -7
- package/src/constants/LOG_REVIEW_GET_LOGS_ROUTE.ts +0 -9
- package/src/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.ts +0 -9
- package/src/constants/LOG_REVIEW_STATUS_ROUTE.ts +0 -10
- package/src/constants/LOG_ROUTE_PATH.ts +0 -9
- package/src/constants/MINUTE_IN_MS.ts +0 -7
- package/src/constants/ROUTE_PATH_PREFIX.ts +0 -7
- package/src/constants/SELECT_ADMIN_CHECK_ROUTE.ts +0 -7
- package/src/errors/ErrorWithCode.tsx +0 -15
- package/src/helpers/abbreviate.test.ts +0 -26
- package/src/helpers/abbreviate.ts +0 -25
- package/src/helpers/asyncArrayFunctions/everyAsync.test.ts +0 -114
- package/src/helpers/asyncArrayFunctions/everyAsync.ts +0 -51
- package/src/helpers/asyncArrayFunctions/filterAsync.test.ts +0 -126
- package/src/helpers/asyncArrayFunctions/filterAsync.ts +0 -50
- package/src/helpers/asyncArrayFunctions/forEachAsync.test.ts +0 -136
- package/src/helpers/asyncArrayFunctions/forEachAsync.ts +0 -40
- package/src/helpers/asyncArrayFunctions/mapAsync.test.ts +0 -125
- package/src/helpers/asyncArrayFunctions/mapAsync.ts +0 -46
- package/src/helpers/asyncArrayFunctions/someAsync.test.ts +0 -92
- package/src/helpers/asyncArrayFunctions/someAsync.ts +0 -49
- package/src/helpers/avg.test.ts +0 -24
- package/src/helpers/avg.ts +0 -22
- package/src/helpers/capitalize.ts +0 -20
- package/src/helpers/ceilToNumDecimals.test.ts +0 -39
- package/src/helpers/ceilToNumDecimals.ts +0 -13
- package/src/helpers/cloneDeep.ts +0 -11
- package/src/helpers/compareArraysByProp.test.ts +0 -147
- package/src/helpers/compareArraysByProp.ts +0 -56
- package/src/helpers/extractProp.test.ts +0 -34
- package/src/helpers/extractProp.ts +0 -17
- package/src/helpers/floorToNumDecimals.test.ts +0 -39
- package/src/helpers/floorToNumDecimals.ts +0 -13
- package/src/helpers/forceNumIntoBounds.test.ts +0 -34
- package/src/helpers/forceNumIntoBounds.ts +0 -19
- package/src/helpers/genCSV.test.ts +0 -75
- package/src/helpers/genCSV.ts +0 -87
- package/src/helpers/genCommaList.test.ts +0 -57
- package/src/helpers/genCommaList.ts +0 -21
- package/src/helpers/getHumanReadableDate.test.ts +0 -29
- package/src/helpers/getHumanReadableDate.ts +0 -36
- package/src/helpers/getLocalTimeInfo.test.ts +0 -48
- package/src/helpers/getLocalTimeInfo.ts +0 -58
- package/src/helpers/getMonthName.test.ts +0 -79
- package/src/helpers/getMonthName.ts +0 -29
- package/src/helpers/getOrdinal.test.ts +0 -84
- package/src/helpers/getOrdinal.ts +0 -14
- package/src/helpers/getPartOfDay.test.ts +0 -56
- package/src/helpers/getPartOfDay.ts +0 -20
- package/src/helpers/getTimeInfoInET.test.ts +0 -72
- package/src/helpers/getTimeInfoInET.ts +0 -79
- package/src/helpers/getTimestampFromTimeInfoInET.ts +0 -179
- package/src/helpers/getWordCount.ts +0 -26
- package/src/helpers/idify.ts +0 -24
- package/src/helpers/onlyKeepLetters.ts +0 -11
- package/src/helpers/padDecimalZeros.tsx +0 -32
- package/src/helpers/padZerosLeft.tsx +0 -21
- package/src/helpers/parallelLimit.ts +0 -63
- package/src/helpers/prefixWithAOrAn.ts +0 -29
- package/src/helpers/roundToNumDecimals.tsx +0 -13
- package/src/helpers/shuffleArray.ts +0 -19
- package/src/helpers/startMinWait.ts +0 -33
- package/src/helpers/stringsToHumanReadableList.ts +0 -39
- package/src/helpers/sum.tsx +0 -16
- package/src/helpers/validators/ChicagoTitleCase.test.ts +0 -85
- package/src/helpers/validators/ChicagoTitleCase.ts +0 -32
- package/src/helpers/validators/findURL.test.ts +0 -83
- package/src/helpers/validators/findURL.ts +0 -43
- package/src/helpers/validators/shared/constants/ERROR_MESSAGES.ts +0 -18
- package/src/helpers/validators/shared/helpers/validateRegex.ts +0 -47
- package/src/helpers/validators/shared/types/ValidationResult.ts +0 -20
- package/src/helpers/validators/validURL.test.ts +0 -90
- package/src/helpers/validators/validURL.ts +0 -18
- package/src/helpers/validators/validateEmail.test.ts +0 -110
- package/src/helpers/validators/validateEmail.ts +0 -47
- package/src/helpers/validators/validatePhoneNumber.test.ts +0 -94
- package/src/helpers/validators/validatePhoneNumber.ts +0 -49
- package/src/helpers/validators/validateString.test.ts +0 -173
- package/src/helpers/validators/validateString.ts +0 -171
- package/src/helpers/waitMs.tsx +0 -12
- package/src/types/DayOfWeek.ts +0 -15
- package/src/types/Log/LogMainInfo.ts +0 -69
- package/src/types/Log/LogSourceSpecificInfo.ts +0 -25
- package/src/types/Log/LogTypeSpecificInfo.ts +0 -33
- package/src/types/Log/index.ts +0 -17
- package/src/types/LogAction.ts +0 -52
- package/src/types/LogBuiltInMetadata.ts +0 -19
- package/src/types/LogFunction.ts +0 -46
- package/src/types/LogLevel.ts +0 -11
- package/src/types/LogMetadataContextMap.ts +0 -15
- package/src/types/LogMetadataTagMap.ts +0 -9
- package/src/types/LogMetadataTargetMap.ts +0 -9
- package/src/types/LogMetadataType.ts +0 -16
- package/src/types/LogReviewerFilterState/ActionErrorFilterState.ts +0 -24
- package/src/types/LogReviewerFilterState/AdvancedFilterState.ts +0 -36
- package/src/types/LogReviewerFilterState/ContextFilterState.ts +0 -16
- package/src/types/LogReviewerFilterState/DateFilterState.ts +0 -26
- package/src/types/LogReviewerFilterState/TagFilterState.ts +0 -9
- package/src/types/LogReviewerFilterState/index.ts +0 -24
- package/src/types/LogSource.ts +0 -12
- package/src/types/LogType.ts +0 -12
- package/src/types/ParamType.ts +0 -18
- package/src/types/ReactKitErrorCode.tsx +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dce-reactkit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Shared components for Harvard DCE apps",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/harvard-edtech/dce-reactkit#readme",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"
|
|
27
|
+
"dce-commonkit": "^5.0.0",
|
|
28
28
|
"react-select": "^5.7.3"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"@fortawesome/free-solid-svg-icons": "^x.x.x",
|
|
34
34
|
"@fortawesome/react-fontawesome": "^x.x.x",
|
|
35
35
|
"bootstrap": "^5.x.x",
|
|
36
|
-
"react": "^x.x.x"
|
|
36
|
+
"react": "^x.x.x",
|
|
37
|
+
"react-dom": "^x.x.x"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -10,24 +10,27 @@ import React, { useState } from 'react';
|
|
|
10
10
|
// Import FontAwesome
|
|
11
11
|
import { faHourglassEnd } from '@fortawesome/free-solid-svg-icons';
|
|
12
12
|
|
|
13
|
+
// Import commonkit
|
|
14
|
+
import {
|
|
15
|
+
LogBuiltInMetadata,
|
|
16
|
+
ErrorWithCode,
|
|
17
|
+
waitMs,
|
|
18
|
+
CommonKitErrorCode,
|
|
19
|
+
} from 'dce-commonkit';
|
|
20
|
+
|
|
13
21
|
// Import shared components
|
|
14
22
|
import ErrorBox from './ErrorBox';
|
|
15
23
|
|
|
16
24
|
// Import shared types
|
|
17
|
-
import ReactKitErrorCode from '../types/ReactKitErrorCode';
|
|
18
25
|
import ModalButtonType from '../types/ModalButtonType';
|
|
19
26
|
import ModalType from '../types/ModalType';
|
|
20
27
|
import Variant from '../types/Variant';
|
|
21
|
-
import LogBuiltInMetadata from '../types/LogBuiltInMetadata';
|
|
22
28
|
|
|
23
29
|
// Import shared components
|
|
24
30
|
// TODO: fix dependency cycle
|
|
25
31
|
// eslint-disable-next-line import/no-cycle
|
|
26
32
|
import ModalForWrapper from './Modal';
|
|
27
33
|
|
|
28
|
-
// Import custom errors
|
|
29
|
-
import ErrorWithCode from '../errors/ErrorWithCode';
|
|
30
|
-
|
|
31
34
|
// Import other helpers
|
|
32
35
|
// TODO: fix dependency cycle
|
|
33
36
|
// eslint-disable-next-line import/no-cycle
|
|
@@ -38,7 +41,6 @@ import {
|
|
|
38
41
|
getSessionExpiredMessage,
|
|
39
42
|
isDarkModeOn,
|
|
40
43
|
} from '../helpers/initClient';
|
|
41
|
-
import waitMs from '../helpers/waitMs';
|
|
42
44
|
|
|
43
45
|
// Import constants
|
|
44
46
|
import NUM_MODAL_PORTALS from '../constants/NUM_MODAL_PORTALS';
|
|
@@ -413,8 +415,8 @@ export const showFatalError = async (
|
|
|
413
415
|
);
|
|
414
416
|
const code: string = (
|
|
415
417
|
typeof error === 'string'
|
|
416
|
-
?
|
|
417
|
-
: String(error.code ??
|
|
418
|
+
? CommonKitErrorCode.NoCode
|
|
419
|
+
: String(error.code ?? CommonKitErrorCode.NoCode)
|
|
418
420
|
);
|
|
419
421
|
|
|
420
422
|
// Call all fatal error listeners
|
|
@@ -856,11 +858,11 @@ const AppWrapper: React.FC<Props> = (props: Props): React.ReactElement => {
|
|
|
856
858
|
sessionHasExpired
|
|
857
859
|
? new ErrorWithCode(
|
|
858
860
|
getSessionExpiredMessage(),
|
|
859
|
-
|
|
861
|
+
CommonKitErrorCode.SessionExpired,
|
|
860
862
|
)
|
|
861
863
|
: new ErrorWithCode(
|
|
862
864
|
(fatalErrorMessage ?? 'An unknown error has occurred. Please contact support.'),
|
|
863
|
-
(fatalErrorCode ??
|
|
865
|
+
(fatalErrorCode ?? CommonKitErrorCode.NoCode),
|
|
864
866
|
)
|
|
865
867
|
);
|
|
866
868
|
|
|
@@ -16,12 +16,14 @@ import {
|
|
|
16
16
|
faChevronDown,
|
|
17
17
|
} from '@fortawesome/free-solid-svg-icons';
|
|
18
18
|
|
|
19
|
+
// Import commonkit
|
|
20
|
+
import {
|
|
21
|
+
idify,
|
|
22
|
+
} from 'dce-commonkit';
|
|
23
|
+
|
|
19
24
|
// Import shared types
|
|
20
25
|
import Variant from '../types/Variant';
|
|
21
26
|
|
|
22
|
-
// Import shared helper
|
|
23
|
-
import idify from '../helpers/idify';
|
|
24
|
-
|
|
25
27
|
/*------------------------------------------------------------------------*/
|
|
26
28
|
/* -------------------------------- Types ------------------------------- */
|
|
27
29
|
/*------------------------------------------------------------------------*/
|
|
@@ -10,9 +10,13 @@ import React, { useReducer } from 'react';
|
|
|
10
10
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
11
11
|
import { faClipboard } from '@fortawesome/free-solid-svg-icons';
|
|
12
12
|
|
|
13
|
+
// Import commonkit
|
|
14
|
+
import {
|
|
15
|
+
waitMs,
|
|
16
|
+
} from 'dce-commonkit';
|
|
17
|
+
|
|
13
18
|
// Import other reactkit functions
|
|
14
19
|
import { alert } from './AppWrapper';
|
|
15
|
-
import waitMs from '../helpers/waitMs';
|
|
16
20
|
|
|
17
21
|
/*------------------------------------------------------------------------*/
|
|
18
22
|
/* -------------------------------- Types ------------------------------- */
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* @param [adminsOnly] true if the endpoint is for admins only
|
|
6
6
|
* @returns the endpoint path
|
|
7
7
|
*/
|
|
8
|
-
const generateEndpointPath = (collectionName: string, adminsOnly
|
|
8
|
+
const generateEndpointPath = (collectionName: string, adminsOnly: boolean = true) => {
|
|
9
9
|
// Determine prefix based on whether the endpoint is for admins only
|
|
10
10
|
const userPath = adminsOnly ? 'admin' : 'ttm';
|
|
11
11
|
|
|
12
12
|
// Return the endpoint path
|
|
13
|
-
return `/api/${userPath}/dce-
|
|
13
|
+
return `/api/${userPath}/dce-commonkit/dbeditor/${collectionName}`;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export default generateEndpointPath;
|
|
@@ -11,8 +11,12 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
11
11
|
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
|
|
12
12
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
13
13
|
|
|
14
|
+
// Import commonkit
|
|
15
|
+
import {
|
|
16
|
+
CommonKitErrorCode,
|
|
17
|
+
} from 'dce-commonkit';
|
|
18
|
+
|
|
14
19
|
// Import shared types
|
|
15
|
-
import ReactKitErrorCode from '../types/ReactKitErrorCode';
|
|
16
20
|
import Variant from '../types/Variant';
|
|
17
21
|
|
|
18
22
|
/*------------------------------------------------------------------------*/
|
|
@@ -82,7 +86,7 @@ const ErrorBox: React.FC<Props> = (props) => {
|
|
|
82
86
|
>
|
|
83
87
|
code:
|
|
84
88
|
{' '}
|
|
85
|
-
{String((error as any).code ??
|
|
89
|
+
{String((error as any).code ?? CommonKitErrorCode.NoCode).toUpperCase()}
|
|
86
90
|
</span>
|
|
87
91
|
</span>
|
|
88
92
|
);
|
|
@@ -17,14 +17,16 @@ import {
|
|
|
17
17
|
faMinus,
|
|
18
18
|
} from '@fortawesome/free-solid-svg-icons';
|
|
19
19
|
|
|
20
|
+
// Import commonkit
|
|
21
|
+
import {
|
|
22
|
+
ParamType,
|
|
23
|
+
roundToNumDecimals,
|
|
24
|
+
genCSV,
|
|
25
|
+
} from 'dce-commonkit';
|
|
26
|
+
|
|
20
27
|
// Import shared types
|
|
21
|
-
import ParamType from '../types/ParamType';
|
|
22
28
|
import IntelliTableColumn from '../types/IntelliTableColumn';
|
|
23
29
|
|
|
24
|
-
// Import shared helpers
|
|
25
|
-
import roundToNumDecimals from '../helpers/roundToNumDecimals';
|
|
26
|
-
import genCSV from '../helpers/genCSV';
|
|
27
|
-
|
|
28
30
|
// Import shared components
|
|
29
31
|
import Modal from './Modal';
|
|
30
32
|
import ModalType from '../types/ModalType';
|
|
@@ -19,32 +19,35 @@ import {
|
|
|
19
19
|
faSearch,
|
|
20
20
|
} from '@fortawesome/free-solid-svg-icons';
|
|
21
21
|
|
|
22
|
+
// Import commonkit
|
|
23
|
+
import {
|
|
24
|
+
getTimeInfoInET,
|
|
25
|
+
getHumanReadableDate,
|
|
26
|
+
LOG_REVIEW_GET_LOGS_ROUTE,
|
|
27
|
+
Log,
|
|
28
|
+
LogMetadataType,
|
|
29
|
+
LogSource,
|
|
30
|
+
LogType,
|
|
31
|
+
LogAction,
|
|
32
|
+
ParamType,
|
|
33
|
+
LogBuiltInMetadata,
|
|
34
|
+
LogMetadataContextMap,
|
|
35
|
+
LogMetadataTargetMap,
|
|
36
|
+
cloneDeep,
|
|
37
|
+
LogReviewerFilterState,
|
|
38
|
+
DateFilterState,
|
|
39
|
+
ContextFilterState,
|
|
40
|
+
TagFilterState,
|
|
41
|
+
ActionErrorFilterState,
|
|
42
|
+
AdvancedFilterState,
|
|
43
|
+
} from 'dce-commonkit';
|
|
44
|
+
|
|
22
45
|
// Import shared helpers
|
|
23
46
|
import visitServerEndpoint from '../helpers/visitServerEndpoint';
|
|
24
|
-
import getTimeInfoInET from '../helpers/getTimeInfoInET';
|
|
25
47
|
import { alert, showFatalError } from './AppWrapper';
|
|
26
|
-
import getHumanReadableDate from '../helpers/getHumanReadableDate';
|
|
27
|
-
|
|
28
|
-
// Import shared constants
|
|
29
|
-
import LOG_REVIEW_GET_LOGS_ROUTE from '../constants/LOG_REVIEW_GET_LOGS_ROUTE';
|
|
30
48
|
|
|
31
49
|
// Import shared types
|
|
32
|
-
import Log from '../types/Log';
|
|
33
|
-
import LogMetadataType from '../types/LogMetadataType';
|
|
34
|
-
import LogSource from '../types/LogSource';
|
|
35
|
-
import LogType from '../types/LogType';
|
|
36
|
-
import LogAction from '../types/LogAction';
|
|
37
|
-
import ParamType from '../types/ParamType';
|
|
38
50
|
import IntelliTableColumn from '../types/IntelliTableColumn';
|
|
39
|
-
import LogBuiltInMetadata from '../types/LogBuiltInMetadata';
|
|
40
|
-
import LogMetadataContextMap from '../types/LogMetadataContextMap';
|
|
41
|
-
import LogMetadataTargetMap from '../types/LogMetadataTargetMap';
|
|
42
|
-
import LogReviewerFilterState from '../types/LogReviewerFilterState';
|
|
43
|
-
import DateFilterState from '../types/LogReviewerFilterState/DateFilterState';
|
|
44
|
-
import ContextFilterState from '../types/LogReviewerFilterState/ContextFilterState';
|
|
45
|
-
import TagFilterState from '../types/LogReviewerFilterState/TagFilterState';
|
|
46
|
-
import ActionErrorFilterState from '../types/LogReviewerFilterState/ActionErrorFilterState';
|
|
47
|
-
import AdvancedFilterState from '../types/LogReviewerFilterState/AdvancedFilterState';
|
|
48
51
|
import Variant from '../types/Variant';
|
|
49
52
|
|
|
50
53
|
// Import shared components
|
|
@@ -59,7 +62,6 @@ import RadioButton from './RadioButton';
|
|
|
59
62
|
import ButtonInputGroup from './ButtonInputGroup';
|
|
60
63
|
import IntelliTable from './IntelliTable';
|
|
61
64
|
import Pagination from './Pagination';
|
|
62
|
-
import cloneDeep from '../helpers/cloneDeep';
|
|
63
65
|
|
|
64
66
|
/*------------------------------------------------------------------------*/
|
|
65
67
|
/* -------------------------------- Types ------------------------------- */
|
|
@@ -13,12 +13,14 @@
|
|
|
13
13
|
import React, { useState, useEffect, useRef } from 'react';
|
|
14
14
|
import ReactDOM from 'react-dom';
|
|
15
15
|
|
|
16
|
+
// Import commonkit
|
|
17
|
+
import {
|
|
18
|
+
waitMs,
|
|
19
|
+
} from 'dce-commonkit';
|
|
20
|
+
|
|
16
21
|
// Import other components
|
|
17
22
|
import LoadingSpinner from '../LoadingSpinner';
|
|
18
23
|
|
|
19
|
-
// Import helpers
|
|
20
|
-
import waitMs from '../../helpers/waitMs';
|
|
21
|
-
|
|
22
24
|
// Import types
|
|
23
25
|
import Variant from '../../types/Variant';
|
|
24
26
|
import ModalButtonType from '../../types/ModalButtonType';
|
|
@@ -12,8 +12,12 @@ import React, { useReducer } from 'react';
|
|
|
12
12
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
13
13
|
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
|
14
14
|
|
|
15
|
+
// Import commonkit
|
|
16
|
+
import {
|
|
17
|
+
idify,
|
|
18
|
+
} from 'dce-commonkit';
|
|
19
|
+
|
|
15
20
|
// Import shared helpers
|
|
16
|
-
import idify from '../helpers/idify';
|
|
17
21
|
import combineClassNames from '../helpers/combineClassNames';
|
|
18
22
|
|
|
19
23
|
/*------------------------------------------------------------------------*/
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
// Import React
|
|
9
9
|
import React, { useRef, useEffect } from 'react';
|
|
10
10
|
|
|
11
|
-
// Import
|
|
12
|
-
import
|
|
11
|
+
// Import commonkit
|
|
12
|
+
import {
|
|
13
|
+
waitMs,
|
|
14
|
+
} from 'dce-commonkit';
|
|
13
15
|
|
|
14
16
|
/*------------------------------------------------------------------------*/
|
|
15
17
|
/* -------------------------------- Types ------------------------------- */
|
|
@@ -7,20 +7,18 @@
|
|
|
7
7
|
// Import React
|
|
8
8
|
import React, { useReducer } from 'react';
|
|
9
9
|
|
|
10
|
+
// Import commonkit
|
|
11
|
+
import {
|
|
12
|
+
getOrdinal,
|
|
13
|
+
getMonthName,
|
|
14
|
+
getTimeInfoInET,
|
|
15
|
+
ErrorWithCode,
|
|
16
|
+
CommonKitErrorCode,
|
|
17
|
+
} from 'dce-commonkit';
|
|
18
|
+
|
|
10
19
|
// Import AppWrapper helpers
|
|
11
20
|
import { confirm } from './AppWrapper';
|
|
12
21
|
|
|
13
|
-
// Import helpers
|
|
14
|
-
import getOrdinal from '../helpers/getOrdinal';
|
|
15
|
-
import getMonthName from '../helpers/getMonthName';
|
|
16
|
-
import getTimeInfoInET from '../helpers/getTimeInfoInET';
|
|
17
|
-
|
|
18
|
-
// Import classes
|
|
19
|
-
import ErrorWithCode from '../errors/ErrorWithCode';
|
|
20
|
-
|
|
21
|
-
// Import types
|
|
22
|
-
import ReactKitErrorCode from '../types/ReactKitErrorCode';
|
|
23
|
-
|
|
24
22
|
/*------------------------------------------------------------------------*/
|
|
25
23
|
/* -------------------------------- Types ------------------------------- */
|
|
26
24
|
/*------------------------------------------------------------------------*/
|
|
@@ -153,7 +151,7 @@ const getChoices = (
|
|
|
153
151
|
if (dontAllowPast && dontAllowFuture) {
|
|
154
152
|
throw new ErrorWithCode(
|
|
155
153
|
'No past or future dates allowed',
|
|
156
|
-
|
|
154
|
+
CommonKitErrorCode.SimpleDateChooserInvalidDateRange,
|
|
157
155
|
);
|
|
158
156
|
}
|
|
159
157
|
|
|
@@ -161,7 +159,7 @@ const getChoices = (
|
|
|
161
159
|
if (numMonthsToShow <= 0) {
|
|
162
160
|
throw new ErrorWithCode(
|
|
163
161
|
'numMonthsToShow must be positive',
|
|
164
|
-
|
|
162
|
+
CommonKitErrorCode.SimpleDateChooserInvalidNumMonths,
|
|
165
163
|
);
|
|
166
164
|
}
|
|
167
165
|
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
// Import React
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
// Import
|
|
10
|
-
import
|
|
9
|
+
// Import commonkit
|
|
10
|
+
import {
|
|
11
|
+
padZerosLeft,
|
|
12
|
+
} from 'dce-commonkit';
|
|
11
13
|
|
|
12
14
|
/*------------------------------------------------------------------------*/
|
|
13
15
|
/* -------------------------------- Types ------------------------------- */
|
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
* @author Gabe Abrams
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
// Import commonkit
|
|
7
|
+
import {
|
|
8
|
+
LOG_REVIEW_STATUS_ROUTE,
|
|
9
|
+
} from 'dce-commonkit';
|
|
10
|
+
|
|
6
11
|
// Import dce-reactkit
|
|
7
12
|
import stubServerEndpoint from './stubServerEndpoint';
|
|
8
13
|
|
|
9
14
|
// Import main function
|
|
10
15
|
import canReviewLogs, { resetCanReviewCache } from './canReviewLogs';
|
|
11
16
|
|
|
12
|
-
// Import shared constants
|
|
13
|
-
import LOG_REVIEW_STATUS_ROUTE from '../constants/LOG_REVIEW_STATUS_ROUTE';
|
|
14
|
-
|
|
15
17
|
describe('helpers > canReviewLogs', () => {
|
|
16
18
|
beforeEach(() => {
|
|
17
19
|
// Reset the cache
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
// Import commonkit
|
|
2
|
+
import {
|
|
3
|
+
LOG_REVIEW_STATUS_ROUTE,
|
|
4
|
+
} from 'dce-commonkit';
|
|
5
|
+
|
|
1
6
|
// Import shared helpers
|
|
2
7
|
import visitServerEndpoint from './visitServerEndpoint';
|
|
3
8
|
|
|
4
|
-
// Import shared constants
|
|
5
|
-
import LOG_REVIEW_STATUS_ROUTE from '../constants/LOG_REVIEW_STATUS_ROUTE';
|
|
6
|
-
|
|
7
9
|
/*------------------------------------------------------------------------*/
|
|
8
10
|
/* -------------------------------- Cache ------------------------------- */
|
|
9
11
|
/*------------------------------------------------------------------------*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
// Import commonkit
|
|
2
|
+
import {
|
|
3
|
+
waitMs,
|
|
4
|
+
ErrorWithCode,
|
|
5
|
+
CommonKitErrorCode,
|
|
6
|
+
} from 'dce-commonkit';
|
|
7
|
+
|
|
1
8
|
// Import other components
|
|
2
9
|
// TODO: fix dependency cycle
|
|
3
10
|
// eslint-disable-next-line import/no-cycle
|
|
4
11
|
import { showFatalError } from '../components/AppWrapper';
|
|
5
12
|
|
|
6
|
-
// Import other helpers
|
|
7
|
-
import waitMs from './waitMs';
|
|
8
|
-
|
|
9
|
-
// Import shared types
|
|
10
|
-
import ErrorWithCode from '../errors/ErrorWithCode';
|
|
11
|
-
import ReactKitErrorCode from '../types/ReactKitErrorCode';
|
|
12
|
-
|
|
13
13
|
/*----------------------------------------*/
|
|
14
14
|
/* ---------------- Types --------------- */
|
|
15
15
|
/*----------------------------------------*/
|
|
@@ -80,7 +80,7 @@ export const getSendRequest = async () => {
|
|
|
80
80
|
showFatalError(
|
|
81
81
|
new ErrorWithCode(
|
|
82
82
|
'Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.',
|
|
83
|
-
|
|
83
|
+
CommonKitErrorCode.NoCACCLSendRequestFunction,
|
|
84
84
|
),
|
|
85
85
|
);
|
|
86
86
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// True if user is on mobile or tablet
|
|
2
|
-
let cachedResult: boolean | undefined
|
|
2
|
+
let cachedResult: boolean | undefined;
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Check if the user is on a mobile device or tablet
|
|
@@ -13,6 +13,7 @@ const isMobileOrTablet = () => {
|
|
|
13
13
|
|
|
14
14
|
try {
|
|
15
15
|
let check = false;
|
|
16
|
+
// eslint-disable-next-line max-len, no-useless-escape
|
|
16
17
|
((a) => { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })((navigator ?? {}).userAgent || (navigator ?? {}).vendor || ((window as any) ?? {}).opera);
|
|
17
18
|
cachedResult = check;
|
|
18
19
|
return cachedResult;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
// Import
|
|
2
|
-
import
|
|
1
|
+
// Import commonkit
|
|
2
|
+
import {
|
|
3
|
+
SELECT_ADMIN_CHECK_ROUTE,
|
|
4
|
+
} from 'dce-commonkit';
|
|
3
5
|
|
|
4
6
|
// Import shared helpers
|
|
5
7
|
import visitServerEndpoint from './visitServerEndpoint';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
// Import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
// Import commonkit
|
|
2
|
+
import {
|
|
3
|
+
LOG_ROUTE_PATH,
|
|
4
|
+
LogBuiltInMetadata,
|
|
5
|
+
LogFunction,
|
|
6
|
+
LogLevel,
|
|
7
|
+
} from 'dce-commonkit';
|
|
6
8
|
|
|
7
9
|
// Import shared functions
|
|
8
10
|
// TODO: fix dependency cycle
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
// Import commonkit
|
|
2
|
+
import {
|
|
3
|
+
ErrorWithCode,
|
|
4
|
+
CommonKitErrorCode,
|
|
5
|
+
} from 'dce-commonkit';
|
|
6
|
+
|
|
1
7
|
/* eslint-disable no-underscore-dangle */
|
|
2
8
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
3
|
-
// Import custom error
|
|
4
|
-
import ErrorWithCode from '../errors/ErrorWithCode';
|
|
5
|
-
import ReactKitErrorCode from '../types/ReactKitErrorCode';
|
|
6
9
|
|
|
7
10
|
// Import helpers
|
|
8
11
|
// TODO: fix dependency cycle
|
|
@@ -62,7 +65,7 @@ export const _setStubResponse = (
|
|
|
62
65
|
} = opts;
|
|
63
66
|
const method = (opts.method ?? 'GET').toUpperCase();
|
|
64
67
|
const errorMessage = (opts.errorMessage ?? 'An unknown error has occurred.');
|
|
65
|
-
const errorCode = (opts.errorCode ??
|
|
68
|
+
const errorCode = (opts.errorCode ?? CommonKitErrorCode.NoCode);
|
|
66
69
|
|
|
67
70
|
// Store to stub responses
|
|
68
71
|
if (!stubResponses[method]) {
|
|
@@ -162,12 +165,12 @@ const visitServerEndpoint = async (
|
|
|
162
165
|
if (!response || !response.body) {
|
|
163
166
|
throw new ErrorWithCode(
|
|
164
167
|
'We didn\'t get a response from the server. Please check your internet connection.',
|
|
165
|
-
|
|
168
|
+
CommonKitErrorCode.NoResponse,
|
|
166
169
|
);
|
|
167
170
|
}
|
|
168
171
|
if (!response.body.success) {
|
|
169
172
|
// Session expired
|
|
170
|
-
if (response.body.code ===
|
|
173
|
+
if (response.body.code === CommonKitErrorCode.SessionExpired) {
|
|
171
174
|
showSessionExpiredMessage();
|
|
172
175
|
|
|
173
176
|
// Never return (don't continue execution)
|
|
@@ -184,7 +187,7 @@ const visitServerEndpoint = async (
|
|
|
184
187
|
),
|
|
185
188
|
(
|
|
186
189
|
response.body.code
|
|
187
|
-
||
|
|
190
|
+
|| CommonKitErrorCode.NoCode
|
|
188
191
|
),
|
|
189
192
|
);
|
|
190
193
|
}
|
package/src/html/genErrorPage.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
// Import
|
|
2
|
-
import
|
|
1
|
+
// Import commonkit
|
|
2
|
+
import {
|
|
3
|
+
CommonKitErrorCode,
|
|
4
|
+
} from 'dce-commonkit';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Generate a static error page
|
|
@@ -8,7 +10,7 @@ import ReactKitErrorCode from '../types/ReactKitErrorCode';
|
|
|
8
10
|
* @param [opts.title=An Error Occurred] title of the error box
|
|
9
11
|
* @param [opts.description=An unknown server error occurred. Please contact support.]
|
|
10
12
|
* a human-readable description of the error
|
|
11
|
-
* @param [opts.code=
|
|
13
|
+
* @param [opts.code=CommonKitErrorCode.NoCode] error code to show
|
|
12
14
|
* @param [opts.pageTitle=opts.title] title of the page/tab if it differs from
|
|
13
15
|
* the title of the error
|
|
14
16
|
* @returns html of the page
|
|
@@ -27,7 +29,7 @@ const genErrorPage = (
|
|
|
27
29
|
opts.description
|
|
28
30
|
?? 'An unknown server error occurred. Please contact support.'
|
|
29
31
|
);
|
|
30
|
-
const code = (opts.code ??
|
|
32
|
+
const code = (opts.code ?? CommonKitErrorCode.NoCode);
|
|
31
33
|
|
|
32
34
|
return `
|
|
33
35
|
<head>
|