Skip to content

HTTPS UI switch #335

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

Merged
merged 7 commits into from
May 3, 2017
Merged

Conversation

andrewn
Copy link
Member

@andrewn andrewn commented Apr 5, 2017

UI switch for toggling HTTP/S (closes #170).

When logged in, shows an HTTPS checkbox that saves the flag to the API, toggles a page reload and redirection to the correct protocol. The correct protocol is also redirected to on sketch load.


Old PR content, left here for archive:

Work-in-progress UI switch for toggling HTTP/S (#170).

I've put a checkbox in as the UI for now until the feature is functional.

screenshot 2017-04-06 00 19 21

This updates the current project's serveStatic flag in the Redux store, but does not do any redirection yet.

I've hit a problem where redirection across domains/reloading the page will lose the state of the flag because the project will not have been saved so I've started work on #334.

Some possible approaches:

  1. Only allow logged in users to switch HTTP/S using this toggle, and auto-save the project when the serveSecure flag is toggled. This is probably simplest.

  2. Auto-save anonymous projects to the API so the flag can be stored in the backend. The projects would need to be linked to a user when they log in.

  3. Use something like cross-storage to persist the redux store across origins. But this means that all browser tabs using the Editor will have the same set of data. I feel like this could be confusing and a source of bugs?

They all sound quite complex and have different trade offs so would be good to get some feedback from @catarak.

@andrewn andrewn force-pushed the feature/https-ui-switch branch from 5122332 to 61d976c Compare April 5, 2017 23:09
@andrewn andrewn changed the title [WIP] HTTPS UI switch [Feedback] HTTPS UI switch Apr 6, 2017
@catarak
Copy link
Member

catarak commented Apr 12, 2017

I think 1 is good--I think we want to point users to log in, as having anonymous sketches led to a lot of confusion. I think it's okay to give people a stripped down version of the editor if they aren't logged in. A user can still reload the page in https if they really want to.

Also cc @lmccart @machinic for design input.

@lmccart
Copy link
Member

lmccart commented Apr 12, 2017

@catarak I agree, I think that sounds reasonable

@machinic
Copy link

My immediate feedback would be to increase the distance between the label for auto refresh and the checkbox for https — a full 20px separating them would be good. Currently, one could mistake that for a trailing checkbox rather than a leading one.

Ultimately, there will be a different location for the toggle in the upcoming design changes.

This doesn't yet persist or reload the page.
@andrewn andrewn force-pushed the feature/https-ui-switch branch 2 times, most recently from f0d93f3 to 75e3b2c Compare April 23, 2017 22:11
@andrewn andrewn force-pushed the feature/https-ui-switch branch from 75e3b2c to cf08f12 Compare April 25, 2017 21:26
@andrewn
Copy link
Member Author

andrewn commented Apr 25, 2017

Thanks for the feedback @machinic and @lmccart!

  • Spacing around HTTPS checkbox
  • Placeholder help icon button that launches modal
  • Modal and content explaining when you'd choose HTTPS/HTTP
  • Only shows checkbox when user is signed in
  • Selecting checkbox saves project and reloads page on correct protocol
  • Sketch page redirects to correct protocol on load
  • API now persists serveSecure to datastore on server

@catarak This is ready for review.

Checkbox and help icon:

screenshot 2017-04-25 23 26 21

Modal:

screenshot 2017-04-25 23 30 40

@andrewn andrewn changed the title [Feedback] HTTPS UI switch HTTPS UI switch Apr 25, 2017
padding: #{10 / $base-font-size}rem 0;

// Basic text styles for help body text
ul,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe put all of the tag styles in styles/base/_bass.scss? Remember we're not using CSS modules here so everything is ~ global ~

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought SASS would expand these rules to .help-modal__section ul to scope it to the HelpModal content? I wasn't sure we'd want to apply globally.

But I can totally move to _bass.scss if you prefer?

Copy link
Member

Choose a reason for hiding this comment

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

oops my bad, did not see that they were nested in .help-modal__section. this is for a different PR, but i think a lot of the overlay/modal styles could probably be cleaned up and made more generic 😄

@catarak
Copy link
Member

catarak commented Apr 27, 2017

i have only one comment but otherwise this is great and works great! v excited to use this feature in a workshop

@catarak catarak merged commit ae668f6 into processing:master May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch between http and https
4 participants