Skip to content

Conversation

@nainar
Copy link
Contributor

@nainar nainar commented Feb 4, 2018

Fixes #10919

Most of the template is copied from similar elements like <amp-facebpook-{like,comment}>

Note: Currently the file test-amp-facebook doesn't have tests for <amp-facebpook-{like,comment}> so I didn't add any for the new , let me know if I should change that.

Copy link
Contributor

@cvializ cvializ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey thanks! Just a few comments and questions.

Also could you please update your PR description to include the issue number for the bug that this resolve, along with any extra description? Consider writing details like your general approach, what you based your code on, or any areas to pay closer attention to. That can help reviewers do a better job and provide context.

this.iframe_ = null;

/** @private {string} */
this.dataLocale_ = element.getAttribute('data-locale');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should assign this.dataLocale_ as the result of a ternary or || expression instead of an if, so that you can annotate this.dataLocale_ as @const for more type safety

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the change here. However, I have written the same code in other files: amp-facebook{,-like,-comments}.js.

Do you mind if I make the change in a separate PR? Or would you like that done here. Happy either way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool, a separate PR would be ok

limitations under the License.
-->

# <a name="amp-facebook-like"></a> `amp-facebook-like`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this with amp-facebook-page

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -0,0 +1,93 @@
<!---
Copyright 2017 The AMP HTML Authors. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 2018

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done across all files

layout="fixed"
data-hide-cover="true"
data-href="https://www.facebook.com/testesmegadivertidos/">
</amp-facebook-like>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amp-facebook-page

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}
tags: { # <amp-facebook-page>
html_format: AMP
tag_name: "AMP-FACEBOOK-page"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should be all-caps AMP-FACEBOOK-PAGE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


Attribute hides cover photo in the header. `false` (cover photo displayed) by default.

##### data-face-pile (optional)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be data-show-face-pile to match 3p/facebook.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Done

3p/facebook.js Outdated
container.setAttribute('data-numposts', data.numposts || 10);
container.setAttribute('data-colorscheme', data.colorscheme || 'light');
container.setAttribute('data-width', '100%');
container.setAttribute('data-height', '100%');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line change intentional? It looks like it affects amp-facebook-comments where this PR is for the amp-facebook-page

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. That was unintentional. Didn't clean it up.

Copy link
Contributor

@honeybadgerdontcare honeybadgerdontcare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace 2017 with 2018 throughout files.

Copy link
Contributor Author

@nainar nainar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cvializ I have made the changes you asked to the files and to the PR description.

PTAL?

Thanks for reviewing!

3p/facebook.js Outdated
container.setAttribute('data-numposts', data.numposts || 10);
container.setAttribute('data-colorscheme', data.colorscheme || 'light');
container.setAttribute('data-width', '100%');
container.setAttribute('data-height', '100%');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. That was unintentional. Didn't clean it up.

@@ -0,0 +1,93 @@
<!---
Copyright 2017 The AMP HTML Authors. All Rights Reserved.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done across all files

limitations under the License.
-->

# <a name="amp-facebook-like"></a> `amp-facebook-like`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

layout="fixed"
data-hide-cover="true"
data-href="https://www.facebook.com/testesmegadivertidos/">
</amp-facebook-like>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


Attribute hides cover photo in the header. `false` (cover photo displayed) by default.

##### data-face-pile (optional)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Done

}
tags: { # <amp-facebook-page>
html_format: AMP
tag_name: "AMP-FACEBOOK-page"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

this.iframe_ = null;

/** @private {string} */
this.dataLocale_ = element.getAttribute('data-locale');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the change here. However, I have written the same code in other files: amp-facebook{,-like,-comments}.js.

Do you mind if I make the change in a separate PR? Or would you like that done here. Happy either way.

Copy link
Contributor

@cvializ cvializ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! I'm happy with the code, but it looks like you'll need to make some small changes to get the gulp lint to pass.

this.iframe_ = null;

/** @private {string} */
this.dataLocale_ = element.getAttribute('data-locale');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool, a separate PR would be ok

*/


import {getIframe, preloadBootstrap} from '../../../src/3p-frame';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's a linter error in Travis: https://travis-ci.org/ampproject/amphtml/jobs/337825128 You'll need to sort your import lines.

@aghassemi
Copy link
Contributor

Thanks @nainar! and @cvializ for the review. Everything looks great to me.

@nainar nainar force-pushed the amp_facebook_page branch from c66a1c8 to 32d2e9d Compare February 6, 2018 23:24
@nainar
Copy link
Contributor Author

nainar commented Feb 7, 2018

Hi @cvializ - thanks so much for the review! I have cleaned up the lint and validator issue.

Please merge the request?

@cvializ cvializ merged commit 9673d3f into ampproject:master Feb 7, 2018
powdercloud added a commit that referenced this pull request Feb 15, 2018
* Revision bump for #13261 - Add support for `<amp-facebook-page>`

* Add media query parsing class to CSS parser. This isn't wired up to the validator currently, but will be in a later CL.

* Use the recommended closure dependency management for JavaScript libraries.

* Add AMP4EMAIL rules.

* Remove stray console.log statments.

* Small tweaks to #13406

* Revision bump for #13381
protonate pushed a commit to protonate/amphtml that referenced this pull request Feb 26, 2018
* Remove spurious files

* cvializ@ suggested changes

* Fixed Travis CI failures
protonate pushed a commit to protonate/amphtml that referenced this pull request Feb 26, 2018
* Revision bump for ampproject#13261 - Add support for `<amp-facebook-page>`

* Add media query parsing class to CSS parser. This isn't wired up to the validator currently, but will be in a later CL.

* Use the recommended closure dependency management for JavaScript libraries.

* Add AMP4EMAIL rules.

* Remove stray console.log statments.

* Small tweaks to ampproject#13406

* Revision bump for ampproject#13381
RanAbram pushed a commit to RanAbram/amphtml that referenced this pull request Mar 12, 2018
* Remove spurious files

* cvializ@ suggested changes

* Fixed Travis CI failures
RanAbram pushed a commit to RanAbram/amphtml that referenced this pull request Mar 12, 2018
* Revision bump for ampproject#13261 - Add support for `<amp-facebook-page>`

* Add media query parsing class to CSS parser. This isn't wired up to the validator currently, but will be in a later CL.

* Use the recommended closure dependency management for JavaScript libraries.

* Add AMP4EMAIL rules.

* Remove stray console.log statments.

* Small tweaks to ampproject#13406

* Revision bump for ampproject#13381
protonate pushed a commit to protonate/amphtml that referenced this pull request Mar 15, 2018
* Remove spurious files

* cvializ@ suggested changes

* Fixed Travis CI failures
protonate pushed a commit to protonate/amphtml that referenced this pull request Mar 15, 2018
* Revision bump for ampproject#13261 - Add support for `<amp-facebook-page>`

* Add media query parsing class to CSS parser. This isn't wired up to the validator currently, but will be in a later CL.

* Use the recommended closure dependency management for JavaScript libraries.

* Add AMP4EMAIL rules.

* Remove stray console.log statments.

* Small tweaks to ampproject#13406

* Revision bump for ampproject#13381
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants