You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/10/27 21:42:39 UTC

[GitHub] [incubator-superset] ktmud commented on pull request #11445: fix: Pasting text issues in MetricsControl and AdhocFilterControl inputs

ktmud commented on pull request #11445:
URL: https://github.com/apache/incubator-superset/pull/11445#issuecomment-717557540


   I think the original intent of `OnPasteSelect` is to automatically add new options when users pasted valid metrics or column names.
   
   We can either stop supporting `onPaste` for AdhocMetric and AdhocFilter like this PR does, or if we want to continue the support, I think the expected behaviors can be implemented as such:
   
   1. Split the pasted text by by `OnPasteSelect.props.separator`, get candidate metric/column name list `pastingItems`
   2. For each item in `pastingItems`, do the following:
       1. If it's a valid metric/column name, create a selected option that appends to current selection
       2. If it's not valid, keep the text in `invalidInputText`
   3. If `invalidInputText` is not empty, set it as `inputText` for the select control.
   3. If there are updates to the updated input, call `onChange` event with the updated input.
   
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org