mirror of
https://github.com/UA-Fediland/synapse-admin.git
synced 2024-11-26 00:03:17 +00:00
yarn: Upgrade packages
- react-admin: 3.10.0 - react-dom: 16.14.0 - react-scripts: 3.4.4 Change-Id: I805bcd2f65419747f7e8c5a3e2c6b9896010ca9e
This commit is contained in:
parent
c841720f0c
commit
1432724a64
3 changed files with 1060 additions and 1033 deletions
|
@ -22,13 +22,13 @@
|
||||||
"prettier": "^2.0.0"
|
"prettier": "^2.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"papaparse": "^5.2.0",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"ra-language-german": "^2.1.2",
|
"ra-language-german": "^2.1.2",
|
||||||
"papaparse": "^5.2.0",
|
|
||||||
"react": "^16.13.1",
|
"react": "^16.13.1",
|
||||||
"react-admin": "^3.7.0",
|
"react-admin": "^3.10.0",
|
||||||
"react-dom": "^16.13.1",
|
"react-dom": "^16.14.0",
|
||||||
"react-scripts": "^3.4.1"
|
"react-scripts": "^3.4.4"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "REACT_APP_VERSION=$(git describe --tags) react-scripts start",
|
"start": "REACT_APP_VERSION=$(git describe --tags) react-scripts start",
|
||||||
|
|
|
@ -78,6 +78,7 @@ const resourceMap = {
|
||||||
id: d.device_id,
|
id: d.device_id,
|
||||||
}),
|
}),
|
||||||
data: "devices",
|
data: "devices",
|
||||||
|
total: json => json.devices.length,
|
||||||
reference: id => ({
|
reference: id => ({
|
||||||
endpoint: `/_synapse/admin/v2/users/${id}/devices`,
|
endpoint: `/_synapse/admin/v2/users/${id}/devices`,
|
||||||
}),
|
}),
|
||||||
|
@ -101,6 +102,7 @@ const resourceMap = {
|
||||||
endpoint: `/_synapse/admin/v1/rooms/${id}/members`,
|
endpoint: `/_synapse/admin/v1/rooms/${id}/members`,
|
||||||
}),
|
}),
|
||||||
data: "members",
|
data: "members",
|
||||||
|
total: json => json.members.length,
|
||||||
},
|
},
|
||||||
servernotices: {
|
servernotices: {
|
||||||
map: n => ({ id: n.event_id }),
|
map: n => ({ id: n.event_id }),
|
||||||
|
@ -191,11 +193,14 @@ const dataProvider = {
|
||||||
params.ids.map(id => jsonClient(`${endpoint_url}/${id}`))
|
params.ids.map(id => jsonClient(`${endpoint_url}/${id}`))
|
||||||
).then(responses => ({
|
).then(responses => ({
|
||||||
data: responses.map(({ json }) => res.map(json)),
|
data: responses.map(({ json }) => res.map(json)),
|
||||||
|
total: responses.length,
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
getManyReference: (resource, params) => {
|
getManyReference: (resource, params) => {
|
||||||
console.log("getManyReference " + resource);
|
console.log("getManyReference " + resource);
|
||||||
|
const { page, perPage } = params.pagination;
|
||||||
|
const from = (page - 1) * perPage;
|
||||||
|
|
||||||
const homeserver = localStorage.getItem("base_url");
|
const homeserver = localStorage.getItem("base_url");
|
||||||
if (!homeserver || !(resource in resourceMap)) return Promise.reject();
|
if (!homeserver || !(resource in resourceMap)) return Promise.reject();
|
||||||
|
@ -207,6 +212,7 @@ const dataProvider = {
|
||||||
|
|
||||||
return jsonClient(endpoint_url).then(({ headers, json }) => ({
|
return jsonClient(endpoint_url).then(({ headers, json }) => ({
|
||||||
data: json[res.data].map(res.map),
|
data: json[res.data].map(res.map),
|
||||||
|
total: res.total(json, from, perPage),
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue