Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #19863 from jmcanterafonseca/restore_organization
Browse files Browse the repository at this point in the history
Bug 1018851 - Facebook Contacts edit mode is not consistent nor correctly implemented according to the Visual Refresh specs
  • Loading branch information
jmcanterafonseca committed Jun 4, 2014
2 parents e157f80 + 592ea0a commit 512bfcb
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 36 deletions.
10 changes: 6 additions & 4 deletions apps/communications/contacts/elements/form.html
Expand Up @@ -120,10 +120,12 @@ <h1 id='contact-form-title' data-l10n-id="addContact">Add contact</h1>
<button type="reset">Clear</button>
</p>
</div>
<p class="fillflow-row">
<input placeholder="Company Name" data-l10n-id="org" name="org" class="textfield" type="text" x-inputmode="latin-prose" value="" id="org">
<button type="reset">Clear</button>
</p>
<div>
<p class="fillflow-row">
<input placeholder="Company Name" data-l10n-id="org" name="org" class="textfield" type="text" x-inputmode="latin-prose" value="" id="org">
<button type="reset">Clear</button>
</p>
</div>
</section>

<ul>
Expand Down
1 change: 1 addition & 0 deletions apps/communications/contacts/js/views/form.js
Expand Up @@ -1109,6 +1109,7 @@ contacts.Form = (function() {
var removedFields = dom.querySelectorAll('.removed');
for (var i = 0; i < removedFields.length; i++) {
removedFields[i].classList.remove(REMOVED_CLASS);
removedFields[i].classList.remove(FB_CLASS);
}
thumbAction.classList.remove('with-photo');
var removeButton = thumbAction.querySelector('button');
Expand Down
22 changes: 0 additions & 22 deletions apps/communications/contacts/style/contacts.css
Expand Up @@ -220,28 +220,6 @@ section[role="region"] > header:first-child .icon.icon-edit-contact {
width: calc(100% - 5rem);
}

/* FB info (non-editable) */
.view-edit-contact .facebook fieldset legend,
.view-edit-contact .facebook fieldset input[type="date"] {
width: 100%;
border-color: #acbee4;
color: #8d9abb;
background-image: url(fb/dialog.svg);
}

.view-edit-contact .facebook input {
border-color: #acbee4;
color: #8d9abb;
}

.view-edit-contact .facebook span {
color: #8d9abb;
}

.view-edit-contact .facebook input[value=""] {
display: none;
}

hr {
background-color: #BCBCBC;
border: 0;
Expand Down
26 changes: 17 additions & 9 deletions apps/communications/contacts/style/fb_extensions.css
Expand Up @@ -20,19 +20,26 @@
visibility: hidden;
}

.facebook.removed dl,
p.facebook.removed input {
background-color: rgba(59, 82, 152, 0.2);
border: 1px solid #3b5998;
/* FB info (non-editable) */
.view-edit-contact .facebook fieldset legend,
.view-edit-contact .facebook fieldset input[type="date"] {
width: 100%;
border-color: #acbee4;
color: #8d9abb;
background-image: url(fb/dialog.svg);
}

.facebook.removed dl dd p:last-child {
border-bottom: none;
.view-edit-contact .facebook input {
border-color: #acbee4;
color: #8d9abb;
}

.facebook.removed dl dd p {
border-bottom: 1px solid #3b5998;
border-left: 1px solid #3b5998;
.view-edit-contact .facebook span {
color: #8d9abb;
}

.view-edit-contact .facebook fieldset input[value=""] {
display: none;
}

.with-photo.removed.facebook img {
Expand All @@ -48,6 +55,7 @@ p.facebook.removed input {
right: 0
}


#settingsFb li p {
margin-left: 0;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/communications/contacts/test/unit/mock_fb.js
Expand Up @@ -205,7 +205,8 @@ Mockfb.Contact = function(devContact, mozCid) {
'test@test.com': true,
'Palencia': true,
'Castilla y León': true,
'España': true
'España': true,
'Test ORG': true
};
this.result[1][date] = true;

Expand Down
15 changes: 15 additions & 0 deletions apps/communications/contacts/test/unit/views/form_test.js
Expand Up @@ -498,6 +498,21 @@ suite('Render contact form', function() {
};
});

test('FB Contact. organization from Facebook', function() {
window.fb.setIsFbContact(true);

var deviceContact = new MockContactAllFields();
var fbContact = new Mockfb.Contact(deviceContact);
fbContact.getDataAndValues().onsuccess = function() {
subject.render(deviceContact, null, this.result);

var org = document.querySelector('input[name="org"]');

assert.isTrue(org.parentNode.classList.contains('facebook'));
assert.isTrue(org.parentNode.classList.contains('removed'));
};
});

test('FB Contact. Birthday from Facebook', function() {
window.fb.setIsFbContact(true);

Expand Down

0 comments on commit 512bfcb

Please sign in to comment.