Ticket #171 (closed Defect: fixed)

Opened 10 years ago

Last modified 5 years ago

"Choose" fields should not create empty topics

Reported by: jri Owned by: jri
Priority: Minor Milestone: Release 4.6
Component: DeepaMehta Standard Distribution Version: 4.0.6
Keywords: Cc: dgf, Malte, JuergeN
Complexity: 3 Area:
Module: deepamehta-webclient

Description (last modified by jri) (diff)

E.g. when I create a person, and let the "Country" field empty, DeepaMehta creates a Country topic (with an empty name) anyway. From now on the Country menu lists an additional empty item.

Change History

comment:1 Changed 10 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 10 years ago by jri

  • Description modified (diff)

comment:3 Changed 9 years ago by jri

  • Milestone changed from Release 4.1 to Release 4.2

comment:4 Changed 8 years ago by jri

  • Milestone Release 4.2 deleted

comment:5 Changed 7 years ago by jri

  • Cc dgf, Malte, JuergeN added
  • Module set to deepamehta-webclient
  • Milestone set to Release 4.6

comment:6 Changed 7 years ago by Jörg Richter <jri@…>

In 01cf8556aacf5cb54f66e448b98bee322e280ac3/deepamehta:

Webclient: Combobox not create empty topic (#171).

When a combobox field (e.g. "Phone Label", "City") is left empty DM does not create an empty topic for that field. As a consequence no empty menu item appears subsequently in the "Phone Label" or "City" menus.

Furthermore when e.g. a Phone Label or City assignment already exists (e.g. for a Person topic) DM deletes that assignment when the user empties the combobox's input field. (The respective Phone Label or City topic is of course not deleted, only the assignment is.)

Committed to master branch.

CHANGES

Core

REST API: The assignment of aggregation-one child can be removed by using the del_id: prefix in the request. (Until now the del_id: prefix was only supported for composition-many and aggregation-many childs.)

Core API: analogously TopicDeletionModel objects can be present in ChildTopicModel objects used for updating aggregation-one childs. DM deletes the respective assignment then.

See #171.

comment:7 follow-up: ↓ 10 Changed 7 years ago by Jörg Richter <jri@…>

In 6eaca4a33cd07f21e11631ec799a9d0c9dc3cde6/deepamehta:

Webclient: don't create empty child topics (#171).

When an input field is left empty DM does not create an empty topic for that field. Now this applies not only for combobox fields (child via Aggregation) [01cf855] but also for regular fields (child via Composition).

Furthermore if a regular field is emptied DM deletes the underlying child topic. The objective is to never store empty (simple) child topics in the DB.

Committed to master branch.

CHANGES

Webclient

Number fields can be empty. The Webclient does not fill in 0 automatically anymore. This design decision was made because 0 and "not set" might mean something different to the user.

Core

REST API: in an update request a composition-one child can be removed by using the del_id: prefix. Now the del_id: prefix is supported for all the 4 cases, that is composition/aggregration, one/many.

Core API: analogously TopicDeletionModel objects can be present in ChildTopicModel objects used for updating composition-one childs. DM deletes the that child topic then.

See #171.

Version 0, edited 7 years ago by Jörg Richter <jri@…> (next)

comment:8 Changed 7 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed

comment:9 Changed 7 years ago by Jörg Richter <jri@…>

In e5aa2d2ea376e4682f80860be9dcc8b4bda97286/deepamehta:

Webclient: fix form processing (#341).

E.g. creating a Person and leaving the Phone field empty works again.

Note: when the Phone field is empty no empty Phone topic will be created (resp. if the field is emptied the Phone topic will be deleted), see #171. That means that there is no Phone Entry association either in this case. As a consequence no Phone Label ("home", "work", ...) can be stored. There can be no Phone Label without a Phone number.

This is a generic pattern. Form input bound to a custom association is ignored/deleted if the child topic is not created resp. deleted.

See #341.

comment:10 in reply to: ↑ 7 Changed 6 years ago by jri

  • Status changed from closed to reopened
  • Resolution fixed deleted

Replying to Jörg Richter <jri@…>:

Number fields can be empty. The Webclient does not fill in 0 automatically anymore. This design decision was made because 0 and "not set" might mean something different to the user.

There is a bug with Number fields and comboboxes: you can't clear that Number field if there is a menu item with 0 (number) label. This is because empty (string) input matches that item. (In Javascript 0 == "" is true.)

This occurs e.g. in Hour/Minute? fields of the DateTime? plugin (#901) as 0 is a valid value for Hour and Minute.

comment:11 Changed 6 years ago by Jörg Richter <jri@…>

In b5c0b64c7d5a89551712f92779e69f5114ba3915/deepamehta:

DateTime? fix: empty Hour/Minute? fields (#171).

The Hour/Minute? fields can be empty. They are not reset to 0.

Actually the problem was in the Webclient's GUIToolkit.

See #171

comment:12 Changed 5 years ago by jri

  • Status changed from reopened to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.