Skip to content

feat(admin): create event with JSON#1654

Open
keabard wants to merge 1 commit intoHugoGresse:mainfrom
keabard:feat/admin/create-event-with-json
Open

feat(admin): create event with JSON#1654
keabard wants to merge 1 commit intoHugoGresse:mainfrom
keabard:feat/admin/create-event-with-json

Conversation

@keabard
Copy link

@keabard keabard commented Sep 22, 2025

It would be cool to avoid hosting our JSON or giving public access to an endpoint, and just paste a JSON object to configure a new OpenFeedback event.

This PR is meant to do that.

Could not manage to make the Firebase install step work tho, so this feature is not tested at all. I hope not much more is needed and that you will be able to complete it 🙏

@keabard keabard force-pushed the feat/admin/create-event-with-json branch from 5692d2b to a829940 Compare September 22, 2025 12:28
@HugoGresse
Copy link
Owner

Nice work! Thank you for the PR; I will take a look this week!
If you need help setting up Firebase, ping me on Discord hugo_42

@HugoGresse HugoGresse added enhancement New feature or request admin app Admin app (openfeedback.io/admin) labels Sep 22, 2025
Repository owner deleted a comment from cursor bot Sep 22, 2025
@HugoGresse
Copy link
Owner

@cursor review


getSpeakers() {
return this.getJsonData().then((data) => data.speakers)
}
Copy link

Choose a reason for hiding this comment

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

Bug: Incorrect Promise Handling in Data Retrieval Methods

The getTalks(), getTalk(), and getSpeakers() methods call .then() on the result of getJsonData(). However, getJsonData() returns data synchronously, not a Promise, which will cause runtime errors.

Fix in Cursor Fix in Web

type="text"
name={t('settingsSetup.json.fieldJson')}
fieldName="json"
type="textarea"
Copy link

Choose a reason for hiding this comment

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

Bug: Form Field Renaming Causes Validation and Submission Issues

The form field's fieldName was updated from jsonUrl to json, but the validationSchema and onSubmit handler still reference jsonUrl. This causes validation to fail and undefined values to be submitted.

Fix in Cursor Fix in Web

component="p"
variant="subtitle1">
detail
</TranslatedTypography>
Copy link

Choose a reason for hiding this comment

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

Bug: JSON Project Type Uses Incorrect Translation Keys

The new JSON project type radio button incorrectly uses translation keys newEvent.step2.projectTypeJsonurl and newEvent.step2.projectTypeJsonurlDetail. It should use newEvent.step2.projectTypeJson and newEvent.step2.projectTypeJsonDetail, which are available in the translation files, to display the correct text.

Fix in Cursor Fix in Web

stepTitle={stepTitle}
title={t('newEvent.step3.jsonurl')}
onCancel={onCancel}>
<SetupJSON
Copy link

Choose a reason for hiding this comment

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

Bug: Incorrect Component Used for JSON URLs

The Step3JSONUrl component uses SetupJSON, which is designed for direct JSON input. As Step3JSONUrl handles JSON URLs, it should instead import and use the SetupJSONUrl component.

Fix in Cursor Fix in Web

},
"json": {
"fieldJson": "JSON",
"jsonUrlRequired": "Le JSON est obligatoire",
Copy link

Choose a reason for hiding this comment

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

Bug: Incorrect JSON Translation Key Name

The French translation key settingsSetup.json.jsonUrlRequired is incorrectly named. It refers to a JSON content requirement, not a URL, which conflicts with its message "Le JSON est obligatoire" and how it's used in the code. It should be settingsSetup.json.jsonRequired.

Fix in Cursor Fix in Web

@HugoGresse
Copy link
Owner

@keabard hey, did you have time to look at the Cursor review?
What do you think, rather than having a new project type, to only have an import of the JSON which will populate the DB?
So users can still edit through the UI?

@keabard
Copy link
Author

keabard commented Nov 5, 2025

No sorry, didn't have the occasion to go through it yet. Yes a simple JSON import would do :)

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

Labels

admin app Admin app (openfeedback.io/admin) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants