Ninext : Fields inspector (evaluate the impact of changing/deleting a field before to do)
Hello everyone,
Have you ever had a cold sweat before deleting a field in a table ? I always wonder what will happen. And the more my database is important, the more I'm afraid to have calculations that are no longer done or displays that are missing.
To try to solve this, I have developed an interface that allows you to see to which part of the code or the display the fields are connected.
This new module of the Ninext project adds badges next to the field names when they are used in other tables or views:
The number indicates how many codes use the field. The color indicates if it is a display code (green), a calculation code to make another field visible or to calculate the values of a column in a list (orange) or if it is used in a formula or to update other fields as in AfterUpdate (red).
By clicking on the badge you can see all the codes that use the field:
And if you click on the lines, you can see the corresponding code. The field is displayed in bold in the code to be more visible:
This popup remains on the screen until you close it. This allows you to open the different codes that are in other fields, tables or views while keeping the list of codes on the screen.
To add this functionality, simply include the code below in an HTML field that should be displayed when the database is opened:
var configLoadModules := {
completion: false,
badges: true,
evalJS: true,
viewEvent: true,
fieldsInspector: true
};
function afterLoadModules() do
if not isAdminMode() then closeRecord() end
end;
html(http("GET", "https://raw.githubusercontent.com/JacquesTur/Ninext/main/loadModules.html").result)
Copy
Copy
I am attaching a test database. Have fun!
56 replies
-
This brings Ninox to the next level ! Thanks Jacques TUR .
-
Jacques TUR You have surpassed yourself here. Massive congratulations on this.
-
Simply Awesome !!!
Can't use the colour tags much tho as I am colour blind! most look the same to me. (thats not a criticism just saying .... )
-
Jacques TUR Congratulations on another excellent add-on. It seems you are making Ninox better than it deserves to be. Users haven't seen this kind of innovation from the developers at Ninox in a long time. You forced their hand with the CodeMirror add-on so it will be interesting to see if there is any kind of response from Ninox regarding this one. Well done!
-
Jacques TUR Excellent work, this help a lot.
Question: the popup only works on Mac ? On Web and Android Tablet I can't see the popup's.
Thanks for you contributions.
-
Thanks Jacques! I wondered how it would affect performance as your code must have to go through the entire DB and figure out how every field is related to every other field. Now I have some experience.
On my Mac, MacBook Pro Retina Mid 2014, it takes from 30 seconds to 2 minutes to open the Edit Fields window or to open a field. So for now I won't be loading the code on a everyday basis.
My DB is quite complicated, for example 1 field in 1 table is referenced 225 times.
It is awesome that you continue to extend the functionality of Ninox!
-
Hello friends,
I have updated the field inspector:
Ver 1.01 beta du 11 septembre 2022
- update : modification of the shape of the badges so that colorblind people can recognize the level of importance.
- fix : modification of the scroll so that it never moves,
Ver 1.02 beta du 13 septembre 2022
- improvement: the list of codes to be inspected is loaded only at startup and when the database is updated.
- correct : only the code directly linked to the file is found. Previously, all the codes linked, directly or by another field, were recovered.
These two updates improve the display time of the field modification window,
Fred Unfortunately it is still a bit slow. I will try again to improve the search and loading time of the inspection window.
-
Hello everyone,
I added some functionality to FieldInspector:
- Display of the field dependency hierarchy. It is now possible to display all sub-dependencies of a field. This allows to have a more complete vision of the impact of a modification on the whole database.
- In the field editing window, highlighting of the tabs. The tabs are displayed with a background color that distinguishes them from other fields. This makes it easier to visually separate fields by tabs.
- Addition of a quick search field. It allows to find a field quickly when the table has many fields. The tabs remain visible in order to know in which tab the filtered fields are located.
-
I have just released FieldsInspector version 1.0.4 beta:
Bug fix: When a field was modified in the fields edit window, the badges disappeared and the search became inoperative. This is now solved and, if the badges disappear, they are immediately recreated and the search becomes operational again. -
Hi Jacques, again thank you for your valuable developments.
It seems that i had a problem with an existing table without field, I keep having this error and i need to close Ninox app on Mac. This might not be a current situation, but in a project I have a "Home" table without field, with a "readable if "trigger : openFullscreen(record(POS,first(select POS))) which leads to open an another table. It is a nice trick to have a home button on the left, as all the other tables are hidden. Anyway, in this case i am getting the following error when i do modify my home table with no field. Maybe you could check something to avoid this situation ?
badges error : null is not an object (evaluating 'document.querySelector('.typeeditor').querySelector('.accordion-pane').querySelector('.t-columneditor-column').listed')
Content aside
-
10
Likes
- 1 yr agoLast active
- 56Replies
- 1012Views
-
18
Following