Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Remove survey link. (#3902) (#4386)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba authored and jaredhirsch committed Apr 30, 2018
1 parent 3cf8d27 commit ff038d2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 116 deletions.
37 changes: 0 additions & 37 deletions server/src/pages/shot/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ const { shotGaFieldForValue } = require("../../ab-tests.js");
// This represents the model we are rendering:
let model;

const SURVEY_EXPIRATION = new Date("2018-01-15");

function shouldHighlightEditIcon(model) {
if (!model.isOwner) {
return false;
Expand All @@ -22,40 +20,6 @@ function shouldHighlightEditIcon(model) {
return !hasSeen;
}

function shouldShowSurveyLink(model) {
if ((new Date()) > SURVEY_EXPIRATION) {
return false;
}
if (!model.isOwner) {
return false;
}
let foundEnglish = false;
// model.userLocales always contains some form of English because it's a server
// fallback. But navigator.languages does not have a fallback (except what the
// user indicates in their browser preferences)
if (model.userLocales[0].startsWith("en")) {
foundEnglish = true;
}
for (const locale of navigator.languages) {
if (locale.startsWith("en")) {
foundEnglish = true;
}
}
if (!foundEnglish) {
return false;
}
const hasSeen = localStorage.hasSeenSurveyLink;
if (!hasSeen) {
localStorage.hasSeenSurveyLink = "1";
}
return !hasSeen;
}

exports.closeSurveyLink = function() {
model.showSurveyLink = false;
render();
};

exports.launch = function(data) {
const firstSet = !model;
model = data;
Expand Down Expand Up @@ -92,7 +56,6 @@ exports.launch = function(data) {
}
}
}
model.showSurveyLink = shouldShowSurveyLink(model);
model.highlightEditButton = shouldHighlightEditIcon(model);
if (firstSet) {
refreshHash();
Expand Down
10 changes: 0 additions & 10 deletions server/src/pages/shot/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ class Body extends React.Component {
<section className="clips">
{ this.props.isOwner && this.props.loginFailed ? <LoginFailedWarning /> : null }
{ errorMessages }
{ this.props.showSurveyLink ? this.renderSurveyLink() : null }
{ clips }
</section>
<Footer forUrl={ shot.viewUrl } {...this.props} />
Expand All @@ -460,15 +459,6 @@ class Body extends React.Component {
this.editButton.style.backgroundColor = "transparent";
}

renderSurveyLink() {
return <div className="clips-message">
<div className="clip-message-content">Help us choose which features to add next by taking this <a href="https://qsurvey.mozilla.com/s3/ss-max-diff-q4-2017" target="_blank" rel="noopener noreferrer">quick survey</a>.</div>
<div className="clip-message-dismiss-wrapper" onClick={controller.closeSurveyLink}>
<div className="clip-message-dismiss" />
</div>
</div>;
}

renderFirefoxRequired() {
return <div className="highlight-color-scheme alt-notification">
<div>
Expand Down
69 changes: 0 additions & 69 deletions static/css/frame.scss
Original file line number Diff line number Diff line change
Expand Up @@ -262,75 +262,6 @@
font-size: 12px;
}

.clips-message {
@include flex-container(row, space-around, center);
animation: clip-message-appear 6s ease-in-out forwards;
animation-delay: 750ms;
background: linear-gradient($white 0%, #f9f9fa 100%);
border-radius: 3px;
box-shadow: 0 5px 11px rgba(0, 0, 0, 0.2);
box-sizing: border-box;
padding: 10px 10px 10px 20px;
position: absolute;
right: 16px;
top: 16px;
height: 72px;
width: 310px;
opacity: 0;
}

.clip-message-content {
color: $black;
font-size: 15px;
line-height: 1.3rem;
padding-right: 5px;

a {
color: $link-blue;
font-weight: bold;
}
}

.clip-message-dismiss-wrapper {
@include flex-container(row, flex-start, flex-start);
flex: 0 0 16px;
height: 100%;
}

.clip-message-dismiss {
background-image: url("/static/img/close-16.svg");
height: 16px;
width: 16px;
cursor: pointer;
}

@keyframes clip-message-appear {
0% {
opacity: 0;
transform: translateY(20px);
}

5% {
transform: translateY(20px);
opacity: 0;
}

10% {
transform: translateY(-2px);
opacity: 1;
}

15% {
transform: translateY(0);
opacity: 1;
}

100% {
transform: translateY(0);
opacity: 1;
}
}

.clip-container {
@include flex-container(row, center, center);
flex: 0 auto;
Expand Down

0 comments on commit ff038d2

Please sign in to comment.