Check Dataverse Org URL for validity #1001
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request primarily focuses on enhancing error handling in the
src/web/client/common/errorHandler.ts
file and adding new telemetry event names in thesrc/common/OneDSLoggerTelemetry/web/client/webExtensionTelemetryEvents.ts
file.The key changes include the addition of two new telemetry event names, a new function
isDynamicsCRMUrl()
, and updates to thecheckMandatoryQueryParameters()
function to include a check for a valid Dynamics CRM URL. Here's a breakdown of the changes:New telemetry event names:
src/common/OneDSLoggerTelemetry/web/client/webExtensionTelemetryEvents.ts
: Two new telemetry event namesWEB_EXTENSION_MULTI_FILE_INVALID_DATAVERSE_URL
andWEB_EXTENSION_MULTI_FILE_INVALID_WEBSITE_PREVIEW_URL
were added to thewebExtensionTelemetryEventNames
enum. These will be used to log specific error events related to invalid URLs.Error handling enhancements:
src/web/client/common/errorHandler.ts
: A new functionisDynamicsCRMUrl()
was added. This function checks if a URL is a valid Dynamics CRM URL using a regular expression and logs an error telemetry event if it's not.src/web/client/common/errorHandler.ts
: ThecheckMandatoryQueryParameters()
function was updated to include a call toisDynamicsCRMUrl()
. This ensures that theorgURL
parameter is a valid Dynamics CRM URL before proceeding.