kgabryje commented on code in PR #24547:
URL: https://github.com/apache/superset/pull/24547#discussion_r1246825788
##########
superset-frontend/src/components/ReportModal/index.tsx:
##########
@@ -257,6 +263,29 @@ function ReportModal({
</div>
</>
);
+ const renderCustomWidthSection = (
+ <StyledInputContainer>
+ <div
+ className="control-label"
+ css={(theme: SupersetTheme) => CustomWidthHeaderStyle(theme)}
+ >
+ {TRANSLATIONS.CUSTOM_SCREENSHOT_WIDTH_TEXT}
+ </div>
+ <div className="input-container">
+ <input
Review Comment:
Can we use Antd input?
##########
superset-frontend/src/features/alerts/AlertReportModal.tsx:
##########
@@ -1471,6 +1486,27 @@ const AlertReportModal:
FunctionComponent<AlertReportModalProps> = ({
</div>
</>
)}
+ {isScreenshot && (
+ <StyledInputContainer>
+ <div
+ className="control-label"
+ css={(theme: SupersetTheme) => CustomWidthHeaderStyle(theme)}
Review Comment:
same as above
##########
superset-frontend/src/components/ReportModal/index.tsx:
##########
@@ -257,6 +263,29 @@ function ReportModal({
</div>
</>
);
+ const renderCustomWidthSection = (
+ <StyledInputContainer>
+ <div
+ className="control-label"
+ css={(theme: SupersetTheme) => CustomWidthHeaderStyle(theme)}
Review Comment:
nit: `css={CustomWidthHeaderStyle}`
##########
superset/reports/schemas.py:
##########
@@ -208,10 +209,34 @@ class ReportSchedulePostSchema(Schema):
dump_default=None,
)
force_screenshot = fields.Boolean(dump_default=False)
+ custom_width = fields.Integer(
+ metadata={
+ "description": _("Custom width of the screenshot in pixels"),
+ "example": 1000,
+ },
+ allow_none=True,
+ required=False,
+ default=None,
+ )
+
+ @validates("custom_width")
+ def validate_custom_width(self, value: int) -> None: # pylint:
disable=no-self-use
Review Comment:
can we add the same validation to the UI? With some danger text under the
input or sth
##########
superset-frontend/src/features/alerts/AlertReportModal.tsx:
##########
@@ -1471,6 +1486,27 @@ const AlertReportModal:
FunctionComponent<AlertReportModalProps> = ({
</div>
</>
)}
+ {isScreenshot && (
+ <StyledInputContainer>
+ <div
+ className="control-label"
+ css={(theme: SupersetTheme) => CustomWidthHeaderStyle(theme)}
+ >
+ {TRANSLATIONS.CUSTOM_SCREENSHOT_WIDTH_TEXT}
+ </div>
+ <div className="input-container">
+ <input
Review Comment:
Can we use Antd here too?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]