Skip to content
Snippets Groups Projects
Commit 1400c0fb authored by Jarosław Staniek's avatar Jarosław Staniek
Browse files

Before physical altering or deleting table ask the user to close depending table/query/report/form

Summary:
If table T is altered, before saving:
- close all table views that use T in lookup fields
- close all query views that use T
- close all query views that use tables having T in lookup fields
- close all tables that use queries in lookup fields and the queries use T

Similarly, close all forms/reports that use tables this way.
Any views are affected (data, design, text).

Also:
- improve existing question messages
- remove Report's extended data source GUI

BUG:371896
FIXED-IN:3.1.0

Test Plan:
Use the test Kexi file (uncompress before testing):
{F4442302}

Test 1.1: If table T is altered, before saving close all table views that use T in lookup fields.

1. Open ownership table in data view.
2. Design the persons table, rename the last (Extra) field to something else, save design.
3. Expected: Kexi asks to close the ownership table. On agreement, they are closed and the design is saved.

Test 1.2. Like 1.1 but open ownership table in design view.
Expected result: like in 1.1.

Test 2.1. If table T is altered, before saving close all query views that use T.

1. Open persons_and_cars query in data view.
2. Design the persons table, rename the last field to something else, save design.
3. Expected: Kexi asks to close the persons_and_cars query. On agreement, they are closed and the design is saved.

Test 2.2. Like 2.1 but open the query in design view.
Expected result: like in 2.1.

Test 2.3. Like 2.1 but open the query in SQL view.
Expected result: like in 2.1.

Test 2.4. Like 2.1 but also open the **ownership table** after 2nd step.
Expected result: Kexi asks to close both the ownership table and the persons_and_cars query. On agreement, they are closed and the design is saved.

Test 2.5. Like 2.4 but also open the **persons form** before saving.
Expected result: Kexi asks to close both the ownership table and the persons_and_cars query and the persons form. On agreement, they are closed and the design is saved.

Test 2.6. Like 2.5 but also open the **persons report** before saving.
Expected result: Kexi asks to close both the ownership table and the persons_and_cars query and the persons form and the persons report. On agreement, they are closed and the design is saved.

Test 3.1. If table T is altered, before saving close all query views that use tables having T in lookup fields.

1. Open ownership_desc query in data view.
2. Design the persons table, rename the last field to something else, save design.
3. Expected: Kexi asks to close the ownership_desc query. On agreement, they are closed and the design is saved.

Test 3.2. Like 2.1 but open the table in design view.
Expected result: like in 3.1.

Test 4.1. If table T is altered, before saving close all tables that use queries in lookup fields if these queries use T.

1. Open with_lookup_query table in data view.
2. Design the persons table, rename the last field to something else, save design.
3. Expected: Kexi asks to close the with_lookup_query query. On agreement, they are closed and the design is saved.

Test 4.2. Like 4.1 but open the table in design view.
Expected result: like in 4.1.

Test 5.1. Testing if Kexi detects dependency between **report cars** and designed **table cars** because the report uses query that uses the table.

1. Open report cars in preview.
2. Design the cars table, rename and field, try to save design (finally don't save unless you have backup of the database).
3. Expected: Kexi asks to close the report cars.

Test 6.1. Improve existing question messages asking for approval for closing depending tabs: see if they sound are correct and look OK.

Example:
{F4440486}

Test 7.1. (Extra test of functionality that was hard to separate to another patch). Updated "Report data source" page (removed Set button and the External data widgets). Test if setting table and query as data source works.

Reviewers: piggz

Reviewed By: piggz

Tags: #kexi

Maniphest Tasks: T7703, T7704

Differential Revision: https://phabricator.kde.org/D8118
parent df5d28de
No related branches found
No related tags found
No related merge requests found
Showing
with 477 additions and 147 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment