[GitHub] GabeLoins commented on a change in pull request #4566: Adding column type label to dropdowns
GabeLoins commented on a change in pull request #4566: Adding column type label to dropdowns URL: https://github.com/apache/incubator-superset/pull/4566#discussion_r173005090 ## File path: superset/assets/javascripts/components/ColumnTypeLabel.jsx ## @@ -0,0 +1,34 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const propTypes = { + type: PropTypes.string.isRequired, +}; + +export default function ColumnTypeLabel({ type }) { + let stringIcon; + let iconSize = '13'; + if (type === '' || type === 'expression') { +stringIcon = '?'; + } else if (type.match(/.*char.*/i) || type.match(/string.*/i) || type.match(/.*text.*/i)) { +stringIcon = 'ABC'; +iconSize = '11'; + } else if (type.match(/.*int.*/i) || type === 'LONG' || type === 'DOUBLE') { +stringIcon = '#'; + } else if (type.match(/.*bool.*/i)) { +stringIcon = 'T/F'; + } else if (type.match(/.*time.*/i)) { +stringIcon = 'time'; + } else { +stringIcon = '?'; + } + + const typeIcon = stringIcon === 'time' ? : ( Review comment: nit: I think it would be a bit more readable to do ``` clause ? option1 : option2; ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] GabeLoins commented on a change in pull request #4566: Adding column type label to dropdowns
GabeLoins commented on a change in pull request #4566: Adding column type label to dropdowns URL: https://github.com/apache/incubator-superset/pull/4566#discussion_r173005090 ## File path: superset/assets/javascripts/components/ColumnTypeLabel.jsx ## @@ -0,0 +1,34 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const propTypes = { + type: PropTypes.string.isRequired, +}; + +export default function ColumnTypeLabel({ type }) { + let stringIcon; + let iconSize = '13'; + if (type === '' || type === 'expression') { +stringIcon = '?'; + } else if (type.match(/.*char.*/i) || type.match(/string.*/i) || type.match(/.*text.*/i)) { +stringIcon = 'ABC'; +iconSize = '11'; + } else if (type.match(/.*int.*/i) || type === 'LONG' || type === 'DOUBLE') { +stringIcon = '#'; + } else if (type.match(/.*bool.*/i)) { +stringIcon = 'T/F'; + } else if (type.match(/.*time.*/i)) { +stringIcon = 'time'; + } else { +stringIcon = '?'; + } + + const typeIcon = stringIcon === 'time' ? : ( Review comment: nit: I think it would be a bit more readable to do ``` clause ? option 1 : option2; ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] GabeLoins commented on a change in pull request #4566: Adding column type label to dropdowns
GabeLoins commented on a change in pull request #4566: Adding column type label to dropdowns URL: https://github.com/apache/incubator-superset/pull/4566#discussion_r173004769 ## File path: superset/assets/javascripts/components/ColumnTypeLabel.jsx ## @@ -0,0 +1,34 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const propTypes = { + type: PropTypes.string.isRequired, +}; + +export default function ColumnTypeLabel({ type }) { + let stringIcon; + let iconSize = '13'; + if (type === '' || type === 'expression') { +stringIcon = '?'; + } else if (type.match(/.*char.*/i) || type.match(/string.*/i) || type.match(/.*text.*/i)) { +stringIcon = 'ABC'; +iconSize = '11'; + } else if (type.match(/.*int.*/i) || type === 'LONG' || type === 'DOUBLE') { +stringIcon = '#'; + } else if (type.match(/.*bool.*/i)) { +stringIcon = 'T/F'; + } else if (type.match(/.*time.*/i)) { +stringIcon = 'time'; + } else { +stringIcon = '?'; Review comment: I kinda feel like the null case should be blank rather than a `?` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] GabeLoins commented on a change in pull request #4566: Adding column type label to dropdowns
GabeLoins commented on a change in pull request #4566: Adding column type label to dropdowns URL: https://github.com/apache/incubator-superset/pull/4566#discussion_r173004769 ## File path: superset/assets/javascripts/components/ColumnTypeLabel.jsx ## @@ -0,0 +1,34 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const propTypes = { + type: PropTypes.string.isRequired, +}; + +export default function ColumnTypeLabel({ type }) { + let stringIcon; + let iconSize = '13'; + if (type === '' || type === 'expression') { +stringIcon = '?'; + } else if (type.match(/.*char.*/i) || type.match(/string.*/i) || type.match(/.*text.*/i)) { +stringIcon = 'ABC'; +iconSize = '11'; + } else if (type.match(/.*int.*/i) || type === 'LONG' || type === 'DOUBLE') { +stringIcon = '#'; + } else if (type.match(/.*bool.*/i)) { +stringIcon = 'T/F'; + } else if (type.match(/.*time.*/i)) { +stringIcon = 'time'; + } else { +stringIcon = '?'; Review comment: I kinda feel like the null case should be blank rather than a `?` to make things a bit cleaner This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services