Skip to content

Commit

Permalink
feat(policy): show policy only when tracking
Browse files Browse the repository at this point in the history
Show policy only when tracking active.
  • Loading branch information
Bill Stavroulakis committed May 3, 2018
1 parent af16b40 commit 1a27da9
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 22 deletions.
15 changes: 14 additions & 1 deletion plugins/tracking/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ const SDK = require("./SDK").getSDK();
const segmentScript = `!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error('Segment snippet included twice.');else{analytics.invoked=!0;analytics.methods=['trackSubmit','trackClick','trackLink','trackForm','pageview','identify','group','track','ready','alias','page','once','off','on'];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement('script');e.type="text/javascript";e.async=!0;e.src=('https:'===document.location.protocol?'https://':'http://')+'cdn.segment.com/analytics.js/v1/'+t+'/analytics.min.js';var n=document.getElementsByTagName('script')[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1";analytics.load("${Config.analyticsKey}");}}();`;

module.exports = {
filters: ["pluginsLoadedCheck", "userFormModalFooter"],
filters: [
"pluginsLoadedCheck",
"userFormModalFooter",
"userLoginPolicy",
"userAddPolicy"
],

actions: [
"pluginsConfigured",
Expand Down Expand Up @@ -100,5 +105,13 @@ module.exports = {

userFormModalFooter() {
return null;
},

userLoginPolicy() {
return null;
},

userAddPolicy() {
return null;
}
};
25 changes: 14 additions & 11 deletions src/js/components/modals/UserFormModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,20 @@ class UserFormModal extends mixin(StoreMixin) {
getFooter() {
return (
<div>
<p className="form-control-feedback">
By adding a user you understand we will process personal information in accordance with our
{" "}
<a
className="reset-color"
href="https://mesosphere.com/privacy/"
target="_blank"
>
Privacy Policy
</a>.
</p>
{Hooks.applyFilter(
"userAddPolicy",
<p className="form-control-feedback">
By adding a user you understand we will process personal information in accordance with our
{" "}
<a
className="reset-color"
href="https://mesosphere.com/privacy/"
target="_blank"
>
Privacy Policy
</a>.
</p>
)}
{Hooks.applyFilter(
"userFormModalFooter",
<p className="form-group-without-top-label flush-bottom text-align-center">
Expand Down
10 changes: 5 additions & 5 deletions src/styles/components/modal/login/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
}

.login-modal-product-name {
bottom: @login-modal-product-name-vertical-offset;
left: 50%;
position: absolute;
top: @login-modal-product-name-vertical-offset;
transform: translateX(-50%);
width: 100%;
}
Expand Down Expand Up @@ -86,7 +86,7 @@
}

.login-modal-product-name {
bottom: @login-modal-product-name-vertical-offset-screen-small;
top: @login-modal-product-name-vertical-offset-screen-small;
}
}
}
Expand All @@ -113,7 +113,7 @@
}

.login-modal-product-name {
bottom: @login-modal-product-name-vertical-offset-screen-medium;
top: @login-modal-product-name-vertical-offset-screen-medium;
}
}
}
Expand All @@ -140,7 +140,7 @@
}

.login-modal-product-name {
bottom: @login-modal-product-name-vertical-offset-screen-large;
top: @login-modal-product-name-vertical-offset-screen-large;
}
}
}
Expand All @@ -167,7 +167,7 @@
}

.login-modal-product-name {
bottom: @login-modal-product-name-vertical-offset-screen-jumbo;
top: @login-modal-product-name-vertical-offset-screen-jumbo;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/styles/components/modal/login/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
* Login Modal Product Name
*/

@login-modal-product-name-vertical-offset: -((4 * @base-spacing-unit));
@login-modal-product-name-vertical-offset-screen-small: -((4 * @base-spacing-unit-screen-small));
@login-modal-product-name-vertical-offset-screen-medium: -((4 * @base-spacing-unit-screen-medium));
@login-modal-product-name-vertical-offset-screen-large: -((4 * @base-spacing-unit-screen-large));
@login-modal-product-name-vertical-offset-screen-jumbo: -((4 * 0.75 * @base-spacing-unit-screen-jumbo));
@login-modal-product-name-vertical-offset: ((3 * @base-spacing-unit)) + @base-spacing-unit / 2;
@login-modal-product-name-vertical-offset-screen-small: ((3 * @base-spacing-unit)) + @base-spacing-unit / 2;
@login-modal-product-name-vertical-offset-screen-medium: ((3 * @base-spacing-unit)) + @base-spacing-unit / 2;
@login-modal-product-name-vertical-offset-screen-large: ((3 * @base-spacing-unit)) + @base-spacing-unit / 2;
@login-modal-product-name-vertical-offset-screen-jumbo: ((3 * @base-spacing-unit)) + @base-spacing-unit / 2;

0 comments on commit 1a27da9

Please sign in to comment.