@@ -22,52 +22,6 @@ import GroupWithAccordion, {
22
22
23
23
const App = ( ) => {
24
24
25
- const fetchDocumentation = ( configType ) => {
26
- if ( configType === 'metadata' ) {
27
- return ;
28
- }
29
- let docs = 'https://readthedocs.org/api/v3/embed/?format=json&url=https://open-sdg.readthedocs.io/en/latest/configuration/' ;
30
- if ( configType === 'indicator' ) {
31
- docs = 'https://readthedocs.org/api/v3/embed/?format=json&url=https://open-sdg.readthedocs.io/en/latest/indicator-configuration/' ;
32
- }
33
- fetch ( docs )
34
- . then ( response => {
35
- return response . json ( )
36
- } )
37
- . then ( data => {
38
- setDocumentation ( data ) ;
39
- } ) ;
40
- }
41
-
42
- const setDocumentation = ( data ) => {
43
- const el = document . createElement ( 'html' ) ;
44
- el . innerHTML = '<html><head><title>titleTest</title></head><body>' + data . content + '</body></html>' ;
45
- const section = el . querySelector ( '.section' ) ;
46
- let currentId = null ;
47
- const settings = { } ;
48
- for ( const child of section . children ) {
49
- if ( child . id ) {
50
- currentId = child . id ;
51
- }
52
- if ( currentId ) {
53
- if ( ! settings [ currentId ] ) {
54
- settings [ currentId ] = '' ;
55
- }
56
- settings [ currentId ] += child . outerHTML ;
57
- }
58
- }
59
- for ( const documentationKey of Object . keys ( settings ) ) {
60
- const accordionEl = document . getElementById ( documentationKey + '-documentation' ) ;
61
- if ( accordionEl ) {
62
- accordionEl . innerHTML = settings [ documentationKey ] ;
63
- const links = accordionEl . getElementsByTagName ( 'a' ) ;
64
- for ( const link of links ) {
65
- link . target = '_blank' ;
66
- }
67
- }
68
- }
69
- }
70
-
71
25
const theme = createTheme ( {
72
26
components : {
73
27
MuiTabs : {
@@ -129,14 +83,12 @@ const App = () => {
129
83
githubOwner,
130
84
repoUrl,
131
85
repositoryLink,
132
- configType,
133
86
} = opensdg . configForm ;
134
87
const [ formData , setFormData ] = useState ( initialData ) ;
135
88
const [ formErrors , setFormErrors ] = useState ( null ) ;
136
89
const jsonformsConfig = {
137
90
showUnfocusedDescription : true ,
138
91
} ;
139
- setTimeout ( fetchDocumentation . bind ( null , configType ) , 2000 ) ;
140
92
return (
141
93
< >
142
94
< SearchBar
0 commit comments