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

LIMS-867: Improve 'Add Lab Contact' page #877

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 17 additions & 0 deletions client/src/js/modules/contact/views/addcontact.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,24 @@ define(['views/form',
ad: 'textarea[name=ADDRESS]',
ci: 'input[name=CITY]',
pc: 'input[name=POSTCODE]',
lb: '.leaveblank',
},

events: {
'change @ui.pid': 'fillUserInfo',
'change @ui.country': 'onCountryChange',
},

onCountryChange: function() {
let country = this.ui.country.val()
if (
app.options.get('facility_courier_countries').indexOf(country) > -1 ||
app.options.get('facility_courier_countries_nde').indexOf(country) > -1
) {
this.ui.lb.html('<br />Academic users from '+country+' can leave this blank to use the facility courier.')
} else {
this.ui.lb.html('')
}
},

fillUserInfo: function() {
Expand Down Expand Up @@ -65,7 +79,10 @@ define(['views/form',
Promise.all([this.countries.fetch(), this.users.fetch()]).then(() => {
this.populateCountries();
this.populateUsers();
this.onCountryChange();
})
this.ui.ad.css('height', '100px')
this.ui.ad.css('width', '50%')
},

populateCountries: function() {
Expand Down
11 changes: 7 additions & 4 deletions client/src/js/templates/contact/contactadd.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1>Add New Home Lab Contact</h1>

<li>
<label>Card Name
<span class="small">Name for the Contact Card</span>
<span class="small">Choose a name you will recognise from a list</span>
</label>
<input type="text" name="CARDNAME" />
</li>
Expand All @@ -37,7 +37,9 @@ <h1>Add New Home Lab Contact</h1>
</li>

<li>
<label>Telephone Number</label>
<label>Telephone Number
<span class="small">You can add more than one number separated by a space</span>
</label>
<input type="text" name="PHONENUMBER" />
</li>

Expand All @@ -58,7 +60,7 @@ <h1>Add New Home Lab Contact</h1>

<li>
<label>Street Address
<span class="small">Address for courier <br/>Exclude post code and city</span>
<span class="small">Pickup/delivery address for couriers <br/>Exclude city and postcode <br />Max 3 lines</span>
</label>
<textarea name="ADDRESS"></textarea>
</li>
Expand All @@ -80,7 +82,8 @@ <h1>Add New Home Lab Contact</h1>

<li class="head">
<label>Dewar Return Details
<span class="small">The following information is used for each shipment associated with this contact</span>
<span class="small">The following information is used for each shipment associated with this contact.
<span class="leaveblank"></span></span>
</label>
</li>

Expand Down
Loading