betodealmeida commented on a change in pull request #17345:
URL: https://github.com/apache/superset/pull/17345#discussion_r743269837
##########
File path: superset-frontend/src/components/DeleteModal/index.tsx
##########
@@ -52,12 +52,35 @@ export default function DeleteModal({
title,
}: DeleteModalProps) {
const [disableChange, setDisableChange] = useState(true);
+ const [confirmation, setConfirmation] = useState<string>('');
+
+ const hide = () => {
+ setConfirmation('');
+ onHide();
+ };
+
+ const confirm = () => {
+ setConfirmation('');
+ onConfirm();
+ };
+
+ const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {
+ const targetValue = event.target.value ?? '';
+ setDisableChange(targetValue.toUpperCase() !== t('DELETE'));
Review comment:
@eschutho this used to be much worse... before it didn't have the `t()`
call, so we'd ask people in a different language, _Por favor digite "apagar"
para confirmar_, but expected "delete" to unblock the dialog...
--
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]