Project

General

Profile

Feature #868

Configure default value by attribute persistent type

Added by Petr Michal over 3 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Low
Category:
Eav
Target version:
Start date:
12/07/2017
Due date:
% Done:

100%

Estimated time:
Milestones:

Description

Improve form attribute detail - input for default value could depend on attribute persistent type:
- boolean - select box - True / False
- date and date time - date picker
...
- add appropriate input validations (reuse the same validations as attributes are rendered in eav form).


Related issues

Related to CzechIdM - Defect #2757: Eav: Prevent to show configured default values for already saved entities (default value is shown on identity more informations for not persisted values)Closed04/15/2021

History

#1 Updated by Radek Tomiška over 3 years ago

  • Assignee changed from Ondřej Kopr to Petr Michal
  • Priority changed from Normal to Low

I am really not able to reproduce this ticket. I tested it on demo and checkbox field with default face.

Add pls concrete use case to reproduce this issue,

#2 Updated by Petr Michal over 3 years ago

  • Assignee changed from Petr Michal to Ondřej Kopr

Usecase is that I want to create new bolean (checkbox) eav with default value as false.

Now I found that you can do it if you leave default value fied empty. Before I tried to fill it with false and 0.
It also means that you can write completely whatever you want to set defaut to true.

So propably only problem is, that this form is not user friedly.
Its the same if I want for example create you eav of date... defautl value its still just input field and I have no idea which format of date I need to use.


Best solution is to change field for default value for every type of eav. So you set easily set usable value.

#3 Updated by Radek Tomiška over 3 years ago

  • Tracker changed from Defect to Feature
  • Category changed from Frontend to Eav
  • Assignee changed from Ondřej Kopr to Radek Tomiška
  • Target version deleted (Garnet (7.7.0))

I understand, but 'Default value for checkbox eav does not work' is not true (the same as whole description). It works as it was implemented (use default value "true", it works).

'Best solution is to change field for default value for every type of eav' ... this is obvious, but it's not implemented, as other UX things. So ... I'm changing this ticket to feature, adding appropriate category etc.

Note: (pls also consider design of select-box for this case, because full page size select-box for true/false looks silly to me - this is another improvement of eav forms.

#4 Updated by Radek Tomiška about 3 years ago

  • Subject changed from Default value for checkbox eav does not work to Configure default value by attribute persistent type
  • Description updated (diff)

#5 Updated by Radek Tomiška 6 months ago

  • Status changed from New to Needs feedback
  • Assignee changed from Radek Tomiška to Vít Švanda
  • Target version set to 10.8.0
  • % Done changed from 0 to 90

Feature is implemented, commit:
https://github.com/bcvsolutions/CzechIdMng/commit/c127354a3ad209bafee66cfb0e6fdb1f14011c50

Could you provide me a feedback, please?

#6 Updated by Vít Švanda 5 months ago

  • Status changed from Needs feedback to In Progress
  • Assignee changed from Vít Švanda to Radek Tomiška

I did reivew and tested it. Nice UX feature. Generaly works nice.

I found one problem: In case when attribute is text type, then default value is not show after creation on the detail (in table is show correctly). Same problem is for multivalue text component.

#7 Updated by Radek Tomiška 5 months ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Vít Švanda

Thx for feedback, I fixed default value initialization and set default value as single select only + not required:
https://github.com/bcvsolutions/CzechIdMng/commit/76e9db478ae4eace67100c97b1e6e28b9ae294e5

Could you provide me a feedback, again, please?

#8 Updated by Vít Švanda 5 months ago

  • Status changed from Needs feedback to In Progress
  • Assignee changed from Vít Švanda to Radek Tomiška

Default value for TEXT works nice now. But clearing of default value on type change doesn't work now (for already exist attribute). If validation doesn't pass (because is text in the default value for integer type), then detail can be still save.

#9 Updated by Radek Tomiška 5 months ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Vít Švanda

Thx for feedback, I fixed cleaning default value:
https://github.com/bcvsolutions/CzechIdMng/commit/680a590bf19d1887795b68266e0064f7e919819e

Could you provide me a feedback, again, please?

Note: validations for default value are not supported now.

#10 Updated by Vít Švanda 5 months ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Vít Švanda to Radek Tomiška
  • % Done changed from 90 to 100

I retested it. Works nice. Thanks for that.

#11 Updated by Radek Tomiška 5 months ago

  • Status changed from Resolved to Closed

#12 Updated by Radek Tomiška 4 months ago

  • Related to Defect #2757: Eav: Prevent to show configured default values for already saved entities (default value is shown on identity more informations for not persisted values) added

Also available in: Atom PDF

Go to top