@itwin/map-layers 5.4.4 → 5.6.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.md +18 -2
- package/README.md +7 -7
- package/lib/cjs/BrowserStorage.d.ts.map +1 -1
- package/lib/cjs/BrowserStorage.js +23 -13
- package/lib/cjs/BrowserStorage.js.map +1 -1
- package/lib/cjs/CustomParamUtils.d.ts +1 -1
- package/lib/cjs/CustomParamUtils.d.ts.map +1 -1
- package/lib/cjs/CustomParamUtils.js +6 -3
- package/lib/cjs/CustomParamUtils.js.map +1 -1
- package/lib/cjs/CustomParamsMappingStorage.d.ts +1 -1
- package/lib/cjs/CustomParamsMappingStorage.d.ts.map +1 -1
- package/lib/cjs/CustomParamsMappingStorage.js +3 -3
- package/lib/cjs/CustomParamsMappingStorage.js.map +1 -1
- package/lib/cjs/CustomParamsStorage.d.ts +1 -1
- package/lib/cjs/CustomParamsStorage.d.ts.map +1 -1
- package/lib/cjs/CustomParamsStorage.js +3 -3
- package/lib/cjs/CustomParamsStorage.js.map +1 -1
- package/lib/cjs/MapLayerPreferences.d.ts +2 -1
- package/lib/cjs/MapLayerPreferences.d.ts.map +1 -1
- package/lib/cjs/MapLayerPreferences.js +50 -25
- package/lib/cjs/MapLayerPreferences.js.map +1 -1
- package/lib/cjs/MapLayersActionIds.d.ts +5 -0
- package/lib/cjs/MapLayersActionIds.d.ts.map +1 -0
- package/lib/cjs/MapLayersActionIds.js +10 -0
- package/lib/cjs/MapLayersActionIds.js.map +1 -0
- package/lib/cjs/MapLayersPrefBrowserStorage.d.ts.map +1 -1
- package/lib/cjs/MapLayersPrefBrowserStorage.js +4 -5
- package/lib/cjs/MapLayersPrefBrowserStorage.js.map +1 -1
- package/lib/cjs/PreferencesBrowserStorage.d.ts +17 -17
- package/lib/cjs/PreferencesBrowserStorage.d.ts.map +1 -1
- package/lib/cjs/PreferencesBrowserStorage.js +14 -14
- package/lib/cjs/PreferencesBrowserStorage.js.map +1 -1
- package/lib/cjs/map-layers.d.ts +1 -0
- package/lib/cjs/map-layers.d.ts.map +1 -1
- package/lib/cjs/map-layers.js +4 -3
- package/lib/cjs/map-layers.js.map +1 -1
- package/lib/cjs/mapLayers.d.ts +2 -2
- package/lib/cjs/mapLayers.d.ts.map +1 -1
- package/lib/cjs/mapLayers.js.map +1 -1
- package/lib/cjs/public/locales/en/mapLayers.json +179 -184
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts +3 -4
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +48 -18
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/Interfaces.d.ts +3 -3
- package/lib/cjs/ui/Interfaces.d.ts.map +1 -1
- package/lib/cjs/ui/Interfaces.js.map +1 -1
- package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts +3 -2
- package/lib/cjs/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/ui/MapLayersUiItemsProvider.js +2 -6
- package/lib/cjs/ui/MapLayersUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js +81 -46
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.d.ts.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.js +44 -25
- package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.scss +2 -4
- package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts +1 -1
- package/lib/cjs/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/ConfirmMessageDialog.js +31 -8
- package/lib/cjs/ui/widget/ConfirmMessageDialog.js.map +1 -1
- package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts +1 -1
- package/lib/cjs/ui/widget/CustomParamEditDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/CustomParamEditDialog.js +34 -20
- package/lib/cjs/ui/widget/CustomParamEditDialog.js.map +1 -1
- package/lib/cjs/ui/widget/CustomParamEditDialog.scss +1 -2
- package/lib/cjs/ui/widget/CustomParamsSettings.d.ts.map +1 -1
- package/lib/cjs/ui/widget/CustomParamsSettings.js +42 -27
- package/lib/cjs/ui/widget/CustomParamsSettings.js.map +1 -1
- package/lib/cjs/ui/widget/CustomParamsSettings.scss +7 -9
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts +3 -2
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.js +4 -2
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.js.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.js +34 -15
- package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerActionButtons.d.ts +1 -1
- package/lib/cjs/ui/widget/MapLayerActionButtons.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerActionButtons.js +30 -17
- package/lib/cjs/ui/widget/MapLayerActionButtons.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.d.ts +2 -2
- package/lib/cjs/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.js +64 -50
- package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.d.ts +2 -2
- package/lib/cjs/ui/widget/MapLayerManager.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.js +158 -84
- package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.scss +3 -6
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts +2 -2
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js +33 -13
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +36 -14
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.scss +5 -5
- package/lib/cjs/ui/widget/MapLayersWidget.d.ts +1 -1
- package/lib/cjs/ui/widget/MapLayersWidget.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayersWidget.js +34 -11
- package/lib/cjs/ui/widget/MapLayersWidget.js.map +1 -1
- package/lib/cjs/ui/widget/MapManagerMapLayersHeader.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapManagerMapLayersHeader.js +5 -8
- package/lib/cjs/ui/widget/MapManagerMapLayersHeader.js.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.js +55 -56
- package/lib/cjs/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/cjs/ui/widget/MapManagerSettings.scss +1 -1
- package/lib/cjs/ui/widget/MapSelectFeaturesDialog.d.ts +2 -2
- package/lib/cjs/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js +33 -18
- package/lib/cjs/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
- package/lib/cjs/ui/widget/MapSelectFeaturesDialog.scss +1 -3
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts +4 -3
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.js +104 -81
- package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.scss +6 -7
- package/lib/cjs/ui/widget/SelectApiKey.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SelectApiKey.js +38 -10
- package/lib/cjs/ui/widget/SelectApiKey.js.map +1 -1
- package/lib/cjs/ui/widget/SelectCustomParam.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SelectCustomParam.js +40 -11
- package/lib/cjs/ui/widget/SelectCustomParam.js.map +1 -1
- package/lib/cjs/ui/widget/SelectMapFormat.d.ts +3 -3
- package/lib/cjs/ui/widget/SelectMapFormat.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SelectMapFormat.js +36 -16
- package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts +2 -2
- package/lib/cjs/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersDataProvider.js +13 -9
- package/lib/cjs/ui/widget/SubLayersDataProvider.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersPopupButton.js +30 -12
- package/lib/cjs/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.d.ts +2 -2
- package/lib/cjs/ui/widget/SubLayersTree.d.ts.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.js +83 -45
- package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.scss +4 -7
- package/lib/cjs/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.js +33 -16
- package/lib/cjs/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/TransparencyPopupButton.scss +1 -2
- package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts +1 -1
- package/lib/cjs/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -1
- package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js +2 -8
- package/lib/cjs/ui/widget/UserPreferencesStorageOptions.js.map +1 -1
- package/lib/esm/BrowserStorage.d.ts.map +1 -1
- package/lib/esm/BrowserStorage.js +23 -13
- package/lib/esm/BrowserStorage.js.map +1 -1
- package/lib/esm/CustomParamUtils.d.ts +1 -1
- package/lib/esm/CustomParamUtils.d.ts.map +1 -1
- package/lib/esm/CustomParamUtils.js +6 -3
- package/lib/esm/CustomParamUtils.js.map +1 -1
- package/lib/esm/CustomParamsMappingStorage.d.ts +1 -1
- package/lib/esm/CustomParamsMappingStorage.d.ts.map +1 -1
- package/lib/esm/CustomParamsMappingStorage.js +3 -3
- package/lib/esm/CustomParamsMappingStorage.js.map +1 -1
- package/lib/esm/CustomParamsStorage.d.ts +1 -1
- package/lib/esm/CustomParamsStorage.d.ts.map +1 -1
- package/lib/esm/CustomParamsStorage.js +3 -3
- package/lib/esm/CustomParamsStorage.js.map +1 -1
- package/lib/esm/MapLayerPreferences.d.ts +2 -1
- package/lib/esm/MapLayerPreferences.d.ts.map +1 -1
- package/lib/esm/MapLayerPreferences.js +50 -25
- package/lib/esm/MapLayerPreferences.js.map +1 -1
- package/lib/esm/MapLayersActionIds.d.ts +5 -0
- package/lib/esm/MapLayersActionIds.d.ts.map +1 -0
- package/lib/esm/MapLayersActionIds.js +7 -0
- package/lib/esm/MapLayersActionIds.js.map +1 -0
- package/lib/esm/MapLayersPrefBrowserStorage.d.ts.map +1 -1
- package/lib/esm/MapLayersPrefBrowserStorage.js +4 -5
- package/lib/esm/MapLayersPrefBrowserStorage.js.map +1 -1
- package/lib/esm/PreferencesBrowserStorage.d.ts +17 -17
- package/lib/esm/PreferencesBrowserStorage.d.ts.map +1 -1
- package/lib/esm/PreferencesBrowserStorage.js +14 -14
- package/lib/esm/PreferencesBrowserStorage.js.map +1 -1
- package/lib/esm/map-layers.d.ts +1 -0
- package/lib/esm/map-layers.d.ts.map +1 -1
- package/lib/esm/map-layers.js +4 -3
- package/lib/esm/map-layers.js.map +1 -1
- package/lib/esm/mapLayers.d.ts +2 -2
- package/lib/esm/mapLayers.d.ts.map +1 -1
- package/lib/esm/mapLayers.js.map +1 -1
- package/lib/esm/public/locales/en/mapLayers.json +179 -184
- package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts +3 -4
- package/lib/esm/ui/FeatureInfoUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js +48 -18
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/Interfaces.d.ts +3 -3
- package/lib/esm/ui/Interfaces.d.ts.map +1 -1
- package/lib/esm/ui/Interfaces.js.map +1 -1
- package/lib/esm/ui/MapLayersUiItemsProvider.d.ts +3 -2
- package/lib/esm/ui/MapLayersUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/ui/MapLayersUiItemsProvider.js +2 -6
- package/lib/esm/ui/MapLayersUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.js +57 -45
- package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.d.ts.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.js +19 -23
- package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.scss +2 -4
- package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts +1 -1
- package/lib/esm/ui/widget/ConfirmMessageDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/ConfirmMessageDialog.js +5 -5
- package/lib/esm/ui/widget/ConfirmMessageDialog.js.map +1 -1
- package/lib/esm/ui/widget/CustomParamEditDialog.d.ts +1 -1
- package/lib/esm/ui/widget/CustomParamEditDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/CustomParamEditDialog.js +9 -18
- package/lib/esm/ui/widget/CustomParamEditDialog.js.map +1 -1
- package/lib/esm/ui/widget/CustomParamEditDialog.scss +1 -2
- package/lib/esm/ui/widget/CustomParamsSettings.d.ts.map +1 -1
- package/lib/esm/ui/widget/CustomParamsSettings.js +17 -25
- package/lib/esm/ui/widget/CustomParamsSettings.js.map +1 -1
- package/lib/esm/ui/widget/CustomParamsSettings.scss +7 -9
- package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts +3 -2
- package/lib/esm/ui/widget/FeatureInfoDataProvider.d.ts.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoDataProvider.js +4 -2
- package/lib/esm/ui/widget/FeatureInfoDataProvider.js.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.d.ts +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.js +10 -14
- package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerActionButtons.d.ts +1 -1
- package/lib/esm/ui/widget/MapLayerActionButtons.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerActionButtons.js +6 -16
- package/lib/esm/ui/widget/MapLayerActionButtons.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts +2 -2
- package/lib/esm/ui/widget/MapLayerDroppable.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.js +38 -47
- package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.d.ts +2 -2
- package/lib/esm/ui/widget/MapLayerManager.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.js +134 -83
- package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.scss +3 -6
- package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts +2 -2
- package/lib/esm/ui/widget/MapLayerSettingsMenu.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js +9 -12
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +11 -12
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.scss +5 -5
- package/lib/esm/ui/widget/MapLayersWidget.d.ts +1 -1
- package/lib/esm/ui/widget/MapLayersWidget.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayersWidget.js +9 -9
- package/lib/esm/ui/widget/MapLayersWidget.js.map +1 -1
- package/lib/esm/ui/widget/MapManagerMapLayersHeader.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapManagerMapLayersHeader.js +5 -8
- package/lib/esm/ui/widget/MapManagerMapLayersHeader.js.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.js +29 -53
- package/lib/esm/ui/widget/MapManagerSettings.js.map +1 -1
- package/lib/esm/ui/widget/MapManagerSettings.scss +1 -1
- package/lib/esm/ui/widget/MapSelectFeaturesDialog.d.ts +2 -2
- package/lib/esm/ui/widget/MapSelectFeaturesDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapSelectFeaturesDialog.js +7 -15
- package/lib/esm/ui/widget/MapSelectFeaturesDialog.js.map +1 -1
- package/lib/esm/ui/widget/MapSelectFeaturesDialog.scss +1 -3
- package/lib/esm/ui/widget/MapUrlDialog.d.ts +4 -3
- package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.js +79 -79
- package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.scss +6 -7
- package/lib/esm/ui/widget/SelectApiKey.d.ts.map +1 -1
- package/lib/esm/ui/widget/SelectApiKey.js +12 -7
- package/lib/esm/ui/widget/SelectApiKey.js.map +1 -1
- package/lib/esm/ui/widget/SelectCustomParam.d.ts.map +1 -1
- package/lib/esm/ui/widget/SelectCustomParam.js +14 -8
- package/lib/esm/ui/widget/SelectCustomParam.js.map +1 -1
- package/lib/esm/ui/widget/SelectMapFormat.d.ts +3 -3
- package/lib/esm/ui/widget/SelectMapFormat.d.ts.map +1 -1
- package/lib/esm/ui/widget/SelectMapFormat.js +11 -14
- package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersDataProvider.d.ts +2 -2
- package/lib/esm/ui/widget/SubLayersDataProvider.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersDataProvider.js +13 -9
- package/lib/esm/ui/widget/SubLayersDataProvider.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersPopupButton.js +6 -11
- package/lib/esm/ui/widget/SubLayersPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.d.ts +2 -2
- package/lib/esm/ui/widget/SubLayersTree.d.ts.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.js +59 -44
- package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.scss +4 -7
- package/lib/esm/ui/widget/TransparencyPopupButton.d.ts.map +1 -1
- package/lib/esm/ui/widget/TransparencyPopupButton.js +8 -14
- package/lib/esm/ui/widget/TransparencyPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/TransparencyPopupButton.scss +1 -2
- package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts +1 -1
- package/lib/esm/ui/widget/UserPreferencesStorageOptions.d.ts.map +1 -1
- package/lib/esm/ui/widget/UserPreferencesStorageOptions.js +2 -8
- package/lib/esm/ui/widget/UserPreferencesStorageOptions.js.map +1 -1
- package/lib/public/locales/en/mapLayers.json +179 -184
- package/package.json +9 -21
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
2
|
/*---------------------------------------------------------------------------------------------
|
|
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
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
6
|
// cSpell:ignore Modeless WMTS
|
|
6
7
|
import "./MapUrlDialog.scss";
|
|
7
8
|
import * as React from "react";
|
|
8
9
|
import { SpecialKey } from "@itwin/appui-abstract";
|
|
9
10
|
import { BeEvent, Guid } from "@itwin/core-bentley";
|
|
10
|
-
import { IModelApp, MapLayerSource, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority
|
|
11
|
+
import { IModelApp, MapLayerSource, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority } from "@itwin/core-frontend";
|
|
11
12
|
import { Dialog, useCrossOriginPopup } from "@itwin/core-react";
|
|
12
13
|
import { SvgStatusWarning, SvgTechnicalPreviewMini } from "@itwin/itwinui-icons-color-react";
|
|
13
14
|
import { Button, Icon, Input, LabeledInput, ProgressLinear } from "@itwin/itwinui-react";
|
|
@@ -63,8 +64,9 @@ export function MapUrlDialog(props) {
|
|
|
63
64
|
const getCustomParamsMapping = React.useCallback((url) => {
|
|
64
65
|
const cpMappingStorage = new CustomParamsMappingStorage();
|
|
65
66
|
const cpMapping = cpMappingStorage.get(url.toLowerCase());
|
|
66
|
-
if (cpMapping && !Array.isArray(cpMapping))
|
|
67
|
+
if (cpMapping && !Array.isArray(cpMapping)) {
|
|
67
68
|
return cpMapping.customParamNames;
|
|
69
|
+
}
|
|
68
70
|
return [];
|
|
69
71
|
}, []);
|
|
70
72
|
const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString(props.signInModeArgs || props.mapLayerSourceToEdit ? "mapLayers:CustomAttach.EditCustomLayer" : "mapLayers:CustomAttach.AttachCustomLayer"));
|
|
@@ -105,8 +107,9 @@ export function MapUrlDialog(props) {
|
|
|
105
107
|
const [mapType, setMapType] = React.useState(getFormatFromProps() ?? "ArcGIS");
|
|
106
108
|
const [customParamNamesChangedByUser, SetCustomParamNamesChangedByUser] = React.useState(false);
|
|
107
109
|
const [customParamNames, setCustomParamNames] = React.useState(() => {
|
|
108
|
-
if (mapUrl)
|
|
110
|
+
if (mapUrl) {
|
|
109
111
|
return getCustomParamsMapping(mapUrl);
|
|
112
|
+
}
|
|
110
113
|
return undefined;
|
|
111
114
|
});
|
|
112
115
|
// 'isMounted' is used to prevent any async operation once the hook has been
|
|
@@ -119,10 +122,10 @@ export function MapUrlDialog(props) {
|
|
|
119
122
|
};
|
|
120
123
|
}, []);
|
|
121
124
|
const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && props?.activeViewport?.iModel?.iTwinId);
|
|
122
|
-
const [hasImodelContext] = React.useState(props?.activeViewport?.iModel?.iTwinId !== undefined
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
const [hasImodelContext] = React.useState(props?.activeViewport?.iModel?.iTwinId !== undefined &&
|
|
126
|
+
props.activeViewport.iModel.iTwinId !== Guid.empty &&
|
|
127
|
+
props?.activeViewport?.iModel?.iModelId !== undefined &&
|
|
128
|
+
props?.activeViewport.iModel.iModelId !== Guid.empty);
|
|
126
129
|
const handleCancel = React.useCallback(() => {
|
|
127
130
|
if (props.onCancelResult) {
|
|
128
131
|
props.onCancelResult();
|
|
@@ -131,13 +134,15 @@ export function MapUrlDialog(props) {
|
|
|
131
134
|
}, [props]);
|
|
132
135
|
const onUsernameChange = React.useCallback((event) => {
|
|
133
136
|
setUserName(event.target.value);
|
|
134
|
-
if (invalidCredentialsProvided)
|
|
137
|
+
if (invalidCredentialsProvided) {
|
|
135
138
|
setInvalidCredentialsProvided(false);
|
|
139
|
+
}
|
|
136
140
|
}, [setUserName, invalidCredentialsProvided, setInvalidCredentialsProvided]);
|
|
137
141
|
const onPasswordChange = React.useCallback((event) => {
|
|
138
142
|
setPassword(event.target.value);
|
|
139
|
-
if (invalidCredentialsProvided)
|
|
143
|
+
if (invalidCredentialsProvided) {
|
|
140
144
|
setInvalidCredentialsProvided(false);
|
|
145
|
+
}
|
|
141
146
|
}, [setPassword, invalidCredentialsProvided, setInvalidCredentialsProvided]);
|
|
142
147
|
const handleArcGisLogin = React.useCallback(() => {
|
|
143
148
|
setLayerAuthPending(true);
|
|
@@ -148,8 +153,8 @@ export function MapUrlDialog(props) {
|
|
|
148
153
|
}, [oauthProcessSucceeded]);
|
|
149
154
|
// return true if authorization is needed
|
|
150
155
|
const updateAuthState = React.useCallback(async (source, sourceValidation) => {
|
|
151
|
-
const sourceRequireAuth =
|
|
152
|
-
let invalidCredentials =
|
|
156
|
+
const sourceRequireAuth = sourceValidation.status === MapLayerSourceStatus.RequireAuth;
|
|
157
|
+
let invalidCredentials = sourceValidation.status === MapLayerSourceStatus.InvalidCredentials;
|
|
153
158
|
if (sourceRequireAuth) {
|
|
154
159
|
let hasTokenEndPoint = false;
|
|
155
160
|
const settings = source.toLayerSettings();
|
|
@@ -162,8 +167,7 @@ export function MapUrlDialog(props) {
|
|
|
162
167
|
hasTokenEndPoint = true;
|
|
163
168
|
}
|
|
164
169
|
}
|
|
165
|
-
catch (_error) {
|
|
166
|
-
}
|
|
170
|
+
catch (_error) { }
|
|
167
171
|
}
|
|
168
172
|
else if (userName.length > 0 || password.length > 0) {
|
|
169
173
|
// This is a patch until @itwin\core-frontend return the expected 'InvalidCredentials' status.
|
|
@@ -252,7 +256,9 @@ export function MapUrlDialog(props) {
|
|
|
252
256
|
await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit, source, vp.iModel.iTwinId, vp?.iModel.iModelId);
|
|
253
257
|
}
|
|
254
258
|
catch (err) {
|
|
255
|
-
const errorMessage = IModelApp.localization.getLocalizedString("mapLayers:Messages.MapLayerEditError", {
|
|
259
|
+
const errorMessage = IModelApp.localization.getLocalizedString("mapLayers:Messages.MapLayerEditError", {
|
|
260
|
+
layerName: props.mapLayerSourceToEdit?.name,
|
|
261
|
+
});
|
|
256
262
|
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));
|
|
257
263
|
return;
|
|
258
264
|
}
|
|
@@ -272,7 +278,7 @@ export function MapUrlDialog(props) {
|
|
|
272
278
|
if (validation.status === MapLayerSourceStatus.Valid) {
|
|
273
279
|
// Update service settings if storage is available and we are not prompting user for credentials
|
|
274
280
|
if (isSettingsStorageAvailable && !props.signInModeArgs) {
|
|
275
|
-
const storeOnIModel =
|
|
281
|
+
const storeOnIModel = hasImodelContext ? "Model" === settingsStorage : undefined;
|
|
276
282
|
const vp = props.activeViewport;
|
|
277
283
|
if (vp?.iModel.iTwinId && !(await MapLayerPreferences.storeSource(source, vp.iModel.iTwinId, vp.iModel.iModelId, storeOnIModel))) {
|
|
278
284
|
const msgError = MapLayersUI.localization.getLocalizedString("mapLayers:Messages.MapLayerPreferencesStoreFailed");
|
|
@@ -319,14 +325,27 @@ export function MapUrlDialog(props) {
|
|
|
319
325
|
onOkResult();
|
|
320
326
|
}
|
|
321
327
|
})();
|
|
322
|
-
}, [
|
|
328
|
+
}, [
|
|
329
|
+
mapUrl,
|
|
330
|
+
createSource,
|
|
331
|
+
props.mapLayerSourceToEdit,
|
|
332
|
+
props.activeViewport,
|
|
333
|
+
props.signInModeArgs,
|
|
334
|
+
onOkResult,
|
|
335
|
+
customParamNames,
|
|
336
|
+
mapName,
|
|
337
|
+
isSettingsStorageAvailable,
|
|
338
|
+
hasImodelContext,
|
|
339
|
+
settingsStorage,
|
|
340
|
+
updateAuthState,
|
|
341
|
+
]);
|
|
323
342
|
React.useEffect(() => {
|
|
324
343
|
const handleOAuthProcessEnd = (success, _state) => {
|
|
325
344
|
onOauthProcessEnd.raiseEvent(success, _state);
|
|
326
345
|
};
|
|
327
346
|
const ac = IModelApp.mapLayerFormatRegistry.getAccessClient(mapType);
|
|
328
347
|
if (ac?.onOAuthProcessEnd) {
|
|
329
|
-
setAccessClient(ac); // cache it, so we
|
|
348
|
+
setAccessClient(ac); // cache it, so we don't need to make another lookup;
|
|
330
349
|
ac.onOAuthProcessEnd.addListener(handleOAuthProcessEnd);
|
|
331
350
|
}
|
|
332
351
|
setAccessClientInitialized(true);
|
|
@@ -359,9 +378,7 @@ export function MapUrlDialog(props) {
|
|
|
359
378
|
React.useEffect(() => {
|
|
360
379
|
// Attach source asynchronously.
|
|
361
380
|
void (async () => {
|
|
362
|
-
if (isAccessClientInitialized
|
|
363
|
-
&& shouldAutoAttachSource
|
|
364
|
-
&& props.signInModeArgs !== undefined) {
|
|
381
|
+
if (isAccessClientInitialized && shouldAutoAttachSource && props.signInModeArgs !== undefined) {
|
|
365
382
|
try {
|
|
366
383
|
let source = props.signInModeArgs.source;
|
|
367
384
|
let validation = props.signInModeArgs.validation;
|
|
@@ -373,10 +390,12 @@ export function MapUrlDialog(props) {
|
|
|
373
390
|
formatId: props.signInModeArgs.layer.formatId,
|
|
374
391
|
});
|
|
375
392
|
if (source !== undefined) {
|
|
376
|
-
if (props.signInModeArgs.layer.savedQueryParams)
|
|
393
|
+
if (props.signInModeArgs.layer.savedQueryParams) {
|
|
377
394
|
source.savedQueryParams = { ...props.signInModeArgs.layer.savedQueryParams };
|
|
378
|
-
|
|
395
|
+
}
|
|
396
|
+
if (props.signInModeArgs.layer.unsavedQueryParams) {
|
|
379
397
|
source.unsavedQueryParams = { ...props.signInModeArgs.layer.unsavedQueryParams };
|
|
398
|
+
}
|
|
380
399
|
setLayerAttachPending(true);
|
|
381
400
|
validation = await source.validateSource(true);
|
|
382
401
|
if (isMounted.current) {
|
|
@@ -396,19 +415,32 @@ export function MapUrlDialog(props) {
|
|
|
396
415
|
const dialogContainer = React.useRef(null);
|
|
397
416
|
const readyToSave = React.useCallback(() => {
|
|
398
417
|
const credentialsSet = !!userName && !!password;
|
|
399
|
-
const ready =
|
|
400
|
-
&&
|
|
401
|
-
|
|
402
|
-
&&
|
|
403
|
-
&&
|
|
404
|
-
|
|
418
|
+
const ready = !!mapUrl &&
|
|
419
|
+
!!mapName &&
|
|
420
|
+
!layerAttachPending &&
|
|
421
|
+
(!serverRequireCredentials || credentialsSet) &&
|
|
422
|
+
!invalidCredentialsProvided &&
|
|
423
|
+
!incompatibleFormat &&
|
|
424
|
+
(externalLoginUrl === undefined || (externalLoginUrl !== undefined && oauthProcessSucceeded));
|
|
405
425
|
return ready;
|
|
406
|
-
}, [
|
|
426
|
+
}, [
|
|
427
|
+
userName,
|
|
428
|
+
password,
|
|
429
|
+
mapUrl,
|
|
430
|
+
mapName,
|
|
431
|
+
layerAttachPending,
|
|
432
|
+
serverRequireCredentials,
|
|
433
|
+
invalidCredentialsProvided,
|
|
434
|
+
incompatibleFormat,
|
|
435
|
+
externalLoginUrl,
|
|
436
|
+
oauthProcessSucceeded,
|
|
437
|
+
]);
|
|
407
438
|
const handleOnKeyDown = React.useCallback((event) => {
|
|
408
439
|
// eslint-disable-next-line deprecation/deprecation
|
|
409
440
|
if (event.key === SpecialKey.Enter) {
|
|
410
|
-
if (readyToSave())
|
|
441
|
+
if (readyToSave()) {
|
|
411
442
|
handleOk();
|
|
443
|
+
}
|
|
412
444
|
}
|
|
413
445
|
}, [handleOk, readyToSave]);
|
|
414
446
|
// onOauthProcessEnd events handler
|
|
@@ -443,8 +475,9 @@ export function MapUrlDialog(props) {
|
|
|
443
475
|
const handleOAuthPopupClose = React.useCallback(() => {
|
|
444
476
|
setShowOauthPopup(false);
|
|
445
477
|
setLayerAuthPending(false);
|
|
446
|
-
if (oauthProcessSucceeded === undefined)
|
|
447
|
-
setOAuthProcessSucceeded(false);
|
|
478
|
+
if (oauthProcessSucceeded === undefined) {
|
|
479
|
+
setOAuthProcessSucceeded(false);
|
|
480
|
+
} // indicates there was a failed attempt
|
|
448
481
|
}, [oauthProcessSucceeded]);
|
|
449
482
|
// Utility function to get warning message section
|
|
450
483
|
function renderWarningMessage() {
|
|
@@ -468,60 +501,27 @@ export function MapUrlDialog(props) {
|
|
|
468
501
|
// Sometimes we want to add an extra node, such as a button
|
|
469
502
|
let extraNode;
|
|
470
503
|
if (oauthProcessSucceeded === false) {
|
|
471
|
-
extraNode =
|
|
472
|
-
React.createElement(Button, { onClick: handleArcGisLogin }, externalLoginTryAgainLabel));
|
|
504
|
+
extraNode = (_jsx("div", { children: _jsx(Button, { onClick: handleArcGisLogin, children: externalLoginTryAgainLabel }) }));
|
|
473
505
|
}
|
|
474
506
|
if (warningMessage !== undefined) {
|
|
475
|
-
return (
|
|
476
|
-
React.createElement(Icon, { size: "small" },
|
|
477
|
-
React.createElement(SvgStatusWarning, null)),
|
|
478
|
-
React.createElement("span", { className: "map-layer-source-warnMessage-label" }, warningMessage),
|
|
479
|
-
extraNode));
|
|
507
|
+
return (_jsxs("div", { className: "map-layer-source-warnMessage", children: [_jsx(Icon, { size: "small", children: _jsx(SvgStatusWarning, {}) }), _jsx("span", { className: "map-layer-source-warnMessage-label", children: warningMessage }), extraNode] }));
|
|
480
508
|
}
|
|
481
509
|
else {
|
|
482
|
-
return (
|
|
510
|
+
return _jsx("span", { className: "map-layer-source-placeholder", children: "\u00A0" });
|
|
483
511
|
}
|
|
484
512
|
}
|
|
485
513
|
// Use a hook to display the popup.
|
|
486
514
|
// The display of the popup is controlled by the 'showOauthPopup' state variable.
|
|
487
515
|
useCrossOriginPopup(showOauthPopup, externalLoginUrl, externalLoginTitle, 450, 450, handleOAuthPopupClose);
|
|
488
516
|
function getFooter() {
|
|
489
|
-
return (
|
|
490
|
-
React.createElement("div", { className: "map-layer-source-footer-status" }),
|
|
491
|
-
React.createElement("div", null,
|
|
492
|
-
React.createElement(Button, { className: "map-layer-features-footer-button", styleType: 'high-visibility', onClick: handleOk, disabled: !readyToSave() }, props?.mapLayerSourceToEdit ? MapLayersUI.translate("Dialog.Edit") : MapLayersUI.translate("Dialog.Add")),
|
|
493
|
-
React.createElement(Button, { className: "map-layer-source-footer-button", styleType: 'default', onClick: handleCancel }, MapLayersUI.translate("Dialog.Cancel")))));
|
|
517
|
+
return (_jsxs("div", { className: "map-layer-source-footer", children: [_jsx("div", { className: "map-layer-source-footer-status" }), _jsxs("div", { children: [_jsx(Button, { className: "map-layer-features-footer-button", styleType: "high-visibility", onClick: handleOk, disabled: !readyToSave(), children: props?.mapLayerSourceToEdit ? MapLayersUI.translate("Dialog.Edit") : MapLayersUI.translate("Dialog.Add") }), _jsx(Button, { className: "map-layer-source-footer-button", styleType: "default", onClick: handleCancel, children: MapLayersUI.translate("Dialog.Cancel") })] })] }));
|
|
494
518
|
}
|
|
495
|
-
return (
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
React.createElement(Input, { className: "map-layer-source-input", placeholder: nameInputPlaceHolder, onChange: onNameChange, value: mapName, disabled: !!props.signInModeArgs || layerAttachPending || layerAuthPending }),
|
|
503
|
-
React.createElement("span", { className: "map-layer-source-label" }, urlLabel),
|
|
504
|
-
React.createElement(Input, { className: "map-layer-source-input", placeholder: urlInputPlaceHolder, onKeyPress: handleOnKeyDown, onChange: onUrlChange, disabled: !!props.signInModeArgs || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending, value: mapUrl }),
|
|
505
|
-
React.createElement("span", { className: "map-layer-source-label" },
|
|
506
|
-
MapLayersUI.translate("CustomAttach.CustomParamsLabel"),
|
|
507
|
-
React.createElement("div", { title: MapLayersUI.translate("Labels.TechPreviewBadgeTooltip"), className: "map-layer-source-previewBadge-icon" },
|
|
508
|
-
React.createElement(Icon, { size: "small" },
|
|
509
|
-
React.createElement(SvgTechnicalPreviewMini, null)))),
|
|
510
|
-
React.createElement(SelectCustomParam, { value: customParamNames, disabled: layerAttachPending || layerAuthPending, onChange: (paramNames) => { setCustomParamNames(paramNames); SetCustomParamNamesChangedByUser(true); resetSignInState(); } }),
|
|
511
|
-
serverRequireCredentials
|
|
512
|
-
&& externalLoginUrl === undefined // external login is handled in popup
|
|
513
|
-
&& props.mapLayerSourceToEdit === undefined &&
|
|
514
|
-
React.createElement(React.Fragment, null,
|
|
515
|
-
React.createElement("span", { className: "map-layer-source-label" }, userNameLabel),
|
|
516
|
-
React.createElement(LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", placeholder: serverRequireCredentials ? userNameRequiredLabel : userNameLabel, status: (!userName && serverRequireCredentials) || invalidCredentialsProvided ? "warning" : undefined, disabled: layerAttachPending || layerAuthPending, onChange: onUsernameChange, value: userName, size: "small" }),
|
|
517
|
-
React.createElement("span", { className: "map-layer-source-label" }, passwordLabel),
|
|
518
|
-
React.createElement(LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", type: "password", placeholder: serverRequireCredentials ? passwordRequiredLabel : passwordLabel, status: (!password && serverRequireCredentials) || invalidCredentialsProvided ? "warning" : undefined, disabled: layerAttachPending || layerAuthPending, onChange: onPasswordChange, onKeyPress: handleOnKeyDown, value: password, size: "small" })),
|
|
519
|
-
!props.signInModeArgs
|
|
520
|
-
&& !props.mapLayerSourceToEdit
|
|
521
|
-
&& React.createElement("div", { title: !isSettingsStorageAvailable ? noSaveSettingsWarning : "" }, hasImodelContext && mapLayerOptions?.showUserPreferencesStorageOptions && (React.createElement(UserPreferencesStorageOptions, { disabled: !isSettingsStorageAvailable, itwinChecked: settingsStorage === "iTwin", modelChecked: settingsStorage === "Model", onChange: onRadioChange }))))),
|
|
522
|
-
renderWarningMessage(),
|
|
523
|
-
(layerAttachPending || layerAuthPending) &&
|
|
524
|
-
React.createElement("div", { className: "map-layer-source-progressBar" },
|
|
525
|
-
React.createElement(ProgressLinear, { indeterminate: true })))));
|
|
519
|
+
return (_jsx("div", { ref: dialogContainer, children: _jsxs(Dialog, { className: "map-layer-url-dialog", title: dialogTitle, opened: true, resizable: true, movable: true, modal: true, footer: getFooter(), onClose: handleCancel, onEscape: handleCancel, minHeight: 120, maxWidth: 600, titleStyle: { paddingLeft: "10px" }, footerStyle: { paddingBottom: "10px", paddingRight: "10px" }, trapFocus: false, children: [_jsx("div", { className: "map-layer-url-dialog-content", children: _jsxs("div", { className: "map-layer-source-url", children: [_jsx("span", { className: "map-layer-source-label", children: typeLabel }), _jsx(SelectMapFormat, { value: mapType, disabled: props.signInModeArgs !== undefined || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending, onChange: setMapType, mapTypesOptions: mapLayerOptions?.mapTypeOptions, status: incompatibleFormat ? "warning" : undefined, message: incompatibleFormat ? MapLayersUI.translate("CustomAttach.InvalidType") : undefined }), _jsx("span", { className: "map-layer-source-label", children: nameLabel }), _jsx(Input, { className: "map-layer-source-input", placeholder: nameInputPlaceHolder, onChange: onNameChange, value: mapName, disabled: !!props.signInModeArgs || layerAttachPending || layerAuthPending }), _jsx("span", { className: "map-layer-source-label", children: urlLabel }), _jsx(Input, { className: "map-layer-source-input", placeholder: urlInputPlaceHolder, onKeyPress: handleOnKeyDown, onChange: onUrlChange, disabled: !!props.signInModeArgs || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending, value: mapUrl }), _jsxs("span", { className: "map-layer-source-label", children: [MapLayersUI.translate("CustomAttach.CustomParamsLabel"), _jsx("div", { title: MapLayersUI.translate("Labels.TechPreviewBadgeTooltip"), className: "map-layer-source-previewBadge-icon", children: _jsx(Icon, { size: "small", children: _jsx(SvgTechnicalPreviewMini, {}) }) })] }), _jsx(SelectCustomParam, { value: customParamNames, disabled: layerAttachPending || layerAuthPending, onChange: (paramNames) => {
|
|
520
|
+
setCustomParamNames(paramNames);
|
|
521
|
+
SetCustomParamNamesChangedByUser(true);
|
|
522
|
+
resetSignInState();
|
|
523
|
+
} }), serverRequireCredentials &&
|
|
524
|
+
externalLoginUrl === undefined && // external login is handled in popup
|
|
525
|
+
props.mapLayerSourceToEdit === undefined && (_jsxs(_Fragment, { children: [_jsx("span", { className: "map-layer-source-label", children: userNameLabel }), _jsx(LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", placeholder: serverRequireCredentials ? userNameRequiredLabel : userNameLabel, status: (!userName && serverRequireCredentials) || invalidCredentialsProvided ? "warning" : undefined, disabled: layerAttachPending || layerAuthPending, onChange: onUsernameChange, value: userName, size: "small" }), _jsx("span", { className: "map-layer-source-label", children: passwordLabel }), _jsx(LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", type: "password", placeholder: serverRequireCredentials ? passwordRequiredLabel : passwordLabel, status: (!password && serverRequireCredentials) || invalidCredentialsProvided ? "warning" : undefined, disabled: layerAttachPending || layerAuthPending, onChange: onPasswordChange, onKeyPress: handleOnKeyDown, value: password, size: "small" })] })), !props.signInModeArgs && !props.mapLayerSourceToEdit && (_jsx("div", { title: !isSettingsStorageAvailable ? noSaveSettingsWarning : "", children: hasImodelContext && mapLayerOptions?.showUserPreferencesStorageOptions && (_jsx(UserPreferencesStorageOptions, { disabled: !isSettingsStorageAvailable, itwinChecked: settingsStorage === "iTwin", modelChecked: settingsStorage === "Model", onChange: onRadioChange })) }))] }) }), renderWarningMessage(), (layerAttachPending || layerAuthPending) && (_jsx("div", { className: "map-layer-source-progressBar", children: _jsx(ProgressLinear, { indeterminate: true }) }))] }) }));
|
|
526
526
|
}
|
|
527
527
|
//# sourceMappingURL=MapUrlDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EA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,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,aAAa,EAC7F,MAAM,EAAE,CAAC,CAAC,QAAQ,IAAI,wBAAwB,CAAC,IAAI,0BAA0B,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACrG,QAAQ,EAAE,kBAAkB,IAAI,gBAAgB,EAChD,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,eAAe,EAC3B,KAAK,EAAE,QAAQ,EACf,IAAI,EAAC,OAAO,GAAG,CAEhB;oBAIJ,CAAC,KAAK,CAAC,cAAc;2BACnB,CAAC,KAAK,CAAC,oBAAoB;2BAC3B,6BAAK,KAAK,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,IACpE,gBAAgB,IAAI,eAAe,EAAE,iCAAiC,IAAI,CACzE,oBAAC,6BAA6B,IAC5B,QAAQ,EAAE,CAAC,0BAA0B,EACrC,YAAY,EAAE,eAAe,KAAK,OAAO,EACzC,YAAY,EAAE,eAAe,KAAK,OAAO,EACzC,QAAQ,EAAE,aAAa,GACvB,CACH,CACG,CACF,CACF;YAGL,oBAAoB,EAAE;YAGtB,CAAC,kBAAkB,IAAI,gBAAgB,CAAC;gBACvC,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,oBAAC,cAAc,IAAC,aAAa,SAAG,CAC5B,CAED,CACJ,CACR,CAAC;AACJ,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*--------------------------------------------------------------------------------------------*/\n// cSpell:ignore Modeless WMTS\n\nimport \"./MapUrlDialog.scss\";\nimport * as React from \"react\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { BeEvent, Guid } from \"@itwin/core-bentley\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport {\n IModelApp, MapLayerAccessClient, MapLayerSource, MapLayerSourceStatus, MapLayerSourceValidation, NotifyMessageDetails, OutputMessagePriority,\n ScreenViewport,\n} from \"@itwin/core-frontend\";\nimport { Dialog, useCrossOriginPopup } from \"@itwin/core-react\";\nimport { SvgStatusWarning, SvgTechnicalPreviewMini } from \"@itwin/itwinui-icons-color-react\";\nimport { Button, Icon, Input, LabeledInput, ProgressLinear } from \"@itwin/itwinui-react\";\nimport { CustomParamsMappingStorage } from \"../../CustomParamsMappingStorage\";\nimport { CustomParamsStorage } from \"../../CustomParamsStorage\";\nimport { CustomParamUtils } from \"../../CustomParamUtils\";\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { MapLayerOptions } from \"../Interfaces\";\nimport { SelectCustomParam } from \"./SelectCustomParam\";\nimport { SelectMapFormat } from \"./SelectMapFormat\";\nimport { UserPreferencesStorageOptions } from \"./UserPreferencesStorageOptions\";\n\nexport const MAP_TYPES = {\n wms: \"WMS\",\n arcGis: \"ArcGIS\",\n wmts: \"WMTS\",\n tileUrl: \"TileURL\",\n arcGisFeature: \"ArcGISFeature\",\n};\nconst URL_SCHEMES = {\n http: \"http://\",\n https: \"https://\",\n};\n\nexport type LayerCreationMode = \"single\"|\"multiple\";\ninterface MapUrlDialogProps {\n activeViewport?: ScreenViewport;\n isOverlay: boolean;\n onOkResult: (result?: SourceState) => void;\n onCancelResult?: () => void;\n mapLayerOptions?: MapLayerOptions;\n\n // An optional layer definition can be provide to enable the edit mode\n signInModeArgs?: {\n layer: ImageMapLayerSettings;\n validation?: MapLayerSourceValidation;\n source?: MapLayerSource;\n };\n\n mapLayerSourceToEdit?: MapLayerSource;\n}\n\nexport interface SourceState {\n source: MapLayerSource;\n validation: MapLayerSourceValidation;\n customParamIdx?: { [key: string]: string };\n privateCustomParamIdx?: { [key: string]: string };\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapUrlDialog(props: MapUrlDialogProps) {\n const { onOkResult, mapLayerOptions } = props;\n\n const getMapUrlFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.url;\n } else if (props.signInModeArgs) {\n return props.signInModeArgs.layer.url;\n }\n return \"\";\n }, [props.mapLayerSourceToEdit, props.signInModeArgs]);\n\n const getMapNameFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.name;\n } else if (props.signInModeArgs) {\n return props.signInModeArgs.layer.name;\n }\n return \"\";\n }, [props.mapLayerSourceToEdit, props.signInModeArgs]);\n\n const getFormatFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.formatId;\n } else if (props.signInModeArgs) {\n return props.signInModeArgs.layer.formatId;\n }\n return undefined;\n }, [props.mapLayerSourceToEdit, props.signInModeArgs]);\n\n const getCustomParamsMapping = React.useCallback((url: string): string [] => {\n const cpMappingStorage = new CustomParamsMappingStorage();\n const cpMapping = cpMappingStorage.get(url.toLowerCase());\n if (cpMapping && !Array.isArray(cpMapping))\n return cpMapping.customParamNames;\n return [];\n }, []);\n\n const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString(props.signInModeArgs || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\n const [typeLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\n const [nameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\n const [nameInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\n const [urlLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\n const [urlInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\n const [missingCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\n const [invalidCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\n const [externalLoginTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLogin\"));\n const [externalLoginFailedMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginFailed\"));\n const [externalLoginSucceededMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginSucceeded\"));\n const [externalLoginWaitingMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginWaiting\"));\n const [externalLoginTryAgainLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginTryAgain\"));\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(false);\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\n const [layerAuthPending, setLayerAuthPending] = React.useState(false);\n const [mapUrl, setMapUrl] = React.useState(getMapUrlFromProps());\n const [mapName, setMapName] = React.useState(getMapNameFromProps());\n const [userName, setUserName] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [noSaveSettingsWarning] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\n const [passwordLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\n const [passwordRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\n const [userNameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\n const [userNameRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"iTwin\");\n const [oauthProcessSucceeded, setOAuthProcessSucceeded] = React.useState<undefined | boolean>(undefined);\n const [showOauthPopup, setShowOauthPopup] = React.useState(false);\n const [externalLoginUrl, setExternalLoginUrl] = React.useState<string | undefined>();\n const [onOauthProcessEnd] = React.useState(new BeEvent());\n const [accessClient, setAccessClient] = React.useState<MapLayerAccessClient | undefined>();\n const [isAccessClientInitialized, setAccessClientInitialized] = React.useState(false);\n const [shouldAutoAttachSource, setShouldAutoAttachSource] = React.useState(true);\n const [incompatibleFormat, setIncompatibleFormat] = React.useState(false);\n\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? \"ArcGIS\");\n const [customParamNamesChangedByUser, SetCustomParamNamesChangedByUser] = React.useState<boolean>(false);\n const [customParamNames, setCustomParamNames] = React.useState<string[]|undefined>(() => {\n if (mapUrl)\n return getCustomParamsMapping(mapUrl);\n return undefined;\n });\n\n // 'isMounted' is used to prevent any async operation once the hook has been\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && props?.activeViewport?.iModel?.iTwinId);\n const [hasImodelContext] = React.useState(\n props?.activeViewport?.iModel?.iTwinId !== undefined\n && props.activeViewport.iModel.iTwinId !== Guid.empty\n && props?.activeViewport?.iModel?.iModelId !== undefined\n && props?.activeViewport.iModel.iModelId !== Guid.empty);\n\n const handleCancel = React.useCallback(() => {\n if (props.onCancelResult) {\n props.onCancelResult();\n return;\n }\n }, [props]);\n\n const onUsernameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setUserName(event.target.value);\n if (invalidCredentialsProvided)\n setInvalidCredentialsProvided(false);\n }, [setUserName, invalidCredentialsProvided, setInvalidCredentialsProvided]);\n\n const onPasswordChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setPassword(event.target.value);\n if (invalidCredentialsProvided)\n setInvalidCredentialsProvided(false);\n }, [setPassword, invalidCredentialsProvided, setInvalidCredentialsProvided]);\n\n const handleArcGisLogin = React.useCallback(() => {\n setLayerAuthPending(true);\n setShowOauthPopup(true);\n if (oauthProcessSucceeded === false) {\n setOAuthProcessSucceeded(undefined);\n }\n\n }, [oauthProcessSucceeded]);\n\n // return true if authorization is needed\n const updateAuthState = React.useCallback(async (source: MapLayerSource, sourceValidation: MapLayerSourceValidation) => {\n const sourceRequireAuth = (sourceValidation.status === MapLayerSourceStatus.RequireAuth);\n let invalidCredentials = (sourceValidation.status === MapLayerSourceStatus.InvalidCredentials);\n if (sourceRequireAuth) {\n let hasTokenEndPoint = false;\n const settings = source.toLayerSettings();\n\n if (accessClient !== undefined && accessClient.getTokenServiceEndPoint !== undefined && settings !== undefined) {\n try {\n const tokenEndpoint = await accessClient.getTokenServiceEndPoint(settings.url);\n if (tokenEndpoint !== undefined) {\n const loginUrl = tokenEndpoint.getLoginUrl();\n setExternalLoginUrl(loginUrl);\n hasTokenEndPoint = true;\n }\n\n } catch (_error) {\n\n }\n } else if (userName.length > 0 || password.length > 0 ) {\n // This is a patch until @itwin\\core-frontend return the expected 'InvalidCredentials' status.\n invalidCredentials = true;\n }\n\n if (!hasTokenEndPoint && (userName.length > 0 || password.length > 0 )) {\n // This is a patch until @itwin\\core-frontend return the expected 'InvalidCredentials' status.\n invalidCredentials = true;\n }\n }\n setServerRequireCredentials(sourceRequireAuth || invalidCredentials);\n if (invalidCredentials) {\n setInvalidCredentialsProvided(true);\n } else if (invalidCredentialsProvided) {\n setInvalidCredentialsProvided(false); // flag reset\n }\n\n return sourceRequireAuth || invalidCredentials;\n }, [accessClient, invalidCredentialsProvided, password.length, userName.length]);\n\n const onNameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setMapName(event.target.value);\n }, []);\n\n const onRadioChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setSettingsStorageRadio(event.target.value);\n }, [setSettingsStorageRadio]);\n\n const onUrlChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n setMapUrl(value);\n\n if (!customParamNamesChangedByUser) {\n if (value === \"\") {\n setCustomParamNames(undefined);\n } else {\n const paramNames = getCustomParamsMapping(value);\n setCustomParamNames(paramNames);\n }\n\n }\n\n }, [getCustomParamsMapping, customParamNamesChangedByUser]);\n\n const createSource = React.useCallback((url: string) => {\n let source: MapLayerSource | undefined;\n if (url && mapName) {\n source = MapLayerSource.fromJSON({url, name: mapName, formatId: mapType});\n\n // Set credentials separately since they are not part of JSON\n if (source) {\n source.userName = userName || undefined; // When there is no value, empty string is always returned, in this case force it to undefined,\n source.password = password || undefined;\n\n if (customParamNames) {\n CustomParamUtils.setSourceCustomParams(source, customParamNames);\n }\n }\n\n }\n return source;\n }, [customParamNames, mapName, mapType, password, userName]);\n\n const handleOk = React.useCallback(() => {\n const mapUrlLow = mapUrl.toLowerCase();\n // Append 'https://' if url is missing scheme\n let url = mapUrl;\n if (!mapUrlLow.startsWith(URL_SCHEMES.http) && !mapUrlLow.startsWith(URL_SCHEMES.https)) {\n url = `${URL_SCHEMES.https}${mapUrl}`;\n setMapUrl(url);\n }\n\n const source = createSource(url);\n if (source === undefined || props.mapLayerSourceToEdit) {\n onOkResult();\n\n if (source === undefined) {\n // Close the dialog and inform end user something went wrong.\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: msgError, sourceName: mapName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n return;\n }\n\n // Store custom params mapping\n if (customParamNames) {\n const cpmStorage = new CustomParamsMappingStorage();\n cpmStorage.save(url.toLowerCase(), {customParamNames});\n }\n\n // Simply change the source definition in the setting service\n if (props.mapLayerSourceToEdit !== undefined) {\n // Apply changes to original source object\n props.mapLayerSourceToEdit.savedQueryParams = {...source.savedQueryParams};\n props.mapLayerSourceToEdit.unsavedQueryParams = {...source.unsavedQueryParams};\n\n const vp = props.activeViewport;\n void (async () => {\n if (isSettingsStorageAvailable && vp?.iModel?.iTwinId) {\n try {\n await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId, vp?.iModel.iModelId);\n } catch (err: any) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerEditError\", { layerName: props.mapLayerSourceToEdit?.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return;\n }\n }\n })();\n return;\n }\n }\n\n // Attach source asynchronously.\n void (async () => {\n\n try {\n setLayerAttachPending(true);\n const validation = await source.validateSource(true);\n\n if (isMounted.current) {\n setLayerAttachPending(false);\n }\n\n if (validation.status === MapLayerSourceStatus.Valid) {\n // Update service settings if storage is available and we are not prompting user for credentials\n if (isSettingsStorageAvailable && !props.signInModeArgs) {\n const storeOnIModel = (hasImodelContext ? \"Model\" === settingsStorage : undefined);\n const vp = props.activeViewport;\n if (vp?.iModel.iTwinId && !(await MapLayerPreferences.storeSource(source, vp.iModel.iTwinId, vp.iModel.iModelId, storeOnIModel))) {\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerPreferencesStoreFailed\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msgError));\n }\n }\n\n // Link an API key to this map-layer URL\n const customParamIdx: { [key: string]: string } = {};\n const privateCustomParamIdx: { [key: string]: string } = {};\n if (customParamNames && customParamNames.length>0) {\n // Link the map-layers URL custom params.\n const cpmStorage = new CustomParamsMappingStorage();\n cpmStorage.save(url.toLowerCase(), {customParamNames});\n\n const cpStorage = new CustomParamsStorage();\n customParamNames.forEach((customParamName) => {\n const items = cpStorage.get(customParamName);\n if (items && !Array.isArray(items) ) {\n (items.secret ? privateCustomParamIdx : customParamIdx)[items.key] = items.value;\n }\n });\n }\n\n onOkResult({source, validation, customParamIdx, privateCustomParamIdx});\n } else if (validation.status === MapLayerSourceStatus.InvalidCoordinateSystem) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCoordinateSystem\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n onOkResult({source, validation});\n } else if (validation.status === MapLayerSourceStatus.IncompatibleFormat) {\n setIncompatibleFormat(true);\n } else {\n const authNeeded = await updateAuthState(source, validation);\n if (!authNeeded) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\n onOkResult({source, validation});\n }\n }\n } catch (error) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n onOkResult();\n }\n })();\n\n }, [mapUrl, createSource, props.mapLayerSourceToEdit, props.activeViewport, props.signInModeArgs, onOkResult, customParamNames, mapName, isSettingsStorageAvailable, hasImodelContext, settingsStorage, updateAuthState]);\n\n React.useEffect(() => {\n const handleOAuthProcessEnd = (success: boolean, _state: any) => {\n onOauthProcessEnd.raiseEvent(success, _state);\n };\n\n const ac = IModelApp.mapLayerFormatRegistry.getAccessClient(mapType);\n if (ac?.onOAuthProcessEnd) {\n setAccessClient(ac); // cache it, so we dont need to make another lookup;\n ac.onOAuthProcessEnd.addListener(handleOAuthProcessEnd);\n }\n setAccessClientInitialized(true);\n return () => {\n if (ac?.onOAuthProcessEnd) {\n ac.onOAuthProcessEnd.removeListener(handleOAuthProcessEnd);\n }\n\n setAccessClient(undefined);\n setAccessClientInitialized(false);\n };\n }, [mapType, onOauthProcessEnd, setAccessClient]);\n\n const resetSignInState = React.useCallback(() => {\n setServerRequireCredentials(false);\n setInvalidCredentialsProvided(false);\n setShowOauthPopup(false);\n setOAuthProcessSucceeded(undefined);\n setExternalLoginUrl(undefined);\n }, []);\n\n // After a map type chang(or setting a new custom query Parameter), make sure the different Oauth states are reset.\n React.useEffect(() => {\n resetSignInState();\n }, [mapType, resetSignInState]);\n\n // After a map type change, make sure the different Oauth states are reset.\n React.useEffect(() => {\n setIncompatibleFormat(false);\n }, [mapType, mapUrl]);\n\n // The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)\n // makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)\n // Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.\n React.useEffect(() => {\n // Attach source asynchronously.\n void (async () => {\n if (isAccessClientInitialized\n && shouldAutoAttachSource\n && props.signInModeArgs !== undefined) {\n try {\n\n let source = props.signInModeArgs.source;\n let validation = props.signInModeArgs.validation;\n if (!source || !validation) {\n // In some cases we don't know why the layer failed to attach, so we need to go through validation process\n source = MapLayerSource.fromJSON({\n url: props.signInModeArgs.layer.url,\n name: props.signInModeArgs.layer.name,\n formatId: props.signInModeArgs.layer.formatId,\n });\n\n if (source !== undefined) {\n if (props.signInModeArgs.layer.savedQueryParams)\n source.savedQueryParams = {...props.signInModeArgs.layer.savedQueryParams};\n if (props.signInModeArgs.layer.unsavedQueryParams)\n source.unsavedQueryParams = {...props.signInModeArgs.layer.unsavedQueryParams};\n\n setLayerAttachPending(true);\n\n validation = await source.validateSource(true);\n if (isMounted.current) {\n setLayerAttachPending(false);\n }\n }\n }\n if (source && validation) {\n setShouldAutoAttachSource(false);\n await updateAuthState(source, validation);\n }\n\n } catch (_error) { }\n }\n })();\n\n }, [isAccessClientInitialized, props.signInModeArgs, shouldAutoAttachSource, updateAuthState]);\n\n const dialogContainer = React.useRef<HTMLDivElement>(null);\n\n const readyToSave = React.useCallback(() => {\n const credentialsSet = !!userName && !!password;\n const ready = (!!mapUrl && !!mapName)\n && !layerAttachPending\n && (!serverRequireCredentials || credentialsSet)\n && !invalidCredentialsProvided\n && !incompatibleFormat\n && (externalLoginUrl === undefined || (externalLoginUrl !== undefined && oauthProcessSucceeded));\n return ready;\n }, [userName, password, mapUrl, mapName, layerAttachPending, serverRequireCredentials, invalidCredentialsProvided, incompatibleFormat, externalLoginUrl, oauthProcessSucceeded]);\n\n const handleOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\n // eslint-disable-next-line deprecation/deprecation\n if (event.key === SpecialKey.Enter) {\n if (readyToSave())\n handleOk();\n }\n }, [handleOk, readyToSave]);\n\n // onOauthProcessEnd events handler\n React.useEffect(() => {\n const handleOauthProcess = (success: boolean, _state: any) => {\n setLayerAuthPending(false);\n if (success) {\n setOAuthProcessSucceeded(true);\n setShowOauthPopup(false);\n setLayerAttachPending(false);\n handleOk(); // Add the layer the same way the user would do by clicking 'ok'\n } else {\n setShowOauthPopup(false);\n setLayerAttachPending(false);\n setOAuthProcessSucceeded(false);\n }\n };\n\n onOauthProcessEnd.addListener(handleOauthProcess);\n return () => {\n onOauthProcessEnd.removeListener(handleOauthProcess);\n };\n }, [handleOk, onOauthProcessEnd]);\n\n //\n // Monitors authentication method changes\n React.useEffect(() => {\n\n if (serverRequireCredentials && oauthProcessSucceeded === undefined && externalLoginUrl !== undefined) {\n handleArcGisLogin();\n }\n }, [oauthProcessSucceeded, externalLoginUrl, handleArcGisLogin, serverRequireCredentials]);\n\n // Monitors Oauth2 popup was closed\n const handleOAuthPopupClose = React.useCallback(() => {\n setShowOauthPopup(false);\n setLayerAuthPending(false);\n if (oauthProcessSucceeded === undefined)\n setOAuthProcessSucceeded(false); // indicates there was a failed attempt\n }, [oauthProcessSucceeded]);\n\n // Utility function to get warning message section\n function renderWarningMessage(): React.ReactNode {\n let warningMessage: string | undefined;\n\n // Get the proper warning message\n if (showOauthPopup) {\n warningMessage = externalLoginWaitingMsg;\n } else if (oauthProcessSucceeded === false) {\n warningMessage = externalLoginFailedMsg;\n } else if (oauthProcessSucceeded === true) {\n warningMessage = externalLoginSucceededMsg;\n } else if (invalidCredentialsProvided) {\n warningMessage = invalidCredentialsLabel;\n } else if (serverRequireCredentials && (!userName || !password)) {\n warningMessage = missingCredentialsLabel;\n }\n\n // Sometimes we want to add an extra node, such as a button\n let extraNode: React.ReactNode;\n if (oauthProcessSucceeded === false) {\n extraNode = <div>\n <Button onClick={handleArcGisLogin}>{externalLoginTryAgainLabel}</Button>\n </div>;\n }\n\n if (warningMessage !== undefined) {\n return (\n <div className=\"map-layer-source-warnMessage\">\n <Icon size=\"small\"><SvgStatusWarning></SvgStatusWarning></Icon>\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span >\n {extraNode}\n </div>);\n } else {\n return (<span className=\"map-layer-source-placeholder\"> </span>);\n }\n }\n\n // Use a hook to display the popup.\n // The display of the popup is controlled by the 'showOauthPopup' state variable.\n useCrossOriginPopup(showOauthPopup, externalLoginUrl, externalLoginTitle, 450, 450, handleOAuthPopupClose);\n\n function getFooter() {\n\n return (\n <div className=\"map-layer-source-footer\">\n <div className=\"map-layer-source-footer-status\"/>\n <div>\n <Button\n className=\"map-layer-features-footer-button\"\n styleType='high-visibility'\n onClick={handleOk}\n disabled={!readyToSave()}\n >\n {props?.mapLayerSourceToEdit ? MapLayersUI.translate(\"Dialog.Edit\") : MapLayersUI.translate(\"Dialog.Add\")}\n </Button>\n <Button\n className=\"map-layer-source-footer-button\"\n styleType='default'\n onClick={handleCancel}\n >\n {MapLayersUI.translate(\"Dialog.Cancel\")}\n </Button>\n </div>\n </div>\n );\n }\n\n return (\n <div ref={dialogContainer}>\n <Dialog\n className=\"map-layer-url-dialog\"\n title={dialogTitle}\n opened={true}\n resizable={true}\n movable={true}\n modal={true}\n footer={getFooter()}\n onClose={handleCancel}\n onEscape={handleCancel}\n minHeight={120}\n maxWidth={600}\n titleStyle={{ paddingLeft: \"10px\" }}\n footerStyle={{ paddingBottom: \"10px\", paddingRight: \"10px\" }}\n trapFocus={false}\n >\n <div className=\"map-layer-url-dialog-content\">\n <div className=\"map-layer-source-url\">\n <span className=\"map-layer-source-label\">{typeLabel}</span>\n <SelectMapFormat\n value={mapType}\n disabled={props.signInModeArgs !== undefined || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending}\n onChange={setMapType}\n mapTypesOptions={mapLayerOptions?.mapTypeOptions}\n status={incompatibleFormat ? \"warning\" : undefined}\n message={incompatibleFormat ? MapLayersUI.translate(\"CustomAttach.InvalidType\") : undefined}\n />\n <span className=\"map-layer-source-label\">{nameLabel}</span>\n <Input className=\"map-layer-source-input\" placeholder={nameInputPlaceHolder} onChange={onNameChange} value={mapName} disabled={!!props.signInModeArgs || layerAttachPending || layerAuthPending} />\n <span className=\"map-layer-source-label\">{urlLabel}</span>\n <Input className=\"map-layer-source-input\" placeholder={urlInputPlaceHolder} onKeyPress={handleOnKeyDown} onChange={onUrlChange} disabled={!!props.signInModeArgs || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending} value={mapUrl} />\n <span className=\"map-layer-source-label\">{MapLayersUI.translate(\"CustomAttach.CustomParamsLabel\")}\n <div title={MapLayersUI.translate(\"Labels.TechPreviewBadgeTooltip\")} className=\"map-layer-source-previewBadge-icon\">\n <Icon size=\"small\"><SvgTechnicalPreviewMini /></Icon>\n </div>\n </span>\n <SelectCustomParam value={customParamNames} disabled={layerAttachPending || layerAuthPending} onChange={(paramNames) => {setCustomParamNames(paramNames); SetCustomParamNamesChangedByUser(true); resetSignInState();}}/>\n\n {serverRequireCredentials\n && externalLoginUrl === undefined // external login is handled in popup\n && props.mapLayerSourceToEdit === undefined &&\n <>\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\n <LabeledInput className=\"map-layer-source-input\"\n displayStyle=\"inline\"\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\n status={(!userName && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\n disabled={layerAttachPending || layerAuthPending}\n onChange={onUsernameChange}\n value={userName}\n size=\"small\" />\n\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\n <LabeledInput className=\"map-layer-source-input\"\n displayStyle=\"inline\"\n type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\n status={(!password && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\n disabled={layerAttachPending || layerAuthPending}\n onChange={onPasswordChange}\n onKeyPress={handleOnKeyDown}\n value={password}\n size=\"small\" />\n\n </>\n }\n\n {/* Store settings options, not shown when editing a layer */}\n {!props.signInModeArgs\n && !props.mapLayerSourceToEdit\n && <div title={!isSettingsStorageAvailable ? noSaveSettingsWarning : \"\"}>\n {hasImodelContext && mapLayerOptions?.showUserPreferencesStorageOptions && (\n <UserPreferencesStorageOptions\n disabled={!isSettingsStorageAvailable}\n itwinChecked={settingsStorage === \"iTwin\"}\n modelChecked={settingsStorage === \"Model\"}\n onChange={onRadioChange}\n />\n )}\n </div>}\n </div>\n </div>\n\n {/* Warning message */}\n {renderWarningMessage()}\n\n {/* Progress bar */}\n {(layerAttachPending || layerAuthPending) &&\n <div className=\"map-layer-source-progressBar\">\n <ProgressLinear indeterminate />\n </div>\n }\n </Dialog>\n </div >\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,8BAA8B;AAE9B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACpI,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,mBAAm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C,KAAK,CAAC,cAAc,IAAI,CAAC,KAAK,CAAC,oBAAoB,IAAI,CACvD,cAAK,KAAK,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,YACjE,gBAAgB,IAAI,eAAe,EAAE,iCAAiC,IAAI,CACzE,KAAC,6BAA6B,IAC5B,QAAQ,EAAE,CAAC,0BAA0B,EACrC,YAAY,EAAE,eAAe,KAAK,OAAO,EACzC,YAAY,EAAE,eAAe,KAAK,OAAO,EACzC,QAAQ,EAAE,aAAa,GACvB,CACH,GACG,CACP,IACG,GACF,EAGL,oBAAoB,EAAE,EAGtB,CAAC,kBAAkB,IAAI,gBAAgB,CAAC,IAAI,CAC3C,cAAK,SAAS,EAAC,8BAA8B,YAC3C,KAAC,cAAc,IAAC,aAAa,SAAG,GAC5B,CACP,IACM,GACL,CACP,CAAC;AACJ,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 *--------------------------------------------------------------------------------------------*/\n// cSpell:ignore Modeless WMTS\n\nimport \"./MapUrlDialog.scss\";\nimport * as React from \"react\";\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { BeEvent, Guid } from \"@itwin/core-bentley\";\nimport { IModelApp, MapLayerSource, MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority } from \"@itwin/core-frontend\";\nimport { Dialog, useCrossOriginPopup } from \"@itwin/core-react\";\nimport { SvgStatusWarning, SvgTechnicalPreviewMini } from \"@itwin/itwinui-icons-color-react\";\nimport { Button, Icon, Input, LabeledInput, ProgressLinear } from \"@itwin/itwinui-react\";\nimport { CustomParamsMappingStorage } from \"../../CustomParamsMappingStorage\";\nimport { CustomParamsStorage } from \"../../CustomParamsStorage\";\nimport { CustomParamUtils } from \"../../CustomParamUtils\";\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { SelectCustomParam } from \"./SelectCustomParam\";\nimport { SelectMapFormat } from \"./SelectMapFormat\";\nimport { UserPreferencesStorageOptions } from \"./UserPreferencesStorageOptions\";\n\nimport type { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport type { MapLayerAccessClient, MapLayerSourceValidation, ScreenViewport } from \"@itwin/core-frontend\";\nimport type { MapLayerOptions } from \"../Interfaces\";\nexport const MAP_TYPES = {\n wms: \"WMS\",\n arcGis: \"ArcGIS\",\n wmts: \"WMTS\",\n tileUrl: \"TileURL\",\n arcGisFeature: \"ArcGISFeature\",\n};\nconst URL_SCHEMES = {\n http: \"http://\",\n https: \"https://\",\n};\n\nexport type LayerCreationMode = \"single\" | \"multiple\";\ninterface MapUrlDialogProps {\n activeViewport?: ScreenViewport;\n isOverlay: boolean;\n onOkResult: (result?: SourceState) => void;\n onCancelResult?: () => void;\n mapLayerOptions?: MapLayerOptions;\n\n // An optional layer definition can be provide to enable the edit mode\n signInModeArgs?: {\n layer: ImageMapLayerSettings;\n validation?: MapLayerSourceValidation;\n source?: MapLayerSource;\n };\n\n mapLayerSourceToEdit?: MapLayerSource;\n}\n\nexport interface SourceState {\n source: MapLayerSource;\n validation: MapLayerSourceValidation;\n customParamIdx?: { [key: string]: string };\n privateCustomParamIdx?: { [key: string]: string };\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapUrlDialog(props: MapUrlDialogProps) {\n const { onOkResult, mapLayerOptions } = props;\n\n const getMapUrlFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.url;\n } else if (props.signInModeArgs) {\n return props.signInModeArgs.layer.url;\n }\n return \"\";\n }, [props.mapLayerSourceToEdit, props.signInModeArgs]);\n\n const getMapNameFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.name;\n } else if (props.signInModeArgs) {\n return props.signInModeArgs.layer.name;\n }\n return \"\";\n }, [props.mapLayerSourceToEdit, props.signInModeArgs]);\n\n const getFormatFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.formatId;\n } else if (props.signInModeArgs) {\n return props.signInModeArgs.layer.formatId;\n }\n return undefined;\n }, [props.mapLayerSourceToEdit, props.signInModeArgs]);\n\n const getCustomParamsMapping = React.useCallback((url: string): string[] => {\n const cpMappingStorage = new CustomParamsMappingStorage();\n const cpMapping = cpMappingStorage.get(url.toLowerCase());\n if (cpMapping && !Array.isArray(cpMapping)) {\n return cpMapping.customParamNames;\n }\n return [];\n }, []);\n\n const [dialogTitle] = React.useState(\n MapLayersUI.localization.getLocalizedString(\n props.signInModeArgs || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\",\n ),\n );\n const [typeLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\n const [nameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\n const [nameInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\n const [urlLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\n const [urlInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\n const [missingCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\n const [invalidCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\n const [externalLoginTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLogin\"));\n const [externalLoginFailedMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginFailed\"));\n const [externalLoginSucceededMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginSucceeded\"));\n const [externalLoginWaitingMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginWaiting\"));\n const [externalLoginTryAgainLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginTryAgain\"));\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(false);\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\n const [layerAuthPending, setLayerAuthPending] = React.useState(false);\n const [mapUrl, setMapUrl] = React.useState(getMapUrlFromProps());\n const [mapName, setMapName] = React.useState(getMapNameFromProps());\n const [userName, setUserName] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [noSaveSettingsWarning] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\n const [passwordLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\n const [passwordRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\n const [userNameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\n const [userNameRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"iTwin\");\n const [oauthProcessSucceeded, setOAuthProcessSucceeded] = React.useState<undefined | boolean>(undefined);\n const [showOauthPopup, setShowOauthPopup] = React.useState(false);\n const [externalLoginUrl, setExternalLoginUrl] = React.useState<string | undefined>();\n const [onOauthProcessEnd] = React.useState(new BeEvent());\n const [accessClient, setAccessClient] = React.useState<MapLayerAccessClient | undefined>();\n const [isAccessClientInitialized, setAccessClientInitialized] = React.useState(false);\n const [shouldAutoAttachSource, setShouldAutoAttachSource] = React.useState(true);\n const [incompatibleFormat, setIncompatibleFormat] = React.useState(false);\n\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? \"ArcGIS\");\n const [customParamNamesChangedByUser, SetCustomParamNamesChangedByUser] = React.useState<boolean>(false);\n const [customParamNames, setCustomParamNames] = React.useState<string[] | undefined>(() => {\n if (mapUrl) {\n return getCustomParamsMapping(mapUrl);\n }\n return undefined;\n });\n\n // 'isMounted' is used to prevent any async operation once the hook has been\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && props?.activeViewport?.iModel?.iTwinId);\n const [hasImodelContext] = React.useState(\n props?.activeViewport?.iModel?.iTwinId !== undefined &&\n props.activeViewport.iModel.iTwinId !== Guid.empty &&\n props?.activeViewport?.iModel?.iModelId !== undefined &&\n props?.activeViewport.iModel.iModelId !== Guid.empty,\n );\n\n const handleCancel = React.useCallback(() => {\n if (props.onCancelResult) {\n props.onCancelResult();\n return;\n }\n }, [props]);\n\n const onUsernameChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setUserName(event.target.value);\n if (invalidCredentialsProvided) {\n setInvalidCredentialsProvided(false);\n }\n },\n [setUserName, invalidCredentialsProvided, setInvalidCredentialsProvided],\n );\n\n const onPasswordChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setPassword(event.target.value);\n if (invalidCredentialsProvided) {\n setInvalidCredentialsProvided(false);\n }\n },\n [setPassword, invalidCredentialsProvided, setInvalidCredentialsProvided],\n );\n\n const handleArcGisLogin = React.useCallback(() => {\n setLayerAuthPending(true);\n setShowOauthPopup(true);\n if (oauthProcessSucceeded === false) {\n setOAuthProcessSucceeded(undefined);\n }\n }, [oauthProcessSucceeded]);\n\n // return true if authorization is needed\n const updateAuthState = React.useCallback(\n async (source: MapLayerSource, sourceValidation: MapLayerSourceValidation) => {\n const sourceRequireAuth = sourceValidation.status === MapLayerSourceStatus.RequireAuth;\n let invalidCredentials = sourceValidation.status === MapLayerSourceStatus.InvalidCredentials;\n if (sourceRequireAuth) {\n let hasTokenEndPoint = false;\n const settings = source.toLayerSettings();\n\n if (accessClient !== undefined && accessClient.getTokenServiceEndPoint !== undefined && settings !== undefined) {\n try {\n const tokenEndpoint = await accessClient.getTokenServiceEndPoint(settings.url);\n if (tokenEndpoint !== undefined) {\n const loginUrl = tokenEndpoint.getLoginUrl();\n setExternalLoginUrl(loginUrl);\n hasTokenEndPoint = true;\n }\n } catch (_error) {}\n } else if (userName.length > 0 || password.length > 0) {\n // This is a patch until @itwin\\core-frontend return the expected 'InvalidCredentials' status.\n invalidCredentials = true;\n }\n\n if (!hasTokenEndPoint && (userName.length > 0 || password.length > 0)) {\n // This is a patch until @itwin\\core-frontend return the expected 'InvalidCredentials' status.\n invalidCredentials = true;\n }\n }\n setServerRequireCredentials(sourceRequireAuth || invalidCredentials);\n if (invalidCredentials) {\n setInvalidCredentialsProvided(true);\n } else if (invalidCredentialsProvided) {\n setInvalidCredentialsProvided(false); // flag reset\n }\n\n return sourceRequireAuth || invalidCredentials;\n },\n [accessClient, invalidCredentialsProvided, password.length, userName.length],\n );\n\n const onNameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setMapName(event.target.value);\n }, []);\n\n const onRadioChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setSettingsStorageRadio(event.target.value);\n },\n [setSettingsStorageRadio],\n );\n\n const onUrlChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n setMapUrl(value);\n\n if (!customParamNamesChangedByUser) {\n if (value === \"\") {\n setCustomParamNames(undefined);\n } else {\n const paramNames = getCustomParamsMapping(value);\n setCustomParamNames(paramNames);\n }\n }\n },\n [getCustomParamsMapping, customParamNamesChangedByUser],\n );\n\n const createSource = React.useCallback(\n (url: string) => {\n let source: MapLayerSource | undefined;\n if (url && mapName) {\n source = MapLayerSource.fromJSON({ url, name: mapName, formatId: mapType });\n\n // Set credentials separately since they are not part of JSON\n if (source) {\n source.userName = userName || undefined; // When there is no value, empty string is always returned, in this case force it to undefined,\n source.password = password || undefined;\n\n if (customParamNames) {\n CustomParamUtils.setSourceCustomParams(source, customParamNames);\n }\n }\n }\n return source;\n },\n [customParamNames, mapName, mapType, password, userName],\n );\n\n const handleOk = React.useCallback(() => {\n const mapUrlLow = mapUrl.toLowerCase();\n // Append 'https://' if url is missing scheme\n let url = mapUrl;\n if (!mapUrlLow.startsWith(URL_SCHEMES.http) && !mapUrlLow.startsWith(URL_SCHEMES.https)) {\n url = `${URL_SCHEMES.https}${mapUrl}`;\n setMapUrl(url);\n }\n\n const source = createSource(url);\n if (source === undefined || props.mapLayerSourceToEdit) {\n onOkResult();\n\n if (source === undefined) {\n // Close the dialog and inform end user something went wrong.\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: msgError, sourceName: mapName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n return;\n }\n\n // Store custom params mapping\n if (customParamNames) {\n const cpmStorage = new CustomParamsMappingStorage();\n cpmStorage.save(url.toLowerCase(), { customParamNames });\n }\n\n // Simply change the source definition in the setting service\n if (props.mapLayerSourceToEdit !== undefined) {\n // Apply changes to original source object\n props.mapLayerSourceToEdit.savedQueryParams = { ...source.savedQueryParams };\n props.mapLayerSourceToEdit.unsavedQueryParams = { ...source.unsavedQueryParams };\n\n const vp = props.activeViewport;\n void (async () => {\n if (isSettingsStorageAvailable && vp?.iModel?.iTwinId) {\n try {\n await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId, vp?.iModel.iModelId);\n } catch (err: any) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerEditError\", {\n layerName: props.mapLayerSourceToEdit?.name,\n });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return;\n }\n }\n })();\n return;\n }\n }\n\n // Attach source asynchronously.\n void (async () => {\n try {\n setLayerAttachPending(true);\n const validation = await source.validateSource(true);\n\n if (isMounted.current) {\n setLayerAttachPending(false);\n }\n\n if (validation.status === MapLayerSourceStatus.Valid) {\n // Update service settings if storage is available and we are not prompting user for credentials\n if (isSettingsStorageAvailable && !props.signInModeArgs) {\n const storeOnIModel = hasImodelContext ? \"Model\" === settingsStorage : undefined;\n const vp = props.activeViewport;\n if (vp?.iModel.iTwinId && !(await MapLayerPreferences.storeSource(source, vp.iModel.iTwinId, vp.iModel.iModelId, storeOnIModel))) {\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerPreferencesStoreFailed\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msgError));\n }\n }\n\n // Link an API key to this map-layer URL\n const customParamIdx: { [key: string]: string } = {};\n const privateCustomParamIdx: { [key: string]: string } = {};\n if (customParamNames && customParamNames.length > 0) {\n // Link the map-layers URL custom params.\n const cpmStorage = new CustomParamsMappingStorage();\n cpmStorage.save(url.toLowerCase(), { customParamNames });\n\n const cpStorage = new CustomParamsStorage();\n customParamNames.forEach((customParamName) => {\n const items = cpStorage.get(customParamName);\n if (items && !Array.isArray(items)) {\n (items.secret ? privateCustomParamIdx : customParamIdx)[items.key] = items.value;\n }\n });\n }\n\n onOkResult({ source, validation, customParamIdx, privateCustomParamIdx });\n } else if (validation.status === MapLayerSourceStatus.InvalidCoordinateSystem) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCoordinateSystem\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n onOkResult({ source, validation });\n } else if (validation.status === MapLayerSourceStatus.IncompatibleFormat) {\n setIncompatibleFormat(true);\n } else {\n const authNeeded = await updateAuthState(source, validation);\n if (!authNeeded) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\n onOkResult({ source, validation });\n }\n }\n } catch (error) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n onOkResult();\n }\n })();\n }, [\n mapUrl,\n createSource,\n props.mapLayerSourceToEdit,\n props.activeViewport,\n props.signInModeArgs,\n onOkResult,\n customParamNames,\n mapName,\n isSettingsStorageAvailable,\n hasImodelContext,\n settingsStorage,\n updateAuthState,\n ]);\n\n React.useEffect(() => {\n const handleOAuthProcessEnd = (success: boolean, _state: any) => {\n onOauthProcessEnd.raiseEvent(success, _state);\n };\n\n const ac = IModelApp.mapLayerFormatRegistry.getAccessClient(mapType);\n if (ac?.onOAuthProcessEnd) {\n setAccessClient(ac); // cache it, so we don't need to make another lookup;\n ac.onOAuthProcessEnd.addListener(handleOAuthProcessEnd);\n }\n setAccessClientInitialized(true);\n return () => {\n if (ac?.onOAuthProcessEnd) {\n ac.onOAuthProcessEnd.removeListener(handleOAuthProcessEnd);\n }\n\n setAccessClient(undefined);\n setAccessClientInitialized(false);\n };\n }, [mapType, onOauthProcessEnd, setAccessClient]);\n\n const resetSignInState = React.useCallback(() => {\n setServerRequireCredentials(false);\n setInvalidCredentialsProvided(false);\n setShowOauthPopup(false);\n setOAuthProcessSucceeded(undefined);\n setExternalLoginUrl(undefined);\n }, []);\n\n // After a map type chang(or setting a new custom query Parameter), make sure the different Oauth states are reset.\n React.useEffect(() => {\n resetSignInState();\n }, [mapType, resetSignInState]);\n\n // After a map type change, make sure the different Oauth states are reset.\n React.useEffect(() => {\n setIncompatibleFormat(false);\n }, [mapType, mapUrl]);\n\n // The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)\n // makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)\n // Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.\n React.useEffect(() => {\n // Attach source asynchronously.\n void (async () => {\n if (isAccessClientInitialized && shouldAutoAttachSource && props.signInModeArgs !== undefined) {\n try {\n let source = props.signInModeArgs.source;\n let validation = props.signInModeArgs.validation;\n if (!source || !validation) {\n // In some cases we don't know why the layer failed to attach, so we need to go through validation process\n source = MapLayerSource.fromJSON({\n url: props.signInModeArgs.layer.url,\n name: props.signInModeArgs.layer.name,\n formatId: props.signInModeArgs.layer.formatId,\n });\n\n if (source !== undefined) {\n if (props.signInModeArgs.layer.savedQueryParams) {\n source.savedQueryParams = { ...props.signInModeArgs.layer.savedQueryParams };\n }\n if (props.signInModeArgs.layer.unsavedQueryParams) {\n source.unsavedQueryParams = { ...props.signInModeArgs.layer.unsavedQueryParams };\n }\n\n setLayerAttachPending(true);\n\n validation = await source.validateSource(true);\n if (isMounted.current) {\n setLayerAttachPending(false);\n }\n }\n }\n if (source && validation) {\n setShouldAutoAttachSource(false);\n await updateAuthState(source, validation);\n }\n } catch (_error) {}\n }\n })();\n }, [isAccessClientInitialized, props.signInModeArgs, shouldAutoAttachSource, updateAuthState]);\n\n const dialogContainer = React.useRef<HTMLDivElement>(null);\n\n const readyToSave = React.useCallback(() => {\n const credentialsSet = !!userName && !!password;\n const ready =\n !!mapUrl &&\n !!mapName &&\n !layerAttachPending &&\n (!serverRequireCredentials || credentialsSet) &&\n !invalidCredentialsProvided &&\n !incompatibleFormat &&\n (externalLoginUrl === undefined || (externalLoginUrl !== undefined && oauthProcessSucceeded));\n return ready;\n }, [\n userName,\n password,\n mapUrl,\n mapName,\n layerAttachPending,\n serverRequireCredentials,\n invalidCredentialsProvided,\n incompatibleFormat,\n externalLoginUrl,\n oauthProcessSucceeded,\n ]);\n\n const handleOnKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n // eslint-disable-next-line deprecation/deprecation\n if (event.key === SpecialKey.Enter) {\n if (readyToSave()) {\n handleOk();\n }\n }\n },\n [handleOk, readyToSave],\n );\n\n // onOauthProcessEnd events handler\n React.useEffect(() => {\n const handleOauthProcess = (success: boolean, _state: any) => {\n setLayerAuthPending(false);\n if (success) {\n setOAuthProcessSucceeded(true);\n setShowOauthPopup(false);\n setLayerAttachPending(false);\n handleOk(); // Add the layer the same way the user would do by clicking 'ok'\n } else {\n setShowOauthPopup(false);\n setLayerAttachPending(false);\n setOAuthProcessSucceeded(false);\n }\n };\n\n onOauthProcessEnd.addListener(handleOauthProcess);\n return () => {\n onOauthProcessEnd.removeListener(handleOauthProcess);\n };\n }, [handleOk, onOauthProcessEnd]);\n\n //\n // Monitors authentication method changes\n React.useEffect(() => {\n if (serverRequireCredentials && oauthProcessSucceeded === undefined && externalLoginUrl !== undefined) {\n handleArcGisLogin();\n }\n }, [oauthProcessSucceeded, externalLoginUrl, handleArcGisLogin, serverRequireCredentials]);\n\n // Monitors Oauth2 popup was closed\n const handleOAuthPopupClose = React.useCallback(() => {\n setShowOauthPopup(false);\n setLayerAuthPending(false);\n if (oauthProcessSucceeded === undefined) {\n setOAuthProcessSucceeded(false);\n } // indicates there was a failed attempt\n }, [oauthProcessSucceeded]);\n\n // Utility function to get warning message section\n function renderWarningMessage(): React.ReactNode {\n let warningMessage: string | undefined;\n\n // Get the proper warning message\n if (showOauthPopup) {\n warningMessage = externalLoginWaitingMsg;\n } else if (oauthProcessSucceeded === false) {\n warningMessage = externalLoginFailedMsg;\n } else if (oauthProcessSucceeded === true) {\n warningMessage = externalLoginSucceededMsg;\n } else if (invalidCredentialsProvided) {\n warningMessage = invalidCredentialsLabel;\n } else if (serverRequireCredentials && (!userName || !password)) {\n warningMessage = missingCredentialsLabel;\n }\n\n // Sometimes we want to add an extra node, such as a button\n let extraNode: React.ReactNode;\n if (oauthProcessSucceeded === false) {\n extraNode = (\n <div>\n <Button onClick={handleArcGisLogin}>{externalLoginTryAgainLabel}</Button>\n </div>\n );\n }\n\n if (warningMessage !== undefined) {\n return (\n <div className=\"map-layer-source-warnMessage\">\n <Icon size=\"small\">\n <SvgStatusWarning></SvgStatusWarning>\n </Icon>\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span>\n {extraNode}\n </div>\n );\n } else {\n return <span className=\"map-layer-source-placeholder\"> </span>;\n }\n }\n\n // Use a hook to display the popup.\n // The display of the popup is controlled by the 'showOauthPopup' state variable.\n useCrossOriginPopup(showOauthPopup, externalLoginUrl, externalLoginTitle, 450, 450, handleOAuthPopupClose);\n\n function getFooter() {\n return (\n <div className=\"map-layer-source-footer\">\n <div className=\"map-layer-source-footer-status\" />\n <div>\n <Button className=\"map-layer-features-footer-button\" styleType=\"high-visibility\" onClick={handleOk} disabled={!readyToSave()}>\n {props?.mapLayerSourceToEdit ? MapLayersUI.translate(\"Dialog.Edit\") : MapLayersUI.translate(\"Dialog.Add\")}\n </Button>\n <Button className=\"map-layer-source-footer-button\" styleType=\"default\" onClick={handleCancel}>\n {MapLayersUI.translate(\"Dialog.Cancel\")}\n </Button>\n </div>\n </div>\n );\n }\n\n return (\n <div ref={dialogContainer}>\n <Dialog\n className=\"map-layer-url-dialog\"\n title={dialogTitle}\n opened={true}\n resizable={true}\n movable={true}\n modal={true}\n footer={getFooter()}\n onClose={handleCancel}\n onEscape={handleCancel}\n minHeight={120}\n maxWidth={600}\n titleStyle={{ paddingLeft: \"10px\" }}\n footerStyle={{ paddingBottom: \"10px\", paddingRight: \"10px\" }}\n trapFocus={false}\n >\n <div className=\"map-layer-url-dialog-content\">\n <div className=\"map-layer-source-url\">\n <span className=\"map-layer-source-label\">{typeLabel}</span>\n <SelectMapFormat\n value={mapType}\n disabled={props.signInModeArgs !== undefined || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending}\n onChange={setMapType}\n mapTypesOptions={mapLayerOptions?.mapTypeOptions}\n status={incompatibleFormat ? \"warning\" : undefined}\n message={incompatibleFormat ? MapLayersUI.translate(\"CustomAttach.InvalidType\") : undefined}\n />\n <span className=\"map-layer-source-label\">{nameLabel}</span>\n <Input\n className=\"map-layer-source-input\"\n placeholder={nameInputPlaceHolder}\n onChange={onNameChange}\n value={mapName}\n disabled={!!props.signInModeArgs || layerAttachPending || layerAuthPending}\n />\n <span className=\"map-layer-source-label\">{urlLabel}</span>\n <Input\n className=\"map-layer-source-input\"\n placeholder={urlInputPlaceHolder}\n onKeyPress={handleOnKeyDown}\n onChange={onUrlChange}\n disabled={!!props.signInModeArgs || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending}\n value={mapUrl}\n />\n <span className=\"map-layer-source-label\">\n {MapLayersUI.translate(\"CustomAttach.CustomParamsLabel\")}\n <div title={MapLayersUI.translate(\"Labels.TechPreviewBadgeTooltip\")} className=\"map-layer-source-previewBadge-icon\">\n <Icon size=\"small\">\n <SvgTechnicalPreviewMini />\n </Icon>\n </div>\n </span>\n <SelectCustomParam\n value={customParamNames}\n disabled={layerAttachPending || layerAuthPending}\n onChange={(paramNames) => {\n setCustomParamNames(paramNames);\n SetCustomParamNamesChangedByUser(true);\n resetSignInState();\n }}\n />\n\n {serverRequireCredentials &&\n externalLoginUrl === undefined && // external login is handled in popup\n props.mapLayerSourceToEdit === undefined && (\n <>\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\n <LabeledInput\n className=\"map-layer-source-input\"\n displayStyle=\"inline\"\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\n status={(!userName && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\n disabled={layerAttachPending || layerAuthPending}\n onChange={onUsernameChange}\n value={userName}\n size=\"small\"\n />\n\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\n <LabeledInput\n className=\"map-layer-source-input\"\n displayStyle=\"inline\"\n type=\"password\"\n placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\n status={(!password && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\n disabled={layerAttachPending || layerAuthPending}\n onChange={onPasswordChange}\n onKeyPress={handleOnKeyDown}\n value={password}\n size=\"small\"\n />\n </>\n )}\n\n {/* Store settings options, not shown when editing a layer */}\n {!props.signInModeArgs && !props.mapLayerSourceToEdit && (\n <div title={!isSettingsStorageAvailable ? noSaveSettingsWarning : \"\"}>\n {hasImodelContext && mapLayerOptions?.showUserPreferencesStorageOptions && (\n <UserPreferencesStorageOptions\n disabled={!isSettingsStorageAvailable}\n itwinChecked={settingsStorage === \"iTwin\"}\n modelChecked={settingsStorage === \"Model\"}\n onChange={onRadioChange}\n />\n )}\n </div>\n )}\n </div>\n </div>\n\n {/* Warning message */}\n {renderWarningMessage()}\n\n {/* Progress bar */}\n {(layerAttachPending || layerAuthPending) && (\n <div className=\"map-layer-source-progressBar\">\n <ProgressLinear indeterminate />\n </div>\n )}\n </Dialog>\n </div>\n );\n}\n"]}
|