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

Toogle for public preview of email #6679

Merged
merged 3 commits into from Nov 7, 2018

Conversation

Projects
3 participants
@kuzmany
Copy link
Contributor

kuzmany commented Oct 4, 2018

Please be sure you are submitting this against the staging branch.

Q A
Bug fix?
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs) #6668
BC breaks?
Deprecations?

Description:

This PR added option to enable/disable public view of email preview.
New decent toggle option added before public link.

image

Also this update allow developers use this toggle button anywhere for any boolean type:

Steps to test this PR:

  1. Create published email
  2. Copy preview link and open it in another/incognito brower
  3. Should see preview of email
  4. Go to detail page of email and disable toggle before preview link
    image
  5. Copy preview link and open it in another/incognito brower
  6. Should see access denied page

@kuzmany kuzmany added this to the 2.15.0 milestone Oct 4, 2018

kuzmany added some commits Oct 4, 2018

Rename toogle to toggle
Setup default to 1

@kuzmany kuzmany added Ready To Test and removed WIP labels Oct 4, 2018

@npracht

This comment has been minimized.

Copy link
Member

npracht commented Oct 5, 2018

Hi @kuzmany could we keep the link working for the logged in people ?

@kuzmany

This comment has been minimized.

Copy link
Contributor Author

kuzmany commented Oct 5, 2018

@npracht works in that way

@npracht

This comment has been minimized.

Copy link
Member

npracht commented Oct 5, 2018

@Woeler

Woeler approved these changes Oct 15, 2018

Copy link
Member

Woeler left a comment

I have tested this and it works. However, I would suggest one small change. Currently it throws a 403 forbidden if you access the non-public email unauthenticated. However, a 403 in general should be thrown when a user is authenticated, but not allowed to view or perform any action on the given resource. This is not the case. A 401 Unauthorized would make more sense here.

Other than that, works perfectly.

@kuzmany

This comment has been minimized.

Copy link
Contributor Author

kuzmany commented Oct 15, 2018

@Woeler It use accessDenied();

Mautic use it everywhere I think It's legit for this case.

@npracht npracht added this to To do in Testing 2.15.0 Oct 16, 2018

@npracht
Copy link
Member

npracht left a comment

👍

@npracht npracht moved this from To do to Ready to commit in Testing 2.15.0 Oct 31, 2018

@Woeler Woeler removed the Ready To Commit label Nov 7, 2018

@Woeler Woeler merged commit 635f91a into mautic:staging Nov 7, 2018

2 checks passed

Scrutinizer Analysis: 6 updated code elements – Tests: passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

Testing 2.15.0 automation moved this from Ready to commit to Merged Nov 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.