/* * Copyright 2007-2017 Charles du Jeu - Abstrium SAS * This file is part of Pydio. * * Pydio is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Pydio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Pydio. If not, see . * * The latest code can be found at . */ import {Component} from 'react' import Pydio from 'pydio' const {AsyncComponent, PydioContextConsumer} = Pydio.requireLib('boot'); class Scheme extends Component { render(){ let style = { position:'relative', fontSize: 24, width: this.props.dimension || 100, height: this.props.dimension || 100, backgroundColor: '#ECEFF1', color: '#607d8b', borderRadius: '50%', margin: '0 auto' }; return (
{this.props.children}
); } } let WorkspacesCard = (props) => { const renderRay = (angle) => { return (
) }; return (

{props.message('workspaces.1')}

{renderRay(30)} {renderRay(0)} {renderRay(-30)}

{props.message('workspaces.2')}

); }; let SearchCard = (props) => { return (

{props.message('globsearch.1')}

{props.message('infopanel.search')}...
{props.message('infopanel.folder')} 1
{props.message('infopanel.file')} 2
{props.message('infopanel.file')} 3

{props.message('globsearch.2')}

); }; let WidgetsCard = (props) => { return (

{props.message('widget-cards')}

); }; class WelcomeTour extends Component{ constructor(props, context){ super(props, context); this.state = {started: !(props.pydio.user && !props.pydio.user.getPreference('gui_preferences', true)['UserAccount.WelcomeModal.Shown'])}; } componentDidMount(){ if(!this.state.started){ pydio.UI.openComponentInModal('UserAccount', 'WelcomeModal', { onRequestStart:(skip) => { this.discard('UserAccount.WelcomeModal.Shown'); if(skip) { this.discard(); }else{ this.setState({started: true}); } } }); } } discard(pref = 'WelcomeComponent.Pydio8.TourGuide.Welcome'){ const {user} = this.props.pydio; let guiPrefs = user.getPreference('gui_preferences', true); guiPrefs[pref] = true; user.setPreference('gui_preferences', guiPrefs, true); user.savePreference('gui_preferences'); } render(){ if(!this.state.started){ return null; } const {getMessage} = this.props; const message = (id) => getMessage('ajax_gui.tour.' + id); const widgetBarEnabled = !!! this.props.pydio.getPluginConfigs('access.ajxp_home').get('DISABLE_WIDGET_BAR'); let tourguideSteps = [ { title : message('workspaces.title'), text : , selector :'.user-workspaces-list', position :'right' }, { title : message('globsearch.title'), text : , selector : '.home-search-form', position : 'bottom' }, ]; if(widgetBarEnabled){ tourguideSteps.push({ title : message('widget-cards.title'), text : , selector : '.dashboard-layout', position : 'left' }); } if(this.props.pydio.user && this.props.pydio.user.getRepositoriesList().size){ tourguideSteps.push({ title : message('openworkspace.title'), text : message('openworkspace'), selector : '.workspace-entry', position : 'right' }); } const callback = (data) => { if(data.type === 'step:after' && data.index === tourguideSteps.length - 1 ){ this.discard(); } }; return ( ); } } WelcomeTour = PydioContextConsumer(WelcomeTour); export {WelcomeTour as default}