This repository has been archived by the owner on Aug 27, 2018. It is now read-only.
On this new version, we focus on stability and bug fixes.
use
npm i -S focus-graph@3.2.0
to install focus-graph in its version 3.2.0
Thanks
Thank you everyone for your bugs' reports and issues in which we have discussed. It helped us improve focus-graph
What's new ?
Improvments
-
Validation translation :
PR #180 : Message for the validation of the domain is now translated -
The selectForListReference :
PR #163
It's a new selector, you just have to give an array of the names of the reference list to have the list in the props. -
The validator in the domain :
PR #115 : Now you can add some options in the domain for the HTML elements
It's possible to give some options in the validator of your domain like this :
validator: {
type: 'string',
options: {
maxLength: 200
}
}
- The fetch :
Before :
//In the file fetch.js in the folder : services
import createfocusFetchProxy from 'focus-application/fetch/fetch-proxy'
let fetch;
export const initFetch = dispatch => {
fetch = createfocusFetchProxy(dispatch);
}
export default (url, method, data) => {
return fetch(url, {
method: method,
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json'
}
});
}
//At the initialisation of the application :
initFetch(store.dispatch);
//For a service by example :
import fetch from './fetch';
export const loadFinance = async ({id}) => {
const response = await fetch(`http://localhost:9999/x/complex/${id}`)
const data = await response.response.json();
return data.finance;
}
After :
import focusFetch from 'focus-application/fetch/fetch-proxy'
export default {
loadMovieCaracteristics(id) {
return focusFetch({url: `http://localhost:8080/movies/${id}/caract`, method: 'GET'}).then((data) => {data.movId = id; return data;});
}
}
//No initialisation