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

- `completedAt` to scheduled tasks to allow the client to specify when a task was completed

### Fixed

- Attribute filtering not clearing selected autocomplete value when invalid
Expand Down
412 changes: 222 additions & 190 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@emotion/styled": "^11.14.1",
"@nylas/react": "^3.1.2",
"@oneblink/sdk-core": "^9.1.0-beta.3",
"@oneblink/storage": "^6.0.0-beta.1",
"@oneblink/storage": "^6.1.0-beta.1",
"@react-google-maps/api": "^2.20.8",
"@react-input/mask": "^2.0.4",
"@sentry/browser": "^10.38.0",
Expand Down
5 changes: 3 additions & 2 deletions src/apps/scheduled-tasks-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,25 +219,26 @@ export async function getTaskGroupInstances(
* @param options
* @returns
*/

export async function completeTask({
formsAppId,
taskId,
taskActionId,
taskGroupInstanceId,
completedAt,
abortSignal,
}: {
formsAppId: number
taskId: string
taskActionId: string
taskGroupInstanceId: string | undefined
completedAt: string | undefined
abortSignal?: AbortSignal
}): Promise<ScheduledTasksTypes.CompletedTask> {
const url = `${tenants.current.apiOrigin}/completed-tasks`
try {
return await postRequest<ScheduledTasksTypes.CompletedTask>(
url,
{ formsAppId, taskId, taskActionId, taskGroupInstanceId },
{ formsAppId, taskId, taskActionId, taskGroupInstanceId, completedAt },
abortSignal,
)
} catch (err) {
Expand Down
1 change: 1 addition & 0 deletions src/apps/services/api/drafts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ async function downloadDraftData(
taskAction: s3SubmissionData.taskAction,
taskGroup: s3SubmissionData.taskGroup,
taskGroupInstance: s3SubmissionData.taskGroupInstance,
completedAt: undefined,
redirectUrl: '',
},
title: latestFormSubmissionDraftVersion.title,
Expand Down
1 change: 1 addition & 0 deletions src/apps/services/api/submissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export async function uploadFormSubmission(
taskActionId: formSubmission.taskCompletion?.taskAction.taskActionId,
taskGroupInstanceId:
formSubmission.taskCompletion?.taskGroupInstance?.taskGroupInstanceId,
taskCompletionTimestamp: formSubmission.taskCompletion?.completedAt,
recaptchas: formSubmission.recaptchas,
onProgress,
abortSignal,
Expand Down
2 changes: 2 additions & 0 deletions src/apps/types/submissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export type BaseFormSubmission = {
taskGroup: ScheduledTasksTypes.TaskGroup | undefined
/** The task group instance */
taskGroupInstance: ScheduledTasksTypes.TaskGroupInstance | undefined
/** The date and time (in ISO format) when the task was completed */
completedAt: string | undefined
/**
* The URL to redirect the user to after completing the task via form
* submission
Expand Down
Loading