@itwin/reports-config-widget-react 0.0.1
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/.rush/temp/package-deps_rebuild.json +48 -0
- package/.rush/temp/shrinkwrap-deps.json +868 -0
- package/CHANGELOG.json +17 -0
- package/CHANGELOG.md +11 -0
- package/LICENSE.md +9 -0
- package/README.md +38 -0
- package/__mocks__/fileMock.js +5 -0
- package/coverage/clover.xml +612 -0
- package/coverage/coverage-final.json +19 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +191 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +193 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/test/index.html +116 -0
- package/coverage/lcov-report/src/test/test-utils.tsx.html +316 -0
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +286 -0
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +253 -0
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +610 -0
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +385 -0
- package/coverage/lcov-report/src/widget/components/Extraction.tsx.html +1030 -0
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +256 -0
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +262 -0
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +523 -0
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +1135 -0
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +829 -0
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +193 -0
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +271 -0
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +391 -0
- package/coverage/lcov-report/src/widget/components/index.html +296 -0
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +562 -0
- package/coverage/lcov-report/src/widget/context/ReportsApiConfigContext.tsx.html +166 -0
- package/coverage/lcov-report/src/widget/context/index.html +116 -0
- package/coverage/lcov-report/src/widget/hooks/index.html +116 -0
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +295 -0
- package/coverage/lcov-report/src/widget/index.html +116 -0
- package/coverage/lcov.info +1260 -0
- package/jest.config.js +19 -0
- package/lib/cjs/ReportsConfigWidget.d.ts +10 -0
- package/lib/cjs/ReportsConfigWidget.d.ts.map +1 -0
- package/lib/cjs/ReportsConfigWidget.js +24 -0
- package/lib/cjs/ReportsConfigWidget.js.map +1 -0
- package/lib/cjs/reports-config-widget-react.d.ts +4 -0
- package/lib/cjs/reports-config-widget-react.d.ts.map +1 -0
- package/lib/cjs/reports-config-widget-react.js +20 -0
- package/lib/cjs/reports-config-widget-react.js.map +1 -0
- package/lib/cjs/test/ReportAction.test.d.ts +2 -0
- package/lib/cjs/test/ReportAction.test.d.ts.map +1 -0
- package/lib/cjs/test/ReportAction.test.js +194 -0
- package/lib/cjs/test/ReportAction.test.js.map +1 -0
- package/lib/cjs/test/ReportMappings.test.d.ts +2 -0
- package/lib/cjs/test/ReportMappings.test.d.ts.map +1 -0
- package/lib/cjs/test/ReportMappings.test.js +530 -0
- package/lib/cjs/test/ReportMappings.test.js.map +1 -0
- package/lib/cjs/test/Reports.test.d.ts +2 -0
- package/lib/cjs/test/Reports.test.d.ts.map +1 -0
- package/lib/cjs/test/Reports.test.js +232 -0
- package/lib/cjs/test/Reports.test.js.map +1 -0
- package/lib/cjs/test/WidgetHeader.test.d.ts +2 -0
- package/lib/cjs/test/WidgetHeader.test.d.ts.map +1 -0
- package/lib/cjs/test/WidgetHeader.test.js +30 -0
- package/lib/cjs/test/WidgetHeader.test.js.map +1 -0
- package/lib/cjs/test/test-utils.d.ts +69 -0
- package/lib/cjs/test/test-utils.d.ts.map +1 -0
- package/lib/cjs/test/test-utils.js +77 -0
- package/lib/cjs/test/test-utils.js.map +1 -0
- package/lib/cjs/tsconfig.tsbuildinfo +1 -0
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +12 -0
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -0
- package/lib/cjs/widget/ReportsConfigUiProvider.js +55 -0
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -0
- package/lib/cjs/widget/components/ActionPanel.d.ts +13 -0
- package/lib/cjs/widget/components/ActionPanel.d.ts.map +1 -0
- package/lib/cjs/widget/components/ActionPanel.js +39 -0
- package/lib/cjs/widget/components/ActionPanel.js.map +1 -0
- package/lib/cjs/widget/components/ActionPanel.scss +12 -0
- package/lib/cjs/widget/components/AddMappingsModal.d.ts +15 -0
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -0
- package/lib/cjs/widget/components/AddMappingsModal.js +118 -0
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -0
- package/lib/cjs/widget/components/AddMappingsModal.scss +18 -0
- package/lib/cjs/widget/components/DeleteModal.d.ts +12 -0
- package/lib/cjs/widget/components/DeleteModal.d.ts.map +1 -0
- package/lib/cjs/widget/components/DeleteModal.js +65 -0
- package/lib/cjs/widget/components/DeleteModal.js.map +1 -0
- package/lib/cjs/widget/components/DeleteModal.scss +18 -0
- package/lib/cjs/widget/components/Extraction.d.ts +28 -0
- package/lib/cjs/widget/components/Extraction.d.ts.map +1 -0
- package/lib/cjs/widget/components/Extraction.js +193 -0
- package/lib/cjs/widget/components/Extraction.js.map +1 -0
- package/lib/cjs/widget/components/Extraction.scss +39 -0
- package/lib/cjs/widget/components/HorizontalTile.d.ts +13 -0
- package/lib/cjs/widget/components/HorizontalTile.d.ts.map +1 -0
- package/lib/cjs/widget/components/HorizontalTile.js +18 -0
- package/lib/cjs/widget/components/HorizontalTile.js.map +1 -0
- package/lib/cjs/widget/components/HorizontalTile.scss +32 -0
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts +4 -0
- package/lib/cjs/widget/components/LocalizedTablePaginator.d.ts.map +1 -0
- package/lib/cjs/widget/components/LocalizedTablePaginator.js +41 -0
- package/lib/cjs/widget/components/LocalizedTablePaginator.js.map +1 -0
- package/lib/cjs/widget/components/ReportAction.d.ts +11 -0
- package/lib/cjs/widget/components/ReportAction.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportAction.js +101 -0
- package/lib/cjs/widget/components/ReportAction.js.map +1 -0
- package/lib/cjs/widget/components/ReportAction.scss +16 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts +17 -0
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportMappings.js +174 -0
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -0
- package/lib/cjs/widget/components/ReportMappings.scss +46 -0
- package/lib/cjs/widget/components/Reports.d.ts +7 -0
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -0
- package/lib/cjs/widget/components/Reports.js +143 -0
- package/lib/cjs/widget/components/Reports.js.map +1 -0
- package/lib/cjs/widget/components/Reports.scss +36 -0
- package/lib/cjs/widget/components/ReportsContainer.d.ts +10 -0
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -0
- package/lib/cjs/widget/components/ReportsContainer.js +34 -0
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -0
- package/lib/cjs/widget/components/ReportsContainer.scss +15 -0
- package/lib/cjs/widget/components/SearchBar.d.ts +10 -0
- package/lib/cjs/widget/components/SearchBar.d.ts.map +1 -0
- package/lib/cjs/widget/components/SearchBar.js +50 -0
- package/lib/cjs/widget/components/SearchBar.js.map +1 -0
- package/lib/cjs/widget/components/SearchBar.scss +27 -0
- package/lib/cjs/widget/components/SelectIModel.d.ts +9 -0
- package/lib/cjs/widget/components/SelectIModel.d.ts.map +1 -0
- package/lib/cjs/widget/components/SelectIModel.js +82 -0
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -0
- package/lib/cjs/widget/components/SelectIModel.scss +15 -0
- package/lib/cjs/widget/components/utils.d.ts +23 -0
- package/lib/cjs/widget/components/utils.d.ts.map +1 -0
- package/lib/cjs/widget/components/utils.js +87 -0
- package/lib/cjs/widget/components/utils.js.map +1 -0
- package/lib/cjs/widget/components/utils.scss +39 -0
- package/lib/cjs/widget/context/ReportsApiConfigContext.d.ts +9 -0
- package/lib/cjs/widget/context/ReportsApiConfigContext.d.ts.map +1 -0
- package/lib/cjs/widget/context/ReportsApiConfigContext.js +37 -0
- package/lib/cjs/widget/context/ReportsApiConfigContext.js.map +1 -0
- package/lib/cjs/widget/hooks/useValidator.d.ts +8 -0
- package/lib/cjs/widget/hooks/useValidator.d.ts.map +1 -0
- package/lib/cjs/widget/hooks/useValidator.js +56 -0
- package/lib/cjs/widget/hooks/useValidator.js.map +1 -0
- package/lib/esm/ReportsConfigWidget.d.ts +10 -0
- package/lib/esm/ReportsConfigWidget.d.ts.map +1 -0
- package/lib/esm/ReportsConfigWidget.js +20 -0
- package/lib/esm/ReportsConfigWidget.js.map +1 -0
- package/lib/esm/reports-config-widget-react.d.ts +4 -0
- package/lib/esm/reports-config-widget-react.d.ts.map +1 -0
- package/lib/esm/reports-config-widget-react.js +8 -0
- package/lib/esm/reports-config-widget-react.js.map +1 -0
- package/lib/esm/test/ReportAction.test.d.ts +2 -0
- package/lib/esm/test/ReportAction.test.d.ts.map +1 -0
- package/lib/esm/test/ReportAction.test.js +170 -0
- package/lib/esm/test/ReportAction.test.js.map +1 -0
- package/lib/esm/test/ReportMappings.test.d.ts +2 -0
- package/lib/esm/test/ReportMappings.test.d.ts.map +1 -0
- package/lib/esm/test/ReportMappings.test.js +506 -0
- package/lib/esm/test/ReportMappings.test.js.map +1 -0
- package/lib/esm/test/Reports.test.d.ts +2 -0
- package/lib/esm/test/Reports.test.d.ts.map +1 -0
- package/lib/esm/test/Reports.test.js +208 -0
- package/lib/esm/test/Reports.test.js.map +1 -0
- package/lib/esm/test/WidgetHeader.test.d.ts +2 -0
- package/lib/esm/test/WidgetHeader.test.d.ts.map +1 -0
- package/lib/esm/test/WidgetHeader.test.js +25 -0
- package/lib/esm/test/WidgetHeader.test.js.map +1 -0
- package/lib/esm/test/test-utils.d.ts +69 -0
- package/lib/esm/test/test-utils.d.ts.map +1 -0
- package/lib/esm/test/test-utils.js +48 -0
- package/lib/esm/test/test-utils.js.map +1 -0
- package/lib/esm/tsconfig.tsbuildinfo +1 -0
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +12 -0
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -0
- package/lib/esm/widget/ReportsConfigUiProvider.js +29 -0
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -0
- package/lib/esm/widget/components/ActionPanel.d.ts +13 -0
- package/lib/esm/widget/components/ActionPanel.d.ts.map +1 -0
- package/lib/esm/widget/components/ActionPanel.js +18 -0
- package/lib/esm/widget/components/ActionPanel.js.map +1 -0
- package/lib/esm/widget/components/ActionPanel.scss +12 -0
- package/lib/esm/widget/components/AddMappingsModal.d.ts +15 -0
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -0
- package/lib/esm/widget/components/AddMappingsModal.js +94 -0
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -0
- package/lib/esm/widget/components/AddMappingsModal.scss +18 -0
- package/lib/esm/widget/components/DeleteModal.d.ts +12 -0
- package/lib/esm/widget/components/DeleteModal.d.ts.map +1 -0
- package/lib/esm/widget/components/DeleteModal.js +42 -0
- package/lib/esm/widget/components/DeleteModal.js.map +1 -0
- package/lib/esm/widget/components/DeleteModal.scss +18 -0
- package/lib/esm/widget/components/Extraction.d.ts +28 -0
- package/lib/esm/widget/components/Extraction.d.ts.map +1 -0
- package/lib/esm/widget/components/Extraction.js +169 -0
- package/lib/esm/widget/components/Extraction.js.map +1 -0
- package/lib/esm/widget/components/Extraction.scss +39 -0
- package/lib/esm/widget/components/HorizontalTile.d.ts +13 -0
- package/lib/esm/widget/components/HorizontalTile.d.ts.map +1 -0
- package/lib/esm/widget/components/HorizontalTile.js +11 -0
- package/lib/esm/widget/components/HorizontalTile.js.map +1 -0
- package/lib/esm/widget/components/HorizontalTile.scss +32 -0
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts +4 -0
- package/lib/esm/widget/components/LocalizedTablePaginator.d.ts.map +1 -0
- package/lib/esm/widget/components/LocalizedTablePaginator.js +18 -0
- package/lib/esm/widget/components/LocalizedTablePaginator.js.map +1 -0
- package/lib/esm/widget/components/ReportAction.d.ts +11 -0
- package/lib/esm/widget/components/ReportAction.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportAction.js +77 -0
- package/lib/esm/widget/components/ReportAction.js.map +1 -0
- package/lib/esm/widget/components/ReportAction.scss +16 -0
- package/lib/esm/widget/components/ReportMappings.d.ts +17 -0
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportMappings.js +148 -0
- package/lib/esm/widget/components/ReportMappings.js.map +1 -0
- package/lib/esm/widget/components/ReportMappings.scss +46 -0
- package/lib/esm/widget/components/Reports.d.ts +7 -0
- package/lib/esm/widget/components/Reports.d.ts.map +1 -0
- package/lib/esm/widget/components/Reports.js +117 -0
- package/lib/esm/widget/components/Reports.js.map +1 -0
- package/lib/esm/widget/components/Reports.scss +36 -0
- package/lib/esm/widget/components/ReportsContainer.d.ts +10 -0
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -0
- package/lib/esm/widget/components/ReportsContainer.js +13 -0
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -0
- package/lib/esm/widget/components/ReportsContainer.scss +15 -0
- package/lib/esm/widget/components/SearchBar.d.ts +10 -0
- package/lib/esm/widget/components/SearchBar.d.ts.map +1 -0
- package/lib/esm/widget/components/SearchBar.js +27 -0
- package/lib/esm/widget/components/SearchBar.js.map +1 -0
- package/lib/esm/widget/components/SearchBar.scss +27 -0
- package/lib/esm/widget/components/SelectIModel.d.ts +9 -0
- package/lib/esm/widget/components/SelectIModel.d.ts.map +1 -0
- package/lib/esm/widget/components/SelectIModel.js +59 -0
- package/lib/esm/widget/components/SelectIModel.js.map +1 -0
- package/lib/esm/widget/components/SelectIModel.scss +15 -0
- package/lib/esm/widget/components/utils.d.ts +23 -0
- package/lib/esm/widget/components/utils.d.ts.map +1 -0
- package/lib/esm/widget/components/utils.js +73 -0
- package/lib/esm/widget/components/utils.js.map +1 -0
- package/lib/esm/widget/components/utils.scss +39 -0
- package/lib/esm/widget/context/ReportsApiConfigContext.d.ts +9 -0
- package/lib/esm/widget/context/ReportsApiConfigContext.d.ts.map +1 -0
- package/lib/esm/widget/context/ReportsApiConfigContext.js +14 -0
- package/lib/esm/widget/context/ReportsApiConfigContext.js.map +1 -0
- package/lib/esm/widget/hooks/useValidator.d.ts +8 -0
- package/lib/esm/widget/hooks/useValidator.d.ts.map +1 -0
- package/lib/esm/widget/hooks/useValidator.js +50 -0
- package/lib/esm/widget/hooks/useValidator.js.map +1 -0
- package/lib/public/locales/en/ReportsConfigWidget.json +76 -0
- package/package.json +124 -0
- package/public/locales/en/ReportsConfigWidget.json +76 -0
- package/reports-config-widget-react.build.error.log +10 -0
- package/reports-config-widget-react.build.log +45 -0
- package/src/ReportsConfigWidget.ts +36 -0
- package/src/reports-config-widget-react.ts +7 -0
- package/src/test/ReportAction.test.tsx +258 -0
- package/src/test/ReportMappings.test.tsx +882 -0
- package/src/test/Reports.test.tsx +365 -0
- package/src/test/WidgetHeader.test.tsx +29 -0
- package/src/test/test-utils.tsx +77 -0
- package/src/widget/ReportsConfigUiProvider.tsx +67 -0
- package/src/widget/components/ActionPanel.scss +12 -0
- package/src/widget/components/ActionPanel.tsx +56 -0
- package/src/widget/components/AddMappingsModal.scss +18 -0
- package/src/widget/components/AddMappingsModal.tsx +175 -0
- package/src/widget/components/DeleteModal.scss +18 -0
- package/src/widget/components/DeleteModal.tsx +100 -0
- package/src/widget/components/Extraction.scss +39 -0
- package/src/widget/components/Extraction.tsx +315 -0
- package/src/widget/components/HorizontalTile.scss +32 -0
- package/src/widget/components/HorizontalTile.tsx +57 -0
- package/src/widget/components/LocalizedTablePaginator.tsx +59 -0
- package/src/widget/components/ReportAction.scss +16 -0
- package/src/widget/components/ReportAction.tsx +146 -0
- package/src/widget/components/ReportMappings.scss +46 -0
- package/src/widget/components/ReportMappings.tsx +350 -0
- package/src/widget/components/Reports.scss +36 -0
- package/src/widget/components/Reports.tsx +248 -0
- package/src/widget/components/ReportsContainer.scss +15 -0
- package/src/widget/components/ReportsContainer.tsx +36 -0
- package/src/widget/components/SearchBar.scss +27 -0
- package/src/widget/components/SearchBar.tsx +62 -0
- package/src/widget/components/SelectIModel.scss +15 -0
- package/src/widget/components/SelectIModel.tsx +102 -0
- package/src/widget/components/utils.scss +39 -0
- package/src/widget/components/utils.tsx +159 -0
- package/src/widget/context/ReportsApiConfigContext.tsx +27 -0
- package/src/widget/hooks/useValidator.ts +70 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
export const ReportsApiConfigContext = createContext({
|
|
4
|
+
getAccessToken: async () => "",
|
|
5
|
+
baseUrl: "",
|
|
6
|
+
});
|
|
7
|
+
export const useReportsApiConfig = () => {
|
|
8
|
+
const context = React.useContext(ReportsApiConfigContext);
|
|
9
|
+
if (!context) {
|
|
10
|
+
throw new Error("useApiConfig should be used within a ReportsApiConfigContext provider");
|
|
11
|
+
}
|
|
12
|
+
return context;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=ReportsApiConfigContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReportsApiConfigContext.js","sourceRoot":"","sources":["../../../../src/widget/context/ReportsApiConfigContext.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAOtC,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAmB;IACrE,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IAC9B,OAAO,EAAE,EAAE;CACZ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAC1D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport type { AccessToken } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport { createContext } from \"react\";\n\nexport interface ReportsApiConfig {\n getAccessToken: () => Promise<AccessToken>;\n baseUrl: string;\n}\n\nexport const ReportsApiConfigContext = createContext<ReportsApiConfig>({\n getAccessToken: async () => \"\",\n baseUrl: \"\",\n});\n\nexport const useReportsApiConfig = () => {\n const context = React.useContext(ReportsApiConfigContext);\n if (!context) {\n throw new Error(\n \"useApiConfig should be used within a ReportsApiConfigContext provider\"\n );\n }\n return context;\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SimpleReactValidator from "simple-react-validator";
|
|
2
|
+
export declare const NAME_REQUIREMENTS = "required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresSpacesAndDigits|CharLimit";
|
|
3
|
+
declare const useValidator: () => [
|
|
4
|
+
SimpleReactValidator,
|
|
5
|
+
React.Dispatch<React.SetStateAction<boolean>>
|
|
6
|
+
];
|
|
7
|
+
export default useValidator;
|
|
8
|
+
//# sourceMappingURL=useValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidator.d.ts","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAKA,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAG1D,eAAO,MAAM,iBAAiB,0HAC2F,CAAC;AAE1H,QAAA,MAAM,YAAY,QAAO;IACvB,oBAAoB;IACpB,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;CAsD9C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import SimpleReactValidator from "simple-react-validator";
|
|
7
|
+
import { ReportsConfigWidget } from "../../ReportsConfigWidget";
|
|
8
|
+
export const NAME_REQUIREMENTS = "required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresSpacesAndDigits|CharLimit";
|
|
9
|
+
const useValidator = () => {
|
|
10
|
+
const [show, setShow] = useState(false);
|
|
11
|
+
const customValidator = {
|
|
12
|
+
NoDuplicateUnderscore: {
|
|
13
|
+
message: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Validators.NoDuplicateUnderscore"),
|
|
14
|
+
rule: (val) => {
|
|
15
|
+
return !val.match(/__+/i);
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
OnlyBeginsWithLetterOrUnderscore: {
|
|
19
|
+
message: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Validators.OnlyBeginsWithLetterOrUnderscore"),
|
|
20
|
+
rule: (val) => {
|
|
21
|
+
return !val.match(/^[\W\d]+/i);
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
FollowedByLettersUnderscoresSpacesAndDigits: {
|
|
25
|
+
message: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Validators.FollowedByLettersUnderscoresSpacesAndDigits"),
|
|
26
|
+
rule: (val) => {
|
|
27
|
+
return !val.match(/[^a-zA-Z0-9_\s]+/i);
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
CharLimit: {
|
|
31
|
+
message: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Validators.CharLimit"),
|
|
32
|
+
rule: (val) => {
|
|
33
|
+
return val.length <= 128;
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
const customMessages = {
|
|
38
|
+
required: ReportsConfigWidget.localization.getLocalizedString("ReportsConfigWidget:Validators.ThisFieldIsRequired"),
|
|
39
|
+
};
|
|
40
|
+
const validator = new SimpleReactValidator({
|
|
41
|
+
messages: customMessages,
|
|
42
|
+
validators: customValidator,
|
|
43
|
+
});
|
|
44
|
+
if (show) {
|
|
45
|
+
validator.showMessages();
|
|
46
|
+
}
|
|
47
|
+
return [validator, setShow];
|
|
48
|
+
};
|
|
49
|
+
export default useValidator;
|
|
50
|
+
//# sourceMappingURL=useValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidator.js","sourceRoot":"","sources":["../../../../src/widget/hooks/useValidator.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAC5B,uHAAuH,CAAC;AAE1H,MAAM,YAAY,GAAG,GAGnB,EAAE;IACF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,eAAe,GAAG;QACtB,qBAAqB,EAAE;YACrB,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC1D,sDAAsD,CACvD;YACD,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC5B,CAAC;SACF;QACD,gCAAgC,EAAE;YAChC,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC1D,iEAAiE,CAClE;YACD,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACjC,CAAC;SACF;QACD,2CAA2C,EAAE;YAC3C,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC1D,4EAA4E,CAC7E;YACD,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACzC,CAAC;SACF;QACD,SAAS,EAAE;YACT,OAAO,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC1D,0CAA0C,CAC3C;YACD,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;gBACpB,OAAO,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC;YAC3B,CAAC;SACF;KACF,CAAC;IAEF,MAAM,cAAc,GAAG;QACrB,QAAQ,EAAE,mBAAmB,CAAC,YAAY,CAAC,kBAAkB,CAC3D,oDAAoD,CACrD;KACF,CAAC;IAEF,MAAM,SAAS,GAAG,IAAI,oBAAoB,CAAC;QACzC,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,eAAe;KAC5B,CAAC,CAAC;IAEH,IAAI,IAAI,EAAE;QACR,SAAS,CAAC,YAAY,EAAE,CAAC;KAC1B;IAED,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { useState } from \"react\";\nimport SimpleReactValidator from \"simple-react-validator\";\nimport { ReportsConfigWidget } from \"../../ReportsConfigWidget\";\n\nexport const NAME_REQUIREMENTS =\n \"required|NoDuplicateUnderscore|OnlyBeginsWithLetterOrUnderscore|FollowedByLettersUnderscoresSpacesAndDigits|CharLimit\";\n\nconst useValidator = (): [\n SimpleReactValidator,\n React.Dispatch<React.SetStateAction<boolean>>\n] => {\n const [show, setShow] = useState(false);\n const customValidator = {\n NoDuplicateUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.NoDuplicateUnderscore\"\n ),\n rule: (val: string) => {\n return !val.match(/__+/i);\n },\n },\n OnlyBeginsWithLetterOrUnderscore: {\n message: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.OnlyBeginsWithLetterOrUnderscore\"\n ),\n rule: (val: string) => {\n return !val.match(/^[\\W\\d]+/i);\n },\n },\n FollowedByLettersUnderscoresSpacesAndDigits: {\n message: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.FollowedByLettersUnderscoresSpacesAndDigits\"\n ),\n rule: (val: string) => {\n return !val.match(/[^a-zA-Z0-9_\\s]+/i);\n },\n },\n CharLimit: {\n message: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.CharLimit\"\n ),\n rule: (val: string) => {\n return val.length <= 128;\n },\n },\n };\n\n const customMessages = {\n required: ReportsConfigWidget.localization.getLocalizedString(\n \"ReportsConfigWidget:Validators.ThisFieldIsRequired\"\n ),\n };\n\n const validator = new SimpleReactValidator({\n messages: customMessages,\n validators: customValidator,\n });\n\n if (show) {\n validator.showMessages();\n }\n\n return [validator, setShow];\n};\n\nexport default useValidator;\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Add": "Add",
|
|
3
|
+
"AddMapping": "Add Mapping",
|
|
4
|
+
"AddMappings": "Add Mappings",
|
|
5
|
+
"AddReport": "Add Report",
|
|
6
|
+
"AreYouSureYouWantToDelete": "Are you sure you want to delete",
|
|
7
|
+
"Cancel": "Cancel",
|
|
8
|
+
"Checking": "Checking",
|
|
9
|
+
"Confirm": "Confirm",
|
|
10
|
+
"CopiedToClipboard": "Copied to clipboard!",
|
|
11
|
+
"Copy": "Copy",
|
|
12
|
+
"CopyJobId": "Copy Job Id",
|
|
13
|
+
"CreateOneReportCTA": "Let's create one!",
|
|
14
|
+
"Delete": "Delete",
|
|
15
|
+
"Description": "Description",
|
|
16
|
+
"ErrorMessages": {
|
|
17
|
+
"401": "You are unauthorized to do this operation.",
|
|
18
|
+
"403": "You don't have permission to access the requested resource.",
|
|
19
|
+
"404": "The requested resource was not found.",
|
|
20
|
+
"409": "This property name is already being used.",
|
|
21
|
+
"422": "Unable to process the request.",
|
|
22
|
+
"429": "Too many requests.",
|
|
23
|
+
"500": "Internal server error.",
|
|
24
|
+
"502": "Bad gateway.",
|
|
25
|
+
"503": "Service unavailable.",
|
|
26
|
+
"SomethingWentWrong": "Something went wrong!",
|
|
27
|
+
"Error": "Error!"
|
|
28
|
+
},
|
|
29
|
+
"Extraction": "Extraction",
|
|
30
|
+
"Failed": "Failed",
|
|
31
|
+
"ITwinReports": "iTwin Reports",
|
|
32
|
+
"LetsAddSomeMappingsCTA": "Let's add some!",
|
|
33
|
+
"Loading": "Loading",
|
|
34
|
+
"MandatoryFields": "Asterisk * indicates mandatory fields.",
|
|
35
|
+
"MappingName": "Mapping Name",
|
|
36
|
+
"Modify": "Modify",
|
|
37
|
+
"ModifyReport": "Modify Report",
|
|
38
|
+
"Name": "Name",
|
|
39
|
+
"New": "New",
|
|
40
|
+
"NoMappingsAvailable": "No Mappings available.",
|
|
41
|
+
"NoReportMappings": "No mappings linked to this report.",
|
|
42
|
+
"NoReports": "No reports exist.",
|
|
43
|
+
"NoReportsAvailable": "No Reports available.",
|
|
44
|
+
"NotStarted": "Not Started",
|
|
45
|
+
"ODataFeedURL": "OData Feed URL",
|
|
46
|
+
"PleaseWait": "Please wait...",
|
|
47
|
+
"Queued": "Queued",
|
|
48
|
+
"Remove": "Remove",
|
|
49
|
+
"ReportDetails": "Report Details",
|
|
50
|
+
"ReportName": "Report Name",
|
|
51
|
+
"ReportsConfig": "Reports Config",
|
|
52
|
+
"RunExtraction": "Run Extraction",
|
|
53
|
+
"Running": "Running",
|
|
54
|
+
"Search": "Search...",
|
|
55
|
+
"SelectIModel": "Select an iModel",
|
|
56
|
+
"Starting": "Starting",
|
|
57
|
+
"Success": "Success",
|
|
58
|
+
"Table": {
|
|
59
|
+
"SizePerPage": "{{size}} per page",
|
|
60
|
+
"StartIndexEndIndex": "{{startIndex}}-{{endIndex}}...",
|
|
61
|
+
"StartIndexEndIndexOf": "{{startIndex}}-{{endIndex}} of {{totalRows}}",
|
|
62
|
+
"PreviousPage": "Previous page",
|
|
63
|
+
"NextPage": "Next page",
|
|
64
|
+
"GoToPage": "Go to page {{page}}",
|
|
65
|
+
"RowsPerPage": "Rows per page"
|
|
66
|
+
},
|
|
67
|
+
"UpdateDataset": "Update your dataset",
|
|
68
|
+
"UpdateInProgress": "Update in progress...",
|
|
69
|
+
"Validators": {
|
|
70
|
+
"NoDuplicateUnderscore": "Remove duplicate \"_\"",
|
|
71
|
+
"OnlyBeginsWithLetterOrUnderscore": "Name can only start with a letter or underscore.",
|
|
72
|
+
"FollowedByLettersUnderscoresSpacesAndDigits": "Name can only contain letters, underscores, spaces, or digits",
|
|
73
|
+
"CharLimit": "There is an 128 character limit.",
|
|
74
|
+
"ThisFieldIsRequired": "This field is required"
|
|
75
|
+
}
|
|
76
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@itwin/reports-config-widget-react",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "An iTwin.js 3D Viewer Widget that interfaces with the iTwin Reporting Platform.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Bentley",
|
|
7
|
+
"BIM",
|
|
8
|
+
"iModel",
|
|
9
|
+
"iTwin",
|
|
10
|
+
"Reporting",
|
|
11
|
+
"Reports"
|
|
12
|
+
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/imodeljs/viewer-components-react/tree/master/packages/itwin/reports-config-widget-react"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "Bentley Systems, Inc.",
|
|
20
|
+
"url": "http://www.bentley.com"
|
|
21
|
+
},
|
|
22
|
+
"main": "lib/cjs/reports-config-widget-react.js",
|
|
23
|
+
"module": "lib/esm/reports-config-widget-react.js",
|
|
24
|
+
"typings": "lib/cjs/reports-config-widget-react",
|
|
25
|
+
"eslintConfig": {
|
|
26
|
+
"plugins": [
|
|
27
|
+
"@itwin"
|
|
28
|
+
],
|
|
29
|
+
"extends": "plugin:@itwin/ui",
|
|
30
|
+
"rules": {
|
|
31
|
+
"no-duplicate-imports": "off",
|
|
32
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
33
|
+
"deprecation/deprecation": "off"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@itwin/imodels-access-frontend": "^1.0.1",
|
|
38
|
+
"@itwin/imodels-client-management": "^1.0.1",
|
|
39
|
+
"@itwin/insights-client": "^0.2.0",
|
|
40
|
+
"@itwin/itwinui-icons-color-react": "^1.0.1",
|
|
41
|
+
"@itwin/itwinui-icons-react": "^1.7.0",
|
|
42
|
+
"@itwin/itwinui-react": "~1.37.3",
|
|
43
|
+
"simple-react-validator": "^1.6.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@faker-js/faker": "6.2.0",
|
|
47
|
+
"@itwin/appui-abstract": "^3.0.0",
|
|
48
|
+
"@itwin/appui-layout-react": "^3.0.0",
|
|
49
|
+
"@itwin/appui-react": "^3.0.0",
|
|
50
|
+
"@itwin/build-tools": "^3.0.0",
|
|
51
|
+
"@itwin/components-react": "^3.0.0",
|
|
52
|
+
"@itwin/core-bentley": "^3.0.0",
|
|
53
|
+
"@itwin/core-common": "^3.0.0",
|
|
54
|
+
"@itwin/core-frontend": "^3.0.0",
|
|
55
|
+
"@itwin/core-geometry": "^3.0.0",
|
|
56
|
+
"@itwin/core-markup": "^3.0.0",
|
|
57
|
+
"@itwin/core-orbitgt": "^3.0.0",
|
|
58
|
+
"@itwin/core-quantity": "^3.0.0",
|
|
59
|
+
"@itwin/core-react": "^3.0.0",
|
|
60
|
+
"@itwin/eslint-plugin": "^3.0.0",
|
|
61
|
+
"@itwin/imodel-components-react": "^3.0.0",
|
|
62
|
+
"@itwin/itwinui-css": "^0.50.0",
|
|
63
|
+
"@itwin/presentation-common": "^3.0.0",
|
|
64
|
+
"@itwin/presentation-frontend": "^3.0.0",
|
|
65
|
+
"@itwin/webgl-compatibility": "^3.0.0",
|
|
66
|
+
"@testing-library/dom": "^8.12.0",
|
|
67
|
+
"@testing-library/jest-dom": "^5.16.3",
|
|
68
|
+
"@testing-library/react": "^12.1.4",
|
|
69
|
+
"@testing-library/user-event": "^14.1.1",
|
|
70
|
+
"@types/i18next": "^8.4.2",
|
|
71
|
+
"@types/jest": "^27.4.1",
|
|
72
|
+
"@types/node": "^14.14.20",
|
|
73
|
+
"@types/react": "^17.0.19",
|
|
74
|
+
"@types/react-dom": "^17.0.9",
|
|
75
|
+
"@types/react-table": "^7.7.0",
|
|
76
|
+
"@types/testing-library__jest-dom": "^5.14.3",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^5.3.1",
|
|
78
|
+
"@typescript-eslint/parser": "^5.10.1",
|
|
79
|
+
"cpx2": "^3.0.0",
|
|
80
|
+
"eslint": "^7.32.0",
|
|
81
|
+
"eslint-plugin-node": "^11.1.0",
|
|
82
|
+
"eslint-plugin-react": "^7.25.1",
|
|
83
|
+
"eslint-plugin-react-hooks": "^4.2.0",
|
|
84
|
+
"jest": "^27.5.1",
|
|
85
|
+
"jest-cli": "^27.5.1",
|
|
86
|
+
"jest-transform-stub": "^2.0.0",
|
|
87
|
+
"msw": "^0.39.2",
|
|
88
|
+
"react": "^17.0.2",
|
|
89
|
+
"react-dom": "^17.0.2",
|
|
90
|
+
"redux": "^4.0.4",
|
|
91
|
+
"rimraf": "^3.0.2",
|
|
92
|
+
"ts-jest": "^27.1.3",
|
|
93
|
+
"typemoq": "^2.1.0",
|
|
94
|
+
"typescript": "~4.3.0"
|
|
95
|
+
},
|
|
96
|
+
"peerDependencies": {
|
|
97
|
+
"@itwin/appui-abstract": "^3.0.0",
|
|
98
|
+
"@itwin/appui-react": "^3.0.0",
|
|
99
|
+
"@itwin/core-bentley": "^3.0.0",
|
|
100
|
+
"@itwin/core-frontend": "^3.0.0",
|
|
101
|
+
"react": "^17.0.2",
|
|
102
|
+
"react-dom": "^17.0.2",
|
|
103
|
+
"react-redux": "^7.2.0"
|
|
104
|
+
},
|
|
105
|
+
"scripts": {
|
|
106
|
+
"build": "npm run -s dual-build && npm run -s copy:assets",
|
|
107
|
+
"build:cjs": "tsc 1>&2 --outDir lib/cjs",
|
|
108
|
+
"build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm",
|
|
109
|
+
"clean": "rimraf lib",
|
|
110
|
+
"copy:assets": "npm run -s copy:public && npm run -s copy:cjs && npm run -s copy:esm",
|
|
111
|
+
"copy:cjs": "cpx \"./src/**/*.scss\" ./lib/cjs",
|
|
112
|
+
"copy:esm": "cpx \"./src/**/*.scss\" ./lib/esm",
|
|
113
|
+
"copy:public": "cpx \"./public/**/*\" ./lib/public",
|
|
114
|
+
"cover": "npm test -- --coverage",
|
|
115
|
+
"dual-build": "npm run -s build:cjs && npm run -s build:esm",
|
|
116
|
+
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
117
|
+
"lint:fix": "npm run lint -- --fix",
|
|
118
|
+
"pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./public/locales/en-PSEUDO",
|
|
119
|
+
"rebuild": "npm run clean && npm run build",
|
|
120
|
+
"test": "jest",
|
|
121
|
+
"test:watch": "jest --watch "
|
|
122
|
+
},
|
|
123
|
+
"readme": "# @itwin/reports-config-widget-react\r\n\r\nCopyright © Bentley Systems, Incorporated. All rights reserved.\r\nThe Reports Config widget is a UI component for iTwin Viewer applications that simplifies how users (and developers) interface with the [Reporting Platform APIs](https://developer.bentley.com/apis/insights/overview/).\r\nThe reports-config-widget package provides a UiProvider class - `ReportsConfigProvider` - which can be passed into the `uiProviders` prop of the iTwin Viewer's `<Viewer />` component.\r\n\r\n## Getting Started\r\n\r\nThis is not a standalone UI and requires a parent iTwin Viewer application to work as intended.\r\nA guide on how to create a basic iTwin Viewer application can be found here: <https://www.itwinjs.org/learning/tutorials/develop-web-viewer/>.\r\nThis package provides a viewer 'widget'. Documentation on how to add a widget to your application can be found here: <https://developer.bentley.com/tutorials/itwin-viewer-hello-world/#2-your-first-ui-widget>.\r\n\r\n## Permissions and Scopes\r\n\r\nThe SPA client used by your iTwin viewer must have these additional scopes:\r\n\r\n- `insights:read`\r\n- `insights:modify`\r\n- `projects:read`\r\n\r\nIn addition, users must have the `imodels_read` and `imodels_write` [permissions](https://developer.bentley.com/apis/insights/operations/create-mapping/#authorization) assigned at either the Project or iModel level. Further instruction on how to create roles and assign permissions can be found in the [iTwin Platform Projects API documentation](https://developer.bentley.com/apis/projects/tutorials/).\r\n\r\n## Sample usage\r\n\r\n### Call ReportsConfigWidget.initialize() **_before_** making use of the provider\r\n\r\n```ts\r\nimport { ReportsConfigWidget } from '@itwin/reports-config-widget-react'\r\n\r\n...\r\n\r\nawait ReportsConfigWidget.initialize(IModelApp.localization);\r\n\r\n<Viewer\r\n ...\r\n uiProviders={[new ReportsConfigProvider()]}\r\n/>\r\n```\r\n"
|
|
124
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Add": "Add",
|
|
3
|
+
"AddMapping": "Add Mapping",
|
|
4
|
+
"AddMappings": "Add Mappings",
|
|
5
|
+
"AddReport": "Add Report",
|
|
6
|
+
"AreYouSureYouWantToDelete": "Are you sure you want to delete",
|
|
7
|
+
"Cancel": "Cancel",
|
|
8
|
+
"Checking": "Checking",
|
|
9
|
+
"Confirm": "Confirm",
|
|
10
|
+
"CopiedToClipboard": "Copied to clipboard!",
|
|
11
|
+
"Copy": "Copy",
|
|
12
|
+
"CopyJobId": "Copy Job Id",
|
|
13
|
+
"CreateOneReportCTA": "Let's create one!",
|
|
14
|
+
"Delete": "Delete",
|
|
15
|
+
"Description": "Description",
|
|
16
|
+
"ErrorMessages": {
|
|
17
|
+
"401": "You are unauthorized to do this operation.",
|
|
18
|
+
"403": "You don't have permission to access the requested resource.",
|
|
19
|
+
"404": "The requested resource was not found.",
|
|
20
|
+
"409": "This property name is already being used.",
|
|
21
|
+
"422": "Unable to process the request.",
|
|
22
|
+
"429": "Too many requests.",
|
|
23
|
+
"500": "Internal server error.",
|
|
24
|
+
"502": "Bad gateway.",
|
|
25
|
+
"503": "Service unavailable.",
|
|
26
|
+
"SomethingWentWrong": "Something went wrong!",
|
|
27
|
+
"Error": "Error!"
|
|
28
|
+
},
|
|
29
|
+
"Extraction": "Extraction",
|
|
30
|
+
"Failed": "Failed",
|
|
31
|
+
"ITwinReports": "iTwin Reports",
|
|
32
|
+
"LetsAddSomeMappingsCTA": "Let's add some!",
|
|
33
|
+
"Loading": "Loading",
|
|
34
|
+
"MandatoryFields": "Asterisk * indicates mandatory fields.",
|
|
35
|
+
"MappingName": "Mapping Name",
|
|
36
|
+
"Modify": "Modify",
|
|
37
|
+
"ModifyReport": "Modify Report",
|
|
38
|
+
"Name": "Name",
|
|
39
|
+
"New": "New",
|
|
40
|
+
"NoMappingsAvailable": "No Mappings available.",
|
|
41
|
+
"NoReportMappings": "No mappings linked to this report.",
|
|
42
|
+
"NoReports": "No reports exist.",
|
|
43
|
+
"NoReportsAvailable": "No Reports available.",
|
|
44
|
+
"NotStarted": "Not Started",
|
|
45
|
+
"ODataFeedURL": "OData Feed URL",
|
|
46
|
+
"PleaseWait": "Please wait...",
|
|
47
|
+
"Queued": "Queued",
|
|
48
|
+
"Remove": "Remove",
|
|
49
|
+
"ReportDetails": "Report Details",
|
|
50
|
+
"ReportName": "Report Name",
|
|
51
|
+
"ReportsConfig": "Reports Config",
|
|
52
|
+
"RunExtraction": "Run Extraction",
|
|
53
|
+
"Running": "Running",
|
|
54
|
+
"Search": "Search...",
|
|
55
|
+
"SelectIModel": "Select an iModel",
|
|
56
|
+
"Starting": "Starting",
|
|
57
|
+
"Success": "Success",
|
|
58
|
+
"Table": {
|
|
59
|
+
"SizePerPage": "{{size}} per page",
|
|
60
|
+
"StartIndexEndIndex": "{{startIndex}}-{{endIndex}}...",
|
|
61
|
+
"StartIndexEndIndexOf": "{{startIndex}}-{{endIndex}} of {{totalRows}}",
|
|
62
|
+
"PreviousPage": "Previous page",
|
|
63
|
+
"NextPage": "Next page",
|
|
64
|
+
"GoToPage": "Go to page {{page}}",
|
|
65
|
+
"RowsPerPage": "Rows per page"
|
|
66
|
+
},
|
|
67
|
+
"UpdateDataset": "Update your dataset",
|
|
68
|
+
"UpdateInProgress": "Update in progress...",
|
|
69
|
+
"Validators": {
|
|
70
|
+
"NoDuplicateUnderscore": "Remove duplicate \"_\"",
|
|
71
|
+
"OnlyBeginsWithLetterOrUnderscore": "Name can only start with a letter or underscore.",
|
|
72
|
+
"FollowedByLettersUnderscoresSpacesAndDigits": "Name can only contain letters, underscores, spaces, or digits",
|
|
73
|
+
"CharLimit": "There is an 128 character limit.",
|
|
74
|
+
"ThisFieldIsRequired": "This field is required"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
PASS src/test/ReportMappings.test.tsx (35.105 s)
|
|
2
|
+
PASS src/test/Reports.test.tsx (8.612 s)
|
|
3
|
+
PASS src/test/ReportAction.test.tsx (5.139 s)
|
|
4
|
+
PASS src/test/WidgetHeader.test.tsx
|
|
5
|
+
|
|
6
|
+
Test Suites: 4 passed, 4 total
|
|
7
|
+
Tests: 22 passed, 22 total
|
|
8
|
+
Snapshots: 0 total
|
|
9
|
+
Time: 52.605 s
|
|
10
|
+
Ran all test suites.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Invoking: npm test -- --coverage
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
> @itwin/reports-config-widget-react@0.0.0 test /home/vsts/work/1/s/packages/itwin/reports-config-widget
|
|
5
|
+
> jest "--coverage"
|
|
6
|
+
|
|
7
|
+
PASS src/test/ReportMappings.test.tsx (35.105 s)
|
|
8
|
+
PASS src/test/Reports.test.tsx (8.612 s)
|
|
9
|
+
PASS src/test/ReportAction.test.tsx (5.139 s)
|
|
10
|
+
PASS src/test/WidgetHeader.test.tsx
|
|
11
|
+
------------------------------|---------|----------|---------|---------|-------------------------------
|
|
12
|
+
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
13
|
+
------------------------------|---------|----------|---------|---------|-------------------------------
|
|
14
|
+
All files | 87.72 | 70.3 | 86.32 | 87.64 |
|
|
15
|
+
src | 100 | 75 | 100 | 100 |
|
|
16
|
+
ReportsConfigWidget.ts | 100 | 75 | 100 | 100 | 21
|
|
17
|
+
src/test | 100 | 66.66 | 100 | 100 |
|
|
18
|
+
test-utils.tsx | 100 | 66.66 | 100 | 100 | 56
|
|
19
|
+
src/widget | 40 | 0 | 0 | 40 |
|
|
20
|
+
ReportsConfigUiProvider.tsx | 40 | 0 | 0 | 40 | 23-65
|
|
21
|
+
src/widget/components | 88.11 | 71.51 | 87.62 | 88.12 |
|
|
22
|
+
ActionPanel.tsx | 100 | 77.77 | 100 | 100 | 25-26
|
|
23
|
+
AddMappingsModal.tsx | 91.66 | 80 | 88.88 | 93.47 | 40,120,134
|
|
24
|
+
DeleteModal.tsx | 85 | 100 | 50 | 84.21 | 42,56-87
|
|
25
|
+
Extraction.tsx | 85.41 | 72.13 | 85.71 | 85.71 | 51-53,138,200-203,226-229,295
|
|
26
|
+
HorizontalTile.tsx | 100 | 100 | 100 | 100 |
|
|
27
|
+
LocalizedTablePaginator.tsx | 100 | 50 | 100 | 100 | 25
|
|
28
|
+
ReportAction.tsx | 94.28 | 81.48 | 100 | 94.28 | 59-60
|
|
29
|
+
ReportMappings.tsx | 96.29 | 74.41 | 94.44 | 96.25 | 97,119,268
|
|
30
|
+
Reports.tsx | 97.14 | 78.68 | 100 | 98.52 | 65
|
|
31
|
+
ReportsContainer.tsx | 77.77 | 0 | 0 | 77.77 | 21-26
|
|
32
|
+
SearchBar.tsx | 70.58 | 71.42 | 60 | 68.75 | 31-45
|
|
33
|
+
SelectIModel.tsx | 97.05 | 81.81 | 85.71 | 96.87 | 92
|
|
34
|
+
utils.tsx | 56.86 | 23.07 | 87.5 | 48.83 | 46-100
|
|
35
|
+
src/widget/context | 80 | 0 | 50 | 77.77 |
|
|
36
|
+
ReportsApiConfigContext.tsx | 80 | 0 | 50 | 77.77 | 15,22
|
|
37
|
+
src/widget/hooks | 100 | 100 | 100 | 100 |
|
|
38
|
+
useValidator.ts | 100 | 100 | 100 | 100 |
|
|
39
|
+
------------------------------|---------|----------|---------|---------|-------------------------------
|
|
40
|
+
|
|
41
|
+
Test Suites: 4 passed, 4 total
|
|
42
|
+
Tests: 22 passed, 22 total
|
|
43
|
+
Snapshots: 0 total
|
|
44
|
+
Time: 52.605 s
|
|
45
|
+
Ran all test suites.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import type { Localization } from "@itwin/core-common";
|
|
6
|
+
import { IModelApp } from "@itwin/core-frontend";
|
|
7
|
+
|
|
8
|
+
export class ReportsConfigWidget {
|
|
9
|
+
private static _localizationNamespace: string;
|
|
10
|
+
private static _localization: Localization;
|
|
11
|
+
|
|
12
|
+
public static get localizationNamespace(): string {
|
|
13
|
+
return ReportsConfigWidget._localizationNamespace;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public static get localization(): Localization {
|
|
17
|
+
return ReportsConfigWidget._localization;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public static async initialize(localization?: Localization): Promise<void> {
|
|
21
|
+
ReportsConfigWidget._localization = localization ?? IModelApp.localization;
|
|
22
|
+
// Setup localization
|
|
23
|
+
const ReportsConfigWidgetNamespace = "ReportsConfigWidget";
|
|
24
|
+
await ReportsConfigWidget._localization.registerNamespace(
|
|
25
|
+
ReportsConfigWidgetNamespace
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
ReportsConfigWidget._localizationNamespace = ReportsConfigWidgetNamespace;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public static terminate() {
|
|
32
|
+
ReportsConfigWidget._localization.unregisterNamespace(
|
|
33
|
+
ReportsConfigWidget.localizationNamespace
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** UI Provider for iTwin Viewer Applications */
|
|
6
|
+
export * from "./widget/ReportsConfigUiProvider";
|
|
7
|
+
export * from "./ReportsConfigWidget";
|