@itwin/map-layers 4.0.0-dev.4 → 4.0.0-dev.41
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 +21 -5
- package/lib/cjs/MapLayerPreferences.js +1 -2
- package/lib/cjs/MapLayerPreferences.js.map +1 -1
- package/lib/cjs/mapLayers.js +10 -12
- package/lib/cjs/mapLayers.js.map +1 -1
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +1 -2
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/MapFeatureInfoTool.d.ts.map +1 -1
- package/lib/cjs/ui/MapFeatureInfoTool.js +1 -1
- package/lib/cjs/ui/MapFeatureInfoTool.js.map +1 -1
- package/lib/cjs/ui/MapLayersUiItemsProvider.js +1 -1
- package/lib/cjs/ui/MapLayersUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js +20 -23
- package/lib/cjs/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.js +4 -4
- package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/cjs/ui/widget/ConfirmMessageDialog.js +4 -7
- package/lib/cjs/ui/widget/ConfirmMessageDialog.js.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.js +3 -4
- package/lib/cjs/ui/widget/FeatureInfoDataProvider.js.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.js +10 -16
- package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerDroppable.js +4 -7
- package/lib/cjs/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.js +17 -19
- package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js +2 -3
- package/lib/cjs/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js +2 -2
- package/lib/cjs/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayersWidget.js +4 -4
- package/lib/cjs/ui/widget/MapLayersWidget.js.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.js +35 -32
- package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/cjs/ui/widget/SelectMapFormat.js +7 -12
- package/lib/cjs/ui/widget/SelectMapFormat.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersDataProvider.js +4 -5
- package/lib/cjs/ui/widget/SubLayersDataProvider.js.map +1 -1
- package/lib/cjs/ui/widget/SubLayersTree.js +28 -34
- package/lib/cjs/ui/widget/SubLayersTree.js.map +1 -1
- package/lib/esm/MapLayerPreferences.js +1 -2
- package/lib/esm/MapLayerPreferences.js.map +1 -1
- package/lib/esm/mapLayers.js +10 -12
- package/lib/esm/mapLayers.js.map +1 -1
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js +1 -2
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/MapFeatureInfoTool.d.ts.map +1 -1
- package/lib/esm/ui/MapFeatureInfoTool.js +2 -2
- package/lib/esm/ui/MapFeatureInfoTool.js.map +1 -1
- package/lib/esm/ui/MapLayersUiItemsProvider.js +1 -1
- package/lib/esm/ui/MapLayersUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/widget/AttachLayerPopupButton.js +21 -24
- package/lib/esm/ui/widget/AttachLayerPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.js +5 -5
- package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/esm/ui/widget/ConfirmMessageDialog.js +4 -7
- package/lib/esm/ui/widget/ConfirmMessageDialog.js.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoDataProvider.js +3 -4
- package/lib/esm/ui/widget/FeatureInfoDataProvider.js.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.js +10 -16
- package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerDroppable.js +5 -8
- package/lib/esm/ui/widget/MapLayerDroppable.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.js +17 -19
- package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js +2 -3
- package/lib/esm/ui/widget/MapLayerSettingsMenu.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js +2 -2
- package/lib/esm/ui/widget/MapLayerSettingsPopupButton.js.map +1 -1
- package/lib/esm/ui/widget/MapLayersWidget.js +4 -4
- package/lib/esm/ui/widget/MapLayersWidget.js.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.js +36 -33
- package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/esm/ui/widget/SelectMapFormat.js +7 -12
- package/lib/esm/ui/widget/SelectMapFormat.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersDataProvider.js +4 -5
- package/lib/esm/ui/widget/SubLayersDataProvider.js.map +1 -1
- package/lib/esm/ui/widget/SubLayersTree.js +28 -34
- package/lib/esm/ui/widget/SubLayersTree.js.map +1 -1
- package/package.json +27 -27
|
@@ -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,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE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B;4BACjB;gCACE,oBAAC,KAAK,IAAC,QAAQ,EAAE,uBAAuB,EACtC,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,OAAO,EACpC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,EAC/D,QAAQ,EAAE,aAAa,GAAI;gCAC7B,oBAAC,KAAK,IAAC,QAAQ,EAAE,uBAAuB,EACtC,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,OAAO,EACpC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,EAC/D,QAAQ,EAAE,aAAa,GAAI,CACzB,CACF,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore Modeless WMTS\r\n\r\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { Button, Input, LabeledInput, ProgressLinear, Radio } from \"@itwin/itwinui-react\";\r\nimport { ImageMapLayerProps } from \"@itwin/core-common\";\r\nimport { IModelApp, MapLayerAccessClient, MapLayerSource,\r\n MapLayerSourceStatus, MapLayerSourceValidation, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { Dialog, Icon, useCrossOriginPopup } from \"@itwin/core-react\";\r\nimport * as React from \"react\";\r\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\nimport { MapTypesOptions } from \"../Interfaces\";\r\nimport \"./MapUrlDialog.scss\";\r\nimport { BeEvent, Guid } from \"@itwin/core-bentley\";\r\nimport { SelectMapFormat } from \"./SelectMapFormat\";\r\n\r\nexport const MAP_TYPES = {\r\n wms: \"WMS\",\r\n arcGis: \"ArcGIS\",\r\n wmts: \"WMTS\",\r\n tileUrl: \"TileURL\",\r\n arcGisFeature: \"ArcGISFeature\",\r\n};\r\n\r\ninterface MapUrlDialogProps {\r\n activeViewport?: ScreenViewport;\r\n isOverlay: boolean;\r\n onOkResult: () => void;\r\n onCancelResult?: () => void;\r\n mapTypesOptions?: MapTypesOptions;\r\n\r\n // An optional layer definition can be provide to enable the edit mode\r\n layerRequiringCredentials?: ImageMapLayerProps;\r\n\r\n mapLayerSourceToEdit?: MapLayerSource;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapUrlDialog(props: MapUrlDialogProps) {\r\n const { isOverlay, onOkResult, mapTypesOptions } = props;\r\n\r\n const getMapUrlFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.url;\r\n } else if (props.layerRequiringCredentials?.url) {\r\n return props.layerRequiringCredentials.url;\r\n }\r\n return \"\";\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const getMapNameFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.name;\r\n } else if (props.layerRequiringCredentials?.name) {\r\n return props.layerRequiringCredentials.name;\r\n }\r\n return \"\";\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const getFormatFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.formatId;\r\n } else if (props.layerRequiringCredentials?.formatId) {\r\n return props.layerRequiringCredentials.formatId;\r\n }\r\n return undefined;\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\r\n const [typeLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\r\n const [nameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\r\n const [nameInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\r\n const [urlLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\r\n const [urlInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\r\n const [iTwinSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\r\n const [modelSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\r\n const [missingCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\r\n const [invalidCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\r\n const [externalLoginTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLogin\"));\r\n const [externalLoginFailedMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginFailed\"));\r\n const [externalLoginSucceededMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginSucceeded\"));\r\n const [externalLoginWaitingMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginWaiting\"));\r\n const [externalLoginTryAgainLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginTryAgain\"));\r\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(false);\r\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\r\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\r\n const [layerAuthPending, setLayerAuthPending] = React.useState(false);\r\n const [mapUrl, setMapUrl] = React.useState(getMapUrlFromProps());\r\n const [mapName, setMapName] = React.useState(getMapNameFromProps());\r\n const [userName, setUserName] = React.useState(\"\");\r\n const [password, setPassword] = React.useState(\"\");\r\n const [noSaveSettingsWarning] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\r\n const [passwordLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\r\n const [passwordRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\r\n const [userNameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\r\n const [userNameRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\r\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"iTwin\");\r\n const [oauthProcessSucceeded, setOAuthProcessSucceeded] = React.useState<undefined|boolean>(undefined);\r\n const [showOauthPopup, setShowOauthPopup] = React.useState(false);\r\n const [externalLoginUrl, setExternalLoginUrl] = React.useState<string|undefined>();\r\n const [onOauthProcessEnd] = React.useState(new BeEvent());\r\n const [accessClient, setAccessClient] = React.useState<MapLayerAccessClient | undefined>();\r\n const [isAccessClientInitialized, setAccessClientInitialized] = React.useState(false);\r\n\r\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? \"ArcGIS\");\r\n\r\n // 'isMounted' is used to prevent any async operation once the hook has been\r\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\r\n const isMounted = React.useRef(false);\r\n React.useEffect(() => {\r\n isMounted.current = true;\r\n return () => {\r\n isMounted.current = false;\r\n };\r\n }, []);\r\n\r\n const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && props?.activeViewport?.iModel?.iTwinId);\r\n const [hasImodelContext] = React.useState (\r\n props?.activeViewport?.iModel?.iTwinId !== undefined\r\n && props.activeViewport.iModel.iTwinId !== Guid.empty\r\n && props?.activeViewport?.iModel?.iModelId !== undefined\r\n && props?.activeViewport.iModel.iModelId !== Guid.empty);\r\n\r\n // Even though the settings storage is available,\r\n // we don't always want to enable it in the UI.\r\n const [settingsStorageDisabled] = React.useState(!isSettingsStorageAvailable || props.mapLayerSourceToEdit !== undefined || props.layerRequiringCredentials !== undefined);\r\n\r\n const [layerRequiringCredentialsIdx] = React.useState((): number | undefined => {\r\n if (props.layerRequiringCredentials === undefined || !props.layerRequiringCredentials.name || !props.layerRequiringCredentials.url) {\r\n return undefined;\r\n }\r\n\r\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(props.layerRequiringCredentials.name, props.layerRequiringCredentials.url, isOverlay);\r\n if (indexInDisplayStyle === undefined || indexInDisplayStyle < 0) {\r\n return undefined;\r\n } else {\r\n return indexInDisplayStyle;\r\n }\r\n });\r\n\r\n const handleCancel = React.useCallback(() => {\r\n if (props.onCancelResult) {\r\n props.onCancelResult();\r\n return;\r\n }\r\n ModalDialogManager.closeDialog();\r\n }, [props]);\r\n\r\n const onUsernameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setUserName(event.target.value);\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n }, [setUserName, invalidCredentialsProvided, setInvalidCredentialsProvided]);\r\n\r\n const onPasswordChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setPassword(event.target.value);\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n }, [setPassword, invalidCredentialsProvided, setInvalidCredentialsProvided]);\r\n\r\n const handleArcGisLogin = React.useCallback(() => {\r\n setLayerAuthPending(true);\r\n setShowOauthPopup(true);\r\n if (oauthProcessSucceeded === false) {\r\n setOAuthProcessSucceeded(undefined);\r\n }\r\n\r\n }, [oauthProcessSucceeded]);\r\n\r\n // return true if authorization is needed\r\n const updateAuthState = React.useCallback(async (source: MapLayerSource, sourceValidation: MapLayerSourceValidation) => {\r\n const sourceRequireAuth = (sourceValidation.status === MapLayerSourceStatus.RequireAuth);\r\n const invalidCredentials = (sourceValidation.status === MapLayerSourceStatus.InvalidCredentials);\r\n if (sourceRequireAuth) {\r\n const settings = source.toLayerSettings();\r\n\r\n if (accessClient !== undefined && accessClient.getTokenServiceEndPoint !== undefined && settings !== undefined) {\r\n try {\r\n const tokenEndpoint = await accessClient.getTokenServiceEndPoint(settings.url);\r\n if (tokenEndpoint !== undefined) {\r\n const loginUrl = tokenEndpoint.getLoginUrl();\r\n setExternalLoginUrl(loginUrl);\r\n }\r\n\r\n } catch (_error){\r\n\r\n }\r\n }\r\n\r\n }\r\n setServerRequireCredentials(sourceRequireAuth || invalidCredentials);\r\n if (invalidCredentials) {\r\n setInvalidCredentialsProvided(true);\r\n } else if (invalidCredentialsProvided) {\r\n setInvalidCredentialsProvided(false); // flag reset\r\n }\r\n\r\n return sourceRequireAuth || invalidCredentials;\r\n }, [accessClient, invalidCredentialsProvided]);\r\n\r\n const updateAttachedLayer = React.useCallback(async (source: MapLayerSource, validation: MapLayerSourceValidation) => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined || layerRequiringCredentialsIdx === undefined) {\r\n const error = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n // Layer is already attached,\r\n vp.displayStyle.changeMapLayerProps({\r\n subLayers: validation.subLayers,\r\n }, layerRequiringCredentialsIdx, isOverlay);\r\n vp.displayStyle.changeMapLayerCredentials(layerRequiringCredentialsIdx, isOverlay, source.userName, source.password);\r\n\r\n // Either initial attach/initialize failed or the layer failed to load at least one tile\r\n // because of an invalid token; in both cases tile tree needs to be fully reset\r\n const provider = vp.getMapLayerImageryProvider(layerRequiringCredentialsIdx, isOverlay);\r\n provider?.resetStatus();\r\n vp.resetMapLayer(layerRequiringCredentialsIdx, isOverlay);\r\n vp.invalidateRenderPlan();\r\n\r\n // This handler will close the layer source handler, and therefore the MapUrl dialog.\r\n // don't call it if the dialog needs to remains open.\r\n onOkResult();\r\n\r\n return true;\r\n }, [isOverlay, layerRequiringCredentialsIdx, onOkResult, props.activeViewport]);\r\n\r\n // Returns true if no further input is needed from end-user.\r\n const doAttach = React.useCallback(async (source: MapLayerSource, validation: MapLayerSourceValidation): Promise<boolean> => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined) {\r\n const error = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n // Update service settings if storage is available and we are not prompting user for credentials\r\n if (!settingsStorageDisabled && !props.layerRequiringCredentials) {\r\n \tconst storeOnIModel = (hasImodelContext ? \"Model\" === settingsStorage : undefined);\r\n if (vp.iModel.iTwinId && !(await MapLayerPreferences.storeSource(source, vp.iModel.iTwinId, vp.iModel.iModelId, storeOnIModel))) {\r\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerPreferencesStoreFailed\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msgError));\r\n\t }\r\n }\r\n const settings = source.toLayerSettings(validation.subLayers);\r\n if (settings) {\r\n vp.displayStyle.attachMapLayer({settings, isOverlay});\r\n\r\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttached\", { sourceName: source.name, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\r\n } else {\r\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSettingsConversionError\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MapLayerAttachError\", { error: msgError, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n }\r\n\r\n vp.invalidateRenderPlan();\r\n\r\n // This handler will close the layer source handler, and therefore the MapUrl dialog.\r\n // don't call it if the dialog needs to remains open.\r\n onOkResult();\r\n\r\n return true;\r\n }, [hasImodelContext, isOverlay, onOkResult, props?.activeViewport, props.layerRequiringCredentials, settingsStorage, settingsStorageDisabled]);\r\n\r\n // Validate the layer source and attempt to attach (or update) the layer.\r\n // Returns true if no further input is needed from end-user (i.e. close the dialog)\r\n const attemptAttachSource = React.useCallback(async (source: MapLayerSource): Promise<boolean> => {\r\n try {\r\n const validation = await source.validateSource(true);\r\n\r\n if (validation.status === MapLayerSourceStatus.Valid) {\r\n if (layerRequiringCredentialsIdx === undefined ) {\r\n return await doAttach(source, validation);\r\n } else {\r\n return await updateAttachedLayer(source, validation);\r\n }\r\n } else if (validation.status === MapLayerSourceStatus.InvalidCoordinateSystem){\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCoordinateSystem\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n } else {\r\n const authNeeded = await updateAuthState(source, validation);\r\n if (authNeeded) {\r\n return false;\r\n } else {\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\r\n return true;\r\n }\r\n }\r\n return false;\r\n } catch (error) {\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n }, [updateAuthState, doAttach, layerRequiringCredentialsIdx, updateAttachedLayer]);\r\n\r\n const onNameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMapName(event.target.value);\r\n }, [setMapName]);\r\n\r\n const onRadioChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setSettingsStorageRadio(event.target.value);\r\n }, [setSettingsStorageRadio]);\r\n\r\n const onUrlChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMapUrl(event.target.value);\r\n }, [setMapUrl]);\r\n\r\n const createSource = React.useCallback(() => {\r\n let source: MapLayerSource | undefined;\r\n if (mapUrl && mapName) {\r\n source = MapLayerSource.fromJSON({\r\n url: mapUrl,\r\n name: mapName,\r\n formatId: mapType});\r\n\r\n // Set credentials separately since they are not part of JSON\r\n if (source) {\r\n source.userName = userName||undefined; // When there is no value, empty string is always returned, in this case force it to undefined,\r\n source.password = password||undefined;\r\n }\r\n\r\n }\r\n return source;\r\n }, [mapName, mapType, mapUrl, password, userName]);\r\n\r\n const handleOk = React.useCallback(() => {\r\n const source = createSource();\r\n if (source === undefined || props.mapLayerSourceToEdit) {\r\n\r\n ModalDialogManager.closeDialog();\r\n onOkResult();\r\n\r\n if (source === undefined) {\r\n // Close the dialog and inform end user something went wrong.\r\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: msgError, sourceUrl: mapUrl });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return;\r\n }\r\n\r\n // Simply change the source definition in the setting service\r\n if (props.mapLayerSourceToEdit !== undefined) {\r\n const vp = props.activeViewport;\r\n void (async () => {\r\n if (isSettingsStorageAvailable && vp?.iModel?.iTwinId) {\r\n try {\r\n await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId, vp?.iModel.iModelId);\r\n } catch (err: any) {\r\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerEditError\", { layerName: props.mapLayerSourceToEdit?.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\r\n return;\r\n }\r\n }\r\n })();\r\n return;\r\n }\r\n }\r\n\r\n setLayerAttachPending(true);\r\n\r\n // Attach source asynchronously.\r\n void (async () => {\r\n try {\r\n const closeDialog = await attemptAttachSource(source);\r\n if (isMounted.current) {\r\n setLayerAttachPending(false);\r\n }\r\n\r\n // In theory the modal dialog should always get closed by the parent\r\n // AttachLayerPanel's 'onOkResult' handler. We close it here just in case.\r\n if (closeDialog) {\r\n ModalDialogManager.closeDialog();\r\n onOkResult();\r\n }\r\n } catch (_error) {\r\n onOkResult();\r\n ModalDialogManager.closeDialog();\r\n }\r\n })();\r\n\r\n }, [createSource, props.mapLayerSourceToEdit, props.activeViewport, onOkResult, mapUrl, isSettingsStorageAvailable, attemptAttachSource]);\r\n\r\n React.useEffect(() => {\r\n const handleOAuthProcessEnd = (success: boolean, _state: any ) => {\r\n onOauthProcessEnd.raiseEvent(success, _state);\r\n };\r\n\r\n // Currently only arcgis support AccessClient\r\n\r\n const ac = IModelApp.mapLayerFormatRegistry.getAccessClient(MAP_TYPES.arcGis);\r\n if (ac?.onOAuthProcessEnd) {\r\n setAccessClient(ac); // cache it, so we dont need to make another lookup;\r\n ac.onOAuthProcessEnd.addListener(handleOAuthProcessEnd);\r\n }\r\n setAccessClientInitialized(true);\r\n return () => {\r\n if (ac?.onOAuthProcessEnd) {\r\n ac.onOAuthProcessEnd.removeListener(handleOAuthProcessEnd);\r\n }\r\n\r\n setAccessClient(undefined);\r\n setAccessClientInitialized(false);\r\n };\r\n }, [mapType, onOauthProcessEnd, setAccessClient]);\r\n\r\n // After a map type change, make sure the different Oauth states are reset.\r\n React.useEffect(() => {\r\n // Reset few states\r\n setServerRequireCredentials(false);\r\n setInvalidCredentialsProvided(false);\r\n setShowOauthPopup(false);\r\n setOAuthProcessSucceeded(undefined);\r\n setExternalLoginUrl(undefined);\r\n\r\n }, [mapType]);\r\n\r\n // The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)\r\n // makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)\r\n // Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.\r\n React.useEffect(() => {\r\n // Attach source asynchronously.\r\n void (async () => {\r\n if (isAccessClientInitialized && props.layerRequiringCredentials?.url !== undefined && props.layerRequiringCredentials?.name !== undefined) {\r\n try {\r\n const source = MapLayerSource.fromJSON({\r\n url: props.layerRequiringCredentials.url,\r\n name: props.layerRequiringCredentials.name,\r\n formatId: props.layerRequiringCredentials.formatId});\r\n\r\n if (source !== undefined) {\r\n setLayerAttachPending(true);\r\n const validation = await source.validateSource(true);\r\n if (isMounted.current) {\r\n setLayerAttachPending(false);\r\n }\r\n await updateAuthState(source, validation);\r\n }\r\n } catch (_error) {}\r\n }\r\n })();\r\n\r\n }, [isAccessClientInitialized,\r\n props.layerRequiringCredentials?.formatId,\r\n props.layerRequiringCredentials?.name,\r\n props.layerRequiringCredentials?.url,\r\n updateAuthState]);\r\n\r\n const dialogContainer = React.useRef<HTMLDivElement>(null);\r\n\r\n const readyToSave = React.useCallback(() => {\r\n const credentialsSet = !!userName && !!password;\r\n return (!!mapUrl && !!mapName)\r\n && !layerAttachPending\r\n && (!serverRequireCredentials || credentialsSet)\r\n && !invalidCredentialsProvided\r\n && (externalLoginUrl === undefined || (externalLoginUrl !== undefined && oauthProcessSucceeded));\r\n }, [userName, password, mapUrl, mapName, serverRequireCredentials, layerAttachPending, invalidCredentialsProvided, externalLoginUrl, oauthProcessSucceeded]);\r\n\r\n const buttonCluster = React.useMemo(() => [\r\n { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },\r\n { type: DialogButtonType.Cancel, onClick: handleCancel },\r\n ], [readyToSave, handleCancel, handleOk]);\r\n\r\n const handleOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.key === SpecialKey.Enter) {\r\n if (readyToSave())\r\n handleOk();\r\n }\r\n }, [handleOk, readyToSave]);\r\n\r\n // onOauthProcessEnd events handler\r\n React.useEffect(() => {\r\n const handleOauthProcess = (success: boolean, _state: any ) => {\r\n setLayerAuthPending(false);\r\n if (success) {\r\n setOAuthProcessSucceeded(true);\r\n setShowOauthPopup(false);\r\n setLayerAttachPending(false);\r\n handleOk(); // Add the layer the same way the user would do by clicking 'ok'\r\n } else {\r\n setShowOauthPopup(false);\r\n setLayerAttachPending(false);\r\n setOAuthProcessSucceeded(false);\r\n }\r\n };\r\n\r\n onOauthProcessEnd.addListener(handleOauthProcess);\r\n return () => {\r\n onOauthProcessEnd.removeListener(handleOauthProcess);\r\n };\r\n }, [handleOk, onOauthProcessEnd]);\r\n\r\n //\r\n // Monitors authentication method changes\r\n React.useEffect(() => {\r\n\r\n if (serverRequireCredentials && oauthProcessSucceeded === undefined && externalLoginUrl !== undefined) {\r\n handleArcGisLogin();\r\n }\r\n }, [oauthProcessSucceeded, externalLoginUrl, handleArcGisLogin, serverRequireCredentials]);\r\n\r\n // Monitors Oauth2 popup was closed\r\n const handleOAuthPopupClose = React.useCallback(() => {\r\n setShowOauthPopup(false);\r\n setLayerAuthPending(false);\r\n if (oauthProcessSucceeded === undefined)\r\n setOAuthProcessSucceeded(false); // indicates there was a failed attempt\r\n }, [oauthProcessSucceeded]);\r\n\r\n // Utility function to get warning message section\r\n function renderWarningMessage(): React.ReactNode {\r\n let node: React.ReactNode;\r\n let warningMessage: string|undefined;\r\n\r\n // Get the proper warning message\r\n if (showOauthPopup) {\r\n warningMessage = externalLoginWaitingMsg;\r\n } else if (oauthProcessSucceeded === false) {\r\n warningMessage = externalLoginFailedMsg;\r\n } else if (oauthProcessSucceeded === true) {\r\n warningMessage = externalLoginSucceededMsg;\r\n }else if (invalidCredentialsProvided) {\r\n warningMessage = invalidCredentialsLabel;\r\n } else if (serverRequireCredentials && (!userName || !password)) {\r\n warningMessage = missingCredentialsLabel;\r\n }\r\n\r\n // Sometimes we want to add an extra node, such as a button\r\n let extraNode: React.ReactNode;\r\n if (oauthProcessSucceeded === false) {\r\n extraNode = <div>\r\n <Button onClick={handleArcGisLogin}>{externalLoginTryAgainLabel}</Button>\r\n </div>;\r\n }\r\n\r\n if (warningMessage !== undefined) {\r\n return(\r\n <div className=\"map-layer-source-warnMessage\">\r\n <Icon className=\"map-layer-source-warnMessage-icon\" iconSpec=\"icon-status-warning\" />\r\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span >\r\n {extraNode}\r\n </div>);\r\n } else {\r\n return (<span className=\"map-layer-source-placeholder\"> </span>);\r\n }\r\n return node;\r\n }\r\n\r\n // Use a hook to display the popup.\r\n // The display of the popup is controlled by the 'showOauthPopup' state variable.\r\n useCrossOriginPopup(showOauthPopup, externalLoginUrl, externalLoginTitle, 450, 450, handleOAuthPopupClose);\r\n return (\r\n <div ref={dialogContainer}>\r\n <Dialog\r\n className=\"map-layer-url-dialog\"\r\n title={dialogTitle}\r\n opened={true}\r\n resizable={true}\r\n movable={true}\r\n modal={true}\r\n buttonCluster={buttonCluster}\r\n onClose={handleCancel}\r\n onEscape={handleCancel}\r\n minHeight={120}\r\n maxWidth={600}\r\n titleStyle={{paddingLeft: \"10px\"}}\r\n footerStyle={{paddingBottom: \"10px\", paddingRight: \"10px\"}}\r\n trapFocus={false}\r\n >\r\n <div className=\"map-layer-url-dialog-content\">\r\n <div className=\"map-layer-source-url\">\r\n <span className=\"map-layer-source-label\">{typeLabel}</span>\r\n <SelectMapFormat\r\n value={mapType}\r\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending}\r\n onChange={setMapType}\r\n mapTypesOptions={mapTypesOptions}\r\n />\r\n <span className=\"map-layer-source-label\">{nameLabel}</span>\r\n <Input className=\"map-layer-source-input\" placeholder={nameInputPlaceHolder} onChange={onNameChange} value={mapName} disabled={props.layerRequiringCredentials !== undefined || layerAttachPending || layerAuthPending} />\r\n <span className=\"map-layer-source-label\">{urlLabel}</span>\r\n <Input className=\"map-layer-source-input\" placeholder={urlInputPlaceHolder} onKeyPress={handleOnKeyDown} onChange={onUrlChange} disabled={props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending} value={mapUrl} />\r\n {serverRequireCredentials\r\n && externalLoginUrl === undefined // external login is handled in popup\r\n && props.mapLayerSourceToEdit === undefined &&\r\n <>\r\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\r\n <LabeledInput className=\"map-layer-source-input\"\r\n displayStyle=\"inline\"\r\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\r\n status={(!userName && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\r\n disabled={layerAttachPending || layerAuthPending}\r\n onChange={onUsernameChange}\r\n value={userName}\r\n size=\"small\" />\r\n\r\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\r\n <LabeledInput className=\"map-layer-source-input\"\r\n\r\n displayStyle=\"inline\"\r\n type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\r\n status={(!password && serverRequireCredentials) || invalidCredentialsProvided? \"warning\" : undefined}\r\n disabled={layerAttachPending || layerAuthPending}\r\n onChange={onPasswordChange}\r\n onKeyPress={handleOnKeyDown}\r\n value={password}\r\n size=\"small\" />\r\n\r\n </>\r\n }\r\n\r\n {/* Store settings options, not shown when editing a layer */}\r\n {isSettingsStorageAvailable &&\r\n <div title={settingsStorageDisabled ? noSaveSettingsWarning : \"\"}>\r\n {hasImodelContext &&\r\n <div>\r\n <Radio disabled={settingsStorageDisabled}\r\n name=\"settingsStorage\" value=\"iTwin\"\r\n label={iTwinSettingsLabel} checked={settingsStorage === \"iTwin\"}\r\n onChange={onRadioChange} />\r\n <Radio disabled={settingsStorageDisabled}\r\n name=\"settingsStorage\" value=\"Model\"\r\n label={modelSettingsLabel} checked={settingsStorage === \"Model\"}\r\n onChange={onRadioChange} />\r\n </div> }\r\n </div>}\r\n </div>\r\n </div>\r\n\r\n {/* Warning message */}\r\n {renderWarningMessage()}\r\n\r\n {/* Progress bar */}\r\n {(layerAttachPending || layerAuthPending) &&\r\n <div className=\"map-layer-source-progressBar\">\r\n <ProgressLinear indeterminate />\r\n </div>\r\n }\r\n </Dialog>\r\n </div >\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE1F,OAAO,EAAE,SAAS,EAAwB,cAAc,EACtD,oBAAoB,EAA4B,oBAAoB,EAAE,qBAAqB,GAC5F,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,WAAW,EAA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,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore Modeless WMTS\r\n\r\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\r\nimport { UiFramework } from \"@itwin/appui-react\";\r\nimport { Button, Input, LabeledInput, ProgressLinear, Radio } from \"@itwin/itwinui-react\";\r\nimport { ImageMapLayerProps } from \"@itwin/core-common\";\r\nimport { IModelApp, MapLayerAccessClient, MapLayerSource,\r\n MapLayerSourceStatus, MapLayerSourceValidation, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { Dialog, Icon, useCrossOriginPopup } from \"@itwin/core-react\";\r\nimport * as React from \"react\";\r\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\nimport { MapTypesOptions } from \"../Interfaces\";\r\nimport \"./MapUrlDialog.scss\";\r\nimport { BeEvent, Guid } from \"@itwin/core-bentley\";\r\nimport { SelectMapFormat } from \"./SelectMapFormat\";\r\n\r\nexport const MAP_TYPES = {\r\n wms: \"WMS\",\r\n arcGis: \"ArcGIS\",\r\n wmts: \"WMTS\",\r\n tileUrl: \"TileURL\",\r\n arcGisFeature: \"ArcGISFeature\",\r\n};\r\n\r\ninterface MapUrlDialogProps {\r\n activeViewport?: ScreenViewport;\r\n isOverlay: boolean;\r\n onOkResult: () => void;\r\n onCancelResult?: () => void;\r\n mapTypesOptions?: MapTypesOptions;\r\n\r\n // An optional layer definition can be provide to enable the edit mode\r\n layerRequiringCredentials?: ImageMapLayerProps;\r\n\r\n mapLayerSourceToEdit?: MapLayerSource;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function MapUrlDialog(props: MapUrlDialogProps) {\r\n const { isOverlay, onOkResult, mapTypesOptions } = props;\r\n\r\n const getMapUrlFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.url;\r\n } else if (props.layerRequiringCredentials?.url) {\r\n return props.layerRequiringCredentials.url;\r\n }\r\n return \"\";\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const getMapNameFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.name;\r\n } else if (props.layerRequiringCredentials?.name) {\r\n return props.layerRequiringCredentials.name;\r\n }\r\n return \"\";\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const getFormatFromProps = React.useCallback(() => {\r\n if (props.mapLayerSourceToEdit) {\r\n return props.mapLayerSourceToEdit.formatId;\r\n } else if (props.layerRequiringCredentials?.formatId) {\r\n return props.layerRequiringCredentials.formatId;\r\n }\r\n return undefined;\r\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\r\n\r\n const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\r\n const [typeLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\r\n const [nameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\r\n const [nameInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\r\n const [urlLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\r\n const [urlInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\r\n const [iTwinSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\r\n const [modelSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\r\n const [missingCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\r\n const [invalidCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\r\n const [externalLoginTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLogin\"));\r\n const [externalLoginFailedMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginFailed\"));\r\n const [externalLoginSucceededMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginSucceeded\"));\r\n const [externalLoginWaitingMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginWaiting\"));\r\n const [externalLoginTryAgainLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginTryAgain\"));\r\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(false);\r\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\r\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\r\n const [layerAuthPending, setLayerAuthPending] = React.useState(false);\r\n const [mapUrl, setMapUrl] = React.useState(getMapUrlFromProps());\r\n const [mapName, setMapName] = React.useState(getMapNameFromProps());\r\n const [userName, setUserName] = React.useState(\"\");\r\n const [password, setPassword] = React.useState(\"\");\r\n const [noSaveSettingsWarning] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\r\n const [passwordLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\r\n const [passwordRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\r\n const [userNameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\r\n const [userNameRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\r\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"iTwin\");\r\n const [oauthProcessSucceeded, setOAuthProcessSucceeded] = React.useState<undefined|boolean>(undefined);\r\n const [showOauthPopup, setShowOauthPopup] = React.useState(false);\r\n const [externalLoginUrl, setExternalLoginUrl] = React.useState<string|undefined>();\r\n const [onOauthProcessEnd] = React.useState(new BeEvent());\r\n const [accessClient, setAccessClient] = React.useState<MapLayerAccessClient | undefined>();\r\n const [isAccessClientInitialized, setAccessClientInitialized] = React.useState(false);\r\n\r\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? \"ArcGIS\");\r\n\r\n // 'isMounted' is used to prevent any async operation once the hook has been\r\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\r\n const isMounted = React.useRef(false);\r\n React.useEffect(() => {\r\n isMounted.current = true;\r\n return () => {\r\n isMounted.current = false;\r\n };\r\n }, []);\r\n\r\n const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && props?.activeViewport?.iModel?.iTwinId);\r\n const [hasImodelContext] = React.useState (\r\n props?.activeViewport?.iModel?.iTwinId !== undefined\r\n && props.activeViewport.iModel.iTwinId !== Guid.empty\r\n && props?.activeViewport?.iModel?.iModelId !== undefined\r\n && props?.activeViewport.iModel.iModelId !== Guid.empty);\r\n\r\n // Even though the settings storage is available,\r\n // we don't always want to enable it in the UI.\r\n const [settingsStorageDisabled] = React.useState(!isSettingsStorageAvailable || props.mapLayerSourceToEdit !== undefined || props.layerRequiringCredentials !== undefined);\r\n\r\n const [layerRequiringCredentialsIdx] = React.useState((): number | undefined => {\r\n if (props.layerRequiringCredentials === undefined || !props.layerRequiringCredentials.name || !props.layerRequiringCredentials.url) {\r\n return undefined;\r\n }\r\n\r\n const indexInDisplayStyle = props.activeViewport?.displayStyle.findMapLayerIndexByNameAndSource(props.layerRequiringCredentials.name, props.layerRequiringCredentials.url, isOverlay);\r\n if (indexInDisplayStyle === undefined || indexInDisplayStyle < 0) {\r\n return undefined;\r\n } else {\r\n return indexInDisplayStyle;\r\n }\r\n });\r\n\r\n const handleCancel = React.useCallback(() => {\r\n if (props.onCancelResult) {\r\n props.onCancelResult();\r\n return;\r\n }\r\n UiFramework.dialogs.modal.close();\r\n }, [props]);\r\n\r\n const onUsernameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setUserName(event.target.value);\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n }, [setUserName, invalidCredentialsProvided, setInvalidCredentialsProvided]);\r\n\r\n const onPasswordChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setPassword(event.target.value);\r\n if (invalidCredentialsProvided)\r\n setInvalidCredentialsProvided(false);\r\n }, [setPassword, invalidCredentialsProvided, setInvalidCredentialsProvided]);\r\n\r\n const handleArcGisLogin = React.useCallback(() => {\r\n setLayerAuthPending(true);\r\n setShowOauthPopup(true);\r\n if (oauthProcessSucceeded === false) {\r\n setOAuthProcessSucceeded(undefined);\r\n }\r\n\r\n }, [oauthProcessSucceeded]);\r\n\r\n // return true if authorization is needed\r\n const updateAuthState = React.useCallback(async (source: MapLayerSource, sourceValidation: MapLayerSourceValidation) => {\r\n const sourceRequireAuth = (sourceValidation.status === MapLayerSourceStatus.RequireAuth);\r\n const invalidCredentials = (sourceValidation.status === MapLayerSourceStatus.InvalidCredentials);\r\n if (sourceRequireAuth) {\r\n const settings = source.toLayerSettings();\r\n\r\n if (accessClient !== undefined && accessClient.getTokenServiceEndPoint !== undefined && settings !== undefined) {\r\n try {\r\n const tokenEndpoint = await accessClient.getTokenServiceEndPoint(settings.url);\r\n if (tokenEndpoint !== undefined) {\r\n const loginUrl = tokenEndpoint.getLoginUrl();\r\n setExternalLoginUrl(loginUrl);\r\n }\r\n\r\n } catch (_error){\r\n\r\n }\r\n }\r\n\r\n }\r\n setServerRequireCredentials(sourceRequireAuth || invalidCredentials);\r\n if (invalidCredentials) {\r\n setInvalidCredentialsProvided(true);\r\n } else if (invalidCredentialsProvided) {\r\n setInvalidCredentialsProvided(false); // flag reset\r\n }\r\n\r\n return sourceRequireAuth || invalidCredentials;\r\n }, [accessClient, invalidCredentialsProvided]);\r\n\r\n const updateAttachedLayer = React.useCallback(async (source: MapLayerSource, validation: MapLayerSourceValidation) => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined || layerRequiringCredentialsIdx === undefined) {\r\n const error = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n // Layer is already attached,\r\n vp.displayStyle.changeMapLayerProps({\r\n subLayers: validation.subLayers,\r\n }, layerRequiringCredentialsIdx, isOverlay);\r\n vp.displayStyle.changeMapLayerCredentials(layerRequiringCredentialsIdx, isOverlay, source.userName, source.password);\r\n\r\n // Either initial attach/initialize failed or the layer failed to load at least one tile\r\n // because of an invalid token; in both cases tile tree needs to be fully reset\r\n const provider = vp.getMapLayerImageryProvider(layerRequiringCredentialsIdx, isOverlay);\r\n provider?.resetStatus();\r\n vp.resetMapLayer(layerRequiringCredentialsIdx, isOverlay);\r\n vp.invalidateRenderPlan();\r\n\r\n // This handler will close the layer source handler, and therefore the MapUrl dialog.\r\n // don't call it if the dialog needs to remains open.\r\n onOkResult();\r\n\r\n return true;\r\n }, [isOverlay, layerRequiringCredentialsIdx, onOkResult, props.activeViewport]);\r\n\r\n // Returns true if no further input is needed from end-user.\r\n const doAttach = React.useCallback(async (source: MapLayerSource, validation: MapLayerSourceValidation): Promise<boolean> => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined) {\r\n const error = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachMissingViewOrSource\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n // Update service settings if storage is available and we are not prompting user for credentials\r\n if (!settingsStorageDisabled && !props.layerRequiringCredentials) {\r\n \tconst storeOnIModel = (hasImodelContext ? \"Model\" === settingsStorage : undefined);\r\n if (vp.iModel.iTwinId && !(await MapLayerPreferences.storeSource(source, vp.iModel.iTwinId, vp.iModel.iModelId, storeOnIModel))) {\r\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerPreferencesStoreFailed\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msgError));\r\n\t }\r\n }\r\n\r\n // Some sources have a single non-visible sub-layer (i.e. ArcGIS World Topo Map); to avoid having a layer with no content (and no way to change the sub-layer visibility)\r\n // we force the sub-layer visibility to ON.\r\n let subLayers = validation.subLayers;\r\n if (validation.subLayers && validation.subLayers.length === 1 && validation.subLayers[0].visible === false) {\r\n subLayers = [{...validation.subLayers[0], visible: true}];\r\n }\r\n const settings = source.toLayerSettings(subLayers);\r\n if (settings) {\r\n vp.displayStyle.attachMapLayer({settings, isOverlay});\r\n\r\n const msg = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttached\", { sourceName: source.name, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));\r\n } else {\r\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSettingsConversionError\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MapLayerAttachError\", { error: msgError, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n }\r\n\r\n vp.invalidateRenderPlan();\r\n\r\n // This handler will close the layer source handler, and therefore the MapUrl dialog.\r\n // don't call it if the dialog needs to remains open.\r\n onOkResult();\r\n\r\n return true;\r\n }, [hasImodelContext, isOverlay, onOkResult, props?.activeViewport, props.layerRequiringCredentials, settingsStorage, settingsStorageDisabled]);\r\n\r\n // Validate the layer source and attempt to attach (or update) the layer.\r\n // Returns true if no further input is needed from end-user (i.e. close the dialog)\r\n const attemptAttachSource = React.useCallback(async (source: MapLayerSource): Promise<boolean> => {\r\n try {\r\n const validation = await source.validateSource(true);\r\n\r\n if (validation.status === MapLayerSourceStatus.Valid) {\r\n if (layerRequiringCredentialsIdx === undefined ) {\r\n return await doAttach(source, validation);\r\n } else {\r\n return await updateAttachedLayer(source, validation);\r\n }\r\n } else if (validation.status === MapLayerSourceStatus.InvalidCoordinateSystem){\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCoordinateSystem\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n } else {\r\n const authNeeded = await updateAuthState(source, validation);\r\n if (authNeeded) {\r\n return false;\r\n } else {\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\r\n return true;\r\n }\r\n }\r\n return false;\r\n } catch (error) {\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return true;\r\n }\r\n\r\n }, [updateAuthState, doAttach, layerRequiringCredentialsIdx, updateAttachedLayer]);\r\n\r\n const onNameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMapName(event.target.value);\r\n }, [setMapName]);\r\n\r\n const onRadioChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setSettingsStorageRadio(event.target.value);\r\n }, [setSettingsStorageRadio]);\r\n\r\n const onUrlChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\r\n setMapUrl(event.target.value);\r\n }, [setMapUrl]);\r\n\r\n const createSource = React.useCallback(() => {\r\n let source: MapLayerSource | undefined;\r\n if (mapUrl && mapName) {\r\n source = MapLayerSource.fromJSON({\r\n url: mapUrl,\r\n name: mapName,\r\n formatId: mapType});\r\n\r\n // Set credentials separately since they are not part of JSON\r\n if (source) {\r\n source.userName = userName||undefined; // When there is no value, empty string is always returned, in this case force it to undefined,\r\n source.password = password||undefined;\r\n }\r\n\r\n }\r\n return source;\r\n }, [mapName, mapType, mapUrl, password, userName]);\r\n\r\n const handleOk = React.useCallback(() => {\r\n const source = createSource();\r\n if (source === undefined || props.mapLayerSourceToEdit) {\r\n\r\n UiFramework.dialogs.modal.close();\r\n onOkResult();\r\n\r\n if (source === undefined) {\r\n // Close the dialog and inform end user something went wrong.\r\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\r\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: msgError, sourceUrl: mapUrl });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n return;\r\n }\r\n\r\n // Simply change the source definition in the setting service\r\n if (props.mapLayerSourceToEdit !== undefined) {\r\n const vp = props.activeViewport;\r\n void (async () => {\r\n if (isSettingsStorageAvailable && vp?.iModel?.iTwinId) {\r\n try {\r\n await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId, vp?.iModel.iModelId);\r\n } catch (err: any) {\r\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerEditError\", { layerName: props.mapLayerSourceToEdit?.name });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\r\n return;\r\n }\r\n }\r\n })();\r\n return;\r\n }\r\n }\r\n\r\n setLayerAttachPending(true);\r\n\r\n // Attach source asynchronously.\r\n void (async () => {\r\n try {\r\n const closeDialog = await attemptAttachSource(source);\r\n if (isMounted.current) {\r\n setLayerAttachPending(false);\r\n }\r\n\r\n // In theory the modal dialog should always get closed by the parent\r\n // AttachLayerPanel's 'onOkResult' handler. We close it here just in case.\r\n if (closeDialog) {\r\n UiFramework.dialogs.modal.close();\r\n onOkResult();\r\n }\r\n } catch (_error) {\r\n onOkResult();\r\n UiFramework.dialogs.modal.close();\r\n }\r\n })();\r\n\r\n }, [createSource, props.mapLayerSourceToEdit, props.activeViewport, onOkResult, mapUrl, isSettingsStorageAvailable, attemptAttachSource]);\r\n\r\n React.useEffect(() => {\r\n const handleOAuthProcessEnd = (success: boolean, _state: any ) => {\r\n onOauthProcessEnd.raiseEvent(success, _state);\r\n };\r\n\r\n // Currently only arcgis support AccessClient\r\n\r\n const ac = IModelApp.mapLayerFormatRegistry.getAccessClient(MAP_TYPES.arcGis);\r\n if (ac?.onOAuthProcessEnd) {\r\n setAccessClient(ac); // cache it, so we dont need to make another lookup;\r\n ac.onOAuthProcessEnd.addListener(handleOAuthProcessEnd);\r\n }\r\n setAccessClientInitialized(true);\r\n return () => {\r\n if (ac?.onOAuthProcessEnd) {\r\n ac.onOAuthProcessEnd.removeListener(handleOAuthProcessEnd);\r\n }\r\n\r\n setAccessClient(undefined);\r\n setAccessClientInitialized(false);\r\n };\r\n }, [mapType, onOauthProcessEnd, setAccessClient]);\r\n\r\n // After a map type change, make sure the different Oauth states are reset.\r\n React.useEffect(() => {\r\n // Reset few states\r\n setServerRequireCredentials(false);\r\n setInvalidCredentialsProvided(false);\r\n setShowOauthPopup(false);\r\n setOAuthProcessSucceeded(undefined);\r\n setExternalLoginUrl(undefined);\r\n\r\n }, [mapType]);\r\n\r\n // The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)\r\n // makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)\r\n // Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.\r\n React.useEffect(() => {\r\n // Attach source asynchronously.\r\n void (async () => {\r\n if (isAccessClientInitialized && props.layerRequiringCredentials?.url !== undefined && props.layerRequiringCredentials?.name !== undefined) {\r\n try {\r\n const source = MapLayerSource.fromJSON({\r\n url: props.layerRequiringCredentials.url,\r\n name: props.layerRequiringCredentials.name,\r\n formatId: props.layerRequiringCredentials.formatId});\r\n\r\n if (source !== undefined) {\r\n setLayerAttachPending(true);\r\n const validation = await source.validateSource(true);\r\n if (isMounted.current) {\r\n setLayerAttachPending(false);\r\n }\r\n await updateAuthState(source, validation);\r\n }\r\n } catch (_error) {}\r\n }\r\n })();\r\n\r\n }, [isAccessClientInitialized,\r\n props.layerRequiringCredentials?.formatId,\r\n props.layerRequiringCredentials?.name,\r\n props.layerRequiringCredentials?.url,\r\n updateAuthState]);\r\n\r\n const dialogContainer = React.useRef<HTMLDivElement>(null);\r\n\r\n const readyToSave = React.useCallback(() => {\r\n const credentialsSet = !!userName && !!password;\r\n return (!!mapUrl && !!mapName)\r\n && !layerAttachPending\r\n && (!serverRequireCredentials || credentialsSet)\r\n && !invalidCredentialsProvided\r\n && (externalLoginUrl === undefined || (externalLoginUrl !== undefined && oauthProcessSucceeded));\r\n }, [userName, password, mapUrl, mapName, serverRequireCredentials, layerAttachPending, invalidCredentialsProvided, externalLoginUrl, oauthProcessSucceeded]);\r\n\r\n const buttonCluster = React.useMemo(() => [\r\n { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },\r\n { type: DialogButtonType.Cancel, onClick: handleCancel },\r\n ], [readyToSave, handleCancel, handleOk]);\r\n\r\n const handleOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\r\n if (event.key === SpecialKey.Enter) {\r\n if (readyToSave())\r\n handleOk();\r\n }\r\n }, [handleOk, readyToSave]);\r\n\r\n // onOauthProcessEnd events handler\r\n React.useEffect(() => {\r\n const handleOauthProcess = (success: boolean, _state: any ) => {\r\n setLayerAuthPending(false);\r\n if (success) {\r\n setOAuthProcessSucceeded(true);\r\n setShowOauthPopup(false);\r\n setLayerAttachPending(false);\r\n handleOk(); // Add the layer the same way the user would do by clicking 'ok'\r\n } else {\r\n setShowOauthPopup(false);\r\n setLayerAttachPending(false);\r\n setOAuthProcessSucceeded(false);\r\n }\r\n };\r\n\r\n onOauthProcessEnd.addListener(handleOauthProcess);\r\n return () => {\r\n onOauthProcessEnd.removeListener(handleOauthProcess);\r\n };\r\n }, [handleOk, onOauthProcessEnd]);\r\n\r\n //\r\n // Monitors authentication method changes\r\n React.useEffect(() => {\r\n\r\n if (serverRequireCredentials && oauthProcessSucceeded === undefined && externalLoginUrl !== undefined) {\r\n handleArcGisLogin();\r\n }\r\n }, [oauthProcessSucceeded, externalLoginUrl, handleArcGisLogin, serverRequireCredentials]);\r\n\r\n // Monitors Oauth2 popup was closed\r\n const handleOAuthPopupClose = React.useCallback(() => {\r\n setShowOauthPopup(false);\r\n setLayerAuthPending(false);\r\n if (oauthProcessSucceeded === undefined)\r\n setOAuthProcessSucceeded(false); // indicates there was a failed attempt\r\n }, [oauthProcessSucceeded]);\r\n\r\n // Utility function to get warning message section\r\n function renderWarningMessage(): React.ReactNode {\r\n let node: React.ReactNode;\r\n let warningMessage: string|undefined;\r\n\r\n // Get the proper warning message\r\n if (showOauthPopup) {\r\n warningMessage = externalLoginWaitingMsg;\r\n } else if (oauthProcessSucceeded === false) {\r\n warningMessage = externalLoginFailedMsg;\r\n } else if (oauthProcessSucceeded === true) {\r\n warningMessage = externalLoginSucceededMsg;\r\n }else if (invalidCredentialsProvided) {\r\n warningMessage = invalidCredentialsLabel;\r\n } else if (serverRequireCredentials && (!userName || !password)) {\r\n warningMessage = missingCredentialsLabel;\r\n }\r\n\r\n // Sometimes we want to add an extra node, such as a button\r\n let extraNode: React.ReactNode;\r\n if (oauthProcessSucceeded === false) {\r\n extraNode = <div>\r\n <Button onClick={handleArcGisLogin}>{externalLoginTryAgainLabel}</Button>\r\n </div>;\r\n }\r\n\r\n if (warningMessage !== undefined) {\r\n return(\r\n <div className=\"map-layer-source-warnMessage\">\r\n <Icon className=\"map-layer-source-warnMessage-icon\" iconSpec=\"icon-status-warning\" />\r\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span >\r\n {extraNode}\r\n </div>);\r\n } else {\r\n return (<span className=\"map-layer-source-placeholder\"> </span>);\r\n }\r\n return node;\r\n }\r\n\r\n // Use a hook to display the popup.\r\n // The display of the popup is controlled by the 'showOauthPopup' state variable.\r\n useCrossOriginPopup(showOauthPopup, externalLoginUrl, externalLoginTitle, 450, 450, handleOAuthPopupClose);\r\n return (\r\n <div ref={dialogContainer}>\r\n <Dialog\r\n className=\"map-layer-url-dialog\"\r\n title={dialogTitle}\r\n opened={true}\r\n resizable={true}\r\n movable={true}\r\n modal={true}\r\n buttonCluster={buttonCluster}\r\n onClose={handleCancel}\r\n onEscape={handleCancel}\r\n minHeight={120}\r\n maxWidth={600}\r\n titleStyle={{paddingLeft: \"10px\"}}\r\n footerStyle={{paddingBottom: \"10px\", paddingRight: \"10px\"}}\r\n trapFocus={false}\r\n >\r\n <div className=\"map-layer-url-dialog-content\">\r\n <div className=\"map-layer-source-url\">\r\n <span className=\"map-layer-source-label\">{typeLabel}</span>\r\n <SelectMapFormat\r\n value={mapType}\r\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending}\r\n onChange={setMapType}\r\n mapTypesOptions={mapTypesOptions}\r\n />\r\n <span className=\"map-layer-source-label\">{nameLabel}</span>\r\n <Input className=\"map-layer-source-input\" placeholder={nameInputPlaceHolder} onChange={onNameChange} value={mapName} disabled={props.layerRequiringCredentials !== undefined || layerAttachPending || layerAuthPending} />\r\n <span className=\"map-layer-source-label\">{urlLabel}</span>\r\n <Input className=\"map-layer-source-input\" placeholder={urlInputPlaceHolder} onKeyPress={handleOnKeyDown} onChange={onUrlChange} disabled={props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending} value={mapUrl} />\r\n {serverRequireCredentials\r\n && externalLoginUrl === undefined // external login is handled in popup\r\n && props.mapLayerSourceToEdit === undefined &&\r\n <>\r\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\r\n <LabeledInput className=\"map-layer-source-input\"\r\n displayStyle=\"inline\"\r\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\r\n status={(!userName && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\r\n disabled={layerAttachPending || layerAuthPending}\r\n onChange={onUsernameChange}\r\n value={userName}\r\n size=\"small\" />\r\n\r\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\r\n <LabeledInput className=\"map-layer-source-input\"\r\n\r\n displayStyle=\"inline\"\r\n type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\r\n status={(!password && serverRequireCredentials) || invalidCredentialsProvided? \"warning\" : undefined}\r\n disabled={layerAttachPending || layerAuthPending}\r\n onChange={onPasswordChange}\r\n onKeyPress={handleOnKeyDown}\r\n value={password}\r\n size=\"small\" />\r\n\r\n </>\r\n }\r\n\r\n {/* Store settings options, not shown when editing a layer */}\r\n {isSettingsStorageAvailable &&\r\n <div title={settingsStorageDisabled ? noSaveSettingsWarning : \"\"}>\r\n {hasImodelContext &&\r\n <div>\r\n <Radio disabled={settingsStorageDisabled}\r\n name=\"settingsStorage\" value=\"iTwin\"\r\n label={iTwinSettingsLabel} checked={settingsStorage === \"iTwin\"}\r\n onChange={onRadioChange} />\r\n <Radio disabled={settingsStorageDisabled}\r\n name=\"settingsStorage\" value=\"Model\"\r\n label={modelSettingsLabel} checked={settingsStorage === \"Model\"}\r\n onChange={onRadioChange} />\r\n </div> }\r\n </div>}\r\n </div>\r\n </div>\r\n\r\n {/* Warning message */}\r\n {renderWarningMessage()}\r\n\r\n {/* Progress bar */}\r\n {(layerAttachPending || layerAuthPending) &&\r\n <div className=\"map-layer-source-progressBar\">\r\n <ProgressLinear indeterminate />\r\n </div>\r\n }\r\n </Dialog>\r\n </div >\r\n );\r\n}\r\n"]}
|
|
@@ -22,17 +22,15 @@ export const MAP_TYPES = {
|
|
|
22
22
|
};
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
24
24
|
export function SelectMapFormat(props) {
|
|
25
|
-
|
|
26
|
-
const [mapFormat, setMapFormat] = React.useState((_a = props.value) !== null && _a !== void 0 ? _a : MAP_TYPES.arcGis);
|
|
25
|
+
const [mapFormat, setMapFormat] = React.useState(props.value ?? MAP_TYPES.arcGis);
|
|
27
26
|
const [techPreviewTooltip] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.TechPreviewBadgeTooltip"));
|
|
28
27
|
const [mapFormats] = React.useState(() => {
|
|
29
|
-
var _a;
|
|
30
28
|
const formats = [
|
|
31
29
|
{ value: MAP_TYPES.arcGis, label: MAP_TYPES.arcGis },
|
|
32
30
|
{ value: MAP_TYPES.wms, label: MAP_TYPES.wms },
|
|
33
31
|
{ value: MAP_TYPES.wmts, label: MAP_TYPES.wmts },
|
|
34
32
|
];
|
|
35
|
-
if (
|
|
33
|
+
if (props.mapTypesOptions?.supportTileUrl)
|
|
36
34
|
formats.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });
|
|
37
35
|
if (IModelApp.mapLayerFormatRegistry.isRegistered(MAP_TYPES.arcGisFeature))
|
|
38
36
|
formats.push({ value: MAP_TYPES.arcGisFeature, label: MAP_TYPES.arcGisFeature, id: "techPreview" });
|
|
@@ -44,13 +42,10 @@ export function SelectMapFormat(props) {
|
|
|
44
42
|
props.onChange(value);
|
|
45
43
|
}
|
|
46
44
|
}, [props]);
|
|
47
|
-
return (React.createElement(Select, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
React.createElement(SvgTechnicalPreviewMini, null)))
|
|
53
|
-
: undefined }, option.label));
|
|
54
|
-
} }));
|
|
45
|
+
return (React.createElement(Select, { className: "map-layer-source-select", options: mapFormats, value: mapFormat, disabled: props.disabled, onChange: handleOnChange, size: "small", itemRenderer: (option) => (React.createElement(MenuItem, { badge: option.id?.includes("techPreview") ?
|
|
46
|
+
React.createElement("div", { title: techPreviewTooltip },
|
|
47
|
+
React.createElement(IconButton, { className: "map-layer-source-select-previewBadge", size: "small" },
|
|
48
|
+
React.createElement(SvgTechnicalPreviewMini, null)))
|
|
49
|
+
: undefined }, option.label)) }));
|
|
55
50
|
}
|
|
56
51
|
//# sourceMappingURL=SelectMapFormat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectMapFormat.js","sourceRoot":"","sources":["../../../../src/ui/widget/SelectMapFormat.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,8BAA8B;AAE9B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAgB,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAC,uBAAuB,EAAC,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,QAAQ;AACR,wEAAwE;AACxE,4EAA4E;AAC5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,MAAM,EAAE,EAAE,CAAC,CACV,oBAAC,QAAQ,IACP,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;gBACzC,6BAAK,KAAK,EAAE,kBAAkB;oBAC5B,oBAAC,UAAU,IAAC,SAAS,EAAC,sCAAsC,EAAE,IAAI,EAAC,OAAO;wBACxE,oBAAC,uBAAuB,OAAG,CAChB,CACT;gBACN,CAAC,CAAC,SAAS,IACZ,MAAM,CAAC,KAAK,CACJ,CAAC,GAChB,CACH,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n// cSpell:ignore Modeless WMTS\r\n\r\nimport { IconButton, MenuItem, Select, SelectOption } from \"@itwin/itwinui-react\";\r\nimport * as React from \"react\";\r\nimport { MapTypesOptions } from \"../Interfaces\";\r\nimport \"./MapUrlDialog.scss\";\r\nimport {SvgTechnicalPreviewMini} from \"@itwin/itwinui-icons-color-react\";\r\nimport { MapLayersUI } from \"../../mapLayers\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\n\r\n// TODO:\r\n// Remove this structure and iterate over the registry's active formats.\r\n// Still need a proper way to exclude some format, like we currently do with\r\n// 'TileUrl' without the need to hardcode any format Id.\r\nexport const MAP_TYPES = {\r\n wms: \"WMS\",\r\n arcGis: \"ArcGIS\",\r\n wmts: \"WMTS\",\r\n tileUrl: \"TileURL\",\r\n arcGisFeature: \"ArcGISFeature\",\r\n};\r\n\r\ninterface SelectMapFormatProps {\r\n value?: string;\r\n disabled?: boolean;\r\n mapTypesOptions?: MapTypesOptions;\r\n onChange?: (mapType: string) => void;\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function SelectMapFormat(props: SelectMapFormatProps) {\r\n\r\n const [mapFormat, setMapFormat] = React.useState(props.value ?? MAP_TYPES.arcGis);\r\n const [techPreviewTooltip] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.TechPreviewBadgeTooltip\"));\r\n\r\n const [mapFormats] = React.useState((): SelectOption<string>[] => {\r\n const formats: SelectOption<string>[] = [\r\n { value: MAP_TYPES.arcGis, label: MAP_TYPES.arcGis },\r\n { value: MAP_TYPES.wms, label: MAP_TYPES.wms },\r\n { value: MAP_TYPES.wmts, label: MAP_TYPES.wmts },\r\n ];\r\n if (props.mapTypesOptions?.supportTileUrl)\r\n formats.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\r\n\r\n if (IModelApp.mapLayerFormatRegistry.isRegistered(MAP_TYPES.arcGisFeature))\r\n formats.push( { value: MAP_TYPES.arcGisFeature, label: MAP_TYPES.arcGisFeature, id:\"techPreview\" });\r\n\r\n return formats;\r\n });\r\n\r\n const handleOnChange = React.useCallback((value: string) => {\r\n setMapFormat(value);\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n }, [props]);\r\n\r\n return (\r\n\r\n <Select\r\n className=\"map-layer-source-select\"\r\n options={mapFormats}\r\n value={mapFormat}\r\n disabled={props.disabled}\r\n onChange={handleOnChange}\r\n size=\"small\"\r\n itemRenderer={\r\n (option) => (\r\n <MenuItem\r\n badge={option.id?.includes(\"techPreview\") ?\r\n <div title={techPreviewTooltip}>\r\n <IconButton className=\"map-layer-source-select-previewBadge\" size=\"small\">\r\n <SvgTechnicalPreviewMini />\r\n </IconButton>\r\n </div>\r\n : undefined}>\r\n {option.label}\r\n </MenuItem>) }\r\n />\r\n );\r\n}\r\n"]}
|
|
@@ -24,10 +24,9 @@ export class SubLayersDataProvider {
|
|
|
24
24
|
return undefined !== props.id ? `${props.id}` : props.name ? props.name : "no-id";
|
|
25
25
|
}
|
|
26
26
|
createNode(props, expanded, isCheckboxDisabled, icon) {
|
|
27
|
-
var _a, _b;
|
|
28
27
|
return {
|
|
29
28
|
id: this.createId(props),
|
|
30
|
-
label: PropertyRecord.fromString(
|
|
29
|
+
label: PropertyRecord.fromString(props.title ?? props.name ?? "unknown"),
|
|
31
30
|
hasChildren: !!props.children,
|
|
32
31
|
isCheckboxVisible: true,
|
|
33
32
|
checkBoxState: props.visible && !isCheckboxDisabled ? CheckBoxState.On : CheckBoxState.Off,
|
|
@@ -40,10 +39,10 @@ export class SubLayersDataProvider {
|
|
|
40
39
|
loadChildNodes(allSubLayers, parentId) {
|
|
41
40
|
const filteredProps = allSubLayers.filter((props) => parentId === props.parent);
|
|
42
41
|
if (filteredProps.length) {
|
|
43
|
-
filteredProps
|
|
42
|
+
filteredProps?.sort((a, b) => compareStringsOrUndefined(a.title, b.title));
|
|
44
43
|
const treeNodes = [];
|
|
45
44
|
filteredProps.forEach((props) => {
|
|
46
|
-
treeNodes.push(this.createNode(props, (!parentId &&
|
|
45
|
+
treeNodes.push(this.createNode(props, (!parentId && props?.children !== undefined) ? true : undefined, // expand root group only (i.e. not the entire tree),
|
|
47
46
|
undefined, SubLayersDataProvider.isUnnamedGroup(props) ? "icon-folder" : "icon-layers"));
|
|
48
47
|
if (props.children)
|
|
49
48
|
this.loadChildNodes(allSubLayers, props.id);
|
|
@@ -52,7 +51,7 @@ export class SubLayersDataProvider {
|
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
loadNodes(subLayerNodes) {
|
|
55
|
-
subLayerNodes
|
|
54
|
+
subLayerNodes?.sort((a, b) => compareStringsOrUndefined(a.title, b.title));
|
|
56
55
|
if (subLayerNodes) {
|
|
57
56
|
this.loadChildNodes(subLayerNodes, undefined);
|
|
58
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubLayersDataProvider.js","sourceRoot":"","sources":["../../../../src/ui/widget/SubLayersDataProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,cAAc,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AA6C;QAC7D,aAAa,EAAE,IAAI,CAAC,CAAC,CAAmB,EAAE,CAAmB,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/G,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;SAC/C;IACH,CAAC;IAIM,KAAK,CAAC,aAAa,CAAC,MAAqB;QAC9C,MAAM,SAAS,GAA+B,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5G,IAAI,SAAS;YACX,OAAO,SAAS,CAAC,MAAM,CAAC;QAE1B,OAAO,CAAC,CAAC;IACX,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,MAAqB;QACzC,MAAM,SAAS,GAA+B,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5G,IAAI,SAAS;YACX,OAAO,SAAS,CAAC;QAEnB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { BeEvent, compareStringsOrUndefined } from \"@itwin/core-bentley\";\r\nimport { MapSubLayerProps, SubLayerId } from \"@itwin/core-common\";\r\nimport { PropertyRecord } from \"@itwin/appui-abstract\";\r\nimport { DelayLoadedTreeNodeItem, ITreeDataProvider, TreeDataChangesListener, TreeNodeItem } from \"@itwin/components-react\";\r\nimport { CheckBoxState } from \"@itwin/core-react\";\r\nimport { StyleMapLayerSettings } from \"../Interfaces\";\r\n\r\n/**\r\n * Data provider that returns some fake nodes to show in tree.\r\n */\r\nexport class SubLayersDataProvider implements ITreeDataProvider {\r\n private readonly _nodeMap = new Map<string, TreeNodeItem[]>();\r\n private readonly _mapLayer: StyleMapLayerSettings;\r\n\r\n constructor(mapLayer: StyleMapLayerSettings) {\r\n this._mapLayer = mapLayer;\r\n this.loadNodes(mapLayer.subLayers);\r\n }\r\n\r\n public static isUnnamedGroup(subLayer: MapSubLayerProps | undefined): boolean {\r\n if (!subLayer)\r\n return false;\r\n\r\n return (!subLayer.name || subLayer.name.length === 0) && (subLayer.children !== undefined && subLayer.children.length > 0);\r\n }\r\n\r\n private createId(props: MapSubLayerProps): string {\r\n return undefined !== props.id ? `${props.id}` : props.name ? props.name : \"no-id\";\r\n }\r\n\r\n private createNode(props: MapSubLayerProps, expanded?: boolean, isCheckboxDisabled?: boolean, icon?: string): DelayLoadedTreeNodeItem {\r\n return {\r\n id: this.createId(props),\r\n label: PropertyRecord.fromString(props.title ?? props.name ?? \"unknown\"),\r\n hasChildren: !!props.children,\r\n isCheckboxVisible: true,\r\n checkBoxState: props.visible && !isCheckboxDisabled ? CheckBoxState.On : CheckBoxState.Off,\r\n extendedData: { subLayerId: props.id },\r\n isCheckboxDisabled,\r\n autoExpand: expanded,\r\n icon,\r\n };\r\n }\r\n\r\n private loadChildNodes(allSubLayers: MapSubLayerProps[], parentId?: SubLayerId) {\r\n const filteredProps = allSubLayers.filter((props) => parentId === props.parent);\r\n if (filteredProps.length) {\r\n filteredProps?.sort((a: MapSubLayerProps, b: MapSubLayerProps) => compareStringsOrUndefined(a.title, b.title));\r\n const treeNodes: TreeNodeItem[] = [];\r\n\r\n filteredProps.forEach((props) => {\r\n treeNodes.push(this.createNode(props,\r\n (!parentId && props?.children !== undefined) ? true : undefined, // expand root group only (i.e. not the entire tree),\r\n undefined,\r\n SubLayersDataProvider.isUnnamedGroup(props) ? \"icon-folder\" : \"icon-layers\"\r\n\r\n ));\r\n if (props.children)\r\n this.loadChildNodes(allSubLayers, props.id);\r\n });\r\n\r\n this._nodeMap.set(undefined !== parentId ? `${parentId}` : \"\", treeNodes);\r\n }\r\n }\r\n\r\n private loadNodes(subLayerNodes: MapSubLayerProps[] | undefined) {\r\n subLayerNodes?.sort((a: MapSubLayerProps, b: MapSubLayerProps) => compareStringsOrUndefined(a.title, b.title));\r\n if (subLayerNodes) {\r\n this.loadChildNodes(subLayerNodes, undefined);\r\n }\r\n }\r\n\r\n public onTreeNodeChanged = new BeEvent<TreeDataChangesListener>();\r\n\r\n public async getNodesCount(parent?: TreeNodeItem) {\r\n const nodeArray: TreeNodeItem[] | undefined = parent ? this._nodeMap.get(parent.id) : this._nodeMap.get(\"\");\r\n if (nodeArray)\r\n return nodeArray.length;\r\n\r\n return 0;\r\n }\r\n\r\n public async getNodes(parent?: TreeNodeItem) {\r\n const nodeArray: TreeNodeItem[] | undefined = parent ? this._nodeMap.get(parent.id) : this._nodeMap.get(\"\");\r\n if (nodeArray)\r\n return nodeArray;\r\n\r\n return [];\r\n }\r\n}\r\n"]}
|