-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CollectionObjectType form's name
field defaults to a picklist
#5216
Comments
We need to add a default viewdef for CollectionObjectType where name is defined as a text field. COType currently does not have a default and so it leads to a 404 error when Specify tries to render the form
Specify tries to autogenerate the view which results in PrepType has a similar field // http://localhost/context/view.json?name=PrepType
{
"name": "PrepType",
"class": "edu.ku.brc.specify.datamodel.PrepType",
"busrules": "edu.ku.brc.specify.datamodel.busrules.PrepTypeBusRules",
"resourcelabels": "false",
"altviews": {
"PrepType View": {
"name": "PrepType View",
"viewdef": "PrepType",
"mode": "view",
"validated": "false"
},
"PrepType Edit": {
"name": "PrepType Edit",
"viewdef": "PrepType",
"mode": "edit",
"validated": "true",
"default": "true"
}
},
"viewdefs": {
"PrepType": "<viewdef type=\"form\" name=\"PrepType\" class=\"edu.ku.brc.specify.datamodel.PrepType\" gettable=\"edu.ku.brc.af.ui.forms.DataGetterForObj\" settable=\"edu.ku.brc.af.ui.forms.DataSetterForObj\">\n \n <desc>PrepType Data Entry Form</desc>\n <columnDef>p,3dlu,p,6dlu,p</columnDef>\n <rowDef>p,2dlu,p</rowDef>\n \n <rows>\n <row>\n <cell type=\"label\" labelfor=\"1\" label=\"Name\" />\n <cell type=\"field\" id=\"1\" name=\"name\" uitype=\"text\" isrequired=\"true\" /> \n <cell type=\"field\" id=\"2\" name=\"isLoanable\" label=\"Is Loanable\" uitype=\"checkbox\" />\n </row>\n </rows>\n </viewdef>\n \n "
},
"view": "<view name=\"PrepType\" class=\"edu.ku.brc.specify.datamodel.PrepType\" busrules=\"edu.ku.brc.specify.datamodel.busrules.PrepTypeBusRules\" resourcelabels=\"false\">\n <desc>The PrepType Object form.</desc>\n <altviews>\n <altview name=\"PrepType View\" viewdef=\"PrepType\" mode=\"view\" validated=\"false\" />\n <altview name=\"PrepType Edit\" viewdef=\"PrepType\" mode=\"edit\" validated=\"true\" default=\"true\" />\n </altviews>\n </view>\n \n ",
"viewsetName": "SystemSetup",
"viewsetLevel": "Backstop",
"viewsetSource": "disk",
"viewsetId": null,
"viewsetFile": "backstop/system.views.xml"
} The other solution could be to modify frontend picklist behavior such that Specify forms do not default to it. However, I think adding a default viewdef would be better as I imagine we need to do that for most new geo tables anyway. |
Here's a viewdef that we could potentially use later on: <viewdef name="CollectionObjectType" class="edu.ku.brc.specify.datamodel.CollectionObjectType" type="form" gettable="edu.ku.brc.af.ui.forms.DataGetterForObj" settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
<desc>The CollectionObjectType Table</desc>
<enableRules/>
<columnDef>p,2px,p,2px,p,2px,p,2px,p,2px,p,p:g</columnDef>
<rowDef auto="true" cell="p" sep="2px"/>
<rows>
<row>
<cell type="label" labelfor="1" label="Name"/>
<cell type="field" id="1" name="name" uitype="text" isrequired="true"/>
<cell type="label" labelfor="2" label="Taxon Tree Definition"/>
<cell type="field" id="2" name="taxontreedef" uitype="querycbx" isrequired="true"/>
</row>
</rows>
</viewdef> |
closed in favor of #5258 |
Describe the bug
The name field in a CollectionObjectType form defaults to the picklist created in #5170 instead of a text field
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The field needs to be a text field so users can add a new CollectionObjectType
Screenshots
The text was updated successfully, but these errors were encountered: