11import { SourceDataTypes } from "helpers/Constants" ;
2+ import { t } from "lang/helpers" ;
23import { AbstractSettingsHandler , SettingHandlerResponse } from "settings/handlers/AbstractSettingHandler" ;
34import { add_dropdown } from "settings/SettingsComponents" ;
45
56export class SourceDropDownHandler extends AbstractSettingsHandler {
67 settingTitle : string = 'Select the source of database data' ;
78 handle ( settingHandlerResponse : SettingHandlerResponse ) : SettingHandlerResponse {
89 const { settingsManager, containerEl, view } = settingHandlerResponse ;
10+ const sourceOptions : Record < string , string > = { } ;
11+ Object . entries ( SourceDataTypes ) . forEach ( ( [ key , value ] ) => {
12+ sourceOptions [ value ] = t ( value ) ;
13+ } ) ;
914 const source_dropdown_promise = async ( value : string ) : Promise < void > => {
1015 // update settings
1116 view . diskConfig . updateConfig ( { source_data : value } ) ;
@@ -18,13 +23,7 @@ export class SourceDropDownHandler extends AbstractSettingsHandler {
1823 this . settingTitle ,
1924 'Select from which source you want to get the data to be displayed in the table.' ,
2025 view . diskConfig . yaml . config . source_data ,
21- {
22- current_folder : SourceDataTypes . CURRENT_FOLDER ,
23- tag : SourceDataTypes . TAG ,
24- outgoing_link : SourceDataTypes . OUTGOING_LINK ,
25- incoming_link : SourceDataTypes . INCOMING_LINK ,
26- query : SourceDataTypes . QUERY ,
27- } ,
26+ sourceOptions ,
2827 source_dropdown_promise
2928 ) ;
3029 return this . goNext ( settingHandlerResponse ) ;
0 commit comments