From 45bf78519c7cb5f18dc7f443b4a952d2ac8dfe1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abd=C3=B3n=20Rodr=C3=ADguez=20Davila?= Date: Wed, 20 Mar 2019 00:02:05 +0100 Subject: [PATCH 1/4] Added comment to improve linting of generated service files --- .../strapi-generate-api/templates/mongoose/service.template | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/strapi-generate-api/templates/mongoose/service.template b/packages/strapi-generate-api/templates/mongoose/service.template index f5de552e9d..79ce8a3239 100644 --- a/packages/strapi-generate-api/templates/mongoose/service.template +++ b/packages/strapi-generate-api/templates/mongoose/service.template @@ -1,5 +1,7 @@ 'use strict'; +/* global <%= globalID %> */ + /** * <%= filename %> service * From c41e114b23ab1899aefefb921e65679f3c22ecfc Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Thu, 21 Mar 2019 08:59:24 +0100 Subject: [PATCH 2/4] Run snyk only on non fork repo and run --build on setup --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a43fce016..9c9ec2cb9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,10 +32,14 @@ install: jobs: include: - stage: test - name: 'Lint / Snyk / Unit Tests ' + name: Snyk + script: npm run -s test:snyk + if: fork = false + + - stage: test + name: 'Lint / Unit Tests ' script: - npm run -s lint - - npm run -s test:snyk - npm run -s test:unit - <<: *e2e_tests From f327143ec75fc14b76aae2f2b11475d9aa0418f1 Mon Sep 17 00:00:00 2001 From: soupette Date: Tue, 26 Mar 2019 20:54:16 +0100 Subject: [PATCH 3/4] Fixes #3000 --- .../admin/src/containers/Onboarding/index.js | 58 +++++++++++++------ .../src/containers/Onboarding/styles.scss | 2 +- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/packages/strapi-admin/admin/src/containers/Onboarding/index.js b/packages/strapi-admin/admin/src/containers/Onboarding/index.js index c6978797cb..905f0a40f6 100644 --- a/packages/strapi-admin/admin/src/containers/Onboarding/index.js +++ b/packages/strapi-admin/admin/src/containers/Onboarding/index.js @@ -15,7 +15,14 @@ import injectReducer from 'utils/injectReducer'; import OnboardingVideo from 'components/OnboardingVideo'; -import { getVideos, onClick, removeVideos, setVideoDuration, setVideoEnd, updateVideoStartTime } from './actions'; +import { + getVideos, + onClick, + removeVideos, + setVideoDuration, + setVideoEnd, + updateVideoStartTime, +} from './actions'; import makeSelectOnboarding from './selectors'; import reducer from './reducer'; import saga from './saga'; @@ -43,17 +50,17 @@ export class Onboarding extends React.Component { setVideoEnd = () => { this.setVideoEnd(); - } - + }; + didPlayVideo = (index, currTime) => { const eventName = `didPlay${index}GetStartedVideo`; - this.context.emitEvent(eventName, {timestamp: currTime}); - } + this.context.emitEvent(eventName, { timestamp: currTime }); + }; didStopVideo = (index, currTime) => { const eventName = `didStop${index}Video`; - this.context.emitEvent(eventName, {timestamp: currTime}); - } + this.context.emitEvent(eventName, { timestamp: currTime }); + }; handleOpenModal = () => this.setState({ showVideos: true }); @@ -67,10 +74,9 @@ export class Onboarding extends React.Component { }; updateCurrentTime = (index, current, duration) => { - this.props.updateVideoStartTime(index, current); - const percent = current * 100 / duration; + const percent = (current * 100) / duration; const video = this.props.videos[index]; if (percent >= 80) { @@ -80,21 +86,35 @@ export class Onboarding extends React.Component { } }; - updateEnd = (index) => { + updateEnd = index => { this.props.setVideoEnd(index, true); }; // eslint-disable-line jsx-handler-names render() { const { videos, onClick, setVideoDuration } = this.props; + const { showVideos } = this.state; + + const style = showVideos ? {} : { maxWidth: 0 }; return ( -
0 ? styles.visible : styles.hidden)}> -
+
0 ? styles.visible : styles.hidden)} + > +
-

+

+ +

{videos.length && ( -

{Math.floor((videos.filter(v => v.end).length)*100/videos.length)}

+

+ {Math.floor((videos.filter(v => v.end).length * 100) / videos.length)} + +

)}
    @@ -116,10 +136,7 @@ export class Onboarding extends React.Component {
-