EASOL/easol

Dashboard - Error occurs when selected dashboard report is deleted

Closed this issue · 6 comments

An error occurs in the dashboard when:

1.) An existing Flex Report is selected for a user role
2.) That Flex Report is deleted
3.) The dashboard is displayed again with the deleted Flex Report (error occurs)

@regiscamimura, let's review this issue after we finish with main functionality implementation.

@edgarf @jasonhoekstra We now have changed the rules for report access, all users can see a chart in the dashboard and into its details page. Should we just remove the "Access" section from the add/edit flex report form?

Regarding the deletion, I'm surprised that you actually can delete a report when it is assigned to the dashboard. A FK should be blocking that attempt, not sure how you pass through it. Can you please confirm you actually can delete a flex report that is already related to the dashboard?

@regiscamimura - we have only provided ability to see details of the chart report. The Access rules haven't changed since then - those can still be applied. Does it make sense?

@edgarf I got the code and database improved. There's a new SQL script that handles the proper foreign keys creation as some triggers to avoid invalid data in the database. Had to use triggers because MSSQL won't allow ON DELETE CASCADE on multiple FKs to the same table FYI.

The SQL script is at ./sql/mssql/incremental/268-dashboard-configuration-report-constraint-cascade-rules.sql

@regiscamimura, when I try running the SQL query you added I get this error:

Msg 111, Level 15, State 1.
'CREATE TRIGGER' must be the first statement in a query batch. (Line 61)

@edgarf Just adjusted the script so the trigger is the first command. That should solve the error.