Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

dont’t call to get site settings outside of mergeProps #9475

Merged
merged 1 commit into from
Jun 30, 2017

Conversation

bridiver
Copy link
Collaborator

@bridiver bridiver commented Jun 14, 2017

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@bridiver bridiver added this to the 0.18.x (Developer Channel) milestone Jun 14, 2017
@bridiver bridiver self-assigned this Jun 14, 2017
@diracdeltas
Copy link
Member

diracdeltas commented Jun 15, 2017

flash allow-once doesn't seem to work.

  1. go to http://homestarrunner.com/
  2. right click to allow flash once
  3. close the tab then go back to http://homestarrunner.com/
  4. flash is still allowed

same for noscript allow-once

@NejcZdovc
Copy link
Contributor

@bridiver can you please rebase? Is scenario by @diracdeltas fixed?

@bridiver
Copy link
Collaborator Author

@NejcZdovc @diracdeltas updated to fix that issue

appActions.noScriptExceptionsAdded(origin,
noScriptExceptions.map(value => value === 0 ? false : value))
if (props.noScriptExceptions) {
appActions.noScriptExceptionsAdded(props.origin, this.props.noScriptExceptions.filter((value, host) => value !== 0 ? false : value))
Copy link
Member

@diracdeltas diracdeltas Jun 29, 2017

Choose a reason for hiding this comment

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

i think this line is wrong - the filter function should be a map function like in the original code

Copy link
Member

Choose a reason for hiding this comment

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

also i think it should be props.noScriptExceptions instead of this.props.noScriptExceptions

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

probably doesn't work because of that. I'll take a look

Copy link
Member

@diracdeltas diracdeltas left a comment

Choose a reason for hiding this comment

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

noscript 'allow once' still isn't working (scripts are allowed even after the tab is closed and re-opened)

appActions.noScriptExceptionsAdded(origin,
noScriptExceptions.map(value => value === 0 ? false : value))
if (props.noScriptExceptions) {
appActions.noScriptExceptionsAdded(props.origin, props.noScriptExceptions.filter((value, host) => value !== 0 ? false : value))
Copy link
Member

@diracdeltas diracdeltas Jun 29, 2017

Choose a reason for hiding this comment

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

this should still be this.noScriptExceptions.map(value => value === 0 ? false : value)), see c5d2f7b

@bridiver
Copy link
Collaborator Author

should be good now

@diracdeltas
Copy link
Member

@bridiver did you see my comment above ^

@bridiver
Copy link
Collaborator Author

no, looks like I mixed it up on the rebase

@bridiver
Copy link
Collaborator Author

updated

appActions.noScriptExceptionsAdded(origin,
noScriptExceptions.map(value => value === 0 ? false : value))
if (props.noScriptExceptions) {
appActions.noScriptExceptionsAdded(props.origin, props.noScriptExceptions.filter((value, host) => value === 0 ? false : value))
Copy link
Member

Choose a reason for hiding this comment

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

this is still the incorrect version, it should be the version above using map not filter

@bridiver
Copy link
Collaborator Author

ok, this time I copy/pasted it so it better be right :)

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Do we need tests for this? At minimum, it looks like we might want a unit test for getVisibleOrigin

@bridiver
Copy link
Collaborator Author

test added for getVisibleOrigin, but otherwise it's a refactoring so should be covered by existing tests

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

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

Thanks for adding the test 😄 ++

@bsclifton bsclifton merged commit fd26195 into master Jun 30, 2017
@bsclifton bsclifton deleted the site-settings-merge-props branch June 30, 2017 18:45
bsclifton added a commit that referenced this pull request Jun 30, 2017
dont’t call to get site settings outside of mergeProps
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants