#50918 Issue 50904 - Connect All React Components And Refactor the Main Navigation Tab Code
Closed by spichugi. Opened by spichugi.
spichugi/389-ds-base final-react-refact  into  master

Download 50918.patch

Description: Port the rest of ds.js and index.html code to React.
It includes instance navigation, creation, removal, and other dsctl tasks.
Fix https://pagure.io/389-ds-base/issue/49902

https://pagure.io/389-ds-base/issue/50904

Reviewed by: ?

The functionality is done and ready for review.

CSS stuff is WIP.

Comment indentation is off in ds.jsx ---> createInstance()

Maybe we could do this later, but in server settings and frieds I only enable the save button if all the fields are valid. I would like to see the same thing for create instance. Basically the handleChange function would do all the validation instead of the create/save function.

But... The loading is messed up. It says "loading configuration...", but there is no progress bar, then it just turns into a blank screen for 60 seconds, then it loads the page.

Also the Nav bar needs better spacing. "Server" is frozen to the left of the screen. There should be some padding. In fact the entire Nav bar feels cramped - I would like to see a little more spacing between all the tabs

The rest looks good!

I also wonder if we should only load the other tabs once they are clicked. That would provide a much faster startup/loading of the UI when you first log in.

One last thing. The loading configuration splash page does not appear to be centered. Okay that's it :-)

1 new commit added

  • Fix CSS issues and make tabs load separately

Issues are fixed. Ready for the final review.

2 new commits added

  • Fix CSS issues and make tabs load separately
  • [WIP] Issue 50904 - Connect All React Components And Refactor the Main Navigation Tab Code

The plugins are still doing all their loading when the UI first loads (check the console log to see what I mean). And the progress bar goes right to 50% and stays there until it's done. It never progresses as I would expect.

1 new commit added

  • Add some plugins to the loading later list

Right, missed the children... Plugins are fixed.

And for the loading progress bar, I am not sure if we should keep it.
It is used only for loading the instance list and then we display the main screen and the Server's tab is loading there.

I've hardcoded 50% and then I just set 100% when it is done because it is basically one-two functions (check package, get list).

Right, missed the children... Plugins are fixed.
And for the loading progress bar, I am not sure if we should keep it.
It is used only for loading the instance list and then we display the main screen and the Server's tab is loading there.
I've hardcoded 50% and then I just set 100% when it is done because it is basically one-two functions (check package, get list).

This is pointless then as its not incrementally progressing. I don't see why you can't increment it after every CLI call. There are 5 dsconf/dsctl call you could use to bump the progress bar:

  • CMD: loadInstanceList: Load the instance list select ==> dsctl -l -j
  • CMD: setServerId: Test if instance is running ==> dsctl -j localhost status
  • CMD: setServerId: Test if instance is alive ==> dsconf -j ldapi://%2fvar%2frun%2fslapd-localhost.socket backend suffix list --suffix
  • CMD: loadBackupsDSInstance: Load Backups ==> dsctl -j localhost backups
  • CMD: loadConfig: Load server configuration ==> dsconf -j localhost config get

There is also still a plugin call being made:

  • CMD: updateSwitch: Get global USN status ==> dsconf -j ldapi://%2fvar%2frun%2fslapd-localhost.socket config get nsslapd-entryusn-global

1 new commit added

  • Fix updateProgress and one plugin loading

Okay, the commands are executed pretty fast on my machine so I wasn't sure if we need the progressBar at all. But there are slower machines so yeah, it makes sense.

Fixed. Please, check.

Okay, the commands are executed pretty fast on my machine so I wasn't sure if we need the progressBar at all.

Yeah I wondering the same thing, but it doesn't hurt to have one even if it runs fast. The last patch took almost 10 seconds on my laptop, so well worth it in that case.

Anyway checking patch shortly...

But there are slower machines so yeah, it makes sense.
Fixed. Please, check.

Much better, and this time it took 15 seconds to load, so the progress bar worked great and I would say is needed.

One last issue, After the initial loading, I see two spinners. Once next to the instance dropdown box (I do have 5 instances right now), and one for "Loading Server configuration...". It would be nice to not have the instance dropdown spinner spinning at the same time as the Server Tab configuration loading page..

Besides that, ACK! Let's get this in!

Okay, it is not a trivial task at all...
The way we handle loading in some components is pretty complex... If we replace the state with the props and add updateLoading function - then we have issues we need additionally address in a lot of places (probably, we need a bigger loading refactoring in some components).

I've made a simple draft with just replacing state -> props and setState() -> props.updateTabLoading() and I had a lot of conflicts in the tabs.

I think the issue is really minor and can be addressed later (I'd even say it can be addressed at the point when we will replace all dsconf calls with one dsconf call)

I am merging this and I'll create a ticket for the issue.

rebased onto c013a0287a8d85f082e1f21050d4b95ab6ca89ce

Pull-Request has been merged by spichugi

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3971

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata