nyt-entity-service icon indicating copy to clipboard operation
nyt-entity-service copied to clipboard

Admin: Drag-and-drop for related entities

Open jeremyjbowers opened this issue 7 years ago • 3 comments

Dragging an entity underneath another should create a related entity.

jeremyjbowers avatar Jun 19 '17 14:06 jeremyjbowers

  • [x] Get a draggable JS library.
  • [x] On the client, figure out when dragging the entity name and the related entity.
  • [x] Make an AJAX request to the server to POST entity and related entity.
  • [x] On the server, get entity and related_entity and make the relationship.
  • [ ] Trap for so many different server-side errors.
  • [ ] Trap for many client-side UX errors / bad behaviors.

jeremyjbowers avatar Jun 19 '17 14:06 jeremyjbowers

By chance, would the following scenario be something to trap for on the server:

User drags gray entity to pink area of another entity. User realizes error: the dragged entity actually should remain gray. User drags entity back to original gray area.

I noticed this when I did a similar action. I wrote an if-statement that checks if the entity id and the canonical id are the same. These two being the same represents the user moving a block back to its original place. If the user moves an entity back to its original place, then the canonical id of the entity is reset to "None."

Is this one trap you intended on existing?

SHewitt95 avatar Jun 23 '17 21:06 SHewitt95

Yup. I was planning on making that an "x" button by any related entity because the drag "syntax" is p weird for that.

contact([{ "twitter": "@jeremybowers", "phone": "727-667-0510", "github": " http://github.com/jeremyjbowers" }])

On Fri, Jun 23, 2017 at 5:30 PM, Sherman Hewitt [email protected] wrote:

By chance, would the following scenario be something to trap for on the server:

User drags gray entity to pink area of another entity. User realizes error: the dragged entity actually should remain gray.

I noticed this when I did a similar action. I wrote an if-statement that checks if the entity id and the canonical id are the same. These two being the same represents the user moving a block back to its original place. If the user moves an entity back to its original place, then the canonical id of the entity is reset to "None."

Is this one trap you intended on existing?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/newsdev/nyt-entity-service/issues/1#issuecomment-310777571, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGtpLs5s0H4M4vGSzP3EOXaYTAnL2Z2ks5sHC5tgaJpZM4N-SG9 .

jeremyjbowers avatar Jun 23 '17 23:06 jeremyjbowers