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

View File

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