@@ -15,16 +15,11 @@ import { ISignal, Signal } from '@lumino/signaling';
1515interface IProps {
1616 model : DriveListModel ;
1717}
18- // export interface IDrive {
19- // name: string;
20- // url: string;
21- // }
2218
2319export interface IDriveInputProps {
2420 isName : boolean ;
2521 value : string ;
2622 getValue : ( event : any ) => void ;
27- // updateSelectedDrives: (item: string, isName: boolean) => void;
2823}
2924export function DriveInputComponent ( props : IDriveInputProps ) {
3025 return (
@@ -34,12 +29,7 @@ export function DriveInputComponent(props: IDriveInputProps) {
3429 < Search className = "drive-search-input" onInput = { props . getValue } />
3530 </ div >
3631 < div className = "column" > </ div >
37- < Button
38- className = "input-add-drive-button"
39- onClick = { ( ) => {
40- // props.updateSelectedDrives(props.value, props.isName);
41- } }
42- >
32+ < Button className = "input-add-drive-button" onClick = { ( ) => { } } >
4333 add
4434 </ Button >
4535 </ div >
@@ -49,10 +39,8 @@ export function DriveInputComponent(props: IDriveInputProps) {
4939interface ISearchListProps {
5040 isName : boolean ;
5141 value : string ;
52- // filteredList: Array<string>;
5342 setValue : ( value : any ) => void ;
5443 availableDrives : Partial < IDriveInfo > [ ] ;
55- // updateSelectedDrives: (item: string, isName: boolean) => void;
5644 model : DriveListModel ;
5745}
5846
@@ -86,7 +74,6 @@ export function DriveSearchListComponent(props: ISearchListProps) {
8674 onClick = { async ( ) => {
8775 await includeDrive ( drive . name ! ) ;
8876 await props . model . refresh ( ) ;
89- // props.updateSelectedDrives(item, true);
9077 } }
9178 >
9279 add
@@ -133,15 +120,12 @@ export function DriveDataGridComponent(props: IDriveDataGridProps) {
133120export function DriveListManagerComponent ( { model } : IProps ) {
134121 const [ driveUrl , setDriveUrl ] = useState ( '' ) ;
135122 const [ searchDrive , setSearchDrive ] = useState ( '' ) ;
136- // let updatedSelectedDrives = [...model.selectedDrives];
137123 const [ selectedDrives , setSelectedDrives ] = useState < Partial < IDriveInfo > [ ] > (
138124 model . selectedDrives
139125 ) ;
140126 const [ availableDrives , setAvailableDrives ] = useState < Partial < IDriveInfo > [ ] > (
141127 model . availableDrives
142128 ) ;
143- // const [drivesFilteredList, setDrivesFilteredList] = useState<Partial<IDriveInfo>[]>(availableDrives);
144- // const nameList: Array<string> = [];
145129
146130 // Called after mounting.
147131 React . useEffect ( ( ) => {
@@ -155,31 +139,10 @@ export function DriveListManagerComponent({ model }: IProps) {
155139 } ) ;
156140 } , [ model ] ) ;
157141
158- // for (const item of availableDrives) {
159- // if (item.name !== '') {
160- // nameList.push(item.name!);
161- // }
162- // }
163-
164142 const getValue = ( event : any ) => {
165143 setDriveUrl ( event . target . value ) ;
166144 } ;
167145
168- // const filter = (event: any) => {
169- // const query = event.target.value;
170- // let updatedList: Partial<IDriveInfo>[];
171-
172- // updatedList = [...drivesFilteredList];
173- // updatedList = updatedList.filter((item: Partial<IDriveInfo>) => {
174- // return item.name!.toLowerCase().indexOf(query.toLowerCase()) !== -1;
175- // });
176- // setDrivesFilteredList(updatedList);
177- // // if (nameFilteredList.length === 1 && nameFilteredList[0] !== '') {
178- // // setDriveName(nameFilteredList[0]);
179- // // setDriveUrl('');
180- // // }
181- // };
182-
183146 return (
184147 < >
185148 < div className = "drive-list-manager" >
@@ -193,22 +156,14 @@ export function DriveListManagerComponent({ model }: IProps) {
193156 isName = { false }
194157 value = { driveUrl }
195158 getValue = { getValue }
196- // updateSelectedDrives={(value, isName) =>
197- // updateSelectedDrives(value, isName)
198- // }
199159 />
200160
201161 < div > Available drives </ div >
202162 < DriveSearchListComponent
203163 isName = { true }
204164 value = { searchDrive }
205165 setValue = { setSearchDrive }
206- // filteredList={drivesFilteredList}
207- // filter={filter}
208166 availableDrives = { availableDrives }
209- // updateSelectedDrives={(value, isName) =>
210- // // updateSelectedDrives(value, isName)
211- // }
212167 model = { model }
213168 />
214169 </ div >
0 commit comments