michael-s-molina opened a new pull request, #21518:
URL: https://github.com/apache/superset/pull/21518

   ### SUMMARY
   We're currently working on a new feature called cross-linking. As one of the 
examples of the feature, we want to show the dashboards related to a specific 
chart in the charts list and enable navigation and filtering. The screenshot 
below shows the concept:
   
   <img width="1439" alt="Screen Shot 2022-09-19 at 11 05 01 AM" 
src="https://user-images.githubusercontent.com/70410625/191037013-8827da7e-a01c-416a-8fff-2b3fe90a5c5c.png";>
   
   To do that, this PR changes the charts list endpoint to also return the 
associated dashboards. The `superset/models/Dashboard` model already contains a 
`slices` property with a `backref` called `dashboards` which allows us to 
reference the dashboards from the `Slice` model. 
   
   This is the modified result:
   
   ```
   "result": [{
      "id": 122,
      "slice_name": "Test",
      "dashboards": [
         {
            "dashboard_title": "Video Game Sales",
            "id": 9
         },
         {
            "dashboard_title": "Test",
            "id": 17
         }
       ],
       ...
   }]
   ```
   
   I also added the `dashboards` property to the list of searchable columns to 
allow queries in the form of:
   ```
   api/v1/chart/?q=(filters:!((col:dashboards,opr:rel_m_m,value:17)), ...)
   ````
   This will allow us to add a Dashboards filter in the charts list screen to 
find all the charts of a particular dashboard.
   
   ### TESTING INSTRUCTIONS
   1 - Check that the dashboards are returned as expected.
   2 - Check that you can the charts list by a particular dashboard.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] 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