Fix react props warning

This commit is contained in:
Paul Chavard 2019-04-03 16:37:37 +02:00 committed by Pierre de La Morinerie
parent 68e995918a
commit a197459e4d

View file

@ -15,29 +15,23 @@ import TypeDeChamps from './components/TypeDeChamps';
library.add(faArrowDown, faArrowsAltV, faArrowUp, faTrash); library.add(faArrowDown, faArrowsAltV, faArrowUp, faTrash);
class TypesDeChampEditor extends Component { class TypesDeChampEditor extends Component {
constructor({ constructor(props) {
baseUrl, super(props);
typeDeChampsTypes,
directUploadUrl,
isAnnotation,
typeDeChamps
}) {
super({ typeDeChamps });
const defaultTypeDeChampAttributes = { const defaultTypeDeChampAttributes = {
type_champ: 'text', type_champ: 'text',
types_de_champ: [], types_de_champ: [],
private: isAnnotation, private: props.isAnnotation,
libelle: `${isAnnotation ? 'Nouvelle annotation' : 'Nouveau champ'} ${ libelle: `${
typeDeChampsTypes[0][0] props.isAnnotation ? 'Nouvelle annotation' : 'Nouveau champ'
}` } ${props.typeDeChampsTypes[0][0]}`
}; };
this.state = { this.state = {
flash: new Flash(isAnnotation), flash: new Flash(props.isAnnotation),
queue: new OperationsQueue(baseUrl), queue: new OperationsQueue(props.baseUrl),
defaultTypeDeChampAttributes, defaultTypeDeChampAttributes,
typeDeChampsTypes, typeDeChampsTypes: props.typeDeChampsTypes,
directUploadUrl, directUploadUrl: props.directUploadUrl,
isAnnotation isAnnotation: props.isAnnotation
}; };
} }