cccs-RyanS opened a new pull request #18794:
URL: https://github.com/apache/superset/pull/18794


   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   # [WIP] feat(business-types): initial implementation of SIP-78
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   This is the initial implementation of the features proposed in 
[SIP-78](https://github.com/apache/superset/issues/17852), this pull request 
includes:
   * business_type field added to the TableColumn model, editable through the 
data source edit modal
   * Addition of the api/v1/chart/business_type/convert api [GET] endpoint used 
for converting user entered values into appropriate format
   * Addition of the api/v1/chart/business_type/types api [GET] used for 
retrieving list of registered business types 
   * AdhocFilterEditPopoverSimpleTabContent changes if a business type is 
present on a column 
     - Populate filter available operator selection based on the current 
selected columns business type if applicable via call to the conversion 
endpoint 
     - Valid subject based on rules of business type, display a usefull error 
message if an invalid value has been entered  and prevent saving 
     - Display converted value to the user via a tool tip
    * Addition of the Port and Internet Address business types as examples 
    * Modification of the sqla connector model to use business type logic for 
converting  if a business type is present on a column 
   
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### Data set modal before / with feature flag disabled 
   
https://user-images.githubusercontent.com/71385290/154559399-6cea7c5c-5378-4a20-9dae-9f33ca9d57cf.mp4
   ### Data set modal after / with feature flag enabled
   
https://user-images.githubusercontent.com/71385290/154559417-19df363e-33a9-4736-91e2-5c5ef27f8c9b.mp4
   
   ### Filter popover before / with feature flag disabled 
   
https://user-images.githubusercontent.com/71385290/154559873-68509502-bc47-48e1-bb58-1e26da3fb50e.mp4
   
   ### Filter popover after / with feature flag enabled
   
https://user-images.githubusercontent.com/71385290/154559925-654ad1f2-7c1d-413b-9c24-173e0755c4e3.mp4
   
   ### Port demo / invalid entry 
   
https://user-images.githubusercontent.com/71385290/154560067-df002970-dc17-4475-8202-b0b933d9cca3.mp4
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   * set ENABLE_BUSINESS_TYPES feature flag to be true
   * add a `port` or `internet_address` business type to an existing column 
through the data source editor
   * open the explore view on that that data source 
   * add a filter on a column tagged with the business type 
   * enter a subject and verify that the converted value is displayed via a 
tool tip (i.e http will show up as 80 for the case of ports)
   * enter an invalid value and insure you cannot save and an error message is 
displayed
   * save a valid filter an a column tagged with a business type and run the 
query
   * verify the query is as expected (i.e a filter with `ip_col, EQUALS, 
1.1.1.1` should be `ip =16843009` in there where caluse ) 
   
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: 
[SIP-78](https://github.com/apache/superset/issues/17852)
   - [x] Required feature flags:  ENABLE_BUSINESS_TYPES
   - [x] Changes UI
   - [x] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [x] Migration is atomic, supports rollback & is backwards-compatible
     - [x] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [x] Introduces new feature or API 
   - [ ] Removes existing feature or API
   


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

Reply via email to