-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link document importer from edit form page.
- Loading branch information
1 parent
2d753c2
commit 79b0ce3
Showing
7 changed files
with
39 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
apps/spotlight/src/components/react/form/import-document.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { getFormFromStorage } from '../../../lib/form-repo'; | ||
import { createFormContext, createPrompt } from '@atj/forms'; | ||
import { DocumentImporter } from '../form-builder/document-importer'; | ||
|
||
export const FormDocumentImport = ({ formId }: { formId: string }) => { | ||
// Fallback to hardcoded data if a magic ID is chosen. | ||
const form = getFormFromStorage(window.localStorage, formId); | ||
if (!form) { | ||
return 'null form retrieved from storage'; | ||
} | ||
const context = createFormContext(form); | ||
const prompt = createPrompt(context); | ||
|
||
return <DocumentImporter />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './pdf'; | ||
export { suggestFormDetails } from './suggestions'; | ||
export * from './suggestions'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters