-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#9492 Add database to Rich Text Editor form builder field #9495
Conversation
@Pashaminkovsky any preference on the approach here? See demo video for context |
Playwright test resultsDetails Open report ↗︎ Flaky testsmsedge-setup › setup/unaffiliated.setup.ts › authenticate with unaffiliated user Skipped testschrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options |
Ideally, the field would be optional and would just disable image upload support if not provided. But for 2.2.0 it's fine if it's required (because it's the primary launch use case for the Rich Text Field) |
+1 to Todd's comment; let's go with the simplest implementation for now (database is required). |
I propose that we merge as-is and I can always easily make the field optional once I go to implement the feature |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9495 +/- ##
==========================================
+ Coverage 74.24% 75.84% +1.59%
==========================================
Files 1332 1415 +83
Lines 40817 42793 +1976
Branches 7634 7884 +250
==========================================
+ Hits 30306 32455 +2149
+ Misses 10511 10338 -173 ☔ View full report in Codecov by Sentry. |
isRequired | ||
schema={{ | ||
$ref: "https://app.pixiebrix.com/schemas/database#", | ||
title: "Database", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the title to "Asset Database"?
}) => { | ||
const { database } = options; | ||
|
||
if (!database) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like using an error in the field preview as a way of showing an error the user has not provided a value. I prefer we stick with showing it as a field error annotation in the Brick Configuration pane. (I think you'd add as a check in the analysis here:
Line 28 in 971d00b
class FormBrickAnalysis extends AnalysisVisitorABC { |
Was there a specific reason you chose to show it in the preview/rendered form instead?
I won't block this PR on it though to keep the ball rolling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a specific reason you chose to show it in the preview/rendered form instead?
I wanted to make sure at minimum that the form displayed errors at run-time due to consideration for passing in variables, but I agree that also including the error annotation in the form itself is ideal.
However - at this point, I'm more convinced that we should favor the approach of making the field optional in the next slice, as it will 1) be easy to do, 2) be more compatible with putting asset database creation behind a feature flag, and 3) reduce complexity around handling form errors.
Let's merge as-is, and I'll remove the required
field limitation in favor of disabling the image feature in the next slice.
@@ -95,60 +96,6 @@ function shouldShowPlaceholderText(uiType: UiType): boolean { | |||
} | |||
} | |||
|
|||
const TextAreaFields: React.FC<{ uiOptionsPath: string }> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment here: https://github.com/pixiebrix/pixiebrix-extension/pull/9495/files#r1838408454
Why not use our existing field error annotations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment: #9495 (review)
When the PR is merged, the first loom link found on this PR will be posted to |
What does this PR do?
Discussion
Demo
Demo & product question
https://www.loom.com/share/b38a0cf4304040f4b0bc1b1066c16dd6