-
Notifications
You must be signed in to change notification settings - Fork 615
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
CRO-97: Storefront admin bar #997
Conversation
a02d8e1
to
fd93157
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 @adambilsing can you add a line to the changelog file with a brief description before merging it?
$('body').addClass('hasAdminBar'); | ||
$('body').prepend($element); | ||
|
||
$('.adminBar-content a').click(attachThemeEditorParams); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code doesn't belong in the theme. If you need to run code in the theme-editor iframe added to https://github.com/bigcommerce-labs/stencil-preview-sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the record: this JS needs to be run in the Cornerstone theme when it's not rendered in the iframe of stencil-editor
f752057
to
6e29fb6
Compare
478c4e7
to
40fdb3b
Compare
@mcampa @bigcommerce/stencil-team @bigcommerce/cp-dt can we get a review on this again, thanks :) |
CHANGELOG.md
Outdated
@@ -11,6 +11,7 @@ | |||
- Update bigcommerce.com footer link [#990](https://github.com/bigcommerce/cornerstone/pull/990) | |||
- Fix invalid icon HTML in AMP templates [#989](https://github.com/bigcommerce/cornerstone/pull/989) | |||
- Add new theme editor setting for SSL common name to enable GeoTrust badge to work properly [#994](https://github.com/bigcommerce/cornerstone/pull/994) | |||
- Add storefront admin bar to replace store not launched preview panel [#997](https://github.com/bigcommerce/cornerstone/pull/997) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should go up in the draft section, like this:
## Draft
- Add storefront admin bar to replace store not launched preview panel [#997](https://github.com/bigcommerce/cornerstone/pull/997)
## 1.7.0 (2017-04-26)
|
||
if (!(header && notice)) { | ||
// Return if header & notice is null or if securePath is not defined (means inside theme editor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition does not mean is in theme-editor. Yo'll have to check if is inside an iframe
http://stackoverflow.com/a/326076/1526448
|
||
$element.html(`<p class="maintenanceNotice-header">${header}</p>${notice}`); | ||
const url = encodeURIComponent(window.location.pathname + window.location.search); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm... i think window.location.pathname
might not be supported in IE: https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname
@@ -7,17 +7,43 @@ import $ from 'jquery'; | |||
export default function (maintenanceMode = {}) { | |||
const header = maintenanceMode.header; | |||
const notice = maintenanceMode.notice; | |||
const password = maintenanceMode.password; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm confused - what's to stop a user from putting a breakpoint to see the preview code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this only be populated if the store owner/admin is logged in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @mjschock
You are injecting the password here https://github.com/bigcommerce/bigcommerce/pull/18694/files#diff-3491c3f0657689614b41beb712cb7681R114
And that is injected in the theme even if the user is not a store admin
@@ -7,17 +7,43 @@ import $ from 'jquery'; | |||
export default function (maintenanceMode = {}) { | |||
const header = maintenanceMode.header; | |||
const notice = maintenanceMode.notice; | |||
const password = maintenanceMode.password; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @mjschock
You are injecting the password here https://github.com/bigcommerce/bigcommerce/pull/18694/files#diff-3491c3f0657689614b41beb712cb7681R114
And that is injected in the theme even if the user is not a store admin
💚 |
can we please squash the commits on this one. |
@@ -7,17 +7,44 @@ import $ from 'jquery'; | |||
export default function (maintenanceMode = {}) { | |||
const header = maintenanceMode.header; | |||
const notice = maintenanceMode.notice; | |||
const password = maintenanceMode.password || false; | |||
const isInIframe = window.location !== window.parent.location; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to put this into a try/catch
or it will throw an error in IE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c5a2f9c
to
ba168fc
Compare
@@ -32,7 +32,7 @@ export default class Cart extends PageManager { | |||
// Does not quality for min/max quantity | |||
if (newQty < minQty) { | |||
return alert(minError); | |||
} else if (newQty > maxQty) { | |||
} else if (maxQty > 0 && newQty > maxQty) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got rolled into the squash.
What?
Removing the Prelaunch yellow box and replacing it with an admin bar.
Tickets / Documentation
https://jira.bigcommerce.com/browse/CRO-97
https://github.com/bigcommerce/bigcommerce/pull/18545
Screenshots (if appropriate)
Testing / Proof
https://launchbay.bigcommerce.net/projects/1/releases/31881
@bigcommerce/cp-dt @wendy @bc-kentaro @jordanwink201