@itwin/reports-config-widget-react 0.6.0 → 0.7.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.
Files changed (134) hide show
  1. package/CHANGELOG.json +45 -1
  2. package/CHANGELOG.md +23 -2
  3. package/README.md +1 -5
  4. package/api/reports-config-widget-react.api.md +11 -15
  5. package/api/reports-config-widget-react.exports.csv +1 -1
  6. package/api/temp/reports-config-widget-react.api.md +11 -15
  7. package/coverage/clover.xml +187 -190
  8. package/coverage/coverage-final.json +11 -11
  9. package/coverage/lcov-report/index.html +19 -19
  10. package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +2 -2
  11. package/coverage/lcov-report/src/index.html +1 -1
  12. package/coverage/lcov-report/src/test/index.html +1 -1
  13. package/coverage/lcov-report/src/test/test-utils.tsx.html +1 -1
  14. package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +11 -26
  15. package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +1 -1
  16. package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +3 -3
  17. package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +7 -10
  18. package/coverage/lcov-report/src/widget/components/Constants.ts.html +1 -1
  19. package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +1 -1
  20. package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +1 -1
  21. package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +1 -1
  22. package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +1 -1
  23. package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +1 -1
  24. package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +1 -1
  25. package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
  26. package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +1 -1
  27. package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +1 -1
  28. package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +3 -3
  29. package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +1 -1
  30. package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +1 -1
  31. package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +15 -15
  32. package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +1 -1
  33. package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +14 -23
  34. package/coverage/lcov-report/src/widget/components/Reports.tsx.html +6 -6
  35. package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +111 -12
  36. package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +8 -17
  37. package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +1 -1
  38. package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +1 -1
  39. package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +1 -1
  40. package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +1 -1
  41. package/coverage/lcov-report/src/widget/components/index.html +11 -11
  42. package/coverage/lcov-report/src/widget/components/utils.tsx.html +2 -2
  43. package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +1 -1
  44. package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +7 -4
  45. package/coverage/lcov-report/src/widget/context/index.html +1 -1
  46. package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
  47. package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +1 -1
  48. package/coverage/lcov-report/src/widget/index.html +13 -13
  49. package/coverage/lcov.info +336 -340
  50. package/lib/cjs/reports-config-widget-react.d.ts +1 -0
  51. package/lib/cjs/reports-config-widget-react.d.ts.map +1 -1
  52. package/lib/cjs/reports-config-widget-react.js +1 -0
  53. package/lib/cjs/reports-config-widget-react.js.map +1 -1
  54. package/lib/cjs/test/ReportAction.test.js +3 -0
  55. package/lib/cjs/test/ReportAction.test.js.map +1 -1
  56. package/lib/cjs/test/ReportMappings.test.js +4 -1
  57. package/lib/cjs/test/ReportMappings.test.js.map +1 -1
  58. package/lib/cjs/test/Reports.test.js +3 -0
  59. package/lib/cjs/test/Reports.test.js.map +1 -1
  60. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  61. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +3 -4
  62. package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  63. package/lib/cjs/widget/ReportsConfigUiProvider.js +3 -4
  64. package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
  65. package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
  66. package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
  67. package/lib/cjs/widget/components/BulkExtractor.d.ts +2 -2
  68. package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
  69. package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
  70. package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
  71. package/lib/cjs/widget/components/ReportMappings.js +4 -6
  72. package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
  73. package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
  74. package/lib/cjs/widget/components/Reports.js.map +1 -1
  75. package/lib/cjs/widget/components/ReportsConfigContext.d.ts +26 -4
  76. package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
  77. package/lib/cjs/widget/components/ReportsConfigContext.js +14 -4
  78. package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
  79. package/lib/cjs/widget/components/ReportsContainer.d.ts +3 -6
  80. package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
  81. package/lib/cjs/widget/components/ReportsContainer.js +6 -2
  82. package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
  83. package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +3 -3
  84. package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
  85. package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
  86. package/lib/esm/reports-config-widget-react.d.ts +1 -0
  87. package/lib/esm/reports-config-widget-react.d.ts.map +1 -1
  88. package/lib/esm/reports-config-widget-react.js +1 -0
  89. package/lib/esm/reports-config-widget-react.js.map +1 -1
  90. package/lib/esm/test/ReportAction.test.js +3 -0
  91. package/lib/esm/test/ReportAction.test.js.map +1 -1
  92. package/lib/esm/test/ReportMappings.test.js +4 -1
  93. package/lib/esm/test/ReportMappings.test.js.map +1 -1
  94. package/lib/esm/test/Reports.test.js +3 -0
  95. package/lib/esm/test/Reports.test.js.map +1 -1
  96. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  97. package/lib/esm/widget/ReportsConfigUiProvider.d.ts +3 -4
  98. package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
  99. package/lib/esm/widget/ReportsConfigUiProvider.js +3 -4
  100. package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
  101. package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
  102. package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
  103. package/lib/esm/widget/components/BulkExtractor.d.ts +2 -2
  104. package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
  105. package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
  106. package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
  107. package/lib/esm/widget/components/ReportMappings.js +5 -7
  108. package/lib/esm/widget/components/ReportMappings.js.map +1 -1
  109. package/lib/esm/widget/components/Reports.d.ts.map +1 -1
  110. package/lib/esm/widget/components/Reports.js.map +1 -1
  111. package/lib/esm/widget/components/ReportsConfigContext.d.ts +26 -4
  112. package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
  113. package/lib/esm/widget/components/ReportsConfigContext.js +14 -4
  114. package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
  115. package/lib/esm/widget/components/ReportsContainer.d.ts +3 -6
  116. package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
  117. package/lib/esm/widget/components/ReportsContainer.js +6 -2
  118. package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
  119. package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +3 -3
  120. package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
  121. package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
  122. package/package.json +2 -2
  123. package/src/reports-config-widget-react.ts +1 -0
  124. package/src/test/ReportAction.test.tsx +3 -0
  125. package/src/test/ReportMappings.test.tsx +4 -1
  126. package/src/test/Reports.test.tsx +3 -0
  127. package/src/widget/ReportsConfigUiProvider.tsx +3 -8
  128. package/src/widget/components/AddMappingsModal.tsx +2 -2
  129. package/src/widget/components/BulkExtractor.ts +5 -6
  130. package/src/widget/components/ReportMappings.tsx +8 -11
  131. package/src/widget/components/Reports.tsx +2 -2
  132. package/src/widget/components/ReportsConfigContext.tsx +41 -8
  133. package/src/widget/components/ReportsContainer.tsx +5 -8
  134. package/src/widget/context/ReportsConfigApiContext.tsx +3 -2
package/CHANGELOG.json CHANGED
@@ -2,7 +2,51 @@
2
2
  "name": "@itwin/reports-config-widget-react",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 10 Jun 2024 17:40:08 GMT",
5
+ "date": "Thu, 12 Sep 2024 12:18:15 GMT",
6
+ "version": "0.7.1",
7
+ "tag": "@itwin/reports-config-widget-react_v0.7.1",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "Mindaugas.Butkus@bentley.com",
12
+ "package": "@itwin/reports-config-widget-react",
13
+ "commit": "c25f5cbe072325e1e09e0dc04bee0c0471ea4481",
14
+ "comment": "Upgraded insights-client to v0.13.0"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Tue, 11 Jun 2024 15:52:38 GMT",
21
+ "version": "0.7.0",
22
+ "tag": "@itwin/reports-config-widget-react_v0.7.0",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "Guillar1@users.noreply.github.com",
27
+ "package": "@itwin/reports-config-widget-react",
28
+ "commit": "3da5297647e428425165200c5596f7a760925961",
29
+ "comment": "Fixed an issue where custom base URL's were not being used."
30
+ }
31
+ ],
32
+ "minor": [
33
+ {
34
+ "author": "Guillar1@users.noreply.github.com",
35
+ "package": "@itwin/reports-config-widget-react",
36
+ "commit": "3da5297647e428425165200c5596f7a760925961",
37
+ "comment": "UIProvider props has been changed to extend from ReportsConfigContext."
38
+ },
39
+ {
40
+ "author": "Guillar1@users.noreply.github.com",
41
+ "package": "@itwin/reports-config-widget-react",
42
+ "commit": "3da5297647e428425165200c5596f7a760925961",
43
+ "comment": "Changed client prop types to use corresponding interfaces."
44
+ }
45
+ ]
46
+ }
47
+ },
48
+ {
49
+ "date": "Mon, 10 Jun 2024 17:40:38 GMT",
6
50
  "version": "0.6.0",
7
51
  "tag": "@itwin/reports-config-widget-react_v0.6.0",
8
52
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,33 @@
1
1
  # Change Log - @itwin/reports-config-widget-react
2
2
 
3
- This log was last generated on Mon, 10 Jun 2024 17:40:08 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 12 Sep 2024 12:18:15 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.7.1
8
+
9
+ Thu, 12 Sep 2024 12:18:15 GMT
10
+
11
+ ### Patches
12
+
13
+ - Upgraded insights-client to v0.13.0 ([#1041](https://github.com/iTwin/viewer-components-react/pull/1041))
14
+
15
+ ## 0.7.0
16
+
17
+ Tue, 11 Jun 2024 15:52:38 GMT
18
+
19
+ ### Minor changes
20
+
21
+ - UIProvider props has been changed to extend from ReportsConfigContext. ([#897](https://github.com/iTwin/viewer-components-react/pull/897))
22
+ - Changed client prop types to use corresponding interfaces. ([#897](https://github.com/iTwin/viewer-components-react/pull/897))
23
+
24
+ ### Patches
25
+
26
+ - Fixed an issue where custom base URL's were not being used. ([#897](https://github.com/iTwin/viewer-components-react/pull/897))
27
+
7
28
  ## 0.6.0
8
29
 
9
- Mon, 10 Jun 2024 17:40:08 GMT
30
+ Mon, 10 Jun 2024 17:40:38 GMT
10
31
 
11
32
  ### Minor changes
12
33
 
package/README.md CHANGED
@@ -12,11 +12,7 @@ This package provides a viewer 'widget'. Documentation on how to add a widget to
12
12
 
13
13
  ## Permissions and Scopes
14
14
 
15
- The SPA client used by your iTwin viewer must have these additional scopes:
16
-
17
- - `insights:read`
18
- - `insights:modify`
19
- - `projects:read`
15
+ The SPA client used by your iTwin viewer must have the `itwin-platform` scope.
20
16
 
21
17
  In 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/).
22
18
 
@@ -7,14 +7,14 @@
7
7
  /// <reference types="react" />
8
8
 
9
9
  import type { AccessToken } from '@itwin/core-bentley';
10
- import { ExtractionClient } from '@itwin/insights-client';
11
10
  import type { ExtractionRequestDetails } from '@itwin/insights-client';
11
+ import type { IExtractionClient } from '@itwin/insights-client';
12
+ import type { IMappingsClient } from '@itwin/insights-client';
12
13
  import { IModelsClient } from '@itwin/imodels-client-management';
14
+ import type { IReportsClient } from '@itwin/insights-client';
13
15
  import type { Localization } from '@itwin/core-common';
14
- import { MappingsClient } from '@itwin/insights-client';
15
16
  import { default as React_2 } from 'react';
16
17
  import type { Report } from '@itwin/insights-client';
17
- import { ReportsClient } from '@itwin/insights-client';
18
18
  import { StagePanelLocation } from '@itwin/appui-react';
19
19
  import { StagePanelSection } from '@itwin/appui-react';
20
20
  import type { UiItemsProvider } from '@itwin/appui-react';
@@ -22,7 +22,7 @@ import type { Widget } from '@itwin/appui-react';
22
22
 
23
23
  // @public (undocumented)
24
24
  export class BulkExtractor {
25
- constructor(reportsClient: ReportsClient, extractionClient: ExtractionClient, getAccessToken: () => Promise<AccessToken>, successfulExtractionToast: (iModelName: string, odataFeedUrl: string) => void, failedExtractionToast: (iModelName: string) => void);
25
+ constructor(reportsClient: IReportsClient, extractionClient: IExtractionClient, getAccessToken: () => Promise<AccessToken>, successfulExtractionToast: (iModelName: string, odataFeedUrl: string) => void, failedExtractionToast: (iModelName: string) => void);
26
26
  // (undocumented)
27
27
  getIModelState(iModelId: string, iModelName: string, odataFeedUrl: string): Promise<ExtractionStates>;
28
28
  // (undocumented)
@@ -74,29 +74,22 @@ export const ReportsConfigContext: (props: ReportsConfigContextProps) => JSX.Ele
74
74
 
75
75
  // @public
76
76
  export interface ReportsConfigContextProps {
77
- // (undocumented)
78
77
  baseUrl?: string;
79
- // (undocumented)
80
78
  bulkExtractor?: BulkExtractor;
81
79
  // (undocumented)
82
80
  children?: React_2.ReactNode;
83
- // (undocumented)
84
- extractionClient?: ExtractionClient;
85
- // (undocumented)
81
+ extractionClient?: IExtractionClient;
86
82
  getAccessToken?: GetAccessTokenFn;
87
- // (undocumented)
88
83
  iModelsClient?: IModelsClient;
89
84
  // (undocumented)
90
85
  iTwinId: string;
91
- // (undocumented)
92
- mappingsClient?: MappingsClient;
93
- // (undocumented)
94
- reportsClient?: ReportsClient;
86
+ mappingsClient?: IMappingsClient;
87
+ reportsClient?: IReportsClient;
95
88
  }
96
89
 
97
90
  // @public
98
91
  export class ReportsConfigProvider implements UiItemsProvider {
99
- constructor(getAccessToken?: () => Promise<AccessToken>, baseUrl?: string);
92
+ constructor(_props?: ReportsContainerProps | undefined);
100
93
  // (undocumented)
101
94
  readonly id = "ReportsConfigProvider";
102
95
  // (undocumented)
@@ -125,6 +118,9 @@ export interface ReportsProps {
125
118
  onClickReportTitle?: (report: Report) => void;
126
119
  }
127
120
 
121
+
122
+ export * from "@itwin/insights-client";
123
+
128
124
  // (No @packageDocumentation comment for this package)
129
125
 
130
126
  ```
@@ -9,6 +9,6 @@ public;Reports: ({ onClickAddReport, onClickReportModify, onClickReportTitle }:
9
9
  internal;REPORTS_CONFIG_BASE_URL = "https://api.bentley.com"
10
10
  public;ReportsConfigContext: (props: ReportsConfigContextProps) => JSX.Element
11
11
  public;ReportsConfigContextProps
12
- public;ReportsConfigProvider
12
+ public;ReportsConfigProvider
13
13
  public;ReportsConfigWidget
14
14
  public;ReportsProps
@@ -7,14 +7,14 @@
7
7
  /// <reference types="react" />
8
8
 
9
9
  import type { AccessToken } from '@itwin/core-bentley';
10
- import { ExtractionClient } from '@itwin/insights-client';
11
10
  import type { ExtractionRequestDetails } from '@itwin/insights-client';
11
+ import type { IExtractionClient } from '@itwin/insights-client';
12
+ import type { IMappingsClient } from '@itwin/insights-client';
12
13
  import { IModelsClient } from '@itwin/imodels-client-management';
14
+ import type { IReportsClient } from '@itwin/insights-client';
13
15
  import type { Localization } from '@itwin/core-common';
14
- import { MappingsClient } from '@itwin/insights-client';
15
16
  import { default as React_2 } from 'react';
16
17
  import type { Report } from '@itwin/insights-client';
17
- import { ReportsClient } from '@itwin/insights-client';
18
18
  import { StagePanelLocation } from '@itwin/appui-react';
19
19
  import { StagePanelSection } from '@itwin/appui-react';
20
20
  import type { UiItemsProvider } from '@itwin/appui-react';
@@ -22,7 +22,7 @@ import type { Widget } from '@itwin/appui-react';
22
22
 
23
23
  // @public (undocumented)
24
24
  export class BulkExtractor {
25
- constructor(reportsClient: ReportsClient, extractionClient: ExtractionClient, getAccessToken: () => Promise<AccessToken>, successfulExtractionToast: (iModelName: string, odataFeedUrl: string) => void, failedExtractionToast: (iModelName: string) => void);
25
+ constructor(reportsClient: IReportsClient, extractionClient: IExtractionClient, getAccessToken: () => Promise<AccessToken>, successfulExtractionToast: (iModelName: string, odataFeedUrl: string) => void, failedExtractionToast: (iModelName: string) => void);
26
26
  // (undocumented)
27
27
  getIModelState(iModelId: string, iModelName: string, odataFeedUrl: string): Promise<ExtractionStates>;
28
28
  // (undocumented)
@@ -74,29 +74,22 @@ export const ReportsConfigContext: (props: ReportsConfigContextProps) => JSX.Ele
74
74
 
75
75
  // @public
76
76
  export interface ReportsConfigContextProps {
77
- // (undocumented)
78
77
  baseUrl?: string;
79
- // (undocumented)
80
78
  bulkExtractor?: BulkExtractor;
81
79
  // (undocumented)
82
80
  children?: React_2.ReactNode;
83
- // (undocumented)
84
- extractionClient?: ExtractionClient;
85
- // (undocumented)
81
+ extractionClient?: IExtractionClient;
86
82
  getAccessToken?: GetAccessTokenFn;
87
- // (undocumented)
88
83
  iModelsClient?: IModelsClient;
89
84
  // (undocumented)
90
85
  iTwinId: string;
91
- // (undocumented)
92
- mappingsClient?: MappingsClient;
93
- // (undocumented)
94
- reportsClient?: ReportsClient;
86
+ mappingsClient?: IMappingsClient;
87
+ reportsClient?: IReportsClient;
95
88
  }
96
89
 
97
90
  // @public
98
91
  export class ReportsConfigProvider implements UiItemsProvider {
99
- constructor(getAccessToken?: () => Promise<AccessToken>, baseUrl?: string);
92
+ constructor(_props?: ReportsContainerProps | undefined);
100
93
  // (undocumented)
101
94
  readonly id = "ReportsConfigProvider";
102
95
  // (undocumented)
@@ -125,6 +118,9 @@ export interface ReportsProps {
125
118
  onClickReportTitle?: (report: Report) => void;
126
119
  }
127
120
 
121
+
122
+ export * from "@itwin/insights-client";
123
+
128
124
  // (No @packageDocumentation comment for this package)
129
125
 
130
126
  ```