BetterDynAdmin icon indicating copy to clipboard operation
BetterDynAdmin copied to clipboard

WIP : Repository Refactor/Revamp

Open troussej opened this issue 7 years ago • 13 comments

This PR is a work in progress, I opened it to start a discussion before going further

My initial goal was to make a new page which would serve as a cross repository explorer, with visual editing features and full ajax queries to be quicker.

To achieve that, I needed to leverage part of the repo's page methods (display as tab, tree) and ended refactoring it quite a lot, not only the "backend part" but also the repo page itsef : display as tab, edit inline, link to child item.

I'm now at a state with a almost full iso-functionnal repository page, with a new "engine" under the hood, and also fixed some bugs / inconsistencies in the UI/UX.

In short, what's new:

  • New "MVC" model that uses classes to formalize models:
    • Using objects makes it clearer, less arrays everywhere that store bits of data.
    • Repository :
      • holds the whole repo definition in memory for when using multiple repositories.
    • ItemDescriptor :
      • contains self and parent properties
      • xmlDef is parsed on demand and stored for further use
    • PropertyDescriptor :
      • stores default value, item type of property if required.
    • RepositoryItem : model of a parsed xml result
    • PropertyValue : each value, default or actual, with its flags parsed from the xml (rdonly, etc )
  • Result as tab:
    • Fully compatible and agnostic between itemtree and standard result (+ repo explorer when it's done)
    • properties sorted alphabetically
    • load sub item :
      • now uses an ajax call, saves the time to reload the page & BDA - several seconds.
      • If the item is already on the page, scroll to it. (like for item tree)
      • Now available for multi items (lists & maps)
    • more constistent collapse expand of long properties:
      • added collapse all button
      • per cell collapse/expand
    • inline edition more consistent across fields types (not finished yet)
    • TODO : reload item view, delete view
  • TODO:
    • change the item tree generation to use the same model for each type of visualization, instead of reloading the tree each time.
    • add help/hints overlays.
    • performance testing

troussej avatar Oct 31 '17 13:10 troussej

also : I'm considering adding Q as a new library to handle Promises, there are a lot of nested callbacks, it has become quite unreadable sometimes.

troussej avatar Oct 31 '17 13:10 troussej

Outch, That's a lot of stuff !

I will need some time to digest since I don't recognize a lot the code anymore ;)

jc7447 avatar Oct 31 '17 15:10 jc7447

Take your time. I don't need to merge right now, I can continue to work on the branch.

troussej avatar Oct 31 '17 15:10 troussej

Added a lot of fixes.

Plus : reload an item, copy item xml from tab, better inline edit, close tab.

troussej avatar Nov 09 '17 15:11 troussej

I'm globally satisfied with the changes, so it's ready to merge when you are.

troussej avatar Nov 09 '17 16:11 troussej

Hi @jc7447

Did you get a chance to look at it? I would like to merge this and work on some other stuff. We also should discuss the next release date, there have been quite some changes since april.

troussej avatar Nov 15 '17 12:11 troussej

Hi,

I'm time short those days but I will try to review this next week, once it's done I will release version 2.2

jc7447 avatar Nov 19 '17 10:11 jc7447

No pressure ;)

Le 19 nov. 2017 11:42 AM, "Jean-Charles Manoury" [email protected] a écrit :

Hi,

I'm time short those days but I will try to review this next week, once it's done I will release version 2.2

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jc7447/BetterDynAdmin/pull/132#issuecomment-345507287, or mute the thread https://github.com/notifications/unsubscribe-auth/AH7cnK7PUbuK02yAsz89D5JLgKRyUJodks5s4AYYgaJpZM4QMwoV .

troussej avatar Nov 19 '17 11:11 troussej

TODO

  • [x] perfs

    • [x] create edition form on click, not on display (almost 30% of time spent here)
  • [x] tooltip/help - I was thinking the same

  • [x] dash - i'm going to remove the new tab for now, as the feature it not quite finished (the repo refactor took over)

  • [x] speedbar button

  • [x] read only vs default values

  • [ ] exception handling

  • [x] anchor links : i used a new method from html5 to scrollTo, it has weird behavior sometimes, depending on the browser. One good thing is that is also scrolls left/right. I'll check if there are more options to tune it, and also maybe flash the item that is scrolled to (it's confusing as hell when there are a lot of priceInfo for example).

troussej avatar Dec 11 '17 10:12 troussej

just rebased from dev to get the latest refactors (some about perfs)

troussej avatar Dec 11 '17 13:12 troussej

perfs : looks like the culprit is buildResultTable, it is linear with the number of items, about 100ms / item

troussej avatar Dec 11 '17 13:12 troussej

I'm replacing all the dom manipulation by string concatenation, it's around 5 times faster.

troussej avatar Dec 21 '17 15:12 troussej

Hi @jc7447

I finally got time to fix the last bugs.

Perfs are much better (even if slower than before, we are doing more calculations) I tried to make it smoother for the user, by adding a loading bar and trying to defer some calculations Added a "speedbarManager" to handle the scroll events, for perfs.

troussej avatar Apr 11 '18 15:04 troussej