Merge branch 'master' into upgrade_dele_room
This commit is contained in:
commit
f9ae502e5f
2
.github/workflows/build-test.yml
vendored
2
.github/workflows/build-test.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
- name: Install dependencies
|
||||
run: yarn --frozen-lockfile
|
||||
- name: Run tests
|
||||
|
2
.github/workflows/edge_ghpage.yml
vendored
2
.github/workflows/edge_ghpage.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
||||
uses: actions/checkout@v2.3.1
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "14"
|
||||
node-version: "16"
|
||||
- name: Install and Build 🔧
|
||||
run: |
|
||||
yarn install
|
||||
|
2
.github/workflows/github-release.yml
vendored
2
.github/workflows/github-release.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "14"
|
||||
node-version: "16"
|
||||
- run: yarn install
|
||||
- run: yarn build
|
||||
- run: |
|
||||
|
@ -15,6 +15,7 @@
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
"eslint": "^7.25.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-config-react-app": "^7.0.1",
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"jest-fetch-mock": "^3.0.3",
|
||||
"prettier": "^2.2.0",
|
||||
@ -28,7 +29,7 @@
|
||||
"react": "^17.0.0",
|
||||
"react-admin": "^3.19.7",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-scripts": "^4.0.0"
|
||||
"react-scripts": "^5.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "REACT_APP_VERSION=$(git describe --tags) react-scripts start",
|
||||
|
@ -71,6 +71,16 @@ const useStyles = makeStyles({
|
||||
},
|
||||
});
|
||||
|
||||
const choices_medium = [
|
||||
{ id: "email", name: "resources.users.email" },
|
||||
{ id: "msisdn", name: "resources.users.msisdn" },
|
||||
];
|
||||
|
||||
const choices_type = [
|
||||
{ id: "bot", name: "bot" },
|
||||
{ id: "support", name: "support" },
|
||||
];
|
||||
|
||||
const date_format = {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
@ -276,15 +286,19 @@ export const UserCreate = props => (
|
||||
autoComplete="new-password"
|
||||
validate={maxLength(512)}
|
||||
/>
|
||||
<SelectInput
|
||||
source="user_type"
|
||||
choices={choices_type}
|
||||
translateChoice={false}
|
||||
allowEmpty={true}
|
||||
resettable
|
||||
/>
|
||||
<BooleanInput source="admin" />
|
||||
<ArrayInput source="threepids">
|
||||
<SimpleFormIterator disableReordering>
|
||||
<SelectInput
|
||||
source="medium"
|
||||
choices={[
|
||||
{ id: "email", name: "resources.users.email" },
|
||||
{ id: "msisdn", name: "resources.users.msisdn" },
|
||||
]}
|
||||
choices={choices_medium}
|
||||
validate={required()}
|
||||
/>
|
||||
<TextInput source="address" validate={validateAddress} />
|
||||
@ -315,6 +329,7 @@ const UserTitle = ({ record }) => {
|
||||
</span>
|
||||
);
|
||||
};
|
||||
|
||||
export const UserEdit = props => {
|
||||
const classes = useStyles();
|
||||
const translate = useTranslate();
|
||||
@ -333,6 +348,13 @@ export const UserEdit = props => {
|
||||
<TextInput source="id" disabled />
|
||||
<TextInput source="displayname" />
|
||||
<PasswordInput source="password" autoComplete="new-password" />
|
||||
<SelectInput
|
||||
source="user_type"
|
||||
choices={choices_type}
|
||||
translateChoice={false}
|
||||
allowEmpty={true}
|
||||
resettable
|
||||
/>
|
||||
<BooleanInput source="admin" />
|
||||
<BooleanInput
|
||||
source="deactivated"
|
||||
@ -349,13 +371,7 @@ export const UserEdit = props => {
|
||||
>
|
||||
<ArrayInput source="threepids">
|
||||
<SimpleFormIterator disableReordering>
|
||||
<SelectInput
|
||||
source="medium"
|
||||
choices={[
|
||||
{ id: "email", name: "resources.users.email" },
|
||||
{ id: "msisdn", name: "resources.users.msisdn" },
|
||||
]}
|
||||
/>
|
||||
<SelectInput source="medium" choices={choices_medium} />
|
||||
<TextInput source="address" />
|
||||
</SimpleFormIterator>
|
||||
</ArrayInput>
|
||||
|
@ -121,6 +121,7 @@ const de = {
|
||||
creation_ts_ms: "Zeitpunkt der Erstellung",
|
||||
consent_version: "Zugestimmte Geschäftsbedingungen",
|
||||
auth_provider: "Provider",
|
||||
user_type: "Benutzertyp",
|
||||
},
|
||||
helper: {
|
||||
deactivate:
|
||||
|
@ -120,6 +120,7 @@ const en = {
|
||||
creation_ts_ms: "Creation timestamp",
|
||||
consent_version: "Consent version",
|
||||
auth_provider: "Provider",
|
||||
user_type: "User type",
|
||||
},
|
||||
helper: {
|
||||
deactivate: "You must provide a password to re-activate an account.",
|
||||
|
@ -298,7 +298,8 @@ const resourceMap = {
|
||||
|
||||
function filterNullValues(key, value) {
|
||||
// Filtering out null properties
|
||||
if (value === null) {
|
||||
// to reset user_type from user, it must be null
|
||||
if (value === null && key !== "user_type") {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
|
Loading…
Reference in New Issue
Block a user