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);
class TypesDeChampEditor extends Component {
constructor({
baseUrl,
typeDeChampsTypes,
directUploadUrl,
isAnnotation,
typeDeChamps
}) {
super({ typeDeChamps });
constructor(props) {
super(props);
const defaultTypeDeChampAttributes = {
type_champ: 'text',
types_de_champ: [],
private: isAnnotation,
libelle: `${isAnnotation ? 'Nouvelle annotation' : 'Nouveau champ'} ${
typeDeChampsTypes[0][0]
}`
private: props.isAnnotation,
libelle: `${
props.isAnnotation ? 'Nouvelle annotation' : 'Nouveau champ'
} ${props.typeDeChampsTypes[0][0]}`
};
this.state = {
flash: new Flash(isAnnotation),
queue: new OperationsQueue(baseUrl),
flash: new Flash(props.isAnnotation),
queue: new OperationsQueue(props.baseUrl),
defaultTypeDeChampAttributes,
typeDeChampsTypes,
directUploadUrl,
isAnnotation
typeDeChampsTypes: props.typeDeChampsTypes,
directUploadUrl: props.directUploadUrl,
isAnnotation: props.isAnnotation
};
}