Skip to content

Conversation

@david-shibley-contentful
Copy link
Contributor

@david-shibley-contentful david-shibley-contentful commented Dec 19, 2025

Purpose

The preview step was the final missing piece of the flow

Things introduced in this PR:

  • Preview step
  • Fetching of the google docs moved to front end

Approach

Screenshot 2025-12-19 at 2 06 17 PM

Testing steps

Breaking Changes

Dependencies and/or References

Deployment

@david-shibley-contentful david-shibley-contentful requested a review from a team as a code owner December 19, 2025 21:08
@david-shibley-contentful david-shibley-contentful changed the title Feat/google docs plan step v0 Feat/google docs plan step v0 [INTEG-3341] Dec 19, 2025
Comment on lines 62 to 76
const analyzeContentTypesResponse = await analyzeContentTypesAction(
sdk,
contentTypeIds,
oauthToken
);
console.log('analyzeContentTypesResponse', analyzeContentTypesResponse);
// If entries provided, use them directly. Otherwise fetch document JSON as fallback
let documentJson: unknown | undefined;
if (!entries || entries.length === 0) {
documentJson = await fetchGoogleDocAsJson(documentId, oauthToken);
}

const processDocumentResponse = await createPreviewAction(
const response = await createEntriesFromDocumentAction(
sdk,
contentTypeIds,
documentId,
oauthToken
);
console.log('processDocumentResponse', processDocumentResponse);
entries,
documentJson
) as any;
const result: FinalEntriesResult = response.sys.result;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we revert to using two functions instead of one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure I understand, aren't we using two functions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into it and the createPreview function only calls the document parser agent and not the content type parser agent (this agent was called by the analyzeContentTypes function that was deleted in the manifest) Was that intentional? If so we would need to delete the content type parser agent.


const submit = useCallback(
async (contentTypeIds: string[]) => {
async (contentTypeIds: string[], entries?: any[]) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have a diff here? Isn't this part for the content type analysis, but now we are fetching the docs and calling create entries? I think this is not what this hook is intended for

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no?

}, [isSubmitting, modalStates.isLoadingModalOpen, closeModal, clearPlan]);

// Handle plan generation completion
useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did this come from

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this to get the modals to switch when the preview is generated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants