Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- salesforce picklist dynamic options

### Fixed

- github action permissions to allow docs and github release jobs
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@nylas/react": "^3.1.2",
"@oneblink/sdk-core": "^9.0.0",
"@oneblink/sdk-core": "^9.1.0-beta.2",
"@oneblink/storage": "^5.0.0-beta.2",
"@react-google-maps/api": "^2.20.8",
"@react-input/mask": "^2.0.4",
Expand Down
72 changes: 72 additions & 0 deletions src/apps/form-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,78 @@ async function getFormElementOptionsSetOptions(
}
}
}
case 'SALESFORCE_PICKLIST': {
const formElementOptionSetEnvironmentSalesforcePicklist =
formElementOptionsSet.environments.find(
(environment) =>
environment.formsAppEnvironmentId === formsAppEnvironmentId,
)
if (!formElementOptionSetEnvironmentSalesforcePicklist) {
return {
type: 'ERROR',
error: new OneBlinkAppsError(
`Dynamic list configuration has not been completed yet. Please contact your administrator to rectify the issue.`,
{
title: 'Misconfigured Dynamic List',
originalError: new Error(
JSON.stringify(
{
formElementOptionsSetId: formElementOptionsSet.id,
formElementOptionsSetName: formElementOptionsSet.name,
formsAppEnvironmentId,
},
null,
2,
),
),
},
),
}
}

try {
const { options } = await getRequest<{ options: unknown }>(
`${tenants.current.apiOrigin}/forms/${formId}/salesforce-picklist-options?formElementOptionsSetId=${formElementOptionsSet.id}`,
abortSignal,
)
return {
type: 'OPTIONS',
options,
}
} catch (error) {
Sentry.captureException(error)
return {
type: 'ERROR',
error: new OneBlinkAppsError(
`Options could not be loaded. Please contact your administrator to rectify the issue.`,
{
title: 'Invalid List Response',
httpStatusCode: (error as HTTPError).status,
originalError: new OneBlinkAppsError(
JSON.stringify(
{
formsAppEnvironmentId,
formElementOptionsSetId: formElementOptionsSet.id,
formElementOptionsSetName: formElementOptionsSet.name,
salesforceObject:
formElementOptionSetEnvironmentSalesforcePicklist.object
.label,
salesforceField:
formElementOptionSetEnvironmentSalesforcePicklist.field
.label,
},
null,
2,
),
{
originalError: error as HTTPError,
},
),
},
),
}
}
}
case 'GOOD_TO_GO_CUSTOM_FIELD': {
const formElementOptionSetEnvironmentGoodToGoCustomField =
formElementOptionsSet.environments.find(
Expand Down