import HelpIcon from '../../../../components/icons-components/HelpIcon';
import OnboardingModal from '../../../../apps/tutorials/onboarding/OnboardingModal';
import { getCurrentUser, getAppState, getGlobalSettingValue } from '../../../../store/rootReducer';
+import { skipOnboarding } from '../../../../store/users/actions';
import { translate } from '../../../../helpers/l10n';
import './GlobalNav.css';
/*::
type Props = {
appState: { organizationsEnabled: boolean },
- currentUser: { isLoggedIn: boolean, showOnboardingTutorial: true },
+ currentUser: { isLoggedIn: boolean, showOnboardingTutorial: boolean },
+ skipOnboarding: () => void,
sonarCloud: boolean
};
*/
closeOnboardingTutorial = () => {
this.setState({ onboardingTutorialOpen: false, onboardingTutorialTooltip: true });
+ this.props.skipOnboarding();
this.interval = setInterval(() => {
this.setState({ onboardingTutorialTooltip: false });
}, 3000);
};
};
-export default connect(mapStateToProps)(GlobalNav);
+const mapDispatchToProps = { skipOnboarding };
+
+export default connect(mapStateToProps, mapDispatchToProps)(GlobalNav);
handleFinish = (projectKey /*: string | void */) => this.setState({ finished: true, projectKey });
- handleReset = () => this.setState({ finished: false });
+ handleReset = () => this.setState({ finished: false, projectKey: undefined });
render() {
if (!this.props.currentUser.isLoggedIn) {
export const RECEIVE_CURRENT_USER = 'RECEIVE_CURRENT_USER';
export const RECEIVE_USER = 'RECEIVE_USER';
+export const SKIP_ONBOARDING = 'SKIP_ONBOARDING';
export const receiveCurrentUser = user => ({
type: RECEIVE_CURRENT_USER,
user
});
+export const skipOnboarding = () => ({ type: SKIP_ONBOARDING });
+
export const fetchCurrentUser = () => dispatch =>
getCurrentUser().then(user => dispatch(receiveCurrentUser(user)));
*/
import { combineReducers } from 'redux';
import { uniq, keyBy } from 'lodash';
-import { RECEIVE_CURRENT_USER, RECEIVE_USER } from './actions';
+import { RECEIVE_CURRENT_USER, RECEIVE_USER, SKIP_ONBOARDING } from './actions';
import { actions as membersActions } from '../organizationsMembers/actions';
const usersByLogin = (state = {}, action = {}) => {
if (action.type === RECEIVE_CURRENT_USER) {
return action.user;
}
+ if (action.type === SKIP_ONBOARDING) {
+ return state ? { ...state, showOnboardingTutorial: false } : null;
+ }
return state;
};