Browse Source

Viewer configuration-loading order has changed:
init configuration < configuration key < extends

Raanan Weber 7 năm trước cách đây
mục cha
commit
97f3278018
1 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 3 4
      Viewer/src/configuration/loader.ts

+ 3 - 4
Viewer/src/configuration/loader.ts

@@ -36,8 +36,6 @@ export class ConfigurationLoader {
 
         let extendedConfiguration = getConfigurationType(loadedConfig.extends || "");
 
-        loadedConfig = deepmerge(extendedConfiguration, loadedConfig);
-
         if (loadedConfig.configuration) {
 
             let mapperType = "json";
@@ -72,13 +70,14 @@ export class ConfigurationLoader {
                 }
             }).then((data: any) => {
                 let mapper = mapperManager.getMapper(mapperType);
-                let parsed = mapper.map(data);
-                let merged = deepmerge(loadedConfig, parsed);
+                let parsed = deepmerge(mapper.map(data), loadedConfig);
+                let merged = deepmerge(extendedConfiguration, parsed);
                 processConfigurationCompatibility(merged);
                 if (callback) callback(merged);
                 return merged;
             });
         } else {
+            loadedConfig = deepmerge(extendedConfiguration, loadedConfig);
             processConfigurationCompatibility(loadedConfig);
             if (callback) callback(loadedConfig);
             return Promise.resolve(loadedConfig);