Merge branch 'master' into feature/deep-filtering-mongoose-bookshelf

This commit is contained in:
Jim LAURIE 2019-04-03 15:35:36 +02:00 committed by GitHub
commit d19cbbacf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 23 deletions

View File

@ -1,3 +1,10 @@
> ⚠️ We have stopped merging PRs for now to the Strapi core.<br><br>
> The reason is that we are developing new architecture for the admin panel and for the plugins.<br>
> This new architecture will provide stability of the Strapi core as we approach the release of Beta.<br>
> We appreciate and welcome all your contributions, but until further notice, please do not submit a PR as it will not be merged.<br>
> Furthermore, you will have to rewrite it based on the new architecture.
<!-- ⚠️ Your PR title will appear in the changelogs please make it short detailed and understandable for all. -->
<!-- Write a short description of what your PR does and link the concerned issues of your update. -->

View File

@ -39,10 +39,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

View File

@ -1,5 +1,11 @@
# Contribute to Strapi
> ⚠️ We have stopped merging PRs for now to the Strapi core.<br><br>
> The reason is that we are developing new architecture for the admin panel and for the plugins.<br>
> This new architecture will provide stability of the Strapi core as we approach the release of Beta.<br>
> We appreciate and welcome all your contributions, but until further notice, please do not submit a PR as it will not be merged.<br>
> Furthermore, you will have to rewrite it based on the new architecture.
First off, thanks for taking the time to contribute! 🎉👍
The following is a set of guidelines for contributing to Strapi and its packages.
@ -206,7 +212,7 @@ Then run
# generate the test app
$ node test/createTestApp.js
# run the testApp in the background (️️️⚠️ be carefull to kill the process after the tests have run)
$ node test/startTestApp.js &
$ node test/startTestApp.js &
# run cypress
$ node test/cypress
```

View File

@ -121,6 +121,12 @@ Be aware that one of the content type builder won't work due to the writing file
## Contributing
> ⚠️ We have stopped merging PRs for now to the Strapi core.<br><br>
> The reason is that we are developing new architecture for the admin panel and for the plugins.<br>
> This new architecture will provide stability of the Strapi core as we approach the release of Beta.<br>
> We appreciate and welcome all your contributions, but until further notice, please do not submit a PR as it will not be merged.<br>
> Furthermore, you will have to rewrite it based on the new architecture.
Please read our [Contributing Guide](./CONTRIBUTING.md) before submitting a Pull Request to the project.
## Support

View File

@ -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 (
<div className={cn(styles.videosWrapper, videos.length > 0 ? styles.visible : styles.hidden)}>
<div className={cn(styles.videosContent, this.state.showVideos ? styles.shown : styles.hide)}>
<div
style={style}
className={cn(styles.videosWrapper, videos.length > 0 ? styles.visible : styles.hidden)}
>
<div
style={style}
className={cn(styles.videosContent, this.state.showVideos ? styles.shown : styles.hide)}
>
<div className={styles.videosHeader}>
<p><FormattedMessage id="app.components.Onboarding.title" /></p>
<p>
<FormattedMessage id="app.components.Onboarding.title" />
</p>
{videos.length && (
<p>{Math.floor((videos.filter(v => v.end).length)*100/videos.length)}<FormattedMessage id="app.components.Onboarding.label.completed" /></p>
<p>
{Math.floor((videos.filter(v => v.end).length * 100) / videos.length)}
<FormattedMessage id="app.components.Onboarding.label.completed" />
</p>
)}
</div>
<ul className={styles.onboardingList}>
@ -116,10 +136,7 @@ export class Onboarding extends React.Component {
</div>
<div className={styles.openBtn}>
<button
onClick={this.handleVideosToggle}
className={this.state.showVideos ? styles.active : ''}
>
<button onClick={this.handleVideosToggle} className={this.state.showVideos ? styles.active : ''}>
<i className="fa fa-question" />
<i className="fa fa-times" />
<span />
@ -157,7 +174,10 @@ Onboarding.propTypes = {
const mapStateToProps = makeSelectOnboarding();
function mapDispatchToProps(dispatch) {
return bindActionCreators({ getVideos, onClick, setVideoDuration, updateVideoStartTime, setVideoEnd, removeVideos }, dispatch);
return bindActionCreators(
{ getVideos, onClick, setVideoDuration, updateVideoStartTime, setVideoEnd, removeVideos },
dispatch,
);
}
const withConnect = connect(

View File

@ -113,4 +113,4 @@
width: 0;
height: 0;
}
}
}

View File

@ -1,5 +1,7 @@
'use strict';
/* global <%= globalID %> */
/**
* <%= filename %> service
*