From b96f55a5140d2f7f22a48d84fb25a3d3880f6dd8 Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane <nathanael.jourdane@irap.omp.eu> Date: Thu, 14 Sep 2017 14:17:04 +0200 Subject: [PATCH] Fill more precisely tableName field when launching epntap from tree view --- js/app/models/LocalParamNode.js | 59 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/js/app/models/LocalParamNode.js b/js/app/models/LocalParamNode.js index 3393117..9412102 100644 --- a/js/app/models/LocalParamNode.js +++ b/js/app/models/LocalParamNode.js @@ -258,29 +258,38 @@ Ext.define('amdaModel.LocalParamNode', return this.get('isParameter'); }, - displayEpnTap: function() { - var missions = {'Rosetta': '67P'}; - var icons = { - 'icon-mercury': 'Mercury', - 'icon-venus': 'Venus', - 'icon-earth': 'Earth', - 'icon-mars': 'Mars', - 'icon-jupiter': 'Jupiter', - 'icon-saturn': 'Saturn', - 'icon-comet': 'Comet', - } - var filter = {'productType': 'all'}; - if(this.get('id') in missions) { - filter['targetName'] = missions[this.get('id')]; - } else if(this.get('iconCls') in icons) { - filter['targetName'] = icons[this.get('iconCls')]; - } else { - filter['targetName'] = ''; - } - filter['start'] = this.get('globalStart') ? this.get('globalStart') : ''; - filter['stop'] = this.get('globalStop') ? this.get('globalStop') : ''; - myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.interop.id, true, function (module) { - module.createWindow({'activeTab': 2, 'epntapFilter': filter}); - }); - } + displayEpnTap: function () { + const missions = { + 'Giotto': '1P', + 'ICE': '21P', + 'Rosetta': '67P', + 'Voyager': 'Jupiter, Io, Thébé, Métis Adrastée, Europe, ' + + 'Saturn, Atlas, Prométhée, Pandore, Téthys, Japet, Encelade, Uranus, Mirandaneptune, Triton', + 'Pioneer': 'Earth, Moon, Venus, Jupiter, Callisto, Ganymede, Io, Europa, Amalthea, Saturn, Iapetus, Phoebe, ' + + 'Hyperion, Epimetheus, Atlas, Dione, Mimas, Janus, Tethys, Enceladus, Calypso, Rhea, Titan', + 'Ulysses': 'Sun', + 'Solar_Probe_Plus': 'Sun', + 'Solar_Orbiter': 'Sun', + 'Ephemerides': 'Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Deimos, Phobos, 67P' + } + const icons = { + 'icon-mercury': 'Mercury', + 'icon-venus': 'Venus', + 'icon-earth': 'Earth', + 'icon-mars': 'Mars', + 'icon-jupiter': 'Jupiter', + 'icon-saturn': 'Saturn', + 'icon-sw': 'Earth, Sun' + } + + const targetName = this.get('id') in missions ? missions[this.get('id')] + : this.get('iconCls') in icons ? icons[this.get('iconCls')] + : '' + const start = this.get('globalStart') ? this.get('globalStart') : '' + const stop = this.get('globalStop') ? this.get('globalStop') : '' + const filter = {'productType': 'all', 'targetName': targetName, 'start': start, 'stop': stop} + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.interop.id, true, function (module) { + module.createWindow({'activeTab': 2, 'epntapFilter': filter}) + }) + } }); -- libgit2 0.21.2