@itwin/map-layers 3.0.0-dev.90 → 3.0.0-dev.91
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/lib/cjs/ui/widget/MapLayerManager.scss +2 -0
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.js +7 -7
- package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.scss +8 -5
- package/lib/esm/ui/widget/MapLayerManager.scss +2 -0
- package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.js +7 -7
- package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.scss +8 -5
- package/package.json +30 -30
|
@@ -480,11 +480,13 @@ button.map-manager-item-visibility {
|
|
|
480
480
|
}
|
|
481
481
|
|
|
482
482
|
.map-manager-sources {
|
|
483
|
+
margin-top: 4px;
|
|
483
484
|
height: 250px;
|
|
484
485
|
min-height: 60px;
|
|
485
486
|
|
|
486
487
|
.map-source-list-entry {
|
|
487
488
|
button.map-source-list-entry-button {
|
|
489
|
+
height: auto;
|
|
488
490
|
padding: 0 4px 0 4px;
|
|
489
491
|
margin: 0;
|
|
490
492
|
background-color: transparent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapUrlDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAC8D,cAAc,EACd,cAAc,EAClF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAGlC,yBAAyB,CAAC,EAAE,aAAa,CAAC;IAE1C,oBAAoB,CAAC,EAAE,cAAc,CAAC;CACvC;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"MapUrlDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAC8D,cAAc,EACd,cAAc,EAClF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAGlC,yBAAyB,CAAC,EAAE,aAAa,CAAC;IAE1C,oBAAoB,CAAC,EAAE,cAAc,CAAC;CACvC;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA0ZpD"}
|
|
@@ -317,21 +317,21 @@ function MapUrlDialog(props) {
|
|
|
317
317
|
}
|
|
318
318
|
}, [handleOk, readyToSave]);
|
|
319
319
|
return (React.createElement("div", { ref: dialogContainer },
|
|
320
|
-
React.createElement(core_react_1.Dialog, { className: "map-layer-url-dialog", title: dialogTitle, opened: true, resizable: true, movable: true, modal: true, buttonCluster: buttonCluster, onClose: handleCancel, onEscape: handleCancel, minHeight: 120, maxWidth: 600, trapFocus: false },
|
|
321
|
-
React.createElement("div",
|
|
320
|
+
React.createElement(core_react_1.Dialog, { className: "map-layer-url-dialog", title: dialogTitle, opened: true, resizable: true, movable: true, modal: true, buttonCluster: buttonCluster, onClose: handleCancel, onEscape: handleCancel, minHeight: 120, maxWidth: 600, titleStyle: { paddingLeft: "10px" }, footerStyle: { paddingBottom: "10px", paddingRight: "10px" }, trapFocus: false },
|
|
321
|
+
React.createElement("div", { className: "map-layer-url-dialog-content" },
|
|
322
322
|
React.createElement("div", { className: "map-layer-source-url" },
|
|
323
323
|
React.createElement("span", { className: "map-layer-source-label" }, typeLabel),
|
|
324
|
-
React.createElement(itwinui_react_1.Select, { className: "map-
|
|
324
|
+
React.createElement(itwinui_react_1.Select, { className: "map-layer-source-select", options: mapTypes, value: mapType, disabled: props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined, onChange: handleMapTypeSelection }),
|
|
325
325
|
React.createElement("span", { className: "map-layer-source-label" }, nameLabel),
|
|
326
|
-
React.createElement(itwinui_react_1.Input, { placeholder: nameInputPlaceHolder, onChange: onNameChange, value: mapName, disabled: props.layerRequiringCredentials !== undefined }),
|
|
326
|
+
React.createElement(itwinui_react_1.Input, { className: "map-layer-source-input", placeholder: nameInputPlaceHolder, onChange: onNameChange, value: mapName, disabled: props.layerRequiringCredentials !== undefined }),
|
|
327
327
|
React.createElement("span", { className: "map-layer-source-label" }, urlLabel),
|
|
328
|
-
React.createElement(itwinui_react_1.Input, { placeholder: urlInputPlaceHolder, onKeyPress: handleOnKeyDown, onChange: onUrlChange, disabled: props.mapLayerSourceToEdit !== undefined, value: mapUrl }),
|
|
328
|
+
React.createElement(itwinui_react_1.Input, { className: "map-layer-source-input", placeholder: urlInputPlaceHolder, onKeyPress: handleOnKeyDown, onChange: onUrlChange, disabled: props.mapLayerSourceToEdit !== undefined, value: mapUrl }),
|
|
329
329
|
isAuthSupported() && props.mapLayerSourceToEdit === undefined &&
|
|
330
330
|
React.createElement(React.Fragment, null,
|
|
331
331
|
React.createElement("span", { className: "map-layer-source-label" }, userNameLabel),
|
|
332
|
-
React.createElement(itwinui_react_1.LabeledInput, { placeholder: serverRequireCredentials ? userNameRequiredLabel : userNameLabel, status: !userName && serverRequireCredentials ? core_react_1.InputStatus.Warning : undefined, onChange: onUsernameChange }),
|
|
332
|
+
React.createElement(itwinui_react_1.LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", placeholder: serverRequireCredentials ? userNameRequiredLabel : userNameLabel, status: !userName && serverRequireCredentials ? core_react_1.InputStatus.Warning : undefined, onChange: onUsernameChange }),
|
|
333
333
|
React.createElement("span", { className: "map-layer-source-label" }, passwordLabel),
|
|
334
|
-
React.createElement(itwinui_react_1.LabeledInput, { type: "password", placeholder: serverRequireCredentials ? passwordRequiredLabel : passwordLabel, status: !password && serverRequireCredentials ? core_react_1.InputStatus.Warning : undefined, onChange: onPasswordChange, onKeyPress: handleOnKeyDown })),
|
|
334
|
+
React.createElement(itwinui_react_1.LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", type: "password", placeholder: serverRequireCredentials ? passwordRequiredLabel : passwordLabel, status: !password && serverRequireCredentials ? core_react_1.InputStatus.Warning : undefined, onChange: onPasswordChange, onKeyPress: handleOnKeyDown })),
|
|
335
335
|
isSettingsStorageAvailable && React.createElement("div", { title: settingsStorageDisabled ? noSaveSettingsWarning : "" },
|
|
336
336
|
React.createElement(itwinui_react_1.Radio, { disabled: settingsStorageDisabled, name: "settingsStorage", value: "iTwin", label: iTwinSettingsLabel, checked: settingsStorage === "iTwin", onChange: onRadioChange }),
|
|
337
337
|
React.createElement(itwinui_react_1.Radio, { disabled: settingsStorageDisabled, name: "settingsStorage", value: "Model", label: modelSettingsLabel, checked: settingsStorage === "Model", onChange: onRadioChange })))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlD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,KAAK,EAAC,OAAO,EACpC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,EAC/D,QAAQ,EAAE,aAAa,GAAI;wBAC7B,oBAAC,qBAAK,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;YAGN,6BAAK,SAAS,EAAC,8BAA8B,IAC1C,cAAc,CAAC,CAAC;gBACf;oBACE,oBAAC,iBAAI,IAAC,SAAS,EAAC,mCAAmC,EAAC,QAAQ,EAAC,qBAAqB,GAAG;oBACrF,8BAAM,SAAS,EAAC,oCAAoC,IAAE,cAAc,CAAS,CAC5E;gBACH,CAAC;oBACD,sCAAsC;oBACtC,8BAAM,SAAS,EAAC,8BAA8B,aAAc,CAE1D;YAGL,kBAAkB;gBACjB,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,oBAAC,8BAAc,IAAC,aAAa,SAAG,CAC5B,CAED,CACJ,CACR,CAAC;AACJ,CAAC;AAlZD,oCAkZC","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 * as React from \"react\";\r\nimport { Input, LabeledInput, ProgressLinear, Radio, Select, SelectOption } from \"@itwin/itwinui-react\";\r\nimport { Dialog, Icon, InputStatus } from \"@itwin/core-react\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\r\nimport { MapTypesOptions } from \"../Interfaces\";\r\nimport {\r\n IModelApp, MapLayerImageryProviderStatus, MapLayerSettingsService, MapLayerSource,\r\n MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { MapLayerProps } from \"@itwin/core-common\";\r\nimport \"./MapUrlDialog.scss\";\r\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\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};\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?: MapLayerProps;\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 const supportWmsAuthentication = (mapTypesOptions?.supportWmsAuthentication ? true : false);\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(MapLayersUiItemsProvider.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\r\n const [typeLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\r\n const [nameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\r\n const [nameInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\r\n const [urlLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\r\n const [urlInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\r\n const [iTwinSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\r\n const [modelSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\r\n const [missingCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\r\n const [invalidCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\r\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(props.layerRequiringCredentials ?? false);\r\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\r\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\r\n const [warningMessage, setWarningMessage] = React.useState(props.layerRequiringCredentials ? missingCredentialsLabel : undefined);\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(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\r\n const [passwordLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\r\n const [passwordRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\r\n const [userNameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\r\n const [userNameRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\r\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"ITwin\");\r\n\r\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? MAP_TYPES.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 [mapTypes] = React.useState((): SelectOption<string>[] => {\r\n const types = [\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 (mapTypesOptions?.supportTileUrl)\r\n types.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\r\n return types;\r\n });\r\n\r\n const [isSettingsStorageAvailable] = React.useState(props?.activeViewport?.iModel?.iTwinId && props?.activeViewport?.iModel?.iModelId);\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 isAuthSupported = React.useCallback(() => {\r\n return ((mapType === MAP_TYPES.wms || mapType === MAP_TYPES.wms) && supportWmsAuthentication)\r\n || mapType === MAP_TYPES.arcGis;\r\n }, [mapType, supportWmsAuthentication]);\r\n\r\n // const [layerIdxToEdit] = React.useState((): number | undefined => {\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.findMapLayerIndexByNameAndUrl(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 // Update warning message based on the dialog state and server response\r\n React.useEffect(() => {\r\n if (invalidCredentialsProvided) {\r\n setWarningMessage(invalidCredentialsLabel);\r\n } else if (serverRequireCredentials && (!userName || !password)) {\r\n setWarningMessage(missingCredentialsLabel);\r\n } else {\r\n setWarningMessage(undefined);\r\n }\r\n }, [invalidCredentialsProvided, invalidCredentialsLabel, missingCredentialsLabel, serverRequireCredentials, userName, password, setWarningMessage]);\r\n\r\n const handleMapTypeSelection = React.useCallback((newValue: string) => {\r\n setMapType(newValue);\r\n }, [setMapType]);\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 doAttach = React.useCallback(async (source: MapLayerSource): Promise<boolean> => {\r\n // Returns a promise, When true, the dialog should closed\r\n return new Promise<boolean>((resolve, _reject) => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined) {\r\n resolve(true);\r\n return;\r\n }\r\n\r\n const storeOnIModel = \"Model\" === settingsStorage;\r\n source.validateSource(true).then(async (validation) => {\r\n if (validation.status === MapLayerSourceStatus.Valid\r\n || validation.status === MapLayerSourceStatus.RequireAuth\r\n || validation.status === MapLayerSourceStatus.InvalidCredentials) {\r\n const sourceRequireAuth = (validation.status === MapLayerSourceStatus.RequireAuth);\r\n const invalidCredentials = (validation.status === MapLayerSourceStatus.InvalidCredentials);\r\n const closeDialog = !sourceRequireAuth && !invalidCredentials;\r\n resolve(closeDialog);\r\n\r\n if (sourceRequireAuth && !serverRequireCredentials) {\r\n setServerRequireCredentials(true);\r\n }\r\n if (invalidCredentials) {\r\n setInvalidCredentialsProvided(true);\r\n return;\r\n } else if (invalidCredentialsProvided) {\r\n setInvalidCredentialsProvided(false); // flag reset\r\n }\r\n\r\n if (validation.status === MapLayerSourceStatus.Valid) {\r\n // Attach layer and update settings service (only if editing)\r\n if (layerRequiringCredentialsIdx !== undefined) {\r\n // Update username / password\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 // Reset the provider's status\r\n const provider = vp.getMapLayerImageryProvider(layerRequiringCredentialsIdx, isOverlay);\r\n if (provider && provider.status !== MapLayerImageryProviderStatus.Valid) {\r\n provider.status = MapLayerImageryProviderStatus.Valid;\r\n }\r\n } else {\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 if (!(await MapLayerSettingsService.storeSourceInSettingsService(source, storeOnIModel, vp.iModel.iTwinId!, vp.iModel.iModelId!)))\r\n return;\r\n }\r\n const layerSettings = source.toLayerSettings(validation.subLayers);\r\n if (layerSettings) {\r\n vp.displayStyle.attachMapLayerSettings(layerSettings, isOverlay, undefined);\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 = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSettingsConversionError\");\r\n const msg = MapLayersUiItemsProvider.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\r\n vp.invalidateRenderPlan();\r\n }\r\n\r\n if (closeDialog) {\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\r\n } else {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\r\n resolve(true);\r\n }\r\n resolve(false);\r\n }).catch((error) => {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n resolve(true);\r\n });\r\n });\r\n }, [props.activeViewport, props.layerRequiringCredentials, settingsStorage, serverRequireCredentials, invalidCredentialsProvided, onOkResult, layerRequiringCredentialsIdx, isOverlay, settingsStorageDisabled]);\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 handleOk = 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 userName,\r\n password,\r\n });\r\n\r\n if (source === undefined || props.mapLayerSourceToEdit) {\r\n\r\n ModalDialogManager.closeDialog();\r\n\r\n if (source === undefined) {\r\n // Close the dialog and inform end user something went wrong.\r\n const msgError = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.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) {\r\n if (!(await MapLayerSettingsService.replaceSourceInSettingsService(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId!, vp.iModel.iModelId!))) {\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 })();\r\n return;\r\n }\r\n }\r\n\r\n setLayerAttachPending(true);\r\n\r\n void (async () => {\r\n // Code below is executed in the an async manner but\r\n // I don't necessarily want to mark the handler as async\r\n // so Im wrapping it un in a void wrapper.\r\n try {\r\n const closeDialog = await doAttach(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 }\r\n } catch (_error) {\r\n ModalDialogManager.closeDialog();\r\n }\r\n })();\r\n }\r\n\r\n }, [mapUrl, mapName, mapType, userName, password, props.mapLayerSourceToEdit, props.activeViewport, isSettingsStorageAvailable, doAttach]);\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 && (!serverRequireCredentials || (serverRequireCredentials && credentialsSet) && !layerAttachPending)\r\n && !invalidCredentialsProvided;\r\n }, [mapUrl, mapName, userName, password, layerAttachPending, invalidCredentialsProvided, serverRequireCredentials]);\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 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 trapFocus={false}\r\n >\r\n <div>\r\n <div className=\"map-layer-source-url\">\r\n <span className=\"map-layer-source-label\">{typeLabel}</span>\r\n <Select\r\n className=\"map-manager-base-select\"\r\n options={mapTypes}\r\n value={mapType}\r\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined}\r\n onChange={handleMapTypeSelection} />\r\n <span className=\"map-layer-source-label\">{nameLabel}</span>\r\n <Input placeholder={nameInputPlaceHolder} onChange={onNameChange} value={mapName} disabled={props.layerRequiringCredentials !== undefined} />\r\n <span className=\"map-layer-source-label\">{urlLabel}</span>\r\n <Input placeholder={urlInputPlaceHolder} onKeyPress={handleOnKeyDown} onChange={onUrlChange} disabled={props.mapLayerSourceToEdit !== undefined} value={mapUrl} />\r\n {isAuthSupported() && props.mapLayerSourceToEdit === undefined &&\r\n <>\r\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\r\n <LabeledInput placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\r\n status={!userName && serverRequireCredentials ? InputStatus.Warning : undefined}\r\n onChange={onUsernameChange} />\r\n\r\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\r\n <LabeledInput type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\r\n status={!password && serverRequireCredentials ? InputStatus.Warning : undefined}\r\n onChange={onPasswordChange}\r\n onKeyPress={handleOnKeyDown} />\r\n </>\r\n }\r\n\r\n {/* Store settings options, not shown when editing a layer */}\r\n {isSettingsStorageAvailable && <div title={settingsStorageDisabled ? noSaveSettingsWarning : \"\"}>\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\r\n {/* Warning message */}\r\n <div className=\"map-layer-source-warnMessage\">\r\n {warningMessage ?\r\n <>\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 </>\r\n :\r\n // Place holder to avoid dialog resize\r\n <span className=\"map-layer-source-placeholder\"> </span>\r\n }\r\n </div>\r\n\r\n {/* Progress bar */}\r\n {layerAttachPending &&\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,+BAA+B;AAC/B,wDAAwG;AACxG,kDAA8D;AAC9D,oDAAwD;AACxD,0EAAuE;AAEvE,wDAG8B;AAE9B,+BAA6B;AAC7B,0DAAqE;AAExD,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACnB,CAAC;AAeF,gEAAgE;AAChE,SAAgB,YAAY,CAAC,KAAwB;;IACnD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IACzD,MAAM,wBAAwB,GAAG,CAAC,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,wBAAwB,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAE5F,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;;QAChD,IAAI,KAAK,CAAC,oBAAoB,EAAE;YA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C,CAAC;gBACf;oBACE,oBAAC,iBAAI,IAAC,SAAS,EAAC,mCAAmC,EAAC,QAAQ,EAAC,qBAAqB,GAAG;oBACrF,8BAAM,SAAS,EAAC,oCAAoC,IAAE,cAAc,CAAS,CAC5E;gBACH,CAAC;oBACD,sCAAsC;oBACtC,8BAAM,SAAS,EAAC,8BAA8B,aAAc,CAE1D;YAGL,kBAAkB;gBACjB,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,oBAAC,8BAAc,IAAC,aAAa,SAAG,CAC5B,CAED,CACJ,CACR,CAAC;AACJ,CAAC;AA1ZD,oCA0ZC","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 * as React from \"react\";\r\nimport { Input, LabeledInput, ProgressLinear, Radio, Select, SelectOption } from \"@itwin/itwinui-react\";\r\nimport { Dialog, Icon, InputStatus } from \"@itwin/core-react\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\r\nimport { MapTypesOptions } from \"../Interfaces\";\r\nimport {\r\n IModelApp, MapLayerImageryProviderStatus, MapLayerSettingsService, MapLayerSource,\r\n MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { MapLayerProps } from \"@itwin/core-common\";\r\nimport \"./MapUrlDialog.scss\";\r\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\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};\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?: MapLayerProps;\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 const supportWmsAuthentication = (mapTypesOptions?.supportWmsAuthentication ? true : false);\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(MapLayersUiItemsProvider.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\r\n const [typeLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\r\n const [nameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\r\n const [nameInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\r\n const [urlLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\r\n const [urlInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\r\n const [iTwinSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\r\n const [modelSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\r\n const [missingCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\r\n const [invalidCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\r\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(props.layerRequiringCredentials ?? false);\r\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\r\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\r\n const [warningMessage, setWarningMessage] = React.useState(props.layerRequiringCredentials ? missingCredentialsLabel : undefined);\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(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\r\n const [passwordLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\r\n const [passwordRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\r\n const [userNameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\r\n const [userNameRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\r\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"ITwin\");\r\n\r\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? MAP_TYPES.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 [mapTypes] = React.useState((): SelectOption<string>[] => {\r\n const types = [\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 (mapTypesOptions?.supportTileUrl)\r\n types.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\r\n return types;\r\n });\r\n\r\n const [isSettingsStorageAvailable] = React.useState(props?.activeViewport?.iModel?.iTwinId && props?.activeViewport?.iModel?.iModelId);\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 isAuthSupported = React.useCallback(() => {\r\n return ((mapType === MAP_TYPES.wms || mapType === MAP_TYPES.wms) && supportWmsAuthentication)\r\n || mapType === MAP_TYPES.arcGis;\r\n }, [mapType, supportWmsAuthentication]);\r\n\r\n // const [layerIdxToEdit] = React.useState((): number | undefined => {\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.findMapLayerIndexByNameAndUrl(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 // Update warning message based on the dialog state and server response\r\n React.useEffect(() => {\r\n if (invalidCredentialsProvided) {\r\n setWarningMessage(invalidCredentialsLabel);\r\n } else if (serverRequireCredentials && (!userName || !password)) {\r\n setWarningMessage(missingCredentialsLabel);\r\n } else {\r\n setWarningMessage(undefined);\r\n }\r\n }, [invalidCredentialsProvided, invalidCredentialsLabel, missingCredentialsLabel, serverRequireCredentials, userName, password, setWarningMessage]);\r\n\r\n const handleMapTypeSelection = React.useCallback((newValue: string) => {\r\n setMapType(newValue);\r\n }, [setMapType]);\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 doAttach = React.useCallback(async (source: MapLayerSource): Promise<boolean> => {\r\n // Returns a promise, When true, the dialog should closed\r\n return new Promise<boolean>((resolve, _reject) => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined) {\r\n resolve(true);\r\n return;\r\n }\r\n\r\n const storeOnIModel = \"Model\" === settingsStorage;\r\n source.validateSource(true).then(async (validation) => {\r\n if (validation.status === MapLayerSourceStatus.Valid\r\n || validation.status === MapLayerSourceStatus.RequireAuth\r\n || validation.status === MapLayerSourceStatus.InvalidCredentials) {\r\n const sourceRequireAuth = (validation.status === MapLayerSourceStatus.RequireAuth);\r\n const invalidCredentials = (validation.status === MapLayerSourceStatus.InvalidCredentials);\r\n const closeDialog = !sourceRequireAuth && !invalidCredentials;\r\n resolve(closeDialog);\r\n\r\n if (sourceRequireAuth && !serverRequireCredentials) {\r\n setServerRequireCredentials(true);\r\n }\r\n if (invalidCredentials) {\r\n setInvalidCredentialsProvided(true);\r\n return;\r\n } else if (invalidCredentialsProvided) {\r\n setInvalidCredentialsProvided(false); // flag reset\r\n }\r\n\r\n if (validation.status === MapLayerSourceStatus.Valid) {\r\n // Attach layer and update settings service (only if editing)\r\n if (layerRequiringCredentialsIdx !== undefined) {\r\n // Update username / password\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 // Reset the provider's status\r\n const provider = vp.getMapLayerImageryProvider(layerRequiringCredentialsIdx, isOverlay);\r\n if (provider && provider.status !== MapLayerImageryProviderStatus.Valid) {\r\n provider.status = MapLayerImageryProviderStatus.Valid;\r\n }\r\n } else {\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 if (!(await MapLayerSettingsService.storeSourceInSettingsService(source, storeOnIModel, vp.iModel.iTwinId!, vp.iModel.iModelId!)))\r\n return;\r\n }\r\n const layerSettings = source.toLayerSettings(validation.subLayers);\r\n if (layerSettings) {\r\n vp.displayStyle.attachMapLayerSettings(layerSettings, isOverlay, undefined);\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 = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSettingsConversionError\");\r\n const msg = MapLayersUiItemsProvider.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\r\n vp.invalidateRenderPlan();\r\n }\r\n\r\n if (closeDialog) {\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\r\n } else {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\r\n resolve(true);\r\n }\r\n resolve(false);\r\n }).catch((error) => {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n resolve(true);\r\n });\r\n });\r\n }, [props.activeViewport, props.layerRequiringCredentials, settingsStorage, serverRequireCredentials, invalidCredentialsProvided, onOkResult, layerRequiringCredentialsIdx, isOverlay, settingsStorageDisabled]);\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 handleOk = 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 userName,\r\n password,\r\n });\r\n\r\n if (source === undefined || props.mapLayerSourceToEdit) {\r\n\r\n ModalDialogManager.closeDialog();\r\n\r\n if (source === undefined) {\r\n // Close the dialog and inform end user something went wrong.\r\n const msgError = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.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) {\r\n if (!(await MapLayerSettingsService.replaceSourceInSettingsService(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId!, vp.iModel.iModelId!))) {\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 })();\r\n return;\r\n }\r\n }\r\n\r\n setLayerAttachPending(true);\r\n\r\n void (async () => {\r\n // Code below is executed in the an async manner but\r\n // I don't necessarily want to mark the handler as async\r\n // so Im wrapping it un in a void wrapper.\r\n try {\r\n const closeDialog = await doAttach(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 }\r\n } catch (_error) {\r\n ModalDialogManager.closeDialog();\r\n }\r\n })();\r\n }\r\n\r\n }, [mapUrl, mapName, mapType, userName, password, props.mapLayerSourceToEdit, props.activeViewport, isSettingsStorageAvailable, doAttach]);\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 && (!serverRequireCredentials || (serverRequireCredentials && credentialsSet) && !layerAttachPending)\r\n && !invalidCredentialsProvided;\r\n }, [mapUrl, mapName, userName, password, layerAttachPending, invalidCredentialsProvided, serverRequireCredentials]);\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 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 <Select\r\n className=\"map-layer-source-select\"\r\n options={mapTypes}\r\n value={mapType}\r\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined}\r\n onChange={handleMapTypeSelection} />\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} />\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} value={mapUrl} />\r\n {isAuthSupported() && props.mapLayerSourceToEdit === undefined &&\r\n <>\r\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\r\n <LabeledInput\r\n className=\"map-layer-source-input\"\r\n displayStyle=\"inline\"\r\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\r\n status={!userName && serverRequireCredentials ? InputStatus.Warning : undefined}\r\n onChange={onUsernameChange} />\r\n\r\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\r\n <LabeledInput\r\n className=\"map-layer-source-input\"\r\n displayStyle=\"inline\"\r\n type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\r\n status={!password && serverRequireCredentials ? InputStatus.Warning : undefined}\r\n onChange={onPasswordChange}\r\n onKeyPress={handleOnKeyDown} />\r\n </>\r\n }\r\n\r\n {/* Store settings options, not shown when editing a layer */}\r\n {isSettingsStorageAvailable && <div title={settingsStorageDisabled ? noSaveSettingsWarning : \"\"}>\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\r\n {/* Warning message */}\r\n <div className=\"map-layer-source-warnMessage\">\r\n {warningMessage ?\r\n <>\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 </>\r\n :\r\n // Place holder to avoid dialog resize\r\n <span className=\"map-layer-source-placeholder\"> </span>\r\n }\r\n </div>\r\n\r\n {/* Progress bar */}\r\n {layerAttachPending &&\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"]}
|
|
@@ -11,13 +11,12 @@ $hovered-icon-color: $buic-foreground-primary-tone;
|
|
|
11
11
|
|
|
12
12
|
.map-layer-url-dialog {
|
|
13
13
|
z-Index: 21000;
|
|
14
|
-
|
|
15
|
-
.core-dialog-content {
|
|
16
|
-
padding-right: 11px !important;
|
|
17
|
-
padding-left: 11px !important;
|
|
18
|
-
}
|
|
19
14
|
}
|
|
20
15
|
|
|
16
|
+
.map-layer-url-dialog-content {
|
|
17
|
+
padding-right: 5px;
|
|
18
|
+
padding-left: 5px;
|
|
19
|
+
}
|
|
21
20
|
.map-layer-source-url {
|
|
22
21
|
|
|
23
22
|
height: 100%;
|
|
@@ -27,6 +26,10 @@ $hovered-icon-color: $buic-foreground-primary-tone;
|
|
|
27
26
|
grid-column-gap: 10px;
|
|
28
27
|
align-items: center;
|
|
29
28
|
|
|
29
|
+
.map-layer-source-select, .map-layer-source-input {
|
|
30
|
+
margin-bottom: 0.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
30
33
|
.map-layer-source-label {
|
|
31
34
|
font-size: $iui-font-size;
|
|
32
35
|
color: $buic-foreground-body;
|
|
@@ -480,11 +480,13 @@ button.map-manager-item-visibility {
|
|
|
480
480
|
}
|
|
481
481
|
|
|
482
482
|
.map-manager-sources {
|
|
483
|
+
margin-top: 4px;
|
|
483
484
|
height: 250px;
|
|
484
485
|
min-height: 60px;
|
|
485
486
|
|
|
486
487
|
.map-source-list-entry {
|
|
487
488
|
button.map-source-list-entry-button {
|
|
489
|
+
height: auto;
|
|
488
490
|
padding: 0 4px 0 4px;
|
|
489
491
|
margin: 0;
|
|
490
492
|
background-color: transparent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapUrlDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAC8D,cAAc,EACd,cAAc,EAClF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAGlC,yBAAyB,CAAC,EAAE,aAAa,CAAC;IAE1C,oBAAoB,CAAC,EAAE,cAAc,CAAC;CACvC;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"MapUrlDialog.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAC8D,cAAc,EACd,cAAc,EAClF,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,qBAAqB,CAAC;AAG7B,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAGlC,yBAAyB,CAAC,EAAE,aAAa,CAAC;IAE1C,oBAAoB,CAAC,EAAE,cAAc,CAAC;CACvC;AAGD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eA0ZpD"}
|
|
@@ -314,21 +314,21 @@ export function MapUrlDialog(props) {
|
|
|
314
314
|
}
|
|
315
315
|
}, [handleOk, readyToSave]);
|
|
316
316
|
return (React.createElement("div", { ref: dialogContainer },
|
|
317
|
-
React.createElement(Dialog, { className: "map-layer-url-dialog", title: dialogTitle, opened: true, resizable: true, movable: true, modal: true, buttonCluster: buttonCluster, onClose: handleCancel, onEscape: handleCancel, minHeight: 120, maxWidth: 600, trapFocus: false },
|
|
318
|
-
React.createElement("div",
|
|
317
|
+
React.createElement(Dialog, { className: "map-layer-url-dialog", title: dialogTitle, opened: true, resizable: true, movable: true, modal: true, buttonCluster: buttonCluster, onClose: handleCancel, onEscape: handleCancel, minHeight: 120, maxWidth: 600, titleStyle: { paddingLeft: "10px" }, footerStyle: { paddingBottom: "10px", paddingRight: "10px" }, trapFocus: false },
|
|
318
|
+
React.createElement("div", { className: "map-layer-url-dialog-content" },
|
|
319
319
|
React.createElement("div", { className: "map-layer-source-url" },
|
|
320
320
|
React.createElement("span", { className: "map-layer-source-label" }, typeLabel),
|
|
321
|
-
React.createElement(Select, { className: "map-
|
|
321
|
+
React.createElement(Select, { className: "map-layer-source-select", options: mapTypes, value: mapType, disabled: props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined, onChange: handleMapTypeSelection }),
|
|
322
322
|
React.createElement("span", { className: "map-layer-source-label" }, nameLabel),
|
|
323
|
-
React.createElement(Input, { placeholder: nameInputPlaceHolder, onChange: onNameChange, value: mapName, disabled: props.layerRequiringCredentials !== undefined }),
|
|
323
|
+
React.createElement(Input, { className: "map-layer-source-input", placeholder: nameInputPlaceHolder, onChange: onNameChange, value: mapName, disabled: props.layerRequiringCredentials !== undefined }),
|
|
324
324
|
React.createElement("span", { className: "map-layer-source-label" }, urlLabel),
|
|
325
|
-
React.createElement(Input, { placeholder: urlInputPlaceHolder, onKeyPress: handleOnKeyDown, onChange: onUrlChange, disabled: props.mapLayerSourceToEdit !== undefined, value: mapUrl }),
|
|
325
|
+
React.createElement(Input, { className: "map-layer-source-input", placeholder: urlInputPlaceHolder, onKeyPress: handleOnKeyDown, onChange: onUrlChange, disabled: props.mapLayerSourceToEdit !== undefined, value: mapUrl }),
|
|
326
326
|
isAuthSupported() && props.mapLayerSourceToEdit === undefined &&
|
|
327
327
|
React.createElement(React.Fragment, null,
|
|
328
328
|
React.createElement("span", { className: "map-layer-source-label" }, userNameLabel),
|
|
329
|
-
React.createElement(LabeledInput, { placeholder: serverRequireCredentials ? userNameRequiredLabel : userNameLabel, status: !userName && serverRequireCredentials ? InputStatus.Warning : undefined, onChange: onUsernameChange }),
|
|
329
|
+
React.createElement(LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", placeholder: serverRequireCredentials ? userNameRequiredLabel : userNameLabel, status: !userName && serverRequireCredentials ? InputStatus.Warning : undefined, onChange: onUsernameChange }),
|
|
330
330
|
React.createElement("span", { className: "map-layer-source-label" }, passwordLabel),
|
|
331
|
-
React.createElement(LabeledInput, { type: "password", placeholder: serverRequireCredentials ? passwordRequiredLabel : passwordLabel, status: !password && serverRequireCredentials ? InputStatus.Warning : undefined, onChange: onPasswordChange, onKeyPress: handleOnKeyDown })),
|
|
331
|
+
React.createElement(LabeledInput, { className: "map-layer-source-input", displayStyle: "inline", type: "password", placeholder: serverRequireCredentials ? passwordRequiredLabel : passwordLabel, status: !password && serverRequireCredentials ? InputStatus.Warning : undefined, onChange: onPasswordChange, onKeyPress: handleOnKeyDown })),
|
|
332
332
|
isSettingsStorageAvailable && React.createElement("div", { title: settingsStorageDisabled ? noSaveSettingsWarning : "" },
|
|
333
333
|
React.createElement(Radio, { disabled: settingsStorageDisabled, name: "settingsStorage", value: "iTwin", label: iTwinSettingsLabel, checked: settingsStorage === "iTwin", onChange: onRadioChange }),
|
|
334
334
|
React.createElement(Radio, { disabled: settingsStorageDisabled, name: "settingsStorage", value: "Model", label: modelSettingsLabel, checked: settingsStorage === "Model", onChange: onRadioChange })))),
|
|
@@ -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,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAgB,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EACL,SAAS,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,cAAc,EACjF,oBAAoB,EAAE,oBAAoB,EAAE,qBAAqB,GAClE,MAAM,sBAAsB,CAAC;AAE9B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAErE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACnB,CAAC;AAeF,gEAAgE;AAChE,MAAM,UAAU,YAAY,CAAC,KAAwB;;IACnD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IACzD,MAAM,wBAAwB,GAAG,CAAC,CAAA,eAAe,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,CAAS,CAC5E;gBACH,CAAC;oBACD,sCAAsC;oBACtC,8BAAM,SAAS,EAAC,8BAA8B,aAAc,CAE1D;YAGL,kBAAkB;gBACjB,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 * as React from \"react\";\r\nimport { Input, LabeledInput, ProgressLinear, Radio, Select, SelectOption } from \"@itwin/itwinui-react\";\r\nimport { Dialog, Icon, InputStatus } from \"@itwin/core-react\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\r\nimport { MapTypesOptions } from \"../Interfaces\";\r\nimport {\r\n IModelApp, MapLayerImageryProviderStatus, MapLayerSettingsService, MapLayerSource,\r\n MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { MapLayerProps } from \"@itwin/core-common\";\r\nimport \"./MapUrlDialog.scss\";\r\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\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};\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?: MapLayerProps;\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 const supportWmsAuthentication = (mapTypesOptions?.supportWmsAuthentication ? true : false);\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(MapLayersUiItemsProvider.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\r\n const [typeLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\r\n const [nameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\r\n const [nameInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\r\n const [urlLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\r\n const [urlInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\r\n const [iTwinSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\r\n const [modelSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\r\n const [missingCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\r\n const [invalidCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\r\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(props.layerRequiringCredentials ?? false);\r\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\r\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\r\n const [warningMessage, setWarningMessage] = React.useState(props.layerRequiringCredentials ? missingCredentialsLabel : undefined);\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(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\r\n const [passwordLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\r\n const [passwordRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\r\n const [userNameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\r\n const [userNameRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\r\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"ITwin\");\r\n\r\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? MAP_TYPES.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 [mapTypes] = React.useState((): SelectOption<string>[] => {\r\n const types = [\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 (mapTypesOptions?.supportTileUrl)\r\n types.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\r\n return types;\r\n });\r\n\r\n const [isSettingsStorageAvailable] = React.useState(props?.activeViewport?.iModel?.iTwinId && props?.activeViewport?.iModel?.iModelId);\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 isAuthSupported = React.useCallback(() => {\r\n return ((mapType === MAP_TYPES.wms || mapType === MAP_TYPES.wms) && supportWmsAuthentication)\r\n || mapType === MAP_TYPES.arcGis;\r\n }, [mapType, supportWmsAuthentication]);\r\n\r\n // const [layerIdxToEdit] = React.useState((): number | undefined => {\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.findMapLayerIndexByNameAndUrl(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 // Update warning message based on the dialog state and server response\r\n React.useEffect(() => {\r\n if (invalidCredentialsProvided) {\r\n setWarningMessage(invalidCredentialsLabel);\r\n } else if (serverRequireCredentials && (!userName || !password)) {\r\n setWarningMessage(missingCredentialsLabel);\r\n } else {\r\n setWarningMessage(undefined);\r\n }\r\n }, [invalidCredentialsProvided, invalidCredentialsLabel, missingCredentialsLabel, serverRequireCredentials, userName, password, setWarningMessage]);\r\n\r\n const handleMapTypeSelection = React.useCallback((newValue: string) => {\r\n setMapType(newValue);\r\n }, [setMapType]);\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 doAttach = React.useCallback(async (source: MapLayerSource): Promise<boolean> => {\r\n // Returns a promise, When true, the dialog should closed\r\n return new Promise<boolean>((resolve, _reject) => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined) {\r\n resolve(true);\r\n return;\r\n }\r\n\r\n const storeOnIModel = \"Model\" === settingsStorage;\r\n source.validateSource(true).then(async (validation) => {\r\n if (validation.status === MapLayerSourceStatus.Valid\r\n || validation.status === MapLayerSourceStatus.RequireAuth\r\n || validation.status === MapLayerSourceStatus.InvalidCredentials) {\r\n const sourceRequireAuth = (validation.status === MapLayerSourceStatus.RequireAuth);\r\n const invalidCredentials = (validation.status === MapLayerSourceStatus.InvalidCredentials);\r\n const closeDialog = !sourceRequireAuth && !invalidCredentials;\r\n resolve(closeDialog);\r\n\r\n if (sourceRequireAuth && !serverRequireCredentials) {\r\n setServerRequireCredentials(true);\r\n }\r\n if (invalidCredentials) {\r\n setInvalidCredentialsProvided(true);\r\n return;\r\n } else if (invalidCredentialsProvided) {\r\n setInvalidCredentialsProvided(false); // flag reset\r\n }\r\n\r\n if (validation.status === MapLayerSourceStatus.Valid) {\r\n // Attach layer and update settings service (only if editing)\r\n if (layerRequiringCredentialsIdx !== undefined) {\r\n // Update username / password\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 // Reset the provider's status\r\n const provider = vp.getMapLayerImageryProvider(layerRequiringCredentialsIdx, isOverlay);\r\n if (provider && provider.status !== MapLayerImageryProviderStatus.Valid) {\r\n provider.status = MapLayerImageryProviderStatus.Valid;\r\n }\r\n } else {\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 if (!(await MapLayerSettingsService.storeSourceInSettingsService(source, storeOnIModel, vp.iModel.iTwinId!, vp.iModel.iModelId!)))\r\n return;\r\n }\r\n const layerSettings = source.toLayerSettings(validation.subLayers);\r\n if (layerSettings) {\r\n vp.displayStyle.attachMapLayerSettings(layerSettings, isOverlay, undefined);\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 = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSettingsConversionError\");\r\n const msg = MapLayersUiItemsProvider.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\r\n vp.invalidateRenderPlan();\r\n }\r\n\r\n if (closeDialog) {\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\r\n } else {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\r\n resolve(true);\r\n }\r\n resolve(false);\r\n }).catch((error) => {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n resolve(true);\r\n });\r\n });\r\n }, [props.activeViewport, props.layerRequiringCredentials, settingsStorage, serverRequireCredentials, invalidCredentialsProvided, onOkResult, layerRequiringCredentialsIdx, isOverlay, settingsStorageDisabled]);\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 handleOk = 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 userName,\r\n password,\r\n });\r\n\r\n if (source === undefined || props.mapLayerSourceToEdit) {\r\n\r\n ModalDialogManager.closeDialog();\r\n\r\n if (source === undefined) {\r\n // Close the dialog and inform end user something went wrong.\r\n const msgError = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.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) {\r\n if (!(await MapLayerSettingsService.replaceSourceInSettingsService(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId!, vp.iModel.iModelId!))) {\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 })();\r\n return;\r\n }\r\n }\r\n\r\n setLayerAttachPending(true);\r\n\r\n void (async () => {\r\n // Code below is executed in the an async manner but\r\n // I don't necessarily want to mark the handler as async\r\n // so Im wrapping it un in a void wrapper.\r\n try {\r\n const closeDialog = await doAttach(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 }\r\n } catch (_error) {\r\n ModalDialogManager.closeDialog();\r\n }\r\n })();\r\n }\r\n\r\n }, [mapUrl, mapName, mapType, userName, password, props.mapLayerSourceToEdit, props.activeViewport, isSettingsStorageAvailable, doAttach]);\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 && (!serverRequireCredentials || (serverRequireCredentials && credentialsSet) && !layerAttachPending)\r\n && !invalidCredentialsProvided;\r\n }, [mapUrl, mapName, userName, password, layerAttachPending, invalidCredentialsProvided, serverRequireCredentials]);\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 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 trapFocus={false}\r\n >\r\n <div>\r\n <div className=\"map-layer-source-url\">\r\n <span className=\"map-layer-source-label\">{typeLabel}</span>\r\n <Select\r\n className=\"map-manager-base-select\"\r\n options={mapTypes}\r\n value={mapType}\r\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined}\r\n onChange={handleMapTypeSelection} />\r\n <span className=\"map-layer-source-label\">{nameLabel}</span>\r\n <Input placeholder={nameInputPlaceHolder} onChange={onNameChange} value={mapName} disabled={props.layerRequiringCredentials !== undefined} />\r\n <span className=\"map-layer-source-label\">{urlLabel}</span>\r\n <Input placeholder={urlInputPlaceHolder} onKeyPress={handleOnKeyDown} onChange={onUrlChange} disabled={props.mapLayerSourceToEdit !== undefined} value={mapUrl} />\r\n {isAuthSupported() && props.mapLayerSourceToEdit === undefined &&\r\n <>\r\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\r\n <LabeledInput placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\r\n status={!userName && serverRequireCredentials ? InputStatus.Warning : undefined}\r\n onChange={onUsernameChange} />\r\n\r\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\r\n <LabeledInput type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\r\n status={!password && serverRequireCredentials ? InputStatus.Warning : undefined}\r\n onChange={onPasswordChange}\r\n onKeyPress={handleOnKeyDown} />\r\n </>\r\n }\r\n\r\n {/* Store settings options, not shown when editing a layer */}\r\n {isSettingsStorageAvailable && <div title={settingsStorageDisabled ? noSaveSettingsWarning : \"\"}>\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\r\n {/* Warning message */}\r\n <div className=\"map-layer-source-warnMessage\">\r\n {warningMessage ?\r\n <>\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 </>\r\n :\r\n // Place holder to avoid dialog resize\r\n <span className=\"map-layer-source-placeholder\"> </span>\r\n }\r\n </div>\r\n\r\n {/* Progress bar */}\r\n {layerAttachPending &&\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/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C,IAAE,cAAc,CAAS,CAC5E;gBACH,CAAC;oBACD,sCAAsC;oBACtC,8BAAM,SAAS,EAAC,8BAA8B,aAAc,CAE1D;YAGL,kBAAkB;gBACjB,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 * as React from \"react\";\r\nimport { Input, LabeledInput, ProgressLinear, Radio, Select, SelectOption } from \"@itwin/itwinui-react\";\r\nimport { Dialog, Icon, InputStatus } from \"@itwin/core-react\";\r\nimport { ModalDialogManager } from \"@itwin/appui-react\";\r\nimport { MapLayersUiItemsProvider } from \"../MapLayersUiItemsProvider\";\r\nimport { MapTypesOptions } from \"../Interfaces\";\r\nimport {\r\n IModelApp, MapLayerImageryProviderStatus, MapLayerSettingsService, MapLayerSource,\r\n MapLayerSourceStatus, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\r\n} from \"@itwin/core-frontend\";\r\nimport { MapLayerProps } from \"@itwin/core-common\";\r\nimport \"./MapUrlDialog.scss\";\r\nimport { DialogButtonType, SpecialKey } from \"@itwin/appui-abstract\";\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};\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?: MapLayerProps;\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 const supportWmsAuthentication = (mapTypesOptions?.supportWmsAuthentication ? true : false);\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(MapLayersUiItemsProvider.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\r\n const [typeLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\r\n const [nameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\r\n const [nameInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\r\n const [urlLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\r\n const [urlInputPlaceHolder] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\r\n const [iTwinSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\r\n const [modelSettingsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\r\n const [missingCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\r\n const [invalidCredentialsLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\r\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(props.layerRequiringCredentials ?? false);\r\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\r\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\r\n const [warningMessage, setWarningMessage] = React.useState(props.layerRequiringCredentials ? missingCredentialsLabel : undefined);\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(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\r\n const [passwordLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\r\n const [passwordRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\r\n const [userNameLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\r\n const [userNameRequiredLabel] = React.useState(MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\r\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"ITwin\");\r\n\r\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? MAP_TYPES.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 [mapTypes] = React.useState((): SelectOption<string>[] => {\r\n const types = [\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 (mapTypesOptions?.supportTileUrl)\r\n types.push({ value: MAP_TYPES.tileUrl, label: MAP_TYPES.tileUrl });\r\n return types;\r\n });\r\n\r\n const [isSettingsStorageAvailable] = React.useState(props?.activeViewport?.iModel?.iTwinId && props?.activeViewport?.iModel?.iModelId);\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 isAuthSupported = React.useCallback(() => {\r\n return ((mapType === MAP_TYPES.wms || mapType === MAP_TYPES.wms) && supportWmsAuthentication)\r\n || mapType === MAP_TYPES.arcGis;\r\n }, [mapType, supportWmsAuthentication]);\r\n\r\n // const [layerIdxToEdit] = React.useState((): number | undefined => {\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.findMapLayerIndexByNameAndUrl(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 // Update warning message based on the dialog state and server response\r\n React.useEffect(() => {\r\n if (invalidCredentialsProvided) {\r\n setWarningMessage(invalidCredentialsLabel);\r\n } else if (serverRequireCredentials && (!userName || !password)) {\r\n setWarningMessage(missingCredentialsLabel);\r\n } else {\r\n setWarningMessage(undefined);\r\n }\r\n }, [invalidCredentialsProvided, invalidCredentialsLabel, missingCredentialsLabel, serverRequireCredentials, userName, password, setWarningMessage]);\r\n\r\n const handleMapTypeSelection = React.useCallback((newValue: string) => {\r\n setMapType(newValue);\r\n }, [setMapType]);\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 doAttach = React.useCallback(async (source: MapLayerSource): Promise<boolean> => {\r\n // Returns a promise, When true, the dialog should closed\r\n return new Promise<boolean>((resolve, _reject) => {\r\n const vp = props?.activeViewport;\r\n if (vp === undefined || source === undefined) {\r\n resolve(true);\r\n return;\r\n }\r\n\r\n const storeOnIModel = \"Model\" === settingsStorage;\r\n source.validateSource(true).then(async (validation) => {\r\n if (validation.status === MapLayerSourceStatus.Valid\r\n || validation.status === MapLayerSourceStatus.RequireAuth\r\n || validation.status === MapLayerSourceStatus.InvalidCredentials) {\r\n const sourceRequireAuth = (validation.status === MapLayerSourceStatus.RequireAuth);\r\n const invalidCredentials = (validation.status === MapLayerSourceStatus.InvalidCredentials);\r\n const closeDialog = !sourceRequireAuth && !invalidCredentials;\r\n resolve(closeDialog);\r\n\r\n if (sourceRequireAuth && !serverRequireCredentials) {\r\n setServerRequireCredentials(true);\r\n }\r\n if (invalidCredentials) {\r\n setInvalidCredentialsProvided(true);\r\n return;\r\n } else if (invalidCredentialsProvided) {\r\n setInvalidCredentialsProvided(false); // flag reset\r\n }\r\n\r\n if (validation.status === MapLayerSourceStatus.Valid) {\r\n // Attach layer and update settings service (only if editing)\r\n if (layerRequiringCredentialsIdx !== undefined) {\r\n // Update username / password\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 // Reset the provider's status\r\n const provider = vp.getMapLayerImageryProvider(layerRequiringCredentialsIdx, isOverlay);\r\n if (provider && provider.status !== MapLayerImageryProviderStatus.Valid) {\r\n provider.status = MapLayerImageryProviderStatus.Valid;\r\n }\r\n } else {\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 if (!(await MapLayerSettingsService.storeSourceInSettingsService(source, storeOnIModel, vp.iModel.iTwinId!, vp.iModel.iModelId!)))\r\n return;\r\n }\r\n const layerSettings = source.toLayerSettings(validation.subLayers);\r\n if (layerSettings) {\r\n vp.displayStyle.attachMapLayerSettings(layerSettings, isOverlay, undefined);\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 = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSettingsConversionError\");\r\n const msg = MapLayersUiItemsProvider.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\r\n vp.invalidateRenderPlan();\r\n }\r\n\r\n if (closeDialog) {\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\r\n } else {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\r\n resolve(true);\r\n }\r\n resolve(false);\r\n }).catch((error) => {\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.MapLayerAttachError\", { error, sourceUrl: source.url });\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\r\n resolve(true);\r\n });\r\n });\r\n }, [props.activeViewport, props.layerRequiringCredentials, settingsStorage, serverRequireCredentials, invalidCredentialsProvided, onOkResult, layerRequiringCredentialsIdx, isOverlay, settingsStorageDisabled]);\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 handleOk = 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 userName,\r\n password,\r\n });\r\n\r\n if (source === undefined || props.mapLayerSourceToEdit) {\r\n\r\n ModalDialogManager.closeDialog();\r\n\r\n if (source === undefined) {\r\n // Close the dialog and inform end user something went wrong.\r\n const msgError = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\r\n const msg = MapLayersUiItemsProvider.localization.getLocalizedString(\"mapLayers:CustomAttach.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) {\r\n if (!(await MapLayerSettingsService.replaceSourceInSettingsService(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId!, vp.iModel.iModelId!))) {\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 })();\r\n return;\r\n }\r\n }\r\n\r\n setLayerAttachPending(true);\r\n\r\n void (async () => {\r\n // Code below is executed in the an async manner but\r\n // I don't necessarily want to mark the handler as async\r\n // so Im wrapping it un in a void wrapper.\r\n try {\r\n const closeDialog = await doAttach(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 }\r\n } catch (_error) {\r\n ModalDialogManager.closeDialog();\r\n }\r\n })();\r\n }\r\n\r\n }, [mapUrl, mapName, mapType, userName, password, props.mapLayerSourceToEdit, props.activeViewport, isSettingsStorageAvailable, doAttach]);\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 && (!serverRequireCredentials || (serverRequireCredentials && credentialsSet) && !layerAttachPending)\r\n && !invalidCredentialsProvided;\r\n }, [mapUrl, mapName, userName, password, layerAttachPending, invalidCredentialsProvided, serverRequireCredentials]);\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 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 <Select\r\n className=\"map-layer-source-select\"\r\n options={mapTypes}\r\n value={mapType}\r\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined}\r\n onChange={handleMapTypeSelection} />\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} />\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} value={mapUrl} />\r\n {isAuthSupported() && props.mapLayerSourceToEdit === undefined &&\r\n <>\r\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\r\n <LabeledInput\r\n className=\"map-layer-source-input\"\r\n displayStyle=\"inline\"\r\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\r\n status={!userName && serverRequireCredentials ? InputStatus.Warning : undefined}\r\n onChange={onUsernameChange} />\r\n\r\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\r\n <LabeledInput\r\n className=\"map-layer-source-input\"\r\n displayStyle=\"inline\"\r\n type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\r\n status={!password && serverRequireCredentials ? InputStatus.Warning : undefined}\r\n onChange={onPasswordChange}\r\n onKeyPress={handleOnKeyDown} />\r\n </>\r\n }\r\n\r\n {/* Store settings options, not shown when editing a layer */}\r\n {isSettingsStorageAvailable && <div title={settingsStorageDisabled ? noSaveSettingsWarning : \"\"}>\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\r\n {/* Warning message */}\r\n <div className=\"map-layer-source-warnMessage\">\r\n {warningMessage ?\r\n <>\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 </>\r\n :\r\n // Place holder to avoid dialog resize\r\n <span className=\"map-layer-source-placeholder\"> </span>\r\n }\r\n </div>\r\n\r\n {/* Progress bar */}\r\n {layerAttachPending &&\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"]}
|
|
@@ -11,13 +11,12 @@ $hovered-icon-color: $buic-foreground-primary-tone;
|
|
|
11
11
|
|
|
12
12
|
.map-layer-url-dialog {
|
|
13
13
|
z-Index: 21000;
|
|
14
|
-
|
|
15
|
-
.core-dialog-content {
|
|
16
|
-
padding-right: 11px !important;
|
|
17
|
-
padding-left: 11px !important;
|
|
18
|
-
}
|
|
19
14
|
}
|
|
20
15
|
|
|
16
|
+
.map-layer-url-dialog-content {
|
|
17
|
+
padding-right: 5px;
|
|
18
|
+
padding-left: 5px;
|
|
19
|
+
}
|
|
21
20
|
.map-layer-source-url {
|
|
22
21
|
|
|
23
22
|
height: 100%;
|
|
@@ -27,6 +26,10 @@ $hovered-icon-color: $buic-foreground-primary-tone;
|
|
|
27
26
|
grid-column-gap: 10px;
|
|
28
27
|
align-items: center;
|
|
29
28
|
|
|
29
|
+
.map-layer-source-select, .map-layer-source-input {
|
|
30
|
+
margin-bottom: 0.5rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
30
33
|
.map-layer-source-label {
|
|
31
34
|
font-size: $iui-font-size;
|
|
32
35
|
color: $buic-foreground-body;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/map-layers",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.91",
|
|
4
4
|
"description": "Extension that adds a Map Layers Widget",
|
|
5
5
|
"main": "lib/cjs/map-layers.js",
|
|
6
6
|
"module": "lib/esm/map-layers.js",
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
"url": "http://www.bentley.com"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@itwin/core-bentley": "3.0.0-dev.
|
|
25
|
-
"@itwin/build-tools": "3.0.0-dev.
|
|
26
|
-
"@itwin/eslint-plugin": "3.0.0-dev.
|
|
27
|
-
"@itwin/core-geometry": "3.0.0-dev.
|
|
28
|
-
"@itwin/core-common": "3.0.0-dev.
|
|
29
|
-
"@itwin/core-frontend": "3.0.0-dev.
|
|
30
|
-
"@itwin/core-i18n": "3.0.0-dev.
|
|
31
|
-
"@itwin/core-quantity": "3.0.0-dev.
|
|
32
|
-
"@bentley/itwin-client": "3.0.0-dev.
|
|
33
|
-
"@itwin/presentation-common": "3.0.0-dev.
|
|
24
|
+
"@itwin/core-bentley": "3.0.0-dev.91",
|
|
25
|
+
"@itwin/build-tools": "3.0.0-dev.91",
|
|
26
|
+
"@itwin/eslint-plugin": "3.0.0-dev.91",
|
|
27
|
+
"@itwin/core-geometry": "3.0.0-dev.91",
|
|
28
|
+
"@itwin/core-common": "3.0.0-dev.91",
|
|
29
|
+
"@itwin/core-frontend": "3.0.0-dev.91",
|
|
30
|
+
"@itwin/core-i18n": "3.0.0-dev.91",
|
|
31
|
+
"@itwin/core-quantity": "3.0.0-dev.91",
|
|
32
|
+
"@bentley/itwin-client": "3.0.0-dev.91",
|
|
33
|
+
"@itwin/presentation-common": "3.0.0-dev.91",
|
|
34
34
|
"@bentley/react-scripts": "4.0.3",
|
|
35
|
-
"@itwin/appui-abstract": "3.0.0-dev.
|
|
36
|
-
"@itwin/components-react": "3.0.0-dev.
|
|
37
|
-
"@itwin/core-react": "3.0.0-dev.
|
|
38
|
-
"@itwin/imodel-components-react": "3.0.0-dev.
|
|
39
|
-
"@itwin/appui-react": "3.0.0-dev.
|
|
40
|
-
"@itwin/appui-layout-react": "3.0.0-dev.
|
|
35
|
+
"@itwin/appui-abstract": "3.0.0-dev.91",
|
|
36
|
+
"@itwin/components-react": "3.0.0-dev.91",
|
|
37
|
+
"@itwin/core-react": "3.0.0-dev.91",
|
|
38
|
+
"@itwin/imodel-components-react": "3.0.0-dev.91",
|
|
39
|
+
"@itwin/appui-react": "3.0.0-dev.91",
|
|
40
|
+
"@itwin/appui-layout-react": "3.0.0-dev.91",
|
|
41
41
|
"@itwin/itwinui-css": "^0.27.0",
|
|
42
42
|
"@itwin/itwinui-react": "^1.16.2",
|
|
43
43
|
"@testing-library/react": "^12.0.0",
|
|
@@ -79,19 +79,19 @@
|
|
|
79
79
|
"react-resize-detector": "^6.7.6"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
82
|
-
"@itwin/core-bentley": "3.0.0-dev.
|
|
83
|
-
"@itwin/core-geometry": "3.0.0-dev.
|
|
84
|
-
"@itwin/core-common": "3.0.0-dev.
|
|
85
|
-
"@itwin/core-frontend": "3.0.0-dev.
|
|
86
|
-
"@itwin/core-i18n": "3.0.0-dev.
|
|
87
|
-
"@itwin/core-quantity": "3.0.0-dev.
|
|
88
|
-
"@bentley/itwin-client": "3.0.0-dev.
|
|
89
|
-
"@itwin/appui-abstract": "3.0.0-dev.
|
|
90
|
-
"@itwin/components-react": "3.0.0-dev.
|
|
91
|
-
"@itwin/core-react": "3.0.0-dev.
|
|
92
|
-
"@itwin/appui-react": "3.0.0-dev.
|
|
93
|
-
"@itwin/imodel-components-react": "3.0.0-dev.
|
|
94
|
-
"@itwin/appui-layout-react": "3.0.0-dev.
|
|
82
|
+
"@itwin/core-bentley": "3.0.0-dev.91",
|
|
83
|
+
"@itwin/core-geometry": "3.0.0-dev.91",
|
|
84
|
+
"@itwin/core-common": "3.0.0-dev.91",
|
|
85
|
+
"@itwin/core-frontend": "3.0.0-dev.91",
|
|
86
|
+
"@itwin/core-i18n": "3.0.0-dev.91",
|
|
87
|
+
"@itwin/core-quantity": "3.0.0-dev.91",
|
|
88
|
+
"@bentley/itwin-client": "3.0.0-dev.91",
|
|
89
|
+
"@itwin/appui-abstract": "3.0.0-dev.91",
|
|
90
|
+
"@itwin/components-react": "3.0.0-dev.91",
|
|
91
|
+
"@itwin/core-react": "3.0.0-dev.91",
|
|
92
|
+
"@itwin/appui-react": "3.0.0-dev.91",
|
|
93
|
+
"@itwin/imodel-components-react": "3.0.0-dev.91",
|
|
94
|
+
"@itwin/appui-layout-react": "3.0.0-dev.91",
|
|
95
95
|
"react": "^17.0.0",
|
|
96
96
|
"react-dom": "^17.0.0"
|
|
97
97
|
},
|