10

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

null
    • Ninox partner
    • RoSoft_Steven.1
    • 1 yr ago
    • Reported - view

    This brings Ninox to the next level ! Thanks Jacques TUR .

    • John_Halls
    • 1 yr ago
    • Reported - view

    Jacques TUR You have surpassed yourself here. Massive congratulations on this.

    • Mel_Charles
    • 1 yr ago
    • Reported - view

    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 .... 😊)

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Mel Charles Maybe with grayscale colors ?

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Mel Charles Thanks, it's precious to know that. I will see about putting different shapes (round, square, triangle)

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Mel Charles I just updated Ninext to show different shapes depending on the impact level:

      green circle :  display code

      organge rounded square : calculation code to make another field visible or to calculate the values of a column in a list 

      red square :  used in a formula or to update other fields as in AfterUpdate

      • Mel_Charles
      • 1 yr ago
      • Reported - view

      Jacques TUR Thats great - But I loved what you did originally I was not making a fuss about being colour blind - it is was it is!! Shapes make it better tho :-) Nice one.

    • Sean
    • 1 yr ago
    • Reported - view

    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!

    • Rafael Sanchis
    • Rafael_Sanchis
    • 1 yr ago
    • Reported - view

    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.

    • Fred
    • 1 yr ago
    • Reported - view

    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!

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Fred I'm going to test with a large database to reduce the opening time. Moreover I must be able to do it in the background so that it does not penalize the use. Thanks for this feedback Fred, it will help me to improve the code 👍.

      • Sean
      • 1 yr ago
      • Reported - view

      Fred I haven't looked at the code yet, but if I was doing it I wouldn't look through the entire database. I would just look at the lastest schema stored in the database file.

      • Fred
      • 1 yr ago
      • Reported - view

      Sean Please don't take my wording to be any where close to what Jacques actually does in his code. I have no idea how the magic happens, so my words are my simpleton's way of trying to understand the magic.

      • Sean
      • 1 yr ago
      • Reported - view

      Fred 😆 No worries! I forget that Jacques is working with the browser version. I use the Mac version and I can open any of my database files in a text editor or use VS Code. I’m not sure how that would work with the browser version.

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      Fred I have optimized the field search and the loading time of the field edition window is now much shorter. The search is done only once for all tables at once at the first use. Until now, it was every time and for every field displayed.
      Tell me if this becomes unusable on your 2014 PM.
      On my computer with a large table, there was a few seconds delay, now it is immediate.

      • Fred
      • 1 yr ago
      • Reported - view

      Jacques TUR Whatever you did made a huge difference. Now it is useable on my main DB. Thanks for continuing to work on this.

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    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.

      • Fred
      • 1 yr ago
      • Reported - view

      It is quite amazing what you can do without being a developer for Ninox and no access to the root code. Thanks for doing all this.

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    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.

      • Fred
      • 1 yr ago
      • Reported - view

      Wow, I’ve always wanted to be able to search my Edit Fields list. You are the best!

      • Fred
      • 1 yr ago
      • Reported - view

      I've just tried the search and it works perfectly. This is going to be a game changer!

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    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.

    • buy
    • 1 yr ago
    • Reported - view

    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')

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      buy yes, I discovered this yesterday. I just fixed the problem, just reload the application and it should work fine.

      • buy
      • 1 yr ago
      • Reported - view

      Jacques TUR works perfectly....cool it is really a must have !

Content aside

  • 10 Likes
  • 7 mths agoLast active
  • 56Replies
  • 923Views
  • 18 Following