File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -4540,14 +4540,21 @@ <h5 class="modal-title" id="githubConfigModalLabel">GitHub Configuration</h5>
45404540 }
45414541
45424542 function generateDatasetId ( ) {
4543- // Format: rdls_{risk_data_type }-{country }_{shortname}_{item }
4543+ // Format: rdls_{short_types }-{countries }_{shortname}_{items }
45444544 // Example: rdls_hzd-ury_ucra_fl or rdls_exp+lss-ury+ita_project_fl+pl
45454545
4546- const parts = [ 'rdls' ] ;
4546+ const parts = [ ] ;
45474547
4548- // 1. Build risk_data_type part (required)
4548+ // 1. Build risk_data_type part (required) with short codes
45494549 const riskDataTypes = currentFormData . risk_data_type || [ ] ;
4550- let riskTypePart = riskDataTypes . length > 0 ? riskDataTypes . join ( '+' ) : 'data' ;
4550+ const typeMap = {
4551+ 'hazard' : 'hzd' ,
4552+ 'exposure' : 'exp' ,
4553+ 'vulnerability' : 'vln' ,
4554+ 'loss' : 'lss'
4555+ } ;
4556+ const shortTypes = riskDataTypes . map ( type => typeMap [ type ] || type ) ;
4557+ let riskTypePart = shortTypes . length > 0 ? shortTypes . join ( '+' ) : 'data' ;
45514558
45524559 // 2. Get country codes (optional)
45534560 let countryCodes = [ ] ;
@@ -4561,7 +4568,7 @@ <h5 class="modal-title" id="githubConfigModalLabel">GitHub Configuration</h5>
45614568 if ( countryCodes . length > 0 ) {
45624569 riskTypePart += '-' + countryCodes . join ( '+' ) ;
45634570 }
4564- parts . push ( riskTypePart ) ;
4571+ parts . push ( 'rdls_' + riskTypePart ) ;
45654572
45664573 // 3. Get shortname from project or publisher (required)
45674574 let shortname = 'dataset' ;
You can’t perform that action at this time.
0 commit comments