Skip to content

insights: API modifications to support Limited Access Mode

Created by: CristinaBirkel

High level summary: we will add some logic in the backend API mutations for creating insights that will ensure they are attached to a global dashboard if needed, in Limited Access Mode.

Details:

  1. Add a new column to the dashboard table called type which we can use to denote that a dashboard is this specific auto-created LAM dashboard. I think this might be more generally useful than a boolean field for is_lam_dashboard, if we end up with other kinds of special dashboard types that we want to keep track of. Thoughts?
  2. Update the createLineChartSearchInsight and createPieChartSearchInsight mutations to do the following: a. Check for LAM. If not LAM, proceed as normal, but if LAM:
    • Are 2 insights already unfrozen?
      • Return an error message. Cannot create any more than 2 insights in LAM.
    • Is this insight being attached to a non-global dashboard?
      • Return an error message. Can only create global insights in LAM.
    • Otherwise, create the insight as normal.
    • If the LAM dashboard doesn't exist, create it.
    • Attach the insight to the LAM dashboard.
  3. Update the deleteInsightsDashboard mutation to do the following: a. If in LAM:
    • Do not allow the user to delete the LAM dashboard.