Closed benloh closed 2 years ago
@kalanicraig @jdanish Please try out the node and edge types editor. It's a little more powerful than the first iteration with the template PR (#175). This hacks around json-editor to make use of its features to handle the combining and splitting types.
Tinkering and it looks good so far. FYI, the node type updates, but the key does not until you reload the page.
I believe colors and labels do update as soon as you hit "Save Changes", but if you delete one, the colors are not updated until you reload.
A number of issues still to fix:
The previous implementation of Template / Node / Edge locking only worked locally, e.g. trying to edit both a node and a template at the same time on the same computer was prevented. However, it did not work across the network: You could edit a template on one machine, and still be able to edit a node or even the template on a second machine.
The latest changes fix this. Template locking is now coordinated across the network starting with b2d1807bac0cff03e8b0d71e503e7985dc40f251
git pull
npm run dev
With power comes responsibility... If you abandon a template edit, or node/edge edit, the Template may be inadvertently locked out. If that happens:
ncUnlockAll()
@jdanish @kalanicraig Please test the network locking for template editing.
Nodes and Edges will now display a warning message if the template is current open for editing.
@jdanish @kalanicraig One more question about Node Type and Edge Type Option editing: Currently the fancy tools that handle dataset remapping when editing types (e.g. using "Change To" map from an old type to a new type), are only available in the Node Type Option and Edge Type Option editors. They are NOT available in the main "Edit Current Template" view. That view just provides a flat list of options to edit without the data conversion tools.
While it is possible, it will be messy to add the conversion tools to the "Edit Current Template" tool. Also it makes the workflow very convoluted. So here are some assumptions I'm making:
Any thoughts? Ideas?
I like / agree with 1 and 2. I think long-long-term we’ll wanna just make all custom editors, but for the short term this works great.
Joshua
Joshua A. Danish (he, him, his) (https://www.mypronouns.org/ https://www.mypronouns.org/)
@.***
On Feb 8, 2022, at 4:36 PM, benloh @.***> wrote:
@jdanish https://github.com/jdanish @kalanicraig https://github.com/kalanicraig One more question about Node Type and Edge Type Option editing: Currently the fancy tools that handle dataset remapping when editing types (e.g. using "Change To" map from an old type to a new type), are only available in the Node Type Option and Edge Type Option editors. They are NOT available in the main "Edit Current Template" view. That view just provides a flat list of options to edit without the data conversion tools.
While it is possible, it will be messy to add the conversion tools to the "Edit Current Template" tool. Also it makes the workflow very convoluted. So here are some assumptions I'm making:
Assume that it's OK that the "Edit Current Template" is focused on the raw template editing and does not provide the data conversion tools. We could add instructional text to the "Edit Current Template" view informing users to use to use the "Node Type Option" and "Edge Type Option" editors if they need to convert data. Or, we could remove the Node Type Option and Edge Type Option from the Edit Current Template view altogether (though I don't like this solution as much as it can be more confusing to have it missing). Any thoughts? Ideas?
— Reply to this email directly, view it on GitHub https://github.com/netcreateorg/netcreate-2018/pull/200#issuecomment-1033085540, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKGCKXICA6G2M6KFB36ZGLU2GEHTANCNFSM5NIIXDWA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.
Standalone mode should work now. In addition, the "Edit Node" and "Edit Edge" buttons are now hidden in standalone mode.
Looks like nc-multiplex works fine.
@jdanish @kalanicraig Alright, I think the Node/Edge Type Option editors is now completed: locking template editing across the network now works, along with standalone mode fixes, and a confirmation that nc-multiplex still works.
Once you confirm the last few fixes starting with "New Feature: Network Locking" above, we can merge this into dev
.
The next step will be to work on importing data.
I noticed that the "NOTE: We recommend using the "Edit Node Types" feature to edit Node Types. It provides additional dataset migration tools." warning appears in both the edit not type editor, and the edit template editor. The first is a bit confusing since you are already there. Is that something that can be turned on only when it is part of the full editor? Same with edges. Otherwise, my minimal testing all looks good. Kalani can speak to more extensive testing / when it is ready, though.
I think I have to remove the "NOTE: We recommend..." manually. It should be doable.
Also there's still an issue with Template edits propagating across the network: #204
Also the key updating (I think I filed an issue?).
Also the key updating (I think I filed an issue?).
Weird. I didn't get a notification. It's #206.
BTW, if you add a "Project" and select "Version 1.4" it should show up in the main work board I'm using: https://github.com/netcreateorg/netcreate-2018/projects/3
@jdanish Three fixes:
This should complete all the features needed for this merge request. The network data update changes are pretty fundamental, so it's worth doing a little more extended testing with this to make sure things still work as expected.
Awesome. One thing I noticed by accident (I can file an issue if you need): If you go to edit a template, then navigate away in some way (e.g., reloading the page), then the network remains locked and there is no way to unlock it without a restart. Can we use the navigate away to trigger the unlock in one manner?
Issue created in #219. Merging.
Merge after #198!
Branch:
dev-bl/typeedit
This hacks the json-editor interface so that we can add some additional functionality around:
In addition to updating the template, the editor will now also update the existing dataset's type options if necessary.
To Test
We recommend making a backup of your dataset and template because these tests will change both template and dataset content.
git fetch && git checkout dev-bl/typeedit
npm run dev
http://localhost:3000
Test Rename
To rename a label, you just type the new name in the "Change To" field. The nice thing about this UI is that the original label is still visible if you're making decisions about naming while reviewing the whole list.
ctrl-c
quit NetCreate and start it again.Test Delete
You can simply remove a type option by deleting it. However, deleting a type option will make it an unknown type -- this means that any node that is set to that type will be displayed as black because it will have an unknown type. We expect that most of the time when you want to delete a label, you would also want to remap it (see the next section "Test Delete and Remap").
Test Delete and Remap
Instead of simply deleting a type option, you can tell the system to change any node with the deleted type to a new type.
Test Adding
You can add new options.
Technically we should probably hide the "Change To" field when adding a new field, but having it actually adds another handy feature. Read on...
Remap Inadvertent "Feature"
Another handy power user feature for managing type options is you can use the "Add Row" feature to both add a type AND rename it at the same time. This is handy if you find that you have a node with a stray type that hasn't been added. For example, let's say you found three black nodes set to a type "Race", but you do not currently have "Race" as a type option. And you don't want the type option to be "Race", you want it to be "Ethnicity". You can Add it and change it in one action:
Under the hood what happens is:
The UI is a little quirky, especially for someone who is not used to managing lists of items in this way. But the nice thing is we don't need to build a custom UI with a ton of actions to take for every single label.
Wiki
Edit Template
Locking Templates
While editing templates, you cannot edit nodes or edges. This is because changes to the Template can affect how Nodes and Edges behave and are displayed. Changes to the template can also result in changes to the dataset (e.g. one node type is remapped to another node type).
Conversely, when you are editing a node or edge, you are not allowed to edit templates.
There is a warning message displayed on the Node/Edge if this occurs.
Edit Node Types / Edit Edge Types
When editing node types or edge types, if you use the "Change To" field, Net.Create will automatically update your dataset for you: any nodes and edges using the original "Label" type will be updated to use the new "Change To" type. This change is executed as soon as you click "Save Changes". Your dataset file on disk will be updated immediately.
NOTES