Sfoglia il codice sorgente

find and add puesto superior

amenpunk 1 anno fa
parent
commit
39fb32f322
2 ha cambiato i file con 153 aggiunte e 371 eliminazioni
  1. 89 164
      src/Components/Modal/AgregarManual.js
  2. 64 207
      src/temp.js

+ 89 - 164
src/Components/Modal/AgregarManual.js

@@ -24,6 +24,19 @@ import { useSelector } from 'react-redux';
24 24
 
25 25
 const filter = createFilterOptions();
26 26
 
27
+  async function getPuestoSuperior  (puesto, auth) {
28
+    if (puesto.length < 3) return []
29
+    let rest = new Service(`/plaza/keypuestosup?keyword=${puesto}`)
30
+    let result = await rest.get(auth.token)
31
+    console.log(result)
32
+    if (result?.data?.length > 0) {
33
+      result = result.data.map((item) => ({ 'title': item.nombre, year: item.id }))
34
+      return result;
35
+    }
36
+    return [];
37
+  }
38
+
39
+
27 40
 function Manual(props) {
28 41
 
29 42
   const auth = useSelector((state) => state.token)
@@ -38,13 +51,14 @@ function Manual(props) {
38 51
     return await rest.getQuery(auth.token)
39 52
   }
40 53
 
54
+
41 55
   const { data } = useQuery('categories', getCategories);
42 56
   const { data: testsCatalog } = useQuery('tests', getTest);
43 57
   const queryClient = useQueryClient();
44 58
 
45 59
   const NewPlazaSchema = Yup.object().shape({
46 60
     nombrepuesto: Yup.string().required('El nombre es requerido').min(5, "El nombre del  puesto debe ser mayor a 5 caracteres").max(100),
47
-    puestosuperior: Yup.string().required("El puesto es requerido").min(5, "El nombre del  puesto debe ser mayor a 5 caracteres").max(15),
61
+    puestosuperior: Yup.string().required("El puesto es requerido").min(5, "El nombre del  puesto debe ser mayor a 5 caracteres").max(30),
48 62
     aredepto: Yup.number().required('Escoge alguna área'),
49 63
     fecha: Yup.date("Ingresa una fecha válida"),
50 64
     notas: Yup.string("Ingresa una nota válida").min(5, "Ingresa una nota válida").max(150),
@@ -52,11 +66,46 @@ function Manual(props) {
52 66
   })
53 67
 
54 68
   const [departamento, setDepartamento] = React.useState('');
55
-  const [puestoSup, setPuestoSup] = React.useState('The Godfather');
56 69
   const [open, setOpen] = React.useState(false);
57 70
   const [date, setDate] = React.useState(new Date());
58 71
   const [tab, setTab] = React.useState(0);
59 72
   const [checklist, setChecklist] = React.useState([]);
73
+  const [valueDialog, setValueDialog] = React.useState();
74
+  const [openDialog, toggleOpenDialog] = React.useState(false);
75
+  const [openSugg, setOpenSugg] = React.useState(false);
76
+  const [options, setOptions] = React.useState([]);
77
+  const [dialogValue, setDialogValue] = React.useState({
78
+    title: '',
79
+    year: '',
80
+  });
81
+
82
+  const loading = openSugg && options.length === 0;
83
+
84
+  React.useEffect(() => {
85
+
86
+    console.log('dialogValue', dialogValue)
87
+    let active = true;
88
+    console.log('loading', loading)
89
+    if (!loading) {
90
+      return undefined;
91
+    }
92
+
93
+    (async () => {
94
+      let puestos = await getPuestoSuperior(dialogValue.title, auth)
95
+      console.log('puestos', puestos)
96
+
97
+      if (active) {
98
+        setOptions(puestos);
99
+      }
100
+    })();
101
+
102
+    return () => {
103
+      active = false;
104
+    };
105
+
106
+  }, [loading, dialogValue, auth]);
107
+
108
+
60 109
 
61 110
   const handleClose = () => false
62 111
 
@@ -64,13 +113,6 @@ function Manual(props) {
64 113
     setDepartamento(event.target.value);
65 114
   };
66 115
 
67
-  const changePuestoSup = (event) => {
68
-    setPuestoSup(event.target.value);
69
-  };
70
-
71
-  const [valueDialog, setValueDialog] = React.useState(null);
72
-  const [openDialog, toggleOpenDialog] = React.useState(false);
73
-
74 116
   const handleCloseDialog = () => {
75 117
     setDialogValue({
76 118
       title: '',
@@ -79,10 +121,6 @@ function Manual(props) {
79 121
     toggleOpenDialog(false);
80 122
   };
81 123
 
82
-  const [dialogValue, setDialogValue] = React.useState({
83
-    title: '',
84
-    year: '',
85
-  });
86 124
 
87 125
   const handleSubmitDialog = (event) => {
88 126
     event.preventDefault();
@@ -94,6 +132,7 @@ function Manual(props) {
94 132
   };
95 133
 
96 134
   const AutoCompleteChange = (event, newValue) => {
135
+    console.log('newValue', newValue)
97 136
     if (typeof newValue === 'string') {
98 137
       // timeout to avoid instant validation of the dialog's form.
99 138
       setTimeout(() => {
@@ -166,7 +205,6 @@ function Manual(props) {
166 205
     setTab(newValue);
167 206
   };
168 207
 
169
-
170 208
   const { errors, touched, handleSubmit, getFieldProps, values, setValues } = formik;
171 209
 
172 210
   const addPrueba = (check, id) => {
@@ -316,11 +354,18 @@ function Manual(props) {
316 354
                       </Select>
317 355
 */}
318 356
 
319
-
320 357
                     <Autocomplete
321 358
                       fullWidth
322 359
                       value={valueDialog}
323 360
                       onChange={AutoCompleteChange}
361
+                      open={openSugg}
362
+                      onOpen={() => {
363
+                        setOpenSugg(true);
364
+                      }}
365
+                      onClose={() => {
366
+                        setOpenSugg(false);
367
+                      }}
368
+                      isOptionEqualToValue={(option, value) => option.title === value.title}
324 369
                       filterOptions={(options, params) => {
325 370
                         const filtered = filter(options, params);
326 371
 
@@ -334,7 +379,8 @@ function Manual(props) {
334 379
                         return filtered;
335 380
                       }}
336 381
                       id="puesto_superior_autocomplete"
337
-                      options={top100Films}
382
+                      options={options}
383
+                      loading={loading}
338 384
                       getOptionLabel={(option) => {
339 385
                         if (typeof option === 'string') {
340 386
                           return option;
@@ -349,29 +395,36 @@ function Manual(props) {
349 395
                       handleHomeEndKeys
350 396
                       renderOption={(props, option) => <li {...props}>{option.title}</li>}
351 397
                       freeSolo
352
-                      renderInput={(params) => <TextField {...params} label="Puesto Superior" />}
353
-                    />
398
+                      renderInput={(params) => (
399
+                        <TextField
400
+                          {...params}
401
+                          {...getFieldProps('puestosuperior')}
402
+                          error={Boolean(touched.puestosuperior && errors.puestosuperior)}
403
+                          label="Puesto Superior"
404
+                          InputProps={{
405
+                            ...params.InputProps,
406
+                            onChange: (event) => {
407
+                              let title = event.target.value;
408
+                              console.log(title)
409
+                              setOptions([]);
410
+                              setDialogValue({
411
+                                title: event.target.value,
412
+                                year: '',
413
+                              });
414
+                            },
415
+                            endAdornment: (
416
+                              <React.Fragment>
417
+                                {loading ? <CircularProgress color="inherit" size={20} /> : null}
418
+                                {params.InputProps.endAdornment}
419
+                              </React.Fragment>
420
+                            ),
421
+                          }}
422
+                        />
423
+                      )}
354 424
 
425
+                    />
355 426
 
356 427
 
357
-                    {/*
358
-                      <Autocomplete
359
-                        id="grouped-demo"
360
-                        value={puestoSup}
361
-                        label="Puesto Superior"
362
-                        freeSolo
363
-                        options={top100Films.map((option) => option.title)}
364
-                        renderInput={(params) =>
365
-                          <TextField
366
-                            onChange={changePuestoSup}
367
-                            error={Boolean(touched.puestosuperior && errors.puestosuperior)}
368
-                            {...getFieldProps('puestosuperior')}
369
-                            {...params}
370
-                            label="Puesto Superior" />
371
-                        }
372
-                      />
373
-*/}
374
-
375 428
                   </FormControl>
376 429
 
377 430
                 </Stack>
@@ -464,131 +517,3 @@ function Manual(props) {
464 517
   )
465 518
 }
466 519
 export default memo(Manual);
467
-
468
-const top100Films = [
469
-  { title: 'The Shawshank Redemption', year: 1994 },
470
-  { title: 'The Godfather', year: 1972 },
471
-  { title: 'The Godfather: Part II', year: 1974 },
472
-  { title: 'The Dark Knight', year: 2008 },
473
-  { title: '12 Angry Men', year: 1957 },
474
-  { title: "Schindler's List", year: 1993 },
475
-  { title: 'Pulp Fiction', year: 1994 },
476
-  {
477
-    title: 'The Lord of the Rings: The Return of the King',
478
-    year: 2003,
479
-  },
480
-  { title: 'The Good, the Bad and the Ugly', year: 1966 },
481
-  { title: 'Fight Club', year: 1999 },
482
-  {
483
-    title: 'The Lord of the Rings: The Fellowship of the Ring',
484
-    year: 2001,
485
-  },
486
-  {
487
-    title: 'Star Wars: Episode V - The Empire Strikes Back',
488
-    year: 1980,
489
-  },
490
-  { title: 'Forrest Gump', year: 1994 },
491
-  { title: 'Inception', year: 2010 },
492
-  {
493
-    title: 'The Lord of the Rings: The Two Towers',
494
-    year: 2002,
495
-  },
496
-  { title: "One Flew Over the Cuckoo's Nest", year: 1975 },
497
-  { title: 'Goodfellas', year: 1990 },
498
-  { title: 'The Matrix', year: 1999 },
499
-  { title: 'Seven Samurai', year: 1954 },
500
-  {
501
-    title: 'Star Wars: Episode IV - A New Hope',
502
-    year: 1977,
503
-  },
504
-  { title: 'City of God', year: 2002 },
505
-  { title: 'Se7en', year: 1995 },
506
-  { title: 'The Silence of the Lambs', year: 1991 },
507
-  { title: "It's a Wonderful Life", year: 1946 },
508
-  { title: 'Life Is Beautiful', year: 1997 },
509
-  { title: 'The Usual Suspects', year: 1995 },
510
-  { title: 'Léon: The Professional', year: 1994 },
511
-  { title: 'Spirited Away', year: 2001 },
512
-  { title: 'Saving Private Ryan', year: 1998 },
513
-  { title: 'Once Upon a Time in the West', year: 1968 },
514
-  { title: 'American History X', year: 1998 },
515
-  { title: 'Interstellar', year: 2014 },
516
-  { title: 'Casablanca', year: 1942 },
517
-  { title: 'City Lights', year: 1931 },
518
-  { title: 'Psycho', year: 1960 },
519
-  { title: 'The Green Mile', year: 1999 },
520
-  { title: 'The Intouchables', year: 2011 },
521
-  { title: 'Modern Times', year: 1936 },
522
-  { title: 'Raiders of the Lost Ark', year: 1981 },
523
-  { title: 'Rear Window', year: 1954 },
524
-  { title: 'The Pianist', year: 2002 },
525
-  { title: 'The Departed', year: 2006 },
526
-  { title: 'Terminator 2: Judgment Day', year: 1991 },
527
-  { title: 'Back to the Future', year: 1985 },
528
-  { title: 'Whiplash', year: 2014 },
529
-  { title: 'Gladiator', year: 2000 },
530
-  { title: 'Memento', year: 2000 },
531
-  { title: 'The Prestige', year: 2006 },
532
-  { title: 'The Lion King', year: 1994 },
533
-  { title: 'Apocalypse Now', year: 1979 },
534
-  { title: 'Alien', year: 1979 },
535
-  { title: 'Sunset Boulevard', year: 1950 },
536
-  {
537
-    title: 'Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb',
538
-    year: 1964,
539
-  },
540
-  { title: 'The Great Dictator', year: 1940 },
541
-  { title: 'Cinema Paradiso', year: 1988 },
542
-  { title: 'The Lives of Others', year: 2006 },
543
-  { title: 'Grave of the Fireflies', year: 1988 },
544
-  { title: 'Paths of Glory', year: 1957 },
545
-  { title: 'Django Unchained', year: 2012 },
546
-  { title: 'The Shining', year: 1980 },
547
-  { title: 'WALL·E', year: 2008 },
548
-  { title: 'American Beauty', year: 1999 },
549
-  { title: 'The Dark Knight Rises', year: 2012 },
550
-  { title: 'Princess Mononoke', year: 1997 },
551
-  { title: 'Aliens', year: 1986 },
552
-  { title: 'Oldboy', year: 2003 },
553
-  { title: 'Once Upon a Time in America', year: 1984 },
554
-  { title: 'Witness for the Prosecution', year: 1957 },
555
-  { title: 'Das Boot', year: 1981 },
556
-  { title: 'Citizen Kane', year: 1941 },
557
-  { title: 'North by Northwest', year: 1959 },
558
-  { title: 'Vertigo', year: 1958 },
559
-  {
560
-    title: 'Star Wars: Episode VI - Return of the Jedi',
561
-    year: 1983,
562
-  },
563
-  { title: 'Reservoir Dogs', year: 1992 },
564
-  { title: 'Braveheart', year: 1995 },
565
-  { title: 'M', year: 1931 },
566
-  { title: 'Requiem for a Dream', year: 2000 },
567
-  { title: 'Amélie', year: 2001 },
568
-  { title: 'A Clockwork Orange', year: 1971 },
569
-  { title: 'Like Stars on Earth', year: 2007 },
570
-  { title: 'Taxi Driver', year: 1976 },
571
-  { title: 'Lawrence of Arabia', year: 1962 },
572
-  { title: 'Double Indemnity', year: 1944 },
573
-  {
574
-    title: 'Eternal Sunshine of the Spotless Mind',
575
-    year: 2004,
576
-  },
577
-  { title: 'Amadeus', year: 1984 },
578
-  { title: 'To Kill a Mockingbird', year: 1962 },
579
-  { title: 'Toy Story 3', year: 2010 },
580
-  { title: 'Logan', year: 2017 },
581
-  { title: 'Full Metal Jacket', year: 1987 },
582
-  { title: 'Dangal', year: 2016 },
583
-  { title: 'The Sting', year: 1973 },
584
-  { title: '2001: A Space Odyssey', year: 1968 },
585
-  { title: "Singin' in the Rain", year: 1952 },
586
-  { title: 'Toy Story', year: 1995 },
587
-  { title: 'Bicycle Thieves', year: 1948 },
588
-  { title: 'The Kid', year: 1921 },
589
-  { title: 'Inglourious Basterds', year: 2009 },
590
-  { title: 'Snatch', year: 2000 },
591
-  { title: '3 Idiots', year: 2009 },
592
-  { title: 'Monty Python and the Holy Grail', year: 1975 },
593
-];
594
-

+ 64 - 207
src/temp.js

@@ -1,147 +1,81 @@
1 1
 import * as React from 'react';
2 2
 import TextField from '@mui/material/TextField';
3
-import Dialog from '@mui/material/Dialog';
4
-import DialogTitle from '@mui/material/DialogTitle';
5
-import DialogContent from '@mui/material/DialogContent';
6
-import DialogContentText from '@mui/material/DialogContentText';
7
-import DialogActions from '@mui/material/DialogActions';
8
-import Button from '@mui/material/Button';
9
-import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';
3
+import Autocomplete from '@mui/material/Autocomplete';
4
+import CircularProgress from '@mui/material/CircularProgress';
10 5
 
11
-const filter = createFilterOptions();
6
+function sleep(delay = 0) {
7
+  return new Promise((resolve) => {
8
+    setTimeout(resolve, delay);
9
+  });
10
+}
12 11
 
13
-export default function FreeSoloCreateOptionDialog() {
14
-  const [value, setValue] = React.useState(null);
15
-  const [open, toggleOpen] = React.useState(false);
12
+export default function Asynchronous() {
13
+  const [open, setOpen] = React.useState(false);
14
+  const [options, setOptions] = React.useState([]);
15
+  const loading = open && options.length === 0;
16 16
 
17
-  const handleClose = () => {
18
-    setDialogValue({
19
-      title: '',
20
-      year: '',
21
-    });
22
-    toggleOpen(false);
23
-  };
17
+  React.useEffect(() => {
18
+    let active = true;
24 19
 
25
-  const [dialogValue, setDialogValue] = React.useState({
26
-    title: '',
27
-    year: '',
28
-  });
20
+    if (!loading) {
21
+      return undefined;
22
+    }
29 23
 
30
-  const handleSubmit = (event) => {
31
-    event.preventDefault();
32
-    setValue({
33
-      title: dialogValue.title,
34
-      year: parseInt(dialogValue.year, 10),
35
-    });
36
-    handleClose();
37
-  };
24
+    (async () => {
25
+      await sleep(1e3); // For demo purposes.
38 26
 
39
-  return (
40
-    <React.Fragment>
41
-      <Autocomplete
42
-        value={value}
43
-        onChange={(event, newValue) => {
27
+      if (active) {
28
+        setOptions([...topFilms]);
29
+      }
30
+    })();
44 31
 
45
-          if (typeof newValue === 'string') {
46
-            // timeout to avoid instant validation of the dialog's form.
47
-            setTimeout(() => {
48
-              toggleOpen(true);
49
-              setDialogValue({
50
-                title: newValue,
51
-                year: '',
52
-              });
53
-            });
54
-          } else if (newValue && newValue.inputValue) {
55
-            toggleOpen(true);
56
-            setDialogValue({
57
-              title: newValue.inputValue,
58
-              year: '',
59
-            });
60
-          } else {
61
-            setValue(newValue);
62
-          }
63
-        }}
64
-        filterOptions={(options, params) => {
65
-          const filtered = filter(options, params);
32
+    return () => {
33
+      active = false;
34
+    };
35
+  }, [loading]);
66 36
 
67
-          if (params.inputValue !== '') {
68
-            filtered.push({
69
-              inputValue: params.inputValue,
70
-              title: `Add "${params.inputValue}"`,
71
-            });
72
-          }
37
+  React.useEffect(() => {
38
+    if (!open) {
39
+      setOptions([]);
40
+    }
41
+  }, [open]);
73 42
 
74
-          return filtered;
75
-        }}
76
-        id="free-solo-dialog-demo"
77
-        options={top100Films}
78
-        getOptionLabel={(option) => {
79
-          // e.g value selected with enter, right from the input
80
-          if (typeof option === 'string') {
81
-            return option;
82
-          }
83
-          if (option.inputValue) {
84
-            return option.inputValue;
85
-          }
86
-          return option.title;
87
-        }}
88
-        selectOnFocus
89
-        clearOnBlur
90
-        handleHomeEndKeys
91
-        renderOption={(props, option) => <li {...props}>{option.title}</li>}
92
-        sx={{ width: 300 }}
93
-        freeSolo
94
-        renderInput={(params) => <TextField {...params} label="Free solo dialog" />}
95
-      />
96
-      <Dialog open={open} onClose={handleClose}>
97
-        <form onSubmit={handleSubmit}>
98
-          <DialogTitle>Add a new film</DialogTitle>
99
-          <DialogContent>
100
-            <DialogContentText>
101
-              Did you miss any film in our list? Please, add it!
102
-            </DialogContentText>
103
-            <TextField
104
-              autoFocus
105
-              margin="dense"
106
-              id="name"
107
-              value={dialogValue.title}
108
-              onChange={(event) =>
109
-                setDialogValue({
110
-                  ...dialogValue,
111
-                  title: event.target.value,
112
-                })
113
-              }
114
-              label="title"
115
-              type="text"
116
-              variant="standard"
117
-            />
118
-            <TextField
119
-              margin="dense"
120
-              id="name"
121
-              value={dialogValue.year}
122
-              onChange={(event) =>
123
-                setDialogValue({
124
-                  ...dialogValue,
125
-                  year: event.target.value,
126
-                })
127
-              }
128
-              label="year"
129
-              type="number"
130
-              variant="standard"
131
-            />
132
-          </DialogContent>
133
-          <DialogActions>
134
-            <Button onClick={handleClose}>Cancel</Button>
135
-            <Button type="submit">Add</Button>
136
-          </DialogActions>
137
-        </form>
138
-      </Dialog>
139
-    </React.Fragment>
43
+  return (
44
+    <Autocomplete
45
+      id="asynchronous-demo"
46
+      sx={{ width: 300 }}
47
+      open={open}
48
+      onOpen={() => {
49
+        setOpen(true);
50
+      }}
51
+      onClose={() => {
52
+        setOpen(false);
53
+      }}
54
+      isOptionEqualToValue={(option, value) => option.title === value.title}
55
+      getOptionLabel={(option) => option.title}
56
+      options={options}
57
+      loading={loading}
58
+      renderInput={(params) => (
59
+        <TextField
60
+          {...params}
61
+          label="Asynchronous"
62
+          InputProps={{
63
+            ...params.InputProps,
64
+            endAdornment: (
65
+              <React.Fragment>
66
+                {loading ? <CircularProgress color="inherit" size={20} /> : null}
67
+                {params.InputProps.endAdornment}
68
+              </React.Fragment>
69
+            ),
70
+          }}
71
+        />
72
+      )}
73
+    />
140 74
   );
141 75
 }
142 76
 
143
-// Top 100 films as rated by IMDb users. http://www.imdb.com/chart/top
144
-const top100Films = [
77
+// Top films as rated by IMDb users. http://www.imdb.com/chart/top
78
+const topFilms = [
145 79
   { title: 'The Shawshank Redemption', year: 1994 },
146 80
   { title: 'The Godfather', year: 1972 },
147 81
   { title: 'The Godfather: Part II', year: 1974 },
@@ -189,81 +123,4 @@ const top100Films = [
189 123
   { title: 'Once Upon a Time in the West', year: 1968 },
190 124
   { title: 'American History X', year: 1998 },
191 125
   { title: 'Interstellar', year: 2014 },
192
-  { title: 'Casablanca', year: 1942 },
193
-  { title: 'City Lights', year: 1931 },
194
-  { title: 'Psycho', year: 1960 },
195
-  { title: 'The Green Mile', year: 1999 },
196
-  { title: 'The Intouchables', year: 2011 },
197
-  { title: 'Modern Times', year: 1936 },
198
-  { title: 'Raiders of the Lost Ark', year: 1981 },
199
-  { title: 'Rear Window', year: 1954 },
200
-  { title: 'The Pianist', year: 2002 },
201
-  { title: 'The Departed', year: 2006 },
202
-  { title: 'Terminator 2: Judgment Day', year: 1991 },
203
-  { title: 'Back to the Future', year: 1985 },
204
-  { title: 'Whiplash', year: 2014 },
205
-  { title: 'Gladiator', year: 2000 },
206
-  { title: 'Memento', year: 2000 },
207
-  { title: 'The Prestige', year: 2006 },
208
-  { title: 'The Lion King', year: 1994 },
209
-  { title: 'Apocalypse Now', year: 1979 },
210
-  { title: 'Alien', year: 1979 },
211
-  { title: 'Sunset Boulevard', year: 1950 },
212
-  {
213
-    title: 'Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb',
214
-    year: 1964,
215
-  },
216
-  { title: 'The Great Dictator', year: 1940 },
217
-  { title: 'Cinema Paradiso', year: 1988 },
218
-  { title: 'The Lives of Others', year: 2006 },
219
-  { title: 'Grave of the Fireflies', year: 1988 },
220
-  { title: 'Paths of Glory', year: 1957 },
221
-  { title: 'Django Unchained', year: 2012 },
222
-  { title: 'The Shining', year: 1980 },
223
-  { title: 'WALL·E', year: 2008 },
224
-  { title: 'American Beauty', year: 1999 },
225
-  { title: 'The Dark Knight Rises', year: 2012 },
226
-  { title: 'Princess Mononoke', year: 1997 },
227
-  { title: 'Aliens', year: 1986 },
228
-  { title: 'Oldboy', year: 2003 },
229
-  { title: 'Once Upon a Time in America', year: 1984 },
230
-  { title: 'Witness for the Prosecution', year: 1957 },
231
-  { title: 'Das Boot', year: 1981 },
232
-  { title: 'Citizen Kane', year: 1941 },
233
-  { title: 'North by Northwest', year: 1959 },
234
-  { title: 'Vertigo', year: 1958 },
235
-  {
236
-    title: 'Star Wars: Episode VI - Return of the Jedi',
237
-    year: 1983,
238
-  },
239
-  { title: 'Reservoir Dogs', year: 1992 },
240
-  { title: 'Braveheart', year: 1995 },
241
-  { title: 'M', year: 1931 },
242
-  { title: 'Requiem for a Dream', year: 2000 },
243
-  { title: 'Amélie', year: 2001 },
244
-  { title: 'A Clockwork Orange', year: 1971 },
245
-  { title: 'Like Stars on Earth', year: 2007 },
246
-  { title: 'Taxi Driver', year: 1976 },
247
-  { title: 'Lawrence of Arabia', year: 1962 },
248
-  { title: 'Double Indemnity', year: 1944 },
249
-  {
250
-    title: 'Eternal Sunshine of the Spotless Mind',
251
-    year: 2004,
252
-  },
253
-  { title: 'Amadeus', year: 1984 },
254
-  { title: 'To Kill a Mockingbird', year: 1962 },
255
-  { title: 'Toy Story 3', year: 2010 },
256
-  { title: 'Logan', year: 2017 },
257
-  { title: 'Full Metal Jacket', year: 1987 },
258
-  { title: 'Dangal', year: 2016 },
259
-  { title: 'The Sting', year: 1973 },
260
-  { title: '2001: A Space Odyssey', year: 1968 },
261
-  { title: "Singin' in the Rain", year: 1952 },
262
-  { title: 'Toy Story', year: 1995 },
263
-  { title: 'Bicycle Thieves', year: 1948 },
264
-  { title: 'The Kid', year: 1921 },
265
-  { title: 'Inglourious Basterds', year: 2009 },
266
-  { title: 'Snatch', year: 2000 },
267
-  { title: '3 Idiots', year: 2009 },
268
-  { title: 'Monty Python and the Holy Grail', year: 1975 },
269 126
 ];