Skip to content

Conversation

benloh
Copy link
Collaborator

@benloh benloh commented Aug 25, 2025

Addresses #433

With all of the changes to the Advanced Panel, Settings Panel, and Template Panel, locking Nodes, Edges, and Advanced Panel functions needs to be reviewed and refined.

The Main Principles

  • Any admin function that potentially changes a template should lock out any other
    • template edit
    • node edit
    • edge edit
  • Navigating away from a template-related editor should release any other template/node/edge lock
    • HOWEVER, note that you have to navigate away from the locked panel and navigate back to update the state. This prevents a race condition should multiple clients have an open request for a lock (e.g. when the "Template Panel" is left open).
  • Template editing includes
    • opening the "Import" panel (only admins can do this, non-admins would see the "Export" panel which is not restricted)
    • opening the "Template" panel
    • opening the "Settings" panel
    • ("User Tokens" does not lock anything)

Testing

  • Handle multiple "Import/Export" panel openings

    1. On one computer, select a node to open the Node Editor
    2. Open the "Advanced" panel and enter the password -- this should take you to the "Import/Export" panel
    3. The open Node Editor should display a "The template is currently being edited..." message.
  • Handle multiple "Template Panel" openings

    1. On one computer, open the "Template Panel"
    2. In another browser, open the"Template Panel" -- you should get a locked message
    3. On another computer, open the"Template Panel" -- you should get a locked message
    4. On the first computer, close the "Template Panel" -- the others should remain locked
    5. To unlock another template, you have to unselect the "Template Panel" and reselect it.
    6. On the first computer, re-open the "Template Panel" -- so the others are locked
    7. On the first computer, change tabs to "User Token" -- this should release the template lock, and the other browsers/computers can unselect and reselect the "Template Panel"
  • Make sure that editing one node does not lock other nodes

To Do

  • Google analytics need to be removed from index.html and index.ejs -- otherwise results in ga errors -- test by searching for a node and selecting from autosuggest
  • The asynchronous template locking and unlocking on individual tabs (Import/Export, Template, Settings) results in mixed locking, especially across the network (e.g. when switching from Import/Export to Template, because of the async nature, unlocking Import/Export happens AFTER Template locks, undoing the attempted Template lock). Refactor template locking to be managed by the Advanced panel so locking/unlocking can be coordinated across panels.
  • "Unique Key" is not updated until page reload #455
  • Remove "isRequired" -- deprecated Template calls #456
  • QA and Merge into deploy-terraform

@jdanish
Copy link

jdanish commented Aug 26, 2025

Screenshot 2025-08-25 at 7 50 00 PM

@benloh
Copy link
Collaborator Author

benloh commented Aug 26, 2025

@jdanish Sorry, I forgot to mark this WIP. Don't worry about this yet.

@benloh benloh changed the title Template/Settings Cleanup DRAFT Template/Settings Cleanup Aug 27, 2025
@jdanish
Copy link

jdanish commented Aug 28, 2025

@benloh I can add an issue but I think this was maybe on your list for this PR: if you change the "Unique Key" field currently, generating tokens works correctly, but you cannot use any of the tokens until you reload the page (it seems to still be expecting old tokens in the login window). Lemme know if you want more details or a separate issue.

@benloh
Copy link
Collaborator Author

benloh commented Aug 28, 2025

@benloh I can add an issue but I think this was maybe on your list for this PR: if you change the "Unique Key" field currently, generating tokens works correctly, but you cannot use any of the tokens until you reload the page (it seems to still be expecting old tokens in the login window). Lemme know if you want more details or a separate issue.

Filed issue #455

@benloh benloh marked this pull request as draft August 28, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants