CRITFC / Helpdesk

Parent repository for tribal CDMS documentation and issues
1 stars 0 forks source link

Feature Enhancement: metadata to show 'required' for system fields #48

Closed cwatry closed 3 years ago

cwatry commented 3 years ago

When a dataset is created and assigned to a project, the metadata does not reflect that the ActivityDate and Location fields are 'required' for validation, even though they are required by default. The only way to currently fix the metadata is to update the individual project datasets to reflect this validation requirement. I request that the validation for these fields be automatically set to 'required' upon dataset creation/project assignment.

cwatry commented 3 years ago

Well, it appears there may be more to this than I realized. When I set validation to 'required' for the Location field, the field initially displays w/ a validation error in Data Entry app; however, selecting a Location from the list does not make the validation error go away and despite meeting validation for all other fields, the save button remains disabled. So, when Validation = 'Required' for the Location field, there is no way to clear the error to proceed with saving the record. Therefore, as it is now, validation for Location must be NULL in order for the Data Entry form to work properly. As a result, I don't know if it's possible for the metadata to reflect this requirement for Location without a more involved change to the underlying code. Thoughts?

nowinski commented 3 years ago

Issue 1 -- to automatically set validation rules for ActivityDate and Location when a new dataset is created and added to a project, I think you just need to add the rule to the appropriate rows in the Fields table. ActivtityDate and Location are both members of the ActivitySystemFields datastore. So, first look up the DatastoreId for ActivitySystemFields and then search the Fields table.

Issue 2 -- Location is handled a little differently than other header fields on the data entry page. I'll look into this and add any changes to the data entry page updates already in progress.

nowinski commented 3 years ago

Following up -- "Required" shows up on the Metadata page after adding "Required" to the Validation column in the Field table records for ActivityDate and Location but this creates issues on the data entry page as described above. It's not specific to the location field. Might apply to all system fields.