MCPcopy Create free account
hub / github.com/gotify/server / UpdateClientDialog

Function UpdateClientDialog

ui/src/client/UpdateClientDialog.tsx:17–62  ·  view source on GitHub ↗
({fClose, fOnSubmit, initialName = ''}: IProps)

Source from the content-addressed store, hash-verified

15}
16
17const UpdateClientDialog = ({fClose, fOnSubmit, initialName = ''}: IProps) => {
18 const [name, setName] = useState(initialName);
19
20 const submitEnabled = name.length !== 0;
21 const submitAndClose = async () => {
22 await fOnSubmit(name);
23 fClose();
24 };
25
26 return (
27 <Dialog open={true} onClose={fClose} aria-labelledby="form-dialog-title" id="client-dialog">
28 <DialogTitle id="form-dialog-title">Update a Client</DialogTitle>
29 <DialogContent>
30 <DialogContentText>
31 A client manages messages, clients, applications and users (with admin
32 permissions).
33 </DialogContentText>
34 <TextField
35 autoFocus
36 margin="dense"
37 className="name"
38 label="Name *"
39 type="text"
40 value={name}
41 onChange={(e) => setName(e.target.value)}
42 fullWidth
43 />
44 </DialogContent>
45 <DialogActions>
46 <Button onClick={fClose}>Cancel</Button>
47 <Tooltip title={submitEnabled ? '' : 'name is required'}>
48 <div>
49 <Button
50 className="update"
51 disabled={!submitEnabled}
52 onClick={submitAndClose}
53 color="primary"
54 variant="contained">
55 Update
56 </Button>
57 </div>
58 </Tooltip>
59 </DialogActions>
60 </Dialog>
61 );
62};
63
64export default UpdateClientDialog;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…