@itwin/reports-config-widget-react 0.6.0 → 0.7.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/CHANGELOG.json +30 -1
- package/CHANGELOG.md +15 -2
- package/api/reports-config-widget-react.api.md +11 -15
- package/api/reports-config-widget-react.exports.csv +1 -1
- package/api/temp/reports-config-widget-react.api.md +11 -15
- package/coverage/clover.xml +133 -134
- package/coverage/coverage-final.json +9 -9
- package/coverage/lcov-report/index.html +14 -14
- package/coverage/lcov-report/src/ReportsConfigWidget.ts.html +2 -2
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/test/index.html +1 -1
- package/coverage/lcov-report/src/test/test-utils.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/ReportsConfigUiProvider.tsx.html +11 -26
- package/coverage/lcov-report/src/widget/components/ActionPanel.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/AddMappingsModal.tsx.html +3 -3
- package/coverage/lcov-report/src/widget/components/BulkExtractor.ts.html +7 -10
- package/coverage/lcov-report/src/widget/components/Constants.ts.html +1 -1
- package/coverage/lcov-report/src/widget/components/DeleteModal.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/FailedExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/QueuedExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/RunningExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/StartingExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/SucceededExtractionState.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStates/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionStatus.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ExtractionToast.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/HorizontalTile.tsx.html +3 -3
- package/coverage/lcov-report/src/widget/components/LocalizedTablePaginator.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ReportAction.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ReportHorizontalTile.tsx.html +15 -15
- package/coverage/lcov-report/src/widget/components/ReportMappingHorizontalTile.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ReportMappings.tsx.html +4 -4
- package/coverage/lcov-report/src/widget/components/Reports.tsx.html +6 -6
- package/coverage/lcov-report/src/widget/components/ReportsConfigContext.tsx.html +112 -13
- package/coverage/lcov-report/src/widget/components/ReportsContainer.tsx.html +8 -17
- package/coverage/lcov-report/src/widget/components/ReportsHeader.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/ReportsRouter.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/SearchBar.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/SelectIModel.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/components/index.html +1 -1
- package/coverage/lcov-report/src/widget/components/utils.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/context/BulkExtractorContext.tsx.html +1 -1
- package/coverage/lcov-report/src/widget/context/ReportsConfigApiContext.tsx.html +7 -4
- package/coverage/lcov-report/src/widget/context/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/index.html +1 -1
- package/coverage/lcov-report/src/widget/hooks/useValidator.ts.html +1 -1
- package/coverage/lcov-report/src/widget/index.html +13 -13
- package/coverage/lcov.info +240 -242
- package/lib/cjs/reports-config-widget-react.d.ts +1 -0
- package/lib/cjs/reports-config-widget-react.d.ts.map +1 -1
- package/lib/cjs/reports-config-widget-react.js +1 -0
- package/lib/cjs/reports-config-widget-react.js.map +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts +3 -4
- package/lib/cjs/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/cjs/widget/ReportsConfigUiProvider.js +3 -4
- package/lib/cjs/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/cjs/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.d.ts +2 -2
- package/lib/cjs/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/cjs/widget/components/BulkExtractor.js.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportMappings.js.map +1 -1
- package/lib/cjs/widget/components/Reports.d.ts.map +1 -1
- package/lib/cjs/widget/components/Reports.js.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts +26 -4
- package/lib/cjs/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsConfigContext.js +15 -5
- package/lib/cjs/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.d.ts +3 -6
- package/lib/cjs/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/cjs/widget/components/ReportsContainer.js +6 -2
- package/lib/cjs/widget/components/ReportsContainer.js.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts +3 -3
- package/lib/cjs/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/cjs/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/lib/esm/reports-config-widget-react.d.ts +1 -0
- package/lib/esm/reports-config-widget-react.d.ts.map +1 -1
- package/lib/esm/reports-config-widget-react.js +1 -0
- package/lib/esm/reports-config-widget-react.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts +3 -4
- package/lib/esm/widget/ReportsConfigUiProvider.d.ts.map +1 -1
- package/lib/esm/widget/ReportsConfigUiProvider.js +3 -4
- package/lib/esm/widget/ReportsConfigUiProvider.js.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.d.ts.map +1 -1
- package/lib/esm/widget/components/AddMappingsModal.js.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.d.ts +2 -2
- package/lib/esm/widget/components/BulkExtractor.d.ts.map +1 -1
- package/lib/esm/widget/components/BulkExtractor.js.map +1 -1
- package/lib/esm/widget/components/ReportMappings.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportMappings.js.map +1 -1
- package/lib/esm/widget/components/Reports.d.ts.map +1 -1
- package/lib/esm/widget/components/Reports.js.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.d.ts +26 -4
- package/lib/esm/widget/components/ReportsConfigContext.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsConfigContext.js +15 -5
- package/lib/esm/widget/components/ReportsConfigContext.js.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.d.ts +3 -6
- package/lib/esm/widget/components/ReportsContainer.d.ts.map +1 -1
- package/lib/esm/widget/components/ReportsContainer.js +6 -2
- package/lib/esm/widget/components/ReportsContainer.js.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts +3 -3
- package/lib/esm/widget/context/ReportsConfigApiContext.d.ts.map +1 -1
- package/lib/esm/widget/context/ReportsConfigApiContext.js.map +1 -1
- package/package.json +1 -1
- package/src/reports-config-widget-react.ts +1 -0
- package/src/widget/ReportsConfigUiProvider.tsx +3 -8
- package/src/widget/components/AddMappingsModal.tsx +2 -2
- package/src/widget/components/BulkExtractor.ts +5 -6
- package/src/widget/components/ReportMappings.tsx +3 -3
- package/src/widget/components/Reports.tsx +2 -2
- package/src/widget/components/ReportsConfigContext.tsx +42 -9
- package/src/widget/components/ReportsContainer.tsx +5 -8
- package/src/widget/context/ReportsConfigApiContext.tsx +3 -2
|
@@ -307,7 +307,7 @@
|
|
|
307
307
|
<span class="cline-any cline-neutral"> </span>
|
|
308
308
|
<span class="cline-any cline-neutral"> </span>
|
|
309
309
|
<span class="cline-any cline-yes">75x</span>
|
|
310
|
-
<span class="cline-any cline-yes">
|
|
310
|
+
<span class="cline-any cline-yes">196x</span>
|
|
311
311
|
<span class="cline-any cline-neutral"> </span>
|
|
312
312
|
<span class="cline-any cline-neutral"> </span>
|
|
313
313
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -372,7 +372,7 @@
|
|
|
372
372
|
<span class="cline-any cline-neutral"> </span>
|
|
373
373
|
<span class="cline-any cline-neutral"> </span>
|
|
374
374
|
<span class="cline-any cline-neutral"> </span>
|
|
375
|
-
<span class="cline-any cline-yes">
|
|
375
|
+
<span class="cline-any cline-yes">216x</span>
|
|
376
376
|
<span class="cline-any cline-neutral"> </span>
|
|
377
377
|
<span class="cline-any cline-neutral"> </span>
|
|
378
378
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -383,7 +383,7 @@
|
|
|
383
383
|
<span class="cline-any cline-neutral"> </span>
|
|
384
384
|
<span class="cline-any cline-neutral"> </span>
|
|
385
385
|
<span class="cline-any cline-neutral"> </span>
|
|
386
|
-
<span class="cline-any cline-yes">
|
|
386
|
+
<span class="cline-any cline-yes">28x</span>
|
|
387
387
|
<span class="cline-any cline-neutral"> </span>
|
|
388
388
|
<span class="cline-any cline-neutral"> </span>
|
|
389
389
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -412,7 +412,7 @@ import type { CreateTypeFromInterface } from "./utils";
|
|
|
412
412
|
import { EmptyMessage, handleError, LoadingOverlay } from "./utils";
|
|
413
413
|
import "./Reports.scss";
|
|
414
414
|
import DeleteModal from "./DeleteModal";
|
|
415
|
-
import type {
|
|
415
|
+
import type { IReportsClient, Report } from "@itwin/insights-client";
|
|
416
416
|
import { ReportHorizontalTile } from "./ReportHorizontalTile";
|
|
417
417
|
import { SearchBar } from "./SearchBar";
|
|
418
418
|
import { useReportsConfigApi } from "../context/ReportsConfigApiContext";
|
|
@@ -427,7 +427,7 @@ const fetchReports = async (
|
|
|
427
427
|
setReports: (reports: Report[]) => void,
|
|
428
428
|
iTwinId: string | undefined,
|
|
429
429
|
setIsLoading: (isLoading: boolean) => void,
|
|
430
|
-
reportsClient:
|
|
430
|
+
reportsClient: IReportsClient,
|
|
431
431
|
getAccessToken: () => Promise<AccessToken>,
|
|
432
432
|
) => {
|
|
433
433
|
try {
|
|
@@ -577,7 +577,7 @@ export const Reports = ({ onClickAddReport, onClickReportModify, onClickReportTi
|
|
|
577
577
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
578
578
|
Code coverage generated by
|
|
579
579
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
580
|
-
at 2024-06-
|
|
580
|
+
at 2024-06-11T15:49:29.425Z
|
|
581
581
|
</div>
|
|
582
582
|
<script src="../../../prettify.js"></script>
|
|
583
583
|
<script>
|
|
@@ -164,13 +164,47 @@
|
|
|
164
164
|
<a name='L99'></a><a href='#L99'>99</a>
|
|
165
165
|
<a name='L100'></a><a href='#L100'>100</a>
|
|
166
166
|
<a name='L101'></a><a href='#L101'>101</a>
|
|
167
|
-
<a name='L102'></a><a href='#L102'>102</a
|
|
167
|
+
<a name='L102'></a><a href='#L102'>102</a>
|
|
168
|
+
<a name='L103'></a><a href='#L103'>103</a>
|
|
169
|
+
<a name='L104'></a><a href='#L104'>104</a>
|
|
170
|
+
<a name='L105'></a><a href='#L105'>105</a>
|
|
171
|
+
<a name='L106'></a><a href='#L106'>106</a>
|
|
172
|
+
<a name='L107'></a><a href='#L107'>107</a>
|
|
173
|
+
<a name='L108'></a><a href='#L108'>108</a>
|
|
174
|
+
<a name='L109'></a><a href='#L109'>109</a>
|
|
175
|
+
<a name='L110'></a><a href='#L110'>110</a>
|
|
176
|
+
<a name='L111'></a><a href='#L111'>111</a>
|
|
177
|
+
<a name='L112'></a><a href='#L112'>112</a>
|
|
178
|
+
<a name='L113'></a><a href='#L113'>113</a>
|
|
179
|
+
<a name='L114'></a><a href='#L114'>114</a>
|
|
180
|
+
<a name='L115'></a><a href='#L115'>115</a>
|
|
181
|
+
<a name='L116'></a><a href='#L116'>116</a>
|
|
182
|
+
<a name='L117'></a><a href='#L117'>117</a>
|
|
183
|
+
<a name='L118'></a><a href='#L118'>118</a>
|
|
184
|
+
<a name='L119'></a><a href='#L119'>119</a>
|
|
185
|
+
<a name='L120'></a><a href='#L120'>120</a>
|
|
186
|
+
<a name='L121'></a><a href='#L121'>121</a>
|
|
187
|
+
<a name='L122'></a><a href='#L122'>122</a>
|
|
188
|
+
<a name='L123'></a><a href='#L123'>123</a>
|
|
189
|
+
<a name='L124'></a><a href='#L124'>124</a>
|
|
190
|
+
<a name='L125'></a><a href='#L125'>125</a>
|
|
191
|
+
<a name='L126'></a><a href='#L126'>126</a>
|
|
192
|
+
<a name='L127'></a><a href='#L127'>127</a>
|
|
193
|
+
<a name='L128'></a><a href='#L128'>128</a>
|
|
194
|
+
<a name='L129'></a><a href='#L129'>129</a>
|
|
195
|
+
<a name='L130'></a><a href='#L130'>130</a>
|
|
196
|
+
<a name='L131'></a><a href='#L131'>131</a>
|
|
197
|
+
<a name='L132'></a><a href='#L132'>132</a>
|
|
198
|
+
<a name='L133'></a><a href='#L133'>133</a>
|
|
199
|
+
<a name='L134'></a><a href='#L134'>134</a>
|
|
200
|
+
<a name='L135'></a><a href='#L135'>135</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
168
201
|
<span class="cline-any cline-neutral"> </span>
|
|
169
202
|
<span class="cline-any cline-neutral"> </span>
|
|
170
203
|
<span class="cline-any cline-neutral"> </span>
|
|
171
204
|
<span class="cline-any cline-yes">7x</span>
|
|
172
205
|
<span class="cline-any cline-neutral"> </span>
|
|
173
206
|
<span class="cline-any cline-yes">7x</span>
|
|
207
|
+
<span class="cline-any cline-neutral"> </span>
|
|
174
208
|
<span class="cline-any cline-yes">7x</span>
|
|
175
209
|
<span class="cline-any cline-yes">7x</span>
|
|
176
210
|
<span class="cline-any cline-yes">7x</span>
|
|
@@ -199,6 +233,28 @@
|
|
|
199
233
|
<span class="cline-any cline-neutral"> </span>
|
|
200
234
|
<span class="cline-any cline-neutral"> </span>
|
|
201
235
|
<span class="cline-any cline-neutral"> </span>
|
|
236
|
+
<span class="cline-any cline-neutral"> </span>
|
|
237
|
+
<span class="cline-any cline-neutral"> </span>
|
|
238
|
+
<span class="cline-any cline-neutral"> </span>
|
|
239
|
+
<span class="cline-any cline-neutral"> </span>
|
|
240
|
+
<span class="cline-any cline-neutral"> </span>
|
|
241
|
+
<span class="cline-any cline-neutral"> </span>
|
|
242
|
+
<span class="cline-any cline-neutral"> </span>
|
|
243
|
+
<span class="cline-any cline-neutral"> </span>
|
|
244
|
+
<span class="cline-any cline-neutral"> </span>
|
|
245
|
+
<span class="cline-any cline-neutral"> </span>
|
|
246
|
+
<span class="cline-any cline-neutral"> </span>
|
|
247
|
+
<span class="cline-any cline-neutral"> </span>
|
|
248
|
+
<span class="cline-any cline-neutral"> </span>
|
|
249
|
+
<span class="cline-any cline-neutral"> </span>
|
|
250
|
+
<span class="cline-any cline-neutral"> </span>
|
|
251
|
+
<span class="cline-any cline-neutral"> </span>
|
|
252
|
+
<span class="cline-any cline-neutral"> </span>
|
|
253
|
+
<span class="cline-any cline-neutral"> </span>
|
|
254
|
+
<span class="cline-any cline-neutral"> </span>
|
|
255
|
+
<span class="cline-any cline-neutral"> </span>
|
|
256
|
+
<span class="cline-any cline-neutral"> </span>
|
|
257
|
+
<span class="cline-any cline-neutral"> </span>
|
|
202
258
|
<span class="cline-any cline-yes">7x</span>
|
|
203
259
|
<span class="cline-any cline-neutral"> </span>
|
|
204
260
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -206,8 +262,8 @@
|
|
|
206
262
|
<span class="cline-any cline-neutral"> </span>
|
|
207
263
|
<span class="cline-any cline-neutral"> </span>
|
|
208
264
|
<span class="cline-any cline-yes">7x</span>
|
|
209
|
-
<span class="cline-any cline-yes">
|
|
210
|
-
<span class="cline-any cline-yes">
|
|
265
|
+
<span class="cline-any cline-yes">158x</span>
|
|
266
|
+
<span class="cline-any cline-yes">98x</span>
|
|
211
267
|
<span class="cline-any cline-yes">58x</span>
|
|
212
268
|
<span class="cline-any cline-yes">29x</span>
|
|
213
269
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -259,6 +315,16 @@
|
|
|
259
315
|
<span class="cline-any cline-neutral"> </span>
|
|
260
316
|
<span class="cline-any cline-neutral"> </span>
|
|
261
317
|
<span class="cline-any cline-neutral"> </span>
|
|
318
|
+
<span class="cline-any cline-neutral"> </span>
|
|
319
|
+
<span class="cline-any cline-neutral"> </span>
|
|
320
|
+
<span class="cline-any cline-neutral"> </span>
|
|
321
|
+
<span class="cline-any cline-neutral"> </span>
|
|
322
|
+
<span class="cline-any cline-neutral"> </span>
|
|
323
|
+
<span class="cline-any cline-neutral"> </span>
|
|
324
|
+
<span class="cline-any cline-neutral"> </span>
|
|
325
|
+
<span class="cline-any cline-neutral"> </span>
|
|
326
|
+
<span class="cline-any cline-neutral"> </span>
|
|
327
|
+
<span class="cline-any cline-neutral"> </span>
|
|
262
328
|
<span class="cline-any cline-yes">58x</span>
|
|
263
329
|
<span class="cline-any cline-neutral"> </span>
|
|
264
330
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -272,6 +338,7 @@
|
|
|
272
338
|
import { IModelApp } from "@itwin/core-frontend";
|
|
273
339
|
import type { IModelsClientOptions } from "@itwin/imodels-client-management";
|
|
274
340
|
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
341
|
+
import type { IExtractionClient, IMappingsClient, IReportsClient } from "@itwin/insights-client";
|
|
275
342
|
import { ExtractionClient, GROUPING_AND_MAPPING_BASE_PATH, MappingsClient, REPORTING_BASE_PATH, ReportsClient } from "@itwin/insights-client";
|
|
276
343
|
import { toaster } from "@itwin/itwinui-react";
|
|
277
344
|
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
@@ -289,13 +356,35 @@ import { generateUrl } from "./utils";
|
|
|
289
356
|
* @public
|
|
290
357
|
*/
|
|
291
358
|
export interface ReportsConfigContextProps {
|
|
359
|
+
/**
|
|
360
|
+
* A callback function that returns an access token for authenticating API requests.
|
|
361
|
+
* If not specified, it defaults to the authorizationClient of the IModelApp.
|
|
362
|
+
*/
|
|
292
363
|
getAccessToken?: GetAccessTokenFn;
|
|
364
|
+
/**
|
|
365
|
+
* The base URL for the API requests. Defaults to https://api.bentley.com.
|
|
366
|
+
*/
|
|
293
367
|
baseUrl?: string;
|
|
294
368
|
iTwinId: string;
|
|
369
|
+
/**
|
|
370
|
+
* The bulk extractor instance to use for extracting data. Internal use only.
|
|
371
|
+
*/
|
|
295
372
|
bulkExtractor?: BulkExtractor;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
373
|
+
/**
|
|
374
|
+
* A custom implementation of ReportsClient. If provided, baseUrl is ignored.
|
|
375
|
+
*/
|
|
376
|
+
reportsClient?: IReportsClient;
|
|
377
|
+
/**
|
|
378
|
+
* A custom implementation of MappingsClient. If provided, baseUrl is ignored.
|
|
379
|
+
*/
|
|
380
|
+
mappingsClient?: IMappingsClient;
|
|
381
|
+
/**
|
|
382
|
+
* A custom implementation of ExtractionClient. If provided, baseUrl is ignored.
|
|
383
|
+
*/
|
|
384
|
+
extractionClient?: IExtractionClient;
|
|
385
|
+
/**
|
|
386
|
+
* A custom implementation of IModelsClient. If provided, baseUrl is ignored.
|
|
387
|
+
*/
|
|
299
388
|
iModelsClient?: IModelsClient;
|
|
300
389
|
children?: React.ReactNode;
|
|
301
390
|
}
|
|
@@ -315,22 +404,22 @@ export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
|
|
|
315
404
|
}),
|
|
316
405
|
[props.baseUrl],
|
|
317
406
|
);
|
|
318
|
-
const [extractionClient, setExtractionClient] = useState<
|
|
407
|
+
const [extractionClient, setExtractionClient] = useState<IExtractionClient>(props.extractionClient ?? new ExtractionClient(reportsBaseUrl()));
|
|
319
408
|
|
|
320
409
|
const [apiConfig, setApiConfig] = useState<ReportsConfigApiProps>({
|
|
321
410
|
getAccessToken: props.getAccessToken ?? <span class="branch-1 cbranch-no" title="branch not covered" >authorizationClientGetAccessToken,</span>
|
|
322
411
|
baseUrl: reportsBaseUrl(),
|
|
323
412
|
iTwinId: props.iTwinId,
|
|
324
413
|
reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),
|
|
325
|
-
mappingsClient: props.mappingsClient ?? new MappingsClient(groupingMappingBaseUrl()),
|
|
414
|
+
mappingsClient: props.mappingsClient ?? new MappingsClient(undefined, groupingMappingBaseUrl()),
|
|
326
415
|
iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),
|
|
327
416
|
});
|
|
328
417
|
|
|
329
418
|
useEffect(() => {
|
|
330
419
|
if (!props.extractionClient) {
|
|
331
|
-
setExtractionClient(props.extractionClient ?? new ExtractionClient(
|
|
420
|
+
setExtractionClient(props.extractionClient ?? new ExtractionClient(undefined, groupingMappingBaseUrl()));
|
|
332
421
|
}
|
|
333
|
-
}, [props.extractionClient
|
|
422
|
+
}, [groupingMappingBaseUrl, props.extractionClient]);
|
|
334
423
|
|
|
335
424
|
const successfulExtractionToast = <span class="fstat-no" title="function not covered" >(i</span>ModelName: string, odataFeedUrl: string) => {
|
|
336
425
|
<span class="cstat-no" title="statement not covered" > toaster.positive(<SuccessfulExtractionToast iModelName={iModelName} odataFeedUrl={odataFeedUrl} />);</span>
|
|
@@ -355,10 +444,20 @@ export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
|
|
|
355
444
|
baseUrl: props.baseUrl || REPORTS_CONFIG_BASE_URL,
|
|
356
445
|
iTwinId: props.iTwinId,
|
|
357
446
|
reportsClient: props.reportsClient ?? new ReportsClient(reportsBaseUrl()),
|
|
358
|
-
mappingsClient: props.mappingsClient ?? new MappingsClient(
|
|
447
|
+
mappingsClient: props.mappingsClient ?? new MappingsClient(undefined, groupingMappingBaseUrl()),
|
|
359
448
|
iModelsClient: props.iModelsClient ?? new IModelsClient(iModelClientOptions),
|
|
360
449
|
}));
|
|
361
|
-
}, [
|
|
450
|
+
}, [
|
|
451
|
+
props.getAccessToken,
|
|
452
|
+
props.baseUrl,
|
|
453
|
+
props.iTwinId,
|
|
454
|
+
props.reportsClient,
|
|
455
|
+
props.mappingsClient,
|
|
456
|
+
props.iModelsClient,
|
|
457
|
+
reportsBaseUrl,
|
|
458
|
+
iModelClientOptions,
|
|
459
|
+
groupingMappingBaseUrl,
|
|
460
|
+
]);
|
|
362
461
|
|
|
363
462
|
return (
|
|
364
463
|
<ReportsConfigApiContext.Provider value={apiConfig}>
|
|
@@ -373,7 +472,7 @@ export const ReportsConfigContext = (props: ReportsConfigContextProps) => {
|
|
|
373
472
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
374
473
|
Code coverage generated by
|
|
375
474
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
376
|
-
at 2024-06-
|
|
475
|
+
at 2024-06-11T15:49:29.425Z
|
|
377
476
|
</div>
|
|
378
477
|
<script src="../../../prettify.js"></script>
|
|
379
478
|
<script>
|
|
@@ -119,11 +119,7 @@
|
|
|
119
119
|
<a name='L54'></a><a href='#L54'>54</a>
|
|
120
120
|
<a name='L55'></a><a href='#L55'>55</a>
|
|
121
121
|
<a name='L56'></a><a href='#L56'>56</a>
|
|
122
|
-
<a name='L57'></a><a href='#L57'>57</a>
|
|
123
|
-
<a name='L58'></a><a href='#L58'>58</a>
|
|
124
|
-
<a name='L59'></a><a href='#L59'>59</a>
|
|
125
|
-
<a name='L60'></a><a href='#L60'>60</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
126
|
-
<span class="cline-any cline-neutral"> </span>
|
|
122
|
+
<a name='L57'></a><a href='#L57'>57</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
127
123
|
<span class="cline-any cline-neutral"> </span>
|
|
128
124
|
<span class="cline-any cline-neutral"> </span>
|
|
129
125
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -133,10 +129,8 @@
|
|
|
133
129
|
<span class="cline-any cline-yes">7x</span>
|
|
134
130
|
<span class="cline-any cline-yes">7x</span>
|
|
135
131
|
<span class="cline-any cline-yes">7x</span>
|
|
136
|
-
<span class="cline-any cline-yes">7x</span>
|
|
137
|
-
<span class="cline-any cline-neutral"> </span>
|
|
138
|
-
<span class="cline-any cline-neutral"> </span>
|
|
139
132
|
<span class="cline-any cline-neutral"> </span>
|
|
133
|
+
<span class="cline-any cline-yes">7x</span>
|
|
140
134
|
<span class="cline-any cline-neutral"> </span>
|
|
141
135
|
<span class="cline-any cline-neutral"> </span>
|
|
142
136
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -185,19 +179,16 @@
|
|
|
185
179
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
186
180
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
187
181
|
*--------------------------------------------------------------------------------------------*/
|
|
188
|
-
import type { AccessToken } from "@itwin/core-bentley";
|
|
189
182
|
import React, { useCallback, useState } from "react";
|
|
190
183
|
import "./ReportsContainer.scss";
|
|
191
184
|
import type { Report } from "@itwin/insights-client";
|
|
192
185
|
import { useActiveIModelConnection } from "@itwin/appui-react";
|
|
193
186
|
import { ReportsHeader } from "./ReportsHeader";
|
|
194
187
|
import { ReportsRouter } from "./ReportsRouter";
|
|
195
|
-
import {
|
|
188
|
+
import type { ReportsConfigContextProps } from "./ReportsConfigContext";
|
|
189
|
+
import { ReportsConfigContext } from "./ReportsConfigContext"
|
|
196
190
|
|
|
197
|
-
|
|
198
|
-
getAccessToken?: () => Promise<AccessToken>;
|
|
199
|
-
baseUrl: string;
|
|
200
|
-
}
|
|
191
|
+
export type ReportsContainerProps = Omit<ReportsConfigContextProps, "iTwinId" | "children">;
|
|
201
192
|
|
|
202
193
|
export enum RouteStep {
|
|
203
194
|
ReportsList,
|
|
@@ -215,7 +206,7 @@ export interface Route {
|
|
|
215
206
|
reportsRoutingFields: ReportsRouteFields;
|
|
216
207
|
}
|
|
217
208
|
|
|
218
|
-
const ReportsContainer = <span class="fstat-no" title="function not covered" >(
|
|
209
|
+
const ReportsContainer = <span class="fstat-no" title="function not covered" >(p</span>rops: ReportsContainerProps) => {
|
|
219
210
|
const [routingHistory, setRoutingHistory] = <span class="cstat-no" title="statement not covered" >useState<Route[]>([{ step: RouteStep.ReportsList, title: "iTwin Reports", reportsRoutingFields: {} }]);</span>
|
|
220
211
|
const currentRoute = <span class="cstat-no" title="statement not covered" >routingHistory[routingHistory.length - 1];</span>
|
|
221
212
|
const iTwinId = <span class="cstat-no" title="statement not covered" >useActiveIModelConnection()?.iTwinId ?? "";</span>
|
|
@@ -230,7 +221,7 @@ const ReportsContainer = <span class="fstat-no" title="function not covered" >({
|
|
|
230
221
|
}, [routingHistory]);
|
|
231
222
|
|
|
232
223
|
<span class="cstat-no" title="statement not covered" > return (</span>
|
|
233
|
-
<ReportsConfigContext
|
|
224
|
+
<ReportsConfigContext {...props} iTwinId={iTwinId}>
|
|
234
225
|
<div className="rcw-reports-container">
|
|
235
226
|
<ReportsHeader goBack={goBack} currentRoute={currentRoute} />
|
|
236
227
|
<ReportsRouter currentRoute={currentRoute} navigateTo={navigateTo} goBack={goBack} />
|
|
@@ -247,7 +238,7 @@ export default ReportsContainer;
|
|
|
247
238
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
248
239
|
Code coverage generated by
|
|
249
240
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
250
|
-
at 2024-06-
|
|
241
|
+
at 2024-06-11T15:49:29.425Z
|
|
251
242
|
</div>
|
|
252
243
|
<script src="../../../prettify.js"></script>
|
|
253
244
|
<script>
|
|
@@ -112,7 +112,7 @@ export const ReportsHeader = <span class="fstat-no" title="function not covered"
|
|
|
112
112
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
113
113
|
Code coverage generated by
|
|
114
114
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
115
|
-
at 2024-06-
|
|
115
|
+
at 2024-06-11T15:49:29.425Z
|
|
116
116
|
</div>
|
|
117
117
|
<script src="../../../prettify.js"></script>
|
|
118
118
|
<script>
|
|
@@ -253,7 +253,7 @@ export const ReportsRouter = <span class="fstat-no" title="function not covered"
|
|
|
253
253
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
254
254
|
Code coverage generated by
|
|
255
255
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
256
|
-
at 2024-06-
|
|
256
|
+
at 2024-06-11T15:49:29.425Z
|
|
257
257
|
</div>
|
|
258
258
|
<script src="../../../prettify.js"></script>
|
|
259
259
|
<script>
|
|
@@ -259,7 +259,7 @@ export const SearchBar = ({ searchValue, setSearchValue, disabled }: SearchBarPr
|
|
|
259
259
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
260
260
|
Code coverage generated by
|
|
261
261
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
262
|
-
at 2024-06-
|
|
262
|
+
at 2024-06-11T15:49:29.425Z
|
|
263
263
|
</div>
|
|
264
264
|
<script src="../../../prettify.js"></script>
|
|
265
265
|
<script>
|
|
@@ -277,7 +277,7 @@ export const SelectIModel = ({ selectedIModelId, setSelectedIModelId }: Selected
|
|
|
277
277
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
278
278
|
Code coverage generated by
|
|
279
279
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
280
|
-
at 2024-06-
|
|
280
|
+
at 2024-06-11T15:49:29.425Z
|
|
281
281
|
</div>
|
|
282
282
|
<script src="../../../prettify.js"></script>
|
|
283
283
|
<script>
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
402
402
|
Code coverage generated by
|
|
403
403
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
404
|
-
at 2024-06-
|
|
404
|
+
at 2024-06-11T15:49:29.425Z
|
|
405
405
|
</div>
|
|
406
406
|
<script src="../../../prettify.js"></script>
|
|
407
407
|
<script>
|
|
@@ -406,7 +406,7 @@ export type CreateTypeFromInterface<Interface> = {
|
|
|
406
406
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
407
407
|
Code coverage generated by
|
|
408
408
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
409
|
-
at 2024-06-
|
|
409
|
+
at 2024-06-11T15:49:29.425Z
|
|
410
410
|
</div>
|
|
411
411
|
<script src="../../../prettify.js"></script>
|
|
412
412
|
<script>
|
|
@@ -142,7 +142,7 @@ export const useBulkExtractor = () => {
|
|
|
142
142
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
143
143
|
Code coverage generated by
|
|
144
144
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
145
|
-
at 2024-06-
|
|
145
|
+
at 2024-06-11T15:49:29.425Z
|
|
146
146
|
</div>
|
|
147
147
|
<script src="../../../prettify.js"></script>
|
|
148
148
|
<script>
|
|
@@ -100,12 +100,14 @@
|
|
|
100
100
|
<a name='L35'></a><a href='#L35'>35</a>
|
|
101
101
|
<a name='L36'></a><a href='#L36'>36</a>
|
|
102
102
|
<a name='L37'></a><a href='#L37'>37</a>
|
|
103
|
-
<a name='L38'></a><a href='#L38'>38</a
|
|
103
|
+
<a name='L38'></a><a href='#L38'>38</a>
|
|
104
|
+
<a name='L39'></a><a href='#L39'>39</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
104
105
|
<span class="cline-any cline-neutral"> </span>
|
|
105
106
|
<span class="cline-any cline-neutral"> </span>
|
|
106
107
|
<span class="cline-any cline-neutral"> </span>
|
|
107
108
|
<span class="cline-any cline-neutral"> </span>
|
|
108
109
|
<span class="cline-any cline-yes">7x</span>
|
|
110
|
+
<span class="cline-any cline-neutral"> </span>
|
|
109
111
|
<span class="cline-any cline-yes">7x</span>
|
|
110
112
|
<span class="cline-any cline-yes">7x</span>
|
|
111
113
|
<span class="cline-any cline-yes">7x</span>
|
|
@@ -143,6 +145,7 @@
|
|
|
143
145
|
*--------------------------------------------------------------------------------------------*/
|
|
144
146
|
import type { AccessToken } from "@itwin/core-bentley";
|
|
145
147
|
import { IModelsClient } from "@itwin/imodels-client-management";
|
|
148
|
+
import type { IMappingsClient, IReportsClient } from "@itwin/insights-client";
|
|
146
149
|
import { MappingsClient, ReportsClient } from "@itwin/insights-client";
|
|
147
150
|
import * as React from "react";
|
|
148
151
|
import { createContext } from "react";
|
|
@@ -153,8 +156,8 @@ export interface ReportsConfigApiProps {
|
|
|
153
156
|
getAccessToken: GetAccessTokenFn;
|
|
154
157
|
iTwinId: string;
|
|
155
158
|
baseUrl: string;
|
|
156
|
-
reportsClient:
|
|
157
|
-
mappingsClient:
|
|
159
|
+
reportsClient: IReportsClient;
|
|
160
|
+
mappingsClient: IMappingsClient;
|
|
158
161
|
iModelsClient: IModelsClient;
|
|
159
162
|
}
|
|
160
163
|
|
|
@@ -181,7 +184,7 @@ export const useReportsConfigApi = () => {
|
|
|
181
184
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
182
185
|
Code coverage generated by
|
|
183
186
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
184
|
-
at 2024-06-
|
|
187
|
+
at 2024-06-11T15:49:29.425Z
|
|
185
188
|
</div>
|
|
186
189
|
<script src="../../../prettify.js"></script>
|
|
187
190
|
<script>
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
117
117
|
Code coverage generated by
|
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
119
|
-
at 2024-06-
|
|
119
|
+
at 2024-06-11T15:49:29.425Z
|
|
120
120
|
</div>
|
|
121
121
|
<script src="../../../prettify.js"></script>
|
|
122
122
|
<script>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at 2024-06-
|
|
104
|
+
at 2024-06-11T15:49:29.425Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../../prettify.js"></script>
|
|
107
107
|
<script>
|
|
@@ -238,7 +238,7 @@ export default useValidator;
|
|
|
238
238
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
239
239
|
Code coverage generated by
|
|
240
240
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
241
|
-
at 2024-06-
|
|
241
|
+
at 2024-06-11T15:49:29.425Z
|
|
242
242
|
</div>
|
|
243
243
|
<script src="../../../prettify.js"></script>
|
|
244
244
|
<script>
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">46.15% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>6/
|
|
28
|
+
<span class='fraction'>6/13</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/
|
|
35
|
+
<span class='fraction'>0/4</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">46.15% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>6/
|
|
49
|
+
<span class='fraction'>6/13</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -80,17 +80,17 @@
|
|
|
80
80
|
</thead>
|
|
81
81
|
<tbody><tr>
|
|
82
82
|
<td class="file low" data-value="ReportsConfigUiProvider.tsx"><a href="ReportsConfigUiProvider.tsx.html">ReportsConfigUiProvider.tsx</a></td>
|
|
83
|
-
<td data-value="
|
|
84
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
83
|
+
<td data-value="46.15" class="pic low">
|
|
84
|
+
<div class="chart"><div class="cover-fill" style="width: 46%"></div><div class="cover-empty" style="width: 54%"></div></div>
|
|
85
85
|
</td>
|
|
86
|
-
<td data-value="
|
|
87
|
-
<td data-value="
|
|
86
|
+
<td data-value="46.15" class="pct low">46.15%</td>
|
|
87
|
+
<td data-value="13" class="abs low">6/13</td>
|
|
88
88
|
<td data-value="0" class="pct low">0%</td>
|
|
89
|
-
<td data-value="
|
|
89
|
+
<td data-value="4" class="abs low">0/4</td>
|
|
90
90
|
<td data-value="0" class="pct low">0%</td>
|
|
91
91
|
<td data-value="2" class="abs low">0/2</td>
|
|
92
|
-
<td data-value="
|
|
93
|
-
<td data-value="
|
|
92
|
+
<td data-value="46.15" class="pct low">46.15%</td>
|
|
93
|
+
<td data-value="13" class="abs low">6/13</td>
|
|
94
94
|
</tr>
|
|
95
95
|
|
|
96
96
|
</tbody>
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
102
|
Code coverage generated by
|
|
103
103
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at 2024-06-
|
|
104
|
+
at 2024-06-11T15:49:29.425Z
|
|
105
105
|
</div>
|
|
106
106
|
<script src="../../prettify.js"></script>
|
|
107
107
|
<script>
|