Merge pull request #3890 from vvlladd28/improvement/size-bundle/1
UI: Optimized load jsZip
This commit is contained in:
		
						commit
						0ae74b77e3
					
				@ -54,7 +54,6 @@ import { ImportEntitiesResultInfo, ImportEntityData } from '@shared/models/entit
 | 
			
		||||
import { RequestConfig } from '@core/http/http-utils';
 | 
			
		||||
import { RuleChain, RuleChainImport, RuleChainMetaData } from '@shared/models/rule-chain.models';
 | 
			
		||||
import { RuleChainService } from '@core/http/rule-chain.service';
 | 
			
		||||
import * as JSZip from 'jszip';
 | 
			
		||||
import { FiltersInfo } from '@shared/models/query/query.models';
 | 
			
		||||
 | 
			
		||||
// @dynamic
 | 
			
		||||
@ -421,7 +420,8 @@ export class ImportExportService {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public exportJSZip(data: object, filename: string) {
 | 
			
		||||
    const jsZip = new JSZip();
 | 
			
		||||
    import('jszip').then((JSZip) => {
 | 
			
		||||
      const jsZip = new JSZip.default();
 | 
			
		||||
      for (const keyName in data) {
 | 
			
		||||
        if (data.hasOwnProperty(keyName)) {
 | 
			
		||||
          const valueData = data[keyName];
 | 
			
		||||
@ -431,6 +431,7 @@ export class ImportExportService {
 | 
			
		||||
      jsZip.generateAsync({type: 'blob'}).then(content => {
 | 
			
		||||
        this.downloadFile(content, filename, ZIP_TYPE);
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private prepareRuleChain(ruleChain: RuleChain): RuleChain {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user