Disable registration tokens

This commit is contained in:
Gregory Lirent 2024-04-20 22:59:35 +03:00
parent 7c08f846a5
commit 311db77306
Signed by: lirent
GPG Key ID: F616BE337EFFEE77
2 changed files with 9 additions and 20 deletions

View File

@ -14,7 +14,6 @@ import userMediaStats from "./components/statistics";
import reports from "./components/EventReports";
import roomDirectory from "./components/RoomDirectory";
import destinations from "./components/destinations";
import registrationToken from "./components/RegistrationTokens";
import LoginPage from "./components/LoginPage";
import { ImportFeature } from "./components/ImportFeature";
import { Route } from "react-router-dom";
@ -57,7 +56,6 @@ const App = () => (
<Resource {...reports} />
<Resource {...roomDirectory} />
<Resource {...destinations} />
<Resource {...registrationToken} />
<Resource name="connections" />
<Resource name="devices" />
<Resource name="room_members" />

View File

@ -54,7 +54,7 @@ const dateFormatter = v => {
return `${year}-${month}-${day}T${hour}:${minute}`;
};
const registrationTokenFilters = [<BooleanInput label="resources.registration_tokens.fields.valid" source="valid" alwaysOn />];
const registrationTokenFilters = [<BooleanInput source="valid" alwaysOn />];
export const RegistrationTokenList = props => (
<List
@ -65,12 +65,11 @@ export const RegistrationTokenList = props => (
perPage={500}
>
<Datagrid rowClick="edit">
<TextField label="resources.registration_tokens.fields.token" source="token" sortable={false} />
<NumberField label="resources.registration_tokens.fields.uses_allowed" source="uses_allowed" sortable={false} />
<NumberField label="resources.registration_tokens.fields.pending" source="pending" sortable={false} />
<NumberField label="resources.registration_tokens.fields.completed" source="completed" sortable={false} />
<TextField source="token" sortable={false} />
<NumberField source="uses_allowed" sortable={false} />
<NumberField source="pending" sortable={false} />
<NumberField source="completed" sortable={false} />
<DateField
label="resources.registration_tokens.fields.expiry_time"
source="expiry_time"
showTime
options={date_format}
@ -91,29 +90,23 @@ export const RegistrationTokenCreate = props => (
}
>
<TextInput
label="resources.registration_tokens.fields.token"
source="token"
autoComplete="off"
validate={validateToken}
resettable
/>
<NumberInput
label="resources.registration_tokens.fields.length"
source="length"
validate={validateLength}
helperText="resources.registration_tokens.helper.length"
step={1}
/>
<NumberInput
label="resources.registration_tokens.fields.uses_allowed"
source="uses_allowed"
validate={validateUsesAllowed}
step={1}
/>
<DateTimeInput
label="resources.registration_tokens.fields.expiry_time"
source="expiry_time"
parse={dateParser} />
<DateTimeInput source="expiry_time" parse={dateParser} />
</SimpleForm>
</Create>
);
@ -121,17 +114,15 @@ export const RegistrationTokenCreate = props => (
export const RegistrationTokenEdit = props => (
<Edit {...props}>
<SimpleForm>
<TextInput label="resources.registration_tokens.fields.token" source="token" disabled />
<NumberInput label="resources.registration_tokens.fields.pending" source="pending" disabled />
<NumberInput label="resources.registration_tokens.fields.completed" source="completed" disabled />
<TextInput source="token" disabled />
<NumberInput source="pending" disabled />
<NumberInput source="completed" disabled />
<NumberInput
label="resources.registration_tokens.fields.uses_allowed"
source="uses_allowed"
validate={validateUsesAllowed}
step={1}
/>
<DateTimeInput
label="resources.registration_tokens.fields.expiry_time"
source="expiry_time"
parse={dateParser}
format={dateFormatter}