From e6943e8e71f2ba45d359ec44ee1b41f9f9d0b24f Mon Sep 17 00:00:00 2001 From: Paulo Jorge Reis Date: Mon, 8 Apr 2019 11:00:36 +0100 Subject: [PATCH] Merge pull request #1667 from sharelatex/pr-add-post-integration-survey-link Add survey link in the projects list sidebar. GitOrigin-RevId: 085f969336e81d546c51043c3ab9dc63585f97fb --- services/web/app/views/project/list.pug | 18 ++++++++ .../src/main/project-list/project-list.js | 30 +++++++++++++ .../stylesheets/app/sidebar-v2-dash-pane.less | 44 +++++++++++++++++++ .../public/stylesheets/core/ol-variables.less | 1 + 4 files changed, 93 insertions(+) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index 947b703fa4..ce38e5bb0e 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -87,6 +87,24 @@ block content aside.project-list-sidebar include ./list/side-bar + .project-list-sidebar-survey( + ng-if="shouldShowSurveyLink" + ) + | Let us know what you think about the new Overleaf by + a.project-list-sidebar-survey-link( + href="https://digitalscienceta.qualtrics.com/jfe/form/SV_3sMm9UAnx7ptpjL?source=dashboard" + target="_blank" + rel="noreferrer noopener" + ) taking our survey + | . + button.project-list-sidebar-survey-dismiss( + type="button" + title="Dismiss survey notice" + ng-click="dismissSurvey()" + ) + span( + aria-hidden="true" + ) × if hasFeature('v1-return-message') .project-list-sidebar-v2-pane(ng-controller="OverleafV1NotificationController") div diff --git a/services/web/public/src/main/project-list/project-list.js b/services/web/public/src/main/project-list/project-list.js index a781afdadc..91e9fa947d 100644 --- a/services/web/public/src/main/project-list/project-list.js +++ b/services/web/public/src/main/project-list/project-list.js @@ -34,6 +34,36 @@ define(['base'], function(App) { $scope.nUntagged = 0 $scope.reverse = true $scope.searchText = { value: '' } + $scope.shouldShowSurveyLink = false + + const surveyStartDate = new Date(2019, 3, 2) + + if ( + localStorage('dismissed-survey') === true || + new Date() < surveyStartDate + ) { + $scope.shouldShowSurveyLink = false + } else { + const _v2LaunchDate = new Date(2019, 0, 8) + let _nRecentProjects = 0 + + for (let project of $scope.projects) { + if ( + project.accessLevel === 'owner' && + new Date(project.lastUpdated) > _v2LaunchDate + ) { + if (++_nRecentProjects > 1) { + $scope.shouldShowSurveyLink = true + break + } + } + } + } + + $scope.dismissSurvey = () => { + localStorage('dismissed-survey', true) + $scope.shouldShowSurveyLink = false + } $timeout(() => recalculateProjectListHeight(), 10) diff --git a/services/web/public/stylesheets/app/sidebar-v2-dash-pane.less b/services/web/public/stylesheets/app/sidebar-v2-dash-pane.less index 3379aba577..8a1f2ad6b4 100644 --- a/services/web/public/stylesheets/app/sidebar-v2-dash-pane.less +++ b/services/web/public/stylesheets/app/sidebar-v2-dash-pane.less @@ -12,6 +12,50 @@ padding-right: 15px; } +.project-list-sidebar-survey { + position: relative; + font-size: @font-size-small; + background-color: @v2-dash-pane-bg; + color: @v2-dash-pane-subdued-color; + padding: @folders-menu-item-v-padding 20px @folders-menu-item-v-padding @folders-menu-item-h-padding; + &::before { + content: ''; + display: block; + height: 15px; + background-image: linear-gradient(to top, rgba(0, 0, 0, 0.1), transparent); + position: absolute; + bottom: 100%; + width: 100%; + left: 0; + } +} + .project-list-sidebar-survey-link { + color: @v2-dash-pane-color; + font-weight: bold; + &:hover, + &:active, + &:focus { + text-decoration: none; + color: @v2-dash-pane-color; + } + } + + .project-list-sidebar-survey-dismiss { + .btn-inline-link; + position: absolute; + top: @folders-menu-item-v-padding; + right: @folders-menu-item-v-padding; + font-size: @font-size-base; + line-height: 1; + color: @v2-dash-pane-color; + &:hover, + &:active, + &:focus { + text-decoration: none; + color: @v2-dash-pane-color; + } + } + .project-list-sidebar-v2-pane { flex-grow: 0; flex-shrink: 0; diff --git a/services/web/public/stylesheets/core/ol-variables.less b/services/web/public/stylesheets/core/ol-variables.less index 4b2bb933b0..0188b14b80 100644 --- a/services/web/public/stylesheets/core/ol-variables.less +++ b/services/web/public/stylesheets/core/ol-variables.less @@ -172,6 +172,7 @@ @v2-dash-pane-bg : @ol-blue-gray-4; @v2-dash-pane-link-color : #FFF; @v2-dash-pane-color : #FFF; +@v2-dash-pane-subdued-color : @ol-blue-gray-2; @v2-dash-pane-toggle-color : #FFF; @v2-dash-pane-btn-bg : @ol-blue-gray-5; @v2-dash-pane-btn-hover-bg : @ol-blue-gray-6;