Replaced React.PropTypes (deprecated) with prop-types package

pull/246/head
Piero Toffanin 2017-07-25 14:09:51 -04:00
rodzic 750f43ca9d
commit 46813e5ec2
17 zmienionych plików z 91 dodań i 75 usunięć

Wyświetl plik

@ -21,9 +21,9 @@ A free, user-friendly, extendable application and [API](http://docs.webodm.org)
![Alt text](/screenshots/pointcloud.png?raw=true "3D Display") ![Alt text](/screenshots/pointcloud.png?raw=true "3D Display")
![Alt text](/screenshots/dashboard.png?raw=true "Dashboard") ![Alt text](https://user-images.githubusercontent.com/1951843/28586405-af18e8cc-7141-11e7-9853-a7feca7c9c6b.gif)
[![WebODM - An Introduction to a Web Interface for OpenDroneMap to Make Drone Mapping Even Easier](https://img.youtube.com/vi/UnN-NzL96T8/0.jpg)](https://www.youtube.com/watch?v=UnN-NzL96T8 "WebODM - An Introduction to a Web Interface for OpenDroneMap to Make Drone Mapping Even Easier") ![Alt text](/screenshots/dashboard.png?raw=true "Dashboard")
If you know Python, web technologies (JS, HTML, CSS, etc.) or both, it's easy to make a change to WebODM! Make a fork, clone the repository and run `./devenv.sh start`. That's it! See the [Development Quickstart](http://docs.webodm.org/#development-quickstart) and [Contributing](/CONTRIBUTING.md) documents for more information. All ideas are considered and people of all skill levels are welcome to contribute. If you know Python, web technologies (JS, HTML, CSS, etc.) or both, it's easy to make a change to WebODM! Make a fork, clone the repository and run `./devenv.sh start`. That's it! See the [Development Quickstart](http://docs.webodm.org/#development-quickstart) and [Contributing](/CONTRIBUTING.md) documents for more information. All ideas are considered and people of all skill levels are welcome to contribute.

Wyświetl plik

@ -2,6 +2,7 @@ import React from 'react';
import './css/MapView.scss'; import './css/MapView.scss';
import Map from './components/Map'; import Map from './components/Map';
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
class MapView extends React.Component { class MapView extends React.Component {
static defaultProps = { static defaultProps = {
@ -11,9 +12,9 @@ class MapView extends React.Component {
}; };
static propTypes = { static propTypes = {
mapItems: React.PropTypes.array.isRequired, // list of dictionaries where each dict is a {mapType: 'orthophoto', url: <tiles.json>}, mapItems: PropTypes.array.isRequired, // list of dictionaries where each dict is a {mapType: 'orthophoto', url: <tiles.json>},
selectedMapType: React.PropTypes.oneOf(['orthophoto', 'dsm', 'dtm']), selectedMapType: PropTypes.oneOf(['orthophoto', 'dsm', 'dtm']),
title: React.PropTypes.string, title: PropTypes.string,
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -4,6 +4,7 @@ import ErrorMessage from './components/ErrorMessage';
import SwitchModeButton from './components/SwitchModeButton'; import SwitchModeButton from './components/SwitchModeButton';
import AssetDownloadButtons from './components/AssetDownloadButtons'; import AssetDownloadButtons from './components/AssetDownloadButtons';
import Standby from './components/Standby'; import Standby from './components/Standby';
import PropTypes from 'prop-types';
import $ from 'jquery'; import $ from 'jquery';
const THREE = require('./vendor/potree/js/three'); // import does not work :/ const THREE = require('./vendor/potree/js/three'); // import does not work :/
@ -18,7 +19,7 @@ class ModelView extends React.Component {
}; };
static propTypes = { static propTypes = {
task: React.PropTypes.object.isRequired, // The object should contain two keys: {id: <taskId>, project: <projectId>} task: PropTypes.object.isRequired, // The object should contain two keys: {id: <taskId>, project: <projectId>}
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import '../css/AssetDownloadButtons.scss'; import '../css/AssetDownloadButtons.scss';
import AssetDownloads from '../classes/AssetDownloads'; import AssetDownloads from '../classes/AssetDownloads';
import PropTypes from 'prop-types';
class AssetDownloadButtons extends React.Component { class AssetDownloadButtons extends React.Component {
static defaultProps = { static defaultProps = {
@ -10,9 +11,9 @@ class AssetDownloadButtons extends React.Component {
}; };
static propTypes = { static propTypes = {
disabled: React.PropTypes.bool, disabled: PropTypes.bool,
task: React.PropTypes.object.isRequired, task: PropTypes.object.isRequired,
direction: React.PropTypes.string direction: PropTypes.string
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -3,6 +3,7 @@ import React from 'react';
import FormDialog from './FormDialog'; import FormDialog from './FormDialog';
import ProcessingNodeOption from './ProcessingNodeOption'; import ProcessingNodeOption from './ProcessingNodeOption';
import PresetUtils from '../classes/PresetUtils'; import PresetUtils from '../classes/PresetUtils';
import PropTypes from 'prop-types';
import $ from 'jquery'; import $ from 'jquery';
class EditPresetDialog extends React.Component { class EditPresetDialog extends React.Component {
@ -10,11 +11,11 @@ class EditPresetDialog extends React.Component {
}; };
static propTypes = { static propTypes = {
preset: React.PropTypes.object.isRequired, preset: PropTypes.object.isRequired,
availableOptions: React.PropTypes.array.isRequired, availableOptions: PropTypes.array.isRequired,
saveAction: React.PropTypes.func.isRequired, saveAction: PropTypes.func.isRequired,
deleteAction: React.PropTypes.func.isRequired, deleteAction: PropTypes.func.isRequired,
onHide: React.PropTypes.func onHide: PropTypes.func
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import ErrorMessage from './ErrorMessage'; import ErrorMessage from './ErrorMessage';
import FormDialog from './FormDialog'; import FormDialog from './FormDialog';
import PropTypes from 'prop-types';
import $ from 'jquery'; import $ from 'jquery';
class EditProjectDialog extends React.Component { class EditProjectDialog extends React.Component {
@ -16,17 +17,17 @@ class EditProjectDialog extends React.Component {
}; };
static propTypes = { static propTypes = {
projectName: React.PropTypes.string, projectName: PropTypes.string,
projectDescr: React.PropTypes.string, projectDescr: PropTypes.string,
saveAction: React.PropTypes.func.isRequired, saveAction: PropTypes.func.isRequired,
onShow: React.PropTypes.func, onShow: PropTypes.func,
deleteAction: React.PropTypes.func, deleteAction: PropTypes.func,
title: React.PropTypes.string, title: PropTypes.string,
saveLabel: React.PropTypes.string, saveLabel: PropTypes.string,
savingLabel: React.PropTypes.string, savingLabel: PropTypes.string,
saveIcon: React.PropTypes.string, saveIcon: PropTypes.string,
deleteWarning: React.PropTypes.string, deleteWarning: PropTypes.string,
show: React.PropTypes.bool show: PropTypes.bool
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -4,6 +4,7 @@ import values from 'object.values';
import Utils from '../classes/Utils'; import Utils from '../classes/Utils';
import EditPresetDialog from './EditPresetDialog'; import EditPresetDialog from './EditPresetDialog';
import ErrorMessage from './ErrorMessage'; import ErrorMessage from './ErrorMessage';
import PropTypes from 'prop-types';
import $ from 'jquery'; import $ from 'jquery';
if (!Object.values) { if (!Object.values) {
@ -17,12 +18,12 @@ class EditTaskForm extends React.Component {
}; };
static propTypes = { static propTypes = {
selectedNode: React.PropTypes.oneOfType([ selectedNode: PropTypes.oneOfType([
React.PropTypes.string, PropTypes.string,
React.PropTypes.number PropTypes.number
]), ]),
onFormLoaded: React.PropTypes.func, onFormLoaded: PropTypes.func,
task: React.PropTypes.object task: PropTypes.object
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -2,6 +2,7 @@ import '../css/EditTaskPanel.scss';
import React from 'react'; import React from 'react';
import ErrorMessage from './ErrorMessage'; import ErrorMessage from './ErrorMessage';
import EditTaskForm from './EditTaskForm'; import EditTaskForm from './EditTaskForm';
import PropTypes from 'prop-types';
import $ from 'jquery'; import $ from 'jquery';
class EditTaskPanel extends React.Component { class EditTaskPanel extends React.Component {
@ -9,9 +10,9 @@ class EditTaskPanel extends React.Component {
}; };
static propTypes = { static propTypes = {
task: React.PropTypes.object.isRequired, task: PropTypes.object.isRequired,
onSave: React.PropTypes.func.isRequired, onSave: PropTypes.func.isRequired,
onCancel: React.PropTypes.func.isRequired onCancel: PropTypes.func.isRequired
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -1,8 +1,9 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
class ErrorMessage extends React.Component { class ErrorMessage extends React.Component {
static propTypes = { static propTypes = {
bind: React.PropTypes.array.isRequired // two element array, bind: PropTypes.array.isRequired // two element array,
// with first element being the parent element // with first element being the parent element
// and the second the error property to display // and the second the error property to display
// ex. [this, 'error'] // ex. [this, 'error']

Wyświetl plik

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import ErrorMessage from './ErrorMessage'; import ErrorMessage from './ErrorMessage';
import '../css/FormDialog.scss'; import '../css/FormDialog.scss';
import PropTypes from 'prop-types';
import $ from 'jquery'; import $ from 'jquery';
class FormDialog extends React.Component { class FormDialog extends React.Component {
@ -14,21 +15,21 @@ class FormDialog extends React.Component {
}; };
static propTypes = { static propTypes = {
getFormData: React.PropTypes.func.isRequired, getFormData: PropTypes.func.isRequired,
reset: React.PropTypes.func.isRequired, reset: PropTypes.func.isRequired,
saveAction: React.PropTypes.func.isRequired, saveAction: PropTypes.func.isRequired,
onShow: React.PropTypes.func, onShow: PropTypes.func,
onHide: React.PropTypes.func, onHide: PropTypes.func,
deleteAction: React.PropTypes.func, deleteAction: PropTypes.func,
title: React.PropTypes.string, title: PropTypes.string,
saveLabel: React.PropTypes.string, saveLabel: PropTypes.string,
savingLabel: React.PropTypes.string, savingLabel: PropTypes.string,
saveIcon: React.PropTypes.string, saveIcon: PropTypes.string,
deleteWarning: React.PropTypes.oneOfType([ deleteWarning: PropTypes.oneOfType([
React.PropTypes.string, PropTypes.string,
React.PropTypes.bool PropTypes.bool
]), ]),
show: React.PropTypes.bool show: PropTypes.bool
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -15,6 +15,7 @@ import $ from 'jquery';
import ErrorMessage from './ErrorMessage'; import ErrorMessage from './ErrorMessage';
import SwitchModeButton from './SwitchModeButton'; import SwitchModeButton from './SwitchModeButton';
import AssetDownloads from '../classes/AssetDownloads'; import AssetDownloads from '../classes/AssetDownloads';
import PropTypes from 'prop-types';
class Map extends React.Component { class Map extends React.Component {
static defaultProps = { static defaultProps = {
@ -26,12 +27,12 @@ class Map extends React.Component {
}; };
static propTypes = { static propTypes = {
maxzoom: React.PropTypes.number, maxzoom: PropTypes.number,
minzoom: React.PropTypes.number, minzoom: PropTypes.number,
showBackground: React.PropTypes.bool, showBackground: PropTypes.bool,
tiles: React.PropTypes.array.isRequired, tiles: PropTypes.array.isRequired,
opacity: React.PropTypes.number, opacity: PropTypes.number,
mapType: React.PropTypes.oneOf(['orthophoto', 'dsm', 'dtm']) mapType: PropTypes.oneOf(['orthophoto', 'dsm', 'dtm'])
}; };
constructor(props) { constructor(props) {

Wyświetl plik

@ -1,6 +1,7 @@
import '../css/NewTaskPanel.scss'; import '../css/NewTaskPanel.scss';
import React from 'react'; import React from 'react';
import EditTaskForm from './EditTaskForm'; import EditTaskForm from './EditTaskForm';
import PropTypes from 'prop-types';
class NewTaskPanel extends React.Component { class NewTaskPanel extends React.Component {
static defaultProps = { static defaultProps = {
@ -9,9 +10,9 @@ class NewTaskPanel extends React.Component {
}; };
static propTypes = { static propTypes = {
onSave: React.PropTypes.func.isRequired, onSave: PropTypes.func.isRequired,
name: React.PropTypes.string, name: PropTypes.string,
uploading: React.PropTypes.bool uploading: PropTypes.bool
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import update from 'immutability-helper'; import update from 'immutability-helper';
import HistoryNav from '../classes/HistoryNav'; import HistoryNav from '../classes/HistoryNav';
import PropTypes from 'prop-types';
class Paginated extends React.Component{ class Paginated extends React.Component{
static defaultProps = { static defaultProps = {
@ -8,8 +9,8 @@ class Paginated extends React.Component{
}; };
static propTypes = { static propTypes = {
history: React.PropTypes.object.isRequired, // reference to the history object coming from the route this component is bound to history: PropTypes.object.isRequired, // reference to the history object coming from the route this component is bound to
currentPage: React.PropTypes.number currentPage: PropTypes.number
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -1,26 +1,27 @@
import React from 'react'; import React from 'react';
import '../css/ProcessingNodeOption.scss'; import '../css/ProcessingNodeOption.scss';
import PropTypes from 'prop-types';
import $ from 'jquery'; import $ from 'jquery';
class ProcessingNodeOption extends React.Component { class ProcessingNodeOption extends React.Component {
static defaultProps = {}; static defaultProps = {};
static propTypes = { static propTypes = {
name: React.PropTypes.string.isRequired, name: PropTypes.string.isRequired,
defaultValue: React.PropTypes.oneOfType([ defaultValue: PropTypes.oneOfType([
React.PropTypes.string, PropTypes.string,
React.PropTypes.bool PropTypes.bool
]).isRequired, ]).isRequired,
value: React.PropTypes.oneOfType([ value: PropTypes.oneOfType([
React.PropTypes.string, PropTypes.string,
React.PropTypes.bool PropTypes.bool
]), ]),
type: React.PropTypes.string, type: PropTypes.string,
domain: React.PropTypes.oneOfType([ domain: PropTypes.oneOfType([
React.PropTypes.string, PropTypes.string,
React.PropTypes.array PropTypes.array
]), ]),
help: React.PropTypes.string, help: PropTypes.string,
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import '../css/Standby.scss'; import '../css/Standby.scss';
import PropTypes from 'prop-types';
class Standby extends React.Component { class Standby extends React.Component {
static defaultProps = { static defaultProps = {
@ -8,8 +9,8 @@ class Standby extends React.Component {
}; };
static propTypes = { static propTypes = {
message: React.PropTypes.string, message: PropTypes.string,
show: React.PropTypes.bool show: PropTypes.bool
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -1,5 +1,6 @@
import React from 'react'; import React from 'react';
import '../css/SwitchModeButton.scss'; import '../css/SwitchModeButton.scss';
import PropTypes from 'prop-types';
class SwitchModeButton extends React.Component { class SwitchModeButton extends React.Component {
static defaultProps = { static defaultProps = {
@ -8,8 +9,8 @@ class SwitchModeButton extends React.Component {
}; };
static propTypes = { static propTypes = {
task: React.PropTypes.object, // The object should contain two keys: {id: <taskId>, project: <projectId>} task: PropTypes.object, // The object should contain two keys: {id: <taskId>, project: <projectId>}
type: React.PropTypes.string // Either "mapToModel" or "modelToMap" type: PropTypes.string // Either "mapToModel" or "modelToMap"
}; };
constructor(props){ constructor(props){

Wyświetl plik

@ -46,6 +46,7 @@
"react-router": "^4.1.1", "react-router": "^4.1.1",
"react-router-dom": "^4.1.1", "react-router-dom": "^4.1.1",
"sass-loader": "^4.0.2", "sass-loader": "^4.0.2",
"statuses": "^1.3.1",
"style-loader": "^0.13.1", "style-loader": "^0.13.1",
"tween.js": "^16.6.0", "tween.js": "^16.6.0",
"url-loader": "^0.5.7", "url-loader": "^0.5.7",