Merge branch 'master' into order_users
This commit is contained in:
commit
42a84d32d7
20
package.json
20
package.json
@ -11,26 +11,26 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@testing-library/jest-dom": "^5.1.1",
|
"@testing-library/jest-dom": "^5.1.1",
|
||||||
"@testing-library/react": "^10.0.2",
|
"@testing-library/react": "^11.2.6",
|
||||||
"@testing-library/user-event": "^12.0.11",
|
"@testing-library/user-event": "^13.1.8",
|
||||||
"enzyme": "^3.11.0",
|
"enzyme": "^3.11.0",
|
||||||
"enzyme-adapter-react-16": "^1.15.2",
|
"enzyme-adapter-react-16": "^1.15.2",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^7.25.0",
|
||||||
"eslint-config-prettier": "^6.10.1",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-prettier": "^3.1.2",
|
"eslint-plugin-prettier": "^3.1.2",
|
||||||
"jest-fetch-mock": "^3.0.3",
|
"jest-fetch-mock": "^3.0.3",
|
||||||
"prettier": "^2.0.0",
|
"prettier": "^2.2.0",
|
||||||
"ra-test": "^3.14.0"
|
"ra-test": "^3.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"papaparse": "^5.2.0",
|
"papaparse": "^5.2.0",
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
"ra-language-chinese": "^2.0.10",
|
"ra-language-chinese": "^2.0.10",
|
||||||
"ra-language-german": "^2.1.2",
|
"ra-language-german": "^3.13.4",
|
||||||
"react": "^17.0.0",
|
"react": "^17.0.0",
|
||||||
"react-admin": "^3.14.0",
|
"react-admin": "^3.15.0",
|
||||||
"react-dom": "^16.14.0",
|
"react-dom": "^17.0.2",
|
||||||
"react-scripts": "^3.4.4"
|
"react-scripts": "^4.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "REACT_APP_VERSION=$(git describe --tags) react-scripts start",
|
"start": "REACT_APP_VERSION=$(git describe --tags) react-scripts start",
|
||||||
|
@ -111,7 +111,9 @@ const LoginPage = ({ theme }) => {
|
|||||||
if (!values.base_url.match(/^(http|https):\/\//)) {
|
if (!values.base_url.match(/^(http|https):\/\//)) {
|
||||||
errors.base_url = translate("synapseadmin.auth.protocol_error");
|
errors.base_url = translate("synapseadmin.auth.protocol_error");
|
||||||
} else if (
|
} else if (
|
||||||
!values.base_url.match(/^(http|https):\/\/[a-zA-Z0-9\-.]+(:\d{1,5})?$/)
|
!values.base_url.match(
|
||||||
|
/^(http|https):\/\/[a-zA-Z0-9\-.]+(:\d{1,5})?[^?&\s]*$/
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
errors.base_url = translate("synapseadmin.auth.url_error");
|
errors.base_url = translate("synapseadmin.auth.url_error");
|
||||||
}
|
}
|
||||||
|
@ -421,6 +421,7 @@ export const UserEdit = props => {
|
|||||||
addLabel={false}
|
addLabel={false}
|
||||||
pagination={<UserPagination />}
|
pagination={<UserPagination />}
|
||||||
perPage={50}
|
perPage={50}
|
||||||
|
sort={{ field: "created_ts", order: "DESC" }}
|
||||||
>
|
>
|
||||||
<Datagrid style={{ width: "100%" }}>
|
<Datagrid style={{ width: "100%" }}>
|
||||||
<DateField
|
<DateField
|
||||||
@ -434,7 +435,6 @@ export const UserEdit = props => {
|
|||||||
minute: "2-digit",
|
minute: "2-digit",
|
||||||
second: "2-digit",
|
second: "2-digit",
|
||||||
}}
|
}}
|
||||||
sortable={false}
|
|
||||||
/>
|
/>
|
||||||
<DateField
|
<DateField
|
||||||
source="last_access_ts"
|
source="last_access_ts"
|
||||||
@ -447,14 +447,13 @@ export const UserEdit = props => {
|
|||||||
minute: "2-digit",
|
minute: "2-digit",
|
||||||
second: "2-digit",
|
second: "2-digit",
|
||||||
}}
|
}}
|
||||||
sortable={false}
|
|
||||||
/>
|
/>
|
||||||
<TextField source="media_id" sortable={false} />
|
<TextField source="media_id" />
|
||||||
<NumberField source="media_length" sortable={false} />
|
<NumberField source="media_length" />
|
||||||
<TextField source="media_type" sortable={false} />
|
<TextField source="media_type" />
|
||||||
<TextField source="upload_name" sortable={false} />
|
<TextField source="upload_name" />
|
||||||
<TextField source="quarantined_by" sortable={false} />
|
<TextField source="quarantined_by" />
|
||||||
<BooleanField source="safe_from_quarantine" sortable={false} />
|
<BooleanField source="safe_from_quarantine" />
|
||||||
<DeleteButton mutationMode="pessimistic" redirect={false} />
|
<DeleteButton mutationMode="pessimistic" redirect={false} />
|
||||||
</Datagrid>
|
</Datagrid>
|
||||||
</ReferenceManyField>
|
</ReferenceManyField>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import germanMessages from "ra-language-german";
|
import germanMessages from "ra-language-german";
|
||||||
|
|
||||||
export default {
|
const de = {
|
||||||
...germanMessages,
|
...germanMessages,
|
||||||
synapseadmin: {
|
synapseadmin: {
|
||||||
auth: {
|
auth: {
|
||||||
@ -351,3 +351,4 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
export default de;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import englishMessages from "ra-language-english";
|
import englishMessages from "ra-language-english";
|
||||||
|
|
||||||
export default {
|
const en = {
|
||||||
...englishMessages,
|
...englishMessages,
|
||||||
synapseadmin: {
|
synapseadmin: {
|
||||||
auth: {
|
auth: {
|
||||||
@ -319,3 +319,4 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
export default en;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import chineseMessages from "ra-language-chinese";
|
import chineseMessages from "ra-language-chinese";
|
||||||
|
|
||||||
export default {
|
const zh = {
|
||||||
...chineseMessages,
|
...chineseMessages,
|
||||||
synapseadmin: {
|
synapseadmin: {
|
||||||
auth: {
|
auth: {
|
||||||
@ -288,3 +288,4 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
export default zh;
|
||||||
|
@ -10,6 +10,7 @@ const authProvider = {
|
|||||||
type: "m.login.password",
|
type: "m.login.password",
|
||||||
user: username,
|
user: username,
|
||||||
password: password,
|
password: password,
|
||||||
|
device_id: localStorage.getItem("device_id"),
|
||||||
initial_device_display_name: "Synapse Admin",
|
initial_device_display_name: "Synapse Admin",
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
@ -17,6 +18,7 @@ const authProvider = {
|
|||||||
// use the base_url from login instead of the well_known entry from the
|
// use the base_url from login instead of the well_known entry from the
|
||||||
// server, since the admin might want to access the admin API via some
|
// server, since the admin might want to access the admin API via some
|
||||||
// private address
|
// private address
|
||||||
|
base_url = base_url.replace(/\/+$/g, "");
|
||||||
localStorage.setItem("base_url", base_url);
|
localStorage.setItem("base_url", base_url);
|
||||||
|
|
||||||
const decoded_base_url = window.decodeURIComponent(base_url);
|
const decoded_base_url = window.decodeURIComponent(base_url);
|
||||||
@ -48,7 +50,6 @@ const authProvider = {
|
|||||||
if (typeof access_token === "string") {
|
if (typeof access_token === "string") {
|
||||||
fetchUtils.fetchJson(logout_api_url, options).then(({ json }) => {
|
fetchUtils.fetchJson(logout_api_url, options).then(({ json }) => {
|
||||||
localStorage.removeItem("access_token");
|
localStorage.removeItem("access_token");
|
||||||
localStorage.removeItem("device_id");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
|
@ -314,10 +314,13 @@ const dataProvider = {
|
|||||||
getManyReference: (resource, params) => {
|
getManyReference: (resource, params) => {
|
||||||
console.log("getManyReference " + resource);
|
console.log("getManyReference " + resource);
|
||||||
const { page, perPage } = params.pagination;
|
const { page, perPage } = params.pagination;
|
||||||
|
const { field, order } = params.sort;
|
||||||
const from = (page - 1) * perPage;
|
const from = (page - 1) * perPage;
|
||||||
const query = {
|
const query = {
|
||||||
from: from,
|
from: from,
|
||||||
limit: perPage,
|
limit: perPage,
|
||||||
|
order_by: field,
|
||||||
|
dir: getSearchOrder(order),
|
||||||
};
|
};
|
||||||
|
|
||||||
const homeserver = localStorage.getItem("base_url");
|
const homeserver = localStorage.getItem("base_url");
|
||||||
|
Loading…
Reference in New Issue
Block a user