Moonshine-IDE / Super.Human.Portal

Portal interface to show documentation for DominoVagrant and Super.Human.Installer
Other
0 stars 1 forks source link

Gray out buttons next/prev when we are last/first item #48

Closed piotrzarzycki21 closed 7 months ago

piotrzarzycki21 commented 7 months ago

Originally posted by @piotrzarzycki21 in https://github.com/Moonshine-IDE/Super.Human.Portal/issues/40#issuecomment-1802391196

piotrzarzycki21 commented 7 months ago

This need to be discussed a little bit more.

piotrzarzycki21 commented 7 months ago

@JoelProminic I have fixed couple of crucial bugs in menu related to this issue. It would be nice if you could deploy newest build before call if you find time. If not I will present this on my screen.

piotrzarzycki21 commented 7 months ago

Unfortunately I haven't finished this today. I'm having case where I'm not sure what to do and what to select in that matter. I will brainstorm with @Aszusz tomorrow and see if we come together with some ideas. Otherwise I will report my findings here.

piotrzarzycki21 commented 7 months ago

This issue has been fixed. We have with @Aszusz refactor actions under buttons next/prev according to requirements. @JoelProminic you can test this with newest build.

JoelProminic commented 7 months ago
Test Behavior Notes
First entry, Directory Previous disabled
First database, nested Previous goes to directory
First entry, database, base Previous button disabled (I once saw this enabled after a refresh, but I couldn't reproduce it) Hard-coded agent to only return base databases
Last entry, Directory Next goes to database entry Hard-coded agent to only return nested databases
Last database, nested Next button disabled Hard-coded agent to only return nested databases
Last entry, database, base Next disabled

On a side note, I found that Browse My Server hung if no databases were returned. This is an unusual case, but we may want to support it in case we restrict DatabaseRead output based on a security setting (though the interface should not be opened at all in this case - see #43). We can discuss this more tomorrow.

JoelProminic commented 7 months ago

I was able to reproduce the case where the Previous button didn't disable:

  1. Open Browse My Server and select the first directory. The button is disabled properly
  2. Create a new nested database that will appear first in the list (i.e. Dir8/TestFirst.nsf with the default SHI server databases).
  3. click the Refresh button in the Browse My Server interface
  4. The new directory is selected by default. BUG: Previous button is enabled
  5. Click the Previous button. Nothing happens
  6. Click Next and then Previous. BUG: Previous button is still disabled
  7. Click the old first directory. BUG: Previous button is disabled

I think this console error triggered on the Refresh, but I was not watching for it:

Uncaught TypeError: parentSelectedItem is null
    classes_topMenu_TopMenu_onTravel https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:39722
    $EH_13_2 https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:39936
    fireListener https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:9215
    fireListenerOverride https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:12902
    handleBrowserEvent_ https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:9259
    f https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:9021
    addEventListener eval:4
piotrzarzycki21 commented 7 months ago

On a side note, I found that Browse My Server hung if no databases were returned. This is an unusual case, but we may want to support it in case we restrict DatabaseRead output based on a security setting (though the interface should not be opened at all in this case - see #43). We can discuss this more tomorrow.

I have made additional restrictions and menu is not displayed if there is no database, but we should discuss what do display in that case in UI.

piotrzarzycki21 commented 7 months ago

I was able to reproduce the case where the Previous button didn't disable:

  1. Open Browse My Server and select the first directory. The button is disabled properly
  2. Create a new nested database that will appear first in the list (i.e. Dir8/TestFirst.nsf with the default SHI server databases).
  3. click the Refresh button in the Browse My Server interface
  4. The new directory is selected by default. BUG: Previous button is enabled
  5. Click the Previous button. Nothing happens
  6. Click Next and then Previous. BUG: Previous button is still disabled
  7. Click the old first directory. BUG: Previous button is disabled

I think this console error triggered on the Refresh, but I was not watching for it:

Uncaught TypeError: parentSelectedItem is null
    classes_topMenu_TopMenu_onTravel https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:39722
    $EH_13_2 https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:39936
    fireListener https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:9215
    fireListenerOverride https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:12902
    handleBrowserEvent_ https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:9259
    f https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:9021
    addEventListener eval:4

Unfortunately I cannot reproduce this issue. Before call please update SHP with latest version because I have made some changes in area of null pointer - maybe that's help.

piotrzarzycki21 commented 7 months ago

I was able to reproduce the case where the Previous button didn't disable:

  1. Open Browse My Server and select the first directory. The button is disabled properly
  2. Create a new nested database that will appear first in the list (i.e. Dir8/TestFirst.nsf with the default SHI server databases).
  3. click the Refresh button in the Browse My Server interface
  4. The new directory is selected by default. BUG: Previous button is enabled
  5. Click the Previous button. Nothing happens
  6. Click Next and then Previous. BUG: Previous button is still disabled
  7. Click the old first directory. BUG: Previous button is disabled

I think this console error triggered on the Refresh, but I was not watching for it:

Uncaught TypeError: parentSelectedItem is null
    classes_topMenu_TopMenu_onTravel https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:39722
    $EH_13_2 https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:39936
    fireListener https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:9215
    fireListenerOverride https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:12902
    handleBrowserEvent_ https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:9259
    f https://domino.domino-1.demoprod.com/Super.Human.Portal/js-debug/SuperHumanPortal_Royale.js:9021
    addEventListener eval:4

@JoelProminic I have fixed this issue.

JoelProminic commented 7 months ago

I confirmed the case with adding a new database was fixed. I don't see any remaining issues.