Skip to content
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

Improve contact parsing in the EmlImportService and added tests #260

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add organizationName, positionName, and userId fields to Contacts
  • Loading branch information
vjrj committed Jan 27, 2025
commit 42ae4ea693da7d25d338699373653b4c56440c40
6 changes: 6 additions & 0 deletions grails-app/domain/au/org/ala/collectory/Contact.groovy
Original file line number Diff line number Diff line change
@@ -14,6 +14,9 @@ class Contact implements Serializable {
String mobile
String email
String fax
String organizationName
String positionName
String userId
String notes
boolean publish = true // controls whether the contact is listed on web site

@@ -31,6 +34,9 @@ class Contact implements Serializable {
mobile(nullable: true, maxSize:45)
email(nullable: true, maxSize:128, email: true)
fax(nullable: true, maxSize:45)
organizationName(nullable: true, maxSize: 255)
positionName(nullable: true, maxSize: 255)
userId(nullable: true, maxSize: 255)
notes(nullable: true, maxSize: 1024)
publish()
userLastModified(maxSize:256)
33 changes: 33 additions & 0 deletions grails-app/migrations/changelog.xml
Original file line number Diff line number Diff line change
@@ -460,4 +460,37 @@ liquibase.command.referencePassword: XXXXX
</addColumn>
</changeSet>

<changeSet author="vjrj" id="20250127-01">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="contact" columnName="organization_name" />
</not>
</preConditions>
<addColumn tableName="contact">
<column name="organization_name" type="VARCHAR(255)"/>
</addColumn>
</changeSet>

<changeSet author="vjrj" id="20250127-02">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="contact" columnName="position_name" />
</not>
</preConditions>
<addColumn tableName="contact">
<column name="position_name" type="VARCHAR(255)"/>
</addColumn>
</changeSet>

<changeSet author="vjrj" id="20250127-03">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="contact" columnName="user_id" />
</not>
</preConditions>
<addColumn tableName="contact">
<column name="user_id" type="VARCHAR(255)"/>
</addColumn>
</changeSet>

</databaseChangeLog>
3 changes: 3 additions & 0 deletions grails-app/views/public/_contacts.gsp
Original file line number Diff line number Diff line change
@@ -6,8 +6,11 @@
<p>
<span class="contactName">${cf?.contact?.buildName()}</span><br/>
<g:if test="${cf?.role}">${cf?.role}<br/></g:if>
<g:if test="${cf?.contact?.positionName}">${cf?.contact?.positionName}<br/></g:if>
<g:if test="${cf?.contact?.organizationName}">${cf?.contact?.organizationName}<br/></g:if>
<g:if test="${cf?.contact?.phone}"><g:message code="public.show.contacts.phone" default="phone"/> : ${cf?.contact?.phone}<br/></g:if>
<g:if test="${cf?.contact?.fax}"><g:message code="public.show.contacts.phone" default="phone"/>: ${cf?.contact?.fax}<br/></g:if>
<g:if test="${cf?.contact?.userId}">id: <a href="${cf?.contact?.userId}" class="user_id_link" target="_blank">${cf?.userId}</a><br/></g:if>
<cl:emailLink email="${cf?.contact?.email}"><g:message code="public.show.contacts.email" default="email this contact"/> </cl:emailLink>
</p>
</div>