Add CRUD relationship UI#47
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2dd259a4fb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (Map.Entry<?, ?> field : instance.entrySet()) { | ||
| body.put(String.valueOf(field.getKey()), field.getValue()); | ||
| } | ||
| String oldId = stringValue(body.get(entity.primaryKeyFieldName())); |
There was a problem hiding this comment.
Normalize exported IDs before recording remaps
When an exported workspace has auto-increment IDs with gaps (for example, create two projects, delete the first, then export), the entity id from entities is parsed by Gson as a numeric 2.0 here, while the relationship edge still contains the string id "2" produced by exportRelationships. That stores the remap under project|2.0, so relationship import misses it and posts to the stale /projects/2/... in the fresh workspace, causing the import to fail or restore edges to the wrong record. Normalize the old id the same way relationship ids are serialized before using it as the importedIdentifiers key.
Useful? React with 👍 / 👎.
| WorkspaceSnapshot snapshot = workspace.replaceWithYaml(schemaYaml); | ||
| Map<String, String> importedIdentifiers = importEntities(document, snapshot); | ||
| importRelationships(document, workspace.snapshot(), importedIdentifiers); |
There was a problem hiding this comment.
Keep failed imports from replacing the live workspace
For imports with a valid schemaYaml but malformed entities/relationships, or with an entity/relationship POST that fails, this replaces and closes the current workspace before any of the rest of the document is validated or fully applied. The controller then returns a 400, but the user's previous in-memory data has already been discarded and the server may be left with a partially imported workspace; build and validate/import into a temporary workspace and swap it in only after the whole import succeeds.
Useful? React with 👍 / 👎.
Summary
thingifier-crud-uiMaven module for a single-user in-memory CRUD workspace/api/*forwarding, import/export, OpenAPI docs, and Swagger UIVerification
node --check thingifier-crud-ui/src/main/resources/public/assets/app.jsmvn -pl thingifier-crud-ui -am testmvn spotless:checkmvn -pl thingifier-crud-ui -DskipTests checkstyle:check@project-fqn-checkmvn -pl thingifier-crud-ui -am -DskipTests packagehttp://localhost:4568/for connect existing, inline create-and-connect, remove relationship edge, and target instance preservationCloses #44