# Reduce code duplication in SQUASH views

XMLWordPrintable

## Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s: None
• Labels:
None
• Story Points:
1.4
• Team:
SQuaRE

## Description

Watching a video about mastering Django from O'reilly Safari there's an interesting solution to reduce code duplication when you have views acting on the same set of data but returning slightly different results. The technique is called "switchboard view"

https://www.safaribooksonline.com/library/view/mastering-django-web/9781783989805/video1_5.html

this ticket will solve the code duplication we have in the squash views by replacing the endpoints api/AMx, api/PAx, used to retrieve data for the bokeh apps, by a single endpoint api/apps.

## Activity

Hide
Angelo Fausti added a comment - - edited

This issue is related to DM-9982 if we don't have a drill down plot associated to a metric we wont have the corresponding endpoint in the SQUASH API

Show
Angelo Fausti added a comment - - edited This issue is related to DM-9982 if we don't have a drill down plot associated to a metric we wont have the corresponding endpoint in the SQUASH API
Hide
Angelo Fausti added a comment - - edited

This ticket also relates to DM-9695, if there's no data blobs associated with the measurement the new BokehAppViewSet view should return an empty data dictionary and the corresponding app should handle that, e.g if there's no data to display show a message instead of the plot.

Show
Angelo Fausti added a comment - - edited This ticket also relates to DM-9695 , if there's no data blobs associated with the measurement the new BokehAppViewSet view should return an empty data dictionary and the corresponding app should handle that, e.g if there's no data to display show a message instead of the plot.
Hide
Angelo Fausti added a comment -
Show
Angelo Fausti added a comment - See changes in this PR: https://github.com/lsst-sqre/qa-dashboard/pull/46
Hide
J Matt Peterson [X] (Inactive) added a comment -

Reviewed in person at the end of coworking. Looks good.

Show
J Matt Peterson [X] (Inactive) added a comment - Reviewed in person at the end of coworking. Looks good.

## People

• Assignee:
Angelo Fausti
Reporter:
Angelo Fausti
Reviewers:
J Matt Peterson [X] (Inactive)
Watchers:
Angelo Fausti, J Matt Peterson [X] (Inactive)