graphdb-workbench 2.3.0-TR6 → 2.3.0-TR7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/{0.15196c70676b993db356.bundle.js → 0.48f0a08c129cab95f345.bundle.js} +3 -3
  2. package/dist/0.48f0a08c129cab95f345.bundle.js.map +1 -0
  3. package/dist/108.112426f55d9e34a78ab3.bundle.js +2 -0
  4. package/dist/108.112426f55d9e34a78ab3.bundle.js.map +1 -0
  5. package/dist/{11.e3c940aa59365084050b.bundle.js → 11.4928d8d13ff46f3872bb.bundle.js} +2 -2
  6. package/dist/11.4928d8d13ff46f3872bb.bundle.js.map +1 -0
  7. package/dist/129.c42b901c27e8de081b82.bundle.js +2 -0
  8. package/dist/129.c42b901c27e8de081b82.bundle.js.map +1 -0
  9. package/dist/148.45985ae23de642595544.bundle.js +1 -1
  10. package/dist/148.45985ae23de642595544.bundle.js.map +1 -1
  11. package/dist/20.4eb25ede434dc329ecf1.bundle.js +1 -1
  12. package/dist/20.4eb25ede434dc329ecf1.bundle.js.map +1 -1
  13. package/dist/{21.dd1a8782fa1bea210dc2.bundle.js → 21.62777310f384dd7b71a4.bundle.js} +2 -2
  14. package/dist/21.62777310f384dd7b71a4.bundle.js.map +1 -0
  15. package/dist/{25.c2d2c79cbb29e36a4cce.bundle.js → 25.dad934ee482c9b825245.bundle.js} +2 -2
  16. package/dist/25.dad934ee482c9b825245.bundle.js.map +1 -0
  17. package/dist/27.fef157d9275358c9f1a0.bundle.js +1 -1
  18. package/dist/27.fef157d9275358c9f1a0.bundle.js.map +1 -1
  19. package/dist/{3.d06a0ca122c78522c911.bundle.js → 3.d4e2ee6def5774b8b495.bundle.js} +2 -2
  20. package/dist/3.d4e2ee6def5774b8b495.bundle.js.map +1 -0
  21. package/dist/33.fde8076c81c87c25c367.bundle.js +1 -1
  22. package/dist/33.fde8076c81c87c25c367.bundle.js.map +1 -1
  23. package/dist/{39.0eebc4b972cff879c1c9.bundle.js → 39.ecdfa8a15c661473c246.bundle.js} +2 -2
  24. package/dist/39.ecdfa8a15c661473c246.bundle.js.map +1 -0
  25. package/dist/40.10f42e3f6d8d87bd3221.bundle.js +1 -1
  26. package/dist/40.10f42e3f6d8d87bd3221.bundle.js.map +1 -1
  27. package/dist/62.eff529f903ab72e57c23.bundle.js +2 -0
  28. package/dist/62.eff529f903ab72e57c23.bundle.js.map +1 -0
  29. package/dist/94.94158487a9024ff3a623.bundle.js +1 -1
  30. package/dist/94.94158487a9024ff3a623.bundle.js.map +1 -1
  31. package/dist/{bundle.00cc9035be8b524d4240.bundle.js → bundle.896281e5e7a26024597b.bundle.js} +3 -3
  32. package/dist/bundle.896281e5e7a26024597b.bundle.js.map +1 -0
  33. package/dist/css/yasr.custom.css +9 -7
  34. package/dist/i18n/locale-en.json +2 -1
  35. package/dist/i18n/locale-fr.json +2 -1
  36. package/dist/index.html +4 -4
  37. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  38. package/dist/{main.59e407d8a8b46a1a9bad.css → main.c29920c7f6f6ecb00cae.css} +1 -1
  39. package/dist/pages/autocomplete.html +1 -1
  40. package/dist/pages/choose-repository-type.html +1 -1
  41. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  42. package/dist/pages/create-index.html +4 -4
  43. package/dist/pages/dependencies.html +1 -1
  44. package/dist/pages/domainRangeInfo.html +2 -2
  45. package/dist/pages/edit.html +1 -1
  46. package/dist/pages/explore.html +1 -1
  47. package/dist/pages/export.html +1 -1
  48. package/dist/pages/find.html +1 -1
  49. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  50. package/dist/pages/graphs-visualizations.html +7 -7
  51. package/dist/pages/guides.html +1 -1
  52. package/dist/pages/import.html +1 -1
  53. package/dist/pages/jdbc-create.html +5 -5
  54. package/dist/pages/monitor/queries.html +1 -1
  55. package/dist/pages/monitor/resources.html +2 -2
  56. package/dist/pages/namespaces.html +2 -2
  57. package/dist/pages/plugins.html +1 -1
  58. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  59. package/dist/pages/rdfrank.html +2 -2
  60. package/dist/pages/repositories.html +2 -2
  61. package/dist/pages/repository.html +2 -2
  62. package/dist/pages/similarity-indexes.html +1 -1
  63. package/dist/pages/sparql-template-create.html +5 -5
  64. package/dist/pages/sparql.html +3 -3
  65. package/dist/pages/webapi.html +2 -2
  66. package/dist/plugins.js +2 -1
  67. package/dist/res/swagger/index.html +27 -27
  68. package/package.json +1 -1
  69. package/dist/0.15196c70676b993db356.bundle.js.map +0 -1
  70. package/dist/108.d415d719be3fc3a428f4.bundle.js +0 -2
  71. package/dist/108.d415d719be3fc3a428f4.bundle.js.map +0 -1
  72. package/dist/11.e3c940aa59365084050b.bundle.js.map +0 -1
  73. package/dist/129.02e23389a50348366a13.bundle.js +0 -2
  74. package/dist/129.02e23389a50348366a13.bundle.js.map +0 -1
  75. package/dist/21.dd1a8782fa1bea210dc2.bundle.js.map +0 -1
  76. package/dist/25.c2d2c79cbb29e36a4cce.bundle.js.map +0 -1
  77. package/dist/3.d06a0ca122c78522c911.bundle.js.map +0 -1
  78. package/dist/39.0eebc4b972cff879c1c9.bundle.js.map +0 -1
  79. package/dist/62.35e111a570b5e038fdea.bundle.js +0 -2
  80. package/dist/62.35e111a570b5e038fdea.bundle.js.map +0 -1
  81. package/dist/bundle.00cc9035be8b524d4240.bundle.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/utils/notifications.js","webpack:///./src/js/angular/graphexplore/controllers/graphs-config.controller.js"],"names":["Notifications","toastr","$translate","showToastMessageWithDelay","message","Promise","r","success","instant","setTimeout","angular","module","factory","$inject","GraphConfigCtrl","$scope","$timeout","$location","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","selectedFixedNodeChanged","page","totalPages","helpHidden","get","HIDE_GRAPH_CONFIG_HELP","toggleHelp","value","undefined","set","fixedVisualCallback","uri","label","newConfig","startIRI","startIRILabel","isDefaultGraph","sample","name","isUserGraph","getSampleName","property","extra","id","configName","showInvalidMsg","warning","getQueryForCurrentPage","config","query","startMode","startGraphQuery","expandQuery","resourceQuery","predicateLabelQuery","resourcePropertiesQuery","isDefined","initForConfig","checkAutocompleteStatus","getAutocompletePromise","getGraphConfigSamples","data","samples","_","filter","s","revertConfig","error","getError","createGraphConfig","async","url","updateGraphConfig","$on","getNamespacesPromise","getNamespaces","getActiveRepository","validateQueryWithCallback","successCallback","queryType","params","all","oneOf","validateQuery","broadcastAddStartFixedNodeEvent","checkPageAndMode","$broadcast","validateCurrentPage","updateModel","goToPage","nextPage","showEditor","notoolbar","goToPreviousPage","goToNextPage","saveGraphConfig","startQueryIncludeInferred","currentQuery","inference","startQuerySameAs","sameAs","isUpdate","window","editor","getValue","trim","setQuery","setValue","updateDirty","q1","q2","queryEditorIsDirty","updateEditor","isActiveRepoOntopType","nocount","loadTab","selectTab","xhr","abort","viewMode","showPreview","outputType","runQuery","revertEditor","$watch","shared","encodeQuery","encodeURIComponent","getConfig","defaultTabConfig","saveQueryToLocal","currentQueryTab","setLoader","isRunning","progressMessage","extraMessage","yasrInnerContainer","element","document","getElementById","queryIsRunning","queryStartTime","Date","now","countTimeouted","addClass","removeClass","$$phase","$apply","fixSizesOnHorizontalViewModeSwitch","verticalViewParam","visibleWindowHeight","innerHeight","documentElement","clientHeight","body","verticalView","orientationViewMode","newHeight","querySelector","getBoundingClientRect","style","height","noPadding","minHeight","paddingRight","paddingLeft","timer","cancel","yasr","container","resize","showHideEditor","$","tab","changePage","explain","executedQueryTab","getQueryType","getQueryMode","explainRequested","currentTabConfig","resultsCount","resetCurrentTabConfig","getRepositoryNamespaces","usedPrefixes","results","bindings","forEach","e","prefix","namespace","namespaces","repositoryError","finally","addKnownPrefixes","JSON","stringify","msg","getExistingTabId","existingTabId","tabsData","item","offset","allResultsCount","pageSize","timeFinished","timeTook","sizeDelta","css","getQueryID","attr","queryExists","tabs","saveTab","idx","i","length","findTabIndexByID","addNewTab","callback","tabName","savedQuery","changePagination","toggleSampleQueries","querySelected","tabId","getLoaderMessage","timeSeconds","timeHuman","getHumanReadableSeconds","changeViewMode","tabID","remove","focusQueryEditor","find","is","focus","on","$watchCollection","tabEvent","relatedTarget","target","copy","showSampleQueries","sampleQueries","getResultsDescription","getUpdateDescription","getStaleWarningMessage","controller"],"mappings":"+EAMA,SAASA,EAAcC,EAAQC,GAC3B,MAAO,CACHC,0BASJ,SAAmCC,GAC/B,OAAO,IAAIC,QAASC,IAChBL,EAAOM,QAAQL,EAAWM,QAAQJ,IAClCK,WAAWH,EAAG,SApB1BI,QACKC,OAAO,wCAAyC,IAChDC,QAAQ,gBAAiBZ,GAE9BA,EAAca,QAAU,CAAC,SAAU,e,gCCJnC,kBAYA,SAASC,EAAgBC,EAAQC,EAAUC,EAAWhB,EAAQiB,EAAeC,EAAmBC,EAASC,EAAwBC,EAAyBC,EAAcvB,EAAewB,EAA8BC,EAAqBC,EAAQxB,GAoB9O,IAAIyB,EAlBJZ,EAAOa,KAAO,EACdb,EAAOc,WAAa,EAEpBd,EAAOe,WAAwE,IAA3DL,EAAoBM,IAAIL,EAAOM,wBAEnDjB,EAAOkB,WAAa,SAAUC,QACZC,IAAVD,IACAA,EAAQT,EAAoBM,IAAIL,EAAOM,yBAE7B,IAAVE,GACAT,EAAoBW,IAAIV,EAAOM,uBAAwB,GACvDjB,EAAOe,YAAa,IAEpBL,EAAoBW,IAAIV,EAAOM,uBAAwB,GACvDjB,EAAOe,YAAa,IAK5Bf,EAAOsB,oBAAsB,SAAUC,EAAKC,GACxCxB,EAAOyB,UAAUC,SAAWH,EAC5BvB,EAAOyB,UAAUE,cAAgBH,EACjCZ,GAA2B,GAG/BZ,EAAO4B,eAAiB,SAAUC,GAC9B,MAAwB,YAAhBA,EAAOC,MAAsC,aAAhBD,EAAOC,MAGhD9B,EAAO+B,YAAc,S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oB,EAC3B5O,EAAOsN,WAAa,GACpBtN,EAAO6O,cAAgB,GAEvB7O,EAAO8O,sBAAwB,aAG/B9O,EAAO+O,qBAAuB,aAG9B/O,EAAOgP,uBAAyB,aAvsBpCrP,QACKC,OAAO,6DAA8D,CAClE,wCACA,gDAEHqP,WAAW,kBAAmBlP,GAEnCA,EAAgBD,QAAU,CAAC,SAAU,WAAY,YAAa,SAAU,gBAAiB,oBAAqB,UAAW,yBAA0B,0BAA2B,eAAgB,gBAAiB,+BAAgC,sBAAuB,SAAU","file":"39.0eebc4b972cff879c1c9.bundle.js","sourcesContent":["angular\n .module('graphdb.framework.utils.notifications', [])\n .factory('Notifications', Notifications);\n\nNotifications.$inject = ['toastr', '$translate'];\n\nfunction Notifications(toastr, $translate) {\n return {\n showToastMessageWithDelay\n };\n\n /**\n * This method will show message with tiny delay and only after completion\n * of latter redirection to \"graphs-visualizations\" page will happen.\n * @param {string} message The message to be displayed.\n * @return {Promise<any>}\n */\n function showToastMessageWithDelay(message) {\n return new Promise((r) => {\n toastr.success($translate.instant(message));\n setTimeout(r, 200);\n });\n }\n}\n","import 'angular/utils/notifications';\nimport 'angular/utils/local-storage-adapter';\n\nangular\n .module('graphdb.framework.graphexplore.controllers.graphviz.config', [\n 'graphdb.framework.utils.notifications',\n 'graphdb.framework.utils.localstorageadapter'\n ])\n .controller('GraphConfigCtrl', GraphConfigCtrl);\n\nGraphConfigCtrl.$inject = ['$scope', '$timeout', '$location', 'toastr', '$repositories', 'SparqlRestService', '$filter', 'GraphConfigRestService', 'AutocompleteRestService', '$routeParams', 'Notifications', 'RDF4JRepositoriesRestService', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction GraphConfigCtrl($scope, $timeout, $location, toastr, $repositories, SparqlRestService, $filter, GraphConfigRestService, AutocompleteRestService, $routeParams, Notifications, RDF4JRepositoriesRestService, LocalStorageAdapter, LSKeys, $translate) {\n\n $scope.page = 1;\n $scope.totalPages = 5;\n\n $scope.helpHidden = LocalStorageAdapter.get(LSKeys.HIDE_GRAPH_CONFIG_HELP) === 1;\n\n $scope.toggleHelp = function (value) {\n if (value === undefined) {\n value = LocalStorageAdapter.get(LSKeys.HIDE_GRAPH_CONFIG_HELP);\n }\n if (value !== 1) {\n LocalStorageAdapter.set(LSKeys.HIDE_GRAPH_CONFIG_HELP, 1);\n $scope.helpHidden = true;\n } else {\n LocalStorageAdapter.set(LSKeys.HIDE_GRAPH_CONFIG_HELP, 0);\n $scope.helpHidden = false;\n }\n };\n\n var selectedFixedNodeChanged;\n $scope.fixedVisualCallback = function (uri, label) {\n $scope.newConfig.startIRI = uri;\n $scope.newConfig.startIRILabel = label;\n selectedFixedNodeChanged = true;\n };\n\n $scope.isDefaultGraph = function (sample) {\n return (sample.name === 'Minimal' || sample.name === 'Advanced');\n };\n\n $scope.isUserGraph = function (sample) {\n return !$scope.isDefaultGraph(sample);\n };\n\n $scope.getSampleName = function (sample, property) {\n const extra = sample[property + 'Description'];\n if (extra) {\n // Sample has description, use it\n return extra;\n } else {\n // Sample is a copy of existing config, prepend Copy of to name\n return sample.id ? 'Copy of ' + sample.name : sample.name;\n }\n };\n\n const getGraphConfigSamples = function () {\n GraphConfigRestService.getGraphConfigSamples()\n .success(function (data) {\n $scope.samples = _.filter(data, function (s) {\n // Skip the currently edited config from samples and store it into a revert variable\n if (!s.id || $scope.newConfig.id !== s.id) {\n return true;\n } else {\n $scope.revertConfig = s;\n return false;\n }\n });\n }).error(function (data) {\n toastr.error(getError(data), $translate.instant('graphexplore.error.graph.configs'));\n });\n };\n\n const configName = $routeParams.configName;\n $scope.newConfig = {startQueryIncludeInferred: true, startQuerySameAs: true};\n $scope.newConfig.startMode = 'search';\n $scope.isUpdate = false;\n $scope.shared = false;\n\n $scope.encodeQuery = function (query) {\n return encodeURIComponent(query);\n };\n\n function showInvalidMsg(message) {\n toastr.warning(message);\n }\n\n if (configName) {\n $scope.isUpdate = true;\n GraphConfigRestService.getConfig(configName)\n .success(function (data) {\n $scope.newConfig = data;\n initForConfig();\n })\n .error(function (data) {\n toastr.error(getError(data), $translate.instant('created.connector', {name: configName}));\n });\n } else {\n $scope.isUpdate = false;\n initForConfig();\n }\n\n function getQueryForCurrentPage(config) {\n let query;\n\n if (config.startMode === 'query' && $scope.page === 1) {\n query = config.startGraphQuery;\n } else if ($scope.page === 2) {\n query = config.expandQuery;\n } else if ($scope.page === 3) {\n query = config.resourceQuery;\n } else if ($scope.page === 4) {\n query = config.predicateLabelQuery;\n } else if ($scope.page === 5) {\n query = config.resourcePropertiesQuery;\n }\n\n return angular.isDefined(query) ? query : '';\n }\n\n function initForConfig() {\n getGraphConfigSamples();\n $scope.createGraphConfig = function () {\n GraphConfigRestService.createGraphConfig($scope.newConfig)\n .success(async function () {\n await Notifications.showToastMessageWithDelay('graphexplore.saved.new.config');\n $location.url('graphs-visualizations');\n }).error(function (data) {\n toastr.error(getError(data), $translate.instant('graphexplore.error.could.not.create'));\n });\n };\n\n $scope.updateGraphConfig = function () {\n GraphConfigRestService.updateGraphConfig($scope.newConfig)\n .success(async function () {\n await Notifications.showToastMessageWithDelay('graphexplore.saved.config');\n $location.url('graphs-visualizations');\n }).error(function (data) {\n toastr.error(getError(data), $translate.instant('graphexplore.error.could.not.save'));\n });\n };\n\n function checkAutocompleteStatus() {\n $scope.getAutocompletePromise = AutocompleteRestService.checkAutocompleteStatus();\n }\n\n $scope.$on('autocompleteStatus', function() {\n checkAutocompleteStatus();\n });\n\n checkAutocompleteStatus();\n $scope.getNamespacesPromise = RDF4JRepositoriesRestService.getNamespaces($scope.getActiveRepository());\n\n const validateQueryWithCallback = function (successCallback, query, queryType, params, all, oneOf) {\n if (!query) {\n successCallback();\n } else {\n GraphConfigRestService.validateQuery(query, queryType, params, all, oneOf)\n .success(function () {\n successCallback();\n }).error(function (data) {\n showInvalidMsg(getError(data));\n });\n }\n };\n\n $scope.validateCurrentPage = function (successCallback) {\n $scope.updateModel();\n\n if ($scope.page === 1) {\n if ($scope.newConfig.startMode === 'node' && !$scope.newConfig.startIRI) {\n showInvalidMsg($translate.instant('graphexplore.select.start.node'));\n } else if ($scope.newConfig.startMode === 'query' && !$scope.newConfig.startGraphQuery) {\n showInvalidMsg($translate.instant('graphexplore.provide.query'));\n } else if ($scope.newConfig.startMode === 'query') {\n validateQueryWithCallback(successCallback, $scope.newConfig.startGraphQuery, 'graph')\n } else {\n successCallback();\n }\n } else if ($scope.page === 2) {\n validateQueryWithCallback(successCallback, $scope.newConfig.expandQuery, 'construct', ['node'])\n } else if ($scope.page === 3) {\n validateQueryWithCallback(successCallback, $scope.newConfig.resourceQuery, 'tuple', ['node'], [], ['type', 'label', 'comment', 'rank']);\n } else if ($scope.page === 4) {\n validateQueryWithCallback(successCallback, $scope.newConfig.predicateLabelQuery, 'tuple', ['edge'], ['label']);\n } else if ($scope.page === 5) {\n validateQueryWithCallback(successCallback, $scope.newConfig.resourcePropertiesQuery, 'tuple', ['node'], ['property', 'value']);\n }\n };\n\n $scope.goToPage = function (nextPage) {\n if ($scope.page === nextPage) {\n // already there\n return;\n }\n\n $scope.validateCurrentPage(function () {\n $scope.showEditor();\n $scope.page = nextPage;\n $scope.notoolbar = $scope.page !== 1;\n });\n };\n\n $scope.goToPreviousPage = function () {\n if ($scope.page > 1) {\n $scope.goToPage($scope.page - 1);\n }\n\n if (checkPageAndMode()) {\n selectedFixedNodeChanged = false;\n }\n };\n\n $scope.goToNextPage = function () {\n broadcastAddStartFixedNodeEvent();\n if ($scope.newConfig.startMode !== 'node' || selectedFixedNodeChanged) {\n $scope.goToPage($scope.page + 1);\n }\n };\n\n function broadcastAddStartFixedNodeEvent() {\n if (checkPageAndMode()) {\n $scope.$broadcast('addStartFixedNodeAutomatically', {startIRI: $scope.newConfig.startIRI});\n }\n }\n\n function checkPageAndMode() {\n return $scope.page === 1 && $scope.newConfig.startMode === 'node';\n }\n\n $scope.saveGraphConfig = function () {\n broadcastAddStartFixedNodeEvent();\n\n if (checkPageAndMode() && !selectedFixedNodeChanged) {\n return;\n }\n\n $scope.newConfig.startQueryIncludeInferred = $scope.currentQuery.inference;\n $scope.newConfig.startQuerySameAs = $scope.currentQuery.sameAs;\n\n $scope.validateCurrentPage(function () {\n if (!$scope.newConfig.name) {\n showInvalidMsg($translate.instant('graphexplore.provide.config.name'));\n return;\n }\n $scope.isUpdate ? $scope.updateGraphConfig($scope.newConfig) : $scope.createGraphConfig($scope.newConfig);\n });\n };\n\n $scope.updateModel = function () {\n const query = window.editor.getValue().trim();\n if ($scope.newConfig.startMode === 'query' && $scope.page === 1) {\n $scope.newConfig.startGraphQuery = query;\n } else if ($scope.page === 2) {\n $scope.newConfig.expandQuery = query;\n } else if ($scope.page === 3) {\n $scope.newConfig.resourceQuery = query;\n } else if ($scope.page === 4) {\n $scope.newConfig.predicateLabelQuery = query;\n } else if ($scope.page === 5) {\n $scope.newConfig.resourcePropertiesQuery = query;\n }\n };\n\n // Called when user clicks on a sample query\n $scope.setQuery = function (query) {\n // Hack for YASQE bug\n window.editor.setValue(query ? query : ' ');\n };\n\n $scope.updateDirty = function () {\n if ($scope.revertConfig) {\n const q1 = getQueryForCurrentPage($scope.revertConfig);\n const q2 = window.editor.getValue().trim();\n $scope.queryEditorIsDirty = q1 !== q2;\n }\n };\n\n // Updates the position of the query editor to match the current div placeholder\n // and sets the editor's query to the relevant query from the model.\n $scope.updateEditor = function () {\n $timeout(function () {\n $scope.currentQuery.query = getQueryForCurrentPage($scope.newConfig);\n // // Check for ontop repository and override nocount property (it's default value is false)\n if ($repositories.isActiveRepoOntopType()) {\n $scope.nocount = true;\n }\n $scope.currentQuery.inference = $scope.newConfig.startQueryIncludeInferred;\n $scope.currentQuery.sameAs = $scope.newConfig.startQuerySameAs;\n loadTab();\n selectTab($scope.currentQuery.id);\n }, 100);\n\n };\n\n $scope.showEditor = function () {\n if (window.editor && window.editor.xhr) {\n window.editor.xhr.abort();\n }\n $scope.viewMode = 'yasr';\n };\n\n $scope.showPreview = function () {\n // For some reason YASR gets confused and sets this to rawResponse\n // if we execute a CONSTRUCT and then a SELECT. This makes sure it's always table.\n $scope.currentQuery.outputType = 'table';\n $scope.runQuery();\n };\n\n $scope.revertEditor = function () {\n $scope.setQuery(getQueryForCurrentPage($scope.revertConfig));\n };\n\n // Trigger for showing the editor and moving it to the right position\n $scope.$watch('newConfig.startMode', function (value) {\n if (value === 'query') {\n $timeout(function () {\n $scope.updateEditor();\n }, 0);\n }\n });\n\n // Trigger for showing the editor and moving it to the right position\n $scope.$watch('page', function (value) {\n if ($scope.newConfig.startMode === 'query' || value > 1) {\n $timeout(function () {\n $scope.showEditor();\n $scope.updateEditor();\n }, 0);\n }\n });\n }\n\n // DOWN HERE WE KEEP EVERYTHING PURELY QUERY EDITOR (MOSTLY BORROWED FROM query-editor.controller.js)\n // But Why? Can't we reuse it instead of borrow?\n\n const defaultTabConfig = {\n id: '1',\n name: '',\n query: 'select * where { \\n' +\n '\\t?s ?p ?o .\\n' +\n '} limit 100 \\n',\n inference: $scope.newConfig.startQueryIncludeInferred,\n sameAs: $scope.newConfig.startQuerySameAs\n };\n\n $scope.resetCurrentTabConfig = function () {\n $scope.currentTabConfig = {\n pageSize: 100, // page limit 100 as this is only used for preview\n page: 1,\n allResultsCount: 0,\n resultsCount: 0\n };\n };\n\n $scope.queryExists = false;\n\n $scope.resetCurrentTabConfig();\n\n $scope.tabsData = $scope.tabs = [defaultTabConfig];\n\n // query tab operations\n $scope.saveTab = saveTab;\n $scope.loadTab = loadTab;\n $scope.addNewTab = addNewTab;\n\n // query operations\n $scope.runQuery = runQuery;\n $scope.getNamespaces = getNamespaces;\n $scope.changePagination = changePagination;\n $scope.toggleSampleQueries = toggleSampleQueries;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.getExistingTabId = getExistingTabId;\n $scope.querySelected = querySelected;\n $scope.saveQueryToLocal = saveQueryToLocal;\n\n $scope.setLoader = setLoader;\n $scope.getLoaderMessage = getLoaderMessage;\n\n // query editor and results orientation\n $scope.fixSizesOnHorizontalViewModeSwitch = fixSizesOnHorizontalViewModeSwitch;\n $scope.changeViewMode = changeViewMode;\n $scope.showHideEditor = showHideEditor;\n $scope.focusQueryEditor = focusQueryEditor;\n $scope.orientationViewMode = true;\n\n // start of repository actions\n\n function saveQueryToLocal(currentQueryTab) {\n }\n\n function setLoader(isRunning, progressMessage, extraMessage) {\n const yasrInnerContainer = angular.element(document.getElementById('yasr-inner'));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n yasrInnerContainer.addClass('hide');\n } else {\n $scope.progressMessage = '';\n $scope.extraMessage = '';\n yasrInnerContainer.removeClass('hide');\n }\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function getLoaderMessage() {\n const timeSeconds = (Date.now() - $scope.queryStartTime) / 1000;\n const timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n let message;\n\n if ($scope.progressMessage) {\n message = $scope.progressMessage + '... ' + timeHuman;\n } else {\n message = $translate.instant('common.running.operation', {timeHuman: timeHuman});\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += '\\n' + $scope.extraMessage;\n }\n\n return message;\n }\n\n\n // start of query editor results orientation operations\n function fixSizesOnHorizontalViewModeSwitch(verticalViewParam) {\n function visibleWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;\n }\n\n const codemirrorWrapperSelector = '.CodeMirror-wrap';\n const verticalView = verticalViewParam;\n if (!$scope.orientationViewMode) {\n $scope.noPadding = {paddingRight: 15, paddingLeft: 0};\n\n // window.editor is undefined if no repo is selected\n if (window.editor && document.querySelector(codemirrorWrapperSelector)) {\n let newHeight = visibleWindowHeight() - (document.querySelector(codemirrorWrapperSelector).getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector(codemirrorWrapperSelector).style.height = newHeight + 'px';\n document.getElementById('yasr').style.minHeight = newHeight + 'px';\n } else {\n let timer;\n if (verticalView) {\n timer = $timeout(function () {\n $scope.fixSizesOnHorizontalViewModeSwitch(verticalView)\n }, 100);\n } else {\n timer = $timeout($scope.fixSizesOnHorizontalViewModeSwitch, 100);\n }\n\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n }\n } else {\n if ($scope.viewMode === 'yasr') {\n let newHeight = visibleWindowHeight() - (document.querySelector(codemirrorWrapperSelector).getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector(codemirrorWrapperSelector).style.height = newHeight + 'px';\n } else {\n $scope.noPadding = {};\n document.querySelector(codemirrorWrapperSelector).style.height = '';\n }\n document.getElementById('yasr').style.minHeight = '';\n }\n if (window.yasr && window.yasr.container) {\n $timeout(function () {\n window.yasr.container.resize();\n }, 100);\n }\n }\n\n if (!$scope.orientationViewMode) {\n showHideEditor();\n }\n\n function changeViewMode(tabID) {\n $scope.viewMode = 'none';\n $scope.orientationViewMode = !$scope.orientationViewMode;\n fixSizesOnHorizontalViewModeSwitch();\n $('.dataTables_filter').remove();\n $('.resultsTable').remove();\n $timeout(function () {\n loadTab();\n selectTab(tabID);\n }, 100);\n }\n\n function showHideEditor() {\n fixSizesOnHorizontalViewModeSwitch(true);\n }\n\n function focusQueryEditor() {\n if (!angular.element(document).find('.editable-input').is(':focus')) {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }\n }\n\n function selectTab(id) {\n $timeout(function () {\n $('a[data-id = \"' + id + '\"]').tab('show');\n }, 0);\n }\n\n // start of query operations\n function runQuery(changePage, explain) {\n $scope.executedQueryTab = $scope.currentQuery;\n if (explain && !(window.editor.getQueryType() === 'SELECT' || window.editor.getQueryType() === 'CONSTRUCT')) {\n toastr.warning($translate.instant('query.editor.warning.msg'));\n return;\n }\n\n if (window.editor.getQueryMode() === 'update') {\n toastr.warning($translate.instant('cannot.execute.update.error'));\n return;\n }\n\n $scope.explainRequested = explain;\n if (!$scope.queryIsRunning) {\n if (changePage) {\n $scope.currentTabConfig.resultsCount = 0;\n } else {\n $scope.resetCurrentTabConfig();\n }\n\n // Hides the editor and shows the yasr results\n $scope.viewMode = 'editor';\n if ($scope.orientationViewMode) {\n $scope.fixSizesOnHorizontalViewModeSwitch()\n }\n\n setLoader(true, $translate.instant('evaluating.query.msg'));\n window.editor.query();\n }\n }\n\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, $translate.instant('common.refreshing.namespaces'), $translate.instant('common.extra.message'));\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n });\n }\n\n function changePagination() {\n runQuery(true, $scope.explainRequested);\n }\n\n if ($scope.getActiveRepository()) {\n getNamespaces();\n }\n\n $scope.$on('$destroy', function () {\n window.editor = null;\n window.yasr = null;\n });\n\n function toggleSampleQueries() {\n }\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n let msg = getError(data);\n toastr.error(msg, $translate.instant('common.add.known.prefixes.error'));\n return true;\n });\n }\n\n $('textarea').on('paste', function () {\n $timeout(function () {\n addKnownPrefixes();\n }, 0);\n });\n\n function querySelected(query) {\n const tabId = getExistingTabId(query);\n $scope.toggleSampleQueries();\n if (!angular.isDefined(tabId)) {\n $scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n\n function getExistingTabId(query) {\n let existingTabId = undefined;\n angular.forEach($scope.tabsData, function (item) {\n if (item.name === query.name && item.query === query.body) {\n existingTabId = item.id;\n return item;\n }\n });\n\n return existingTabId;\n }\n\n // end of query operations\n\n // start of query tab operations\n function findTabIndexByID(id) {\n for (let i = 0; i < $scope.tabsData.length; i++) {\n const tab = $scope.tabsData[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n $scope.$watchCollection('[currentQuery.inference, currentQuery.sameAs]', function () {\n saveQueryToLocal($scope.currentQuery);\n });\n\n function saveTab(id) {\n const idx = findTabIndexByID(id);\n // Tab was deleted, don't try to save it's state\n if (idx === undefined) {\n return {};\n }\n const tab = $scope.tabsData[idx];\n $scope.saveQueryToLocal(tab);\n return tab;\n }\n\n function addNewTab(callback, tabName, savedQuery) {\n }\n\n function loadTab() {\n $scope.tabsData = [$scope.currentQuery];\n\n let tab = $scope.currentQuery;\n\n if ($scope.currentQuery.query == null || $scope.currentQuery.query === '') {\n // hack for YASQE bug\n window.editor.setValue(' ');\n } else {\n window.editor.setValue($scope.currentQuery.query);\n }\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.$apply();\n }, 0);\n\n //Remove padding of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n }\n\n function getQueryID(element) {\n return $(element).attr('data-id');\n }\n\n $scope.$on('tabAction', function (e, tabEvent) {\n if (tabEvent.relatedTarget) {\n $scope.saveTab(getQueryID(tabEvent.relatedTarget));\n }\n $scope.loadTab(getQueryID(tabEvent.target));\n });\n\n $scope.$on('deleteAllexeptSelected', function (e, tabs) {\n $scope.tabsData = tabs;\n $scope.tabs = tabs;\n });\n // end of query tab operations\n\n $scope.currentQuery = angular.copy(defaultTabConfig);\n // $scope.state = {};\n $scope.showSampleQueries = false;\n $scope.savedQuery = {};\n $scope.sampleQueries = {};\n\n $scope.getResultsDescription = function () {\n };\n\n $scope.getUpdateDescription = function () {\n };\n\n $scope.getStaleWarningMessage = function () {\n }\n\n}\n"],"sourceRoot":""}
@@ -1,2 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[62],{56:function(e,t,n){"use strict";n.r(t);n(5),n(17);var r=n(0);function i(e,t,n,i,o,a,s,u,c,d,l,g,y,f,p){const m={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:!0,sameAs:!0};let h,T;function w(t){!function(){if(i.isActiveRepoOntopType())return;const t=document.getElementById("sameAs");!t||e.currentQuery.inference||t.disabled?e.currentQuery.inference&&t.disabled&&(t.removeAttribute("disabled"),e.currentQuery.sameAs=h.appSettings.DEFAULT_SAMEAS):(t.disabled=!0,e.currentQuery.sameAs=!1)}(),e.tabs.forEach((function(n,r){n.id===t.id&&(e.tabs[r].query=t.query,i.isActiveRepoOntopType()||(e.tabs[r].inference=t.inference,e.tabs[r].sameAs=t.sameAs))})),y.set(f.TABS_STATE,e.tabs)}function b(t,n,r,i){const o=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,e.noLoaderTimer=i,o.addClass("hide")):(e.progressMessage="",e.extraMessage="",e.noLoaderTimer=!1,e.currentTrackAlias=null,e.abortRequested=!1,o.removeClass("hide")),null===e.$$phase&&e.$apply()}function C(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let r;r=t(n?function(){e.fixSizesOnHorizontalViewModeSwitch(n)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(r)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function S(){C(!0)}function q(t,n){n.newRepo&&(e.tabsData=y.get(f.TABS_STATE),e.tabsData.forEach((function(e){e.yasrData=void 0,e.queryType=void 0,e.resultsCount=0,e.allResultsCount=0,e.sizeDelta=void 0})),y.set(f.TABS_STATE,e.tabsData),e.tabs=e.tabsData,e.currentQuery={},e.errorMessage=null,e.repositoryError=null)}function E(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function v(r,o){if(e.executedQueryTab=e.currentQuery,o){if("SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType())return void n.warning(p.instant("query.editor.warning.msg"));if(i.isActiveRepoOntopType())return void n.warning(p.instant("query.editor.virtual.repo.warning.msg"))}if(e.explainRequested=o,!e.queryIsRunning){if(r?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.lastRunQueryMode=window.editor.getQueryMode(),"update"===e.lastRunQueryMode&&i.isActiveRepoOntopType())return void n.warning(p.instant("query.editor.virtual.repo.update.warning.msg"));if(b(!0,"update"===e.lastRunQueryMode?p.instant("query.editor.executing.update"):p.instant("query.editor.evaluating.query")),"none"!==e.viewMode){e.viewMode="none",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch();const n=t(window.editor.query,500);e.$on("$destroy",(function(){t.cancel(n)}))}else window.editor.query()}}function Q(){e.showSampleQueries=!e.showSampleQueries,e.showSampleQueries?s.getSavedQueries().success((function(t){e.sampleQueries=t,$("#sampleQueriesCollapse").collapse("show").width("300px")})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.get.saved.queries.error"))})):$("#sampleQueriesCollapse").collapse("hide")}function M(t){let n=void 0;return e.tabsData.forEach((function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}function A(t){return function(n,r,i){e.savedQuery={name:n,query:r||window.editor.getValue(),shared:i},$(t).modal("show")}}function D(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}e.getPrincipal=function(){return d.getPrincipal().then(t=>{h=t,function(e,t){m.inference=t.appSettings.DEFAULT_INFERENCE,m.sameAs=t.appSettings.DEFAULT_SAMEAS,e.skipCountQuery=!t.appSettings.EXECUTE_COUNT,e.ignoreSharedQueries=t.appSettings.IGNORE_SHARED_QUERIES,e.tabsData=e.tabs=y.get(f.TABS_STATE)||[m],e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(e,t,n){w(n.currentQuery)})),e.$on("repositoryIsSet",q)}(e,h)})},e.getPrincipal(),this.hint=document.createElement("span"),this.hint.innerHTML=p.instant("query.editor.autocomplete.hint"),this.hint.style.fontSize="12px",this.hint.style.color="gray",this.hint.style.backgroundColor="white",this.hint.style.position="absolute",this.hint.style.zIndex="3",this.hint.style.paddingLeft="12px",e.$watch((function(){return angular.element(".CodeMirror-hints").length}),e=>{if(e){const e=angular.element(".CodeMirror-hints")[0].getBoundingClientRect();document.body.appendChild(this.hint),this.hint.style.top=e.top-20+"px",this.hint.style.left=e.right-this.hint.offsetWidth-12+"px"}else this.hint&&this.hint.parentNode&&this.hint.parentNode.removeChild(this.hint)}),e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:1e3,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.saveTab=function(t){const n=D(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=function(n){e.tabsData=y.get(f.TABS_STATE)||[m];const r=D(n),o=e.tabsData[r];o.yasrData&&b(!0,p.instant("query.editor.render.results.msg"),null,!0);t((function(){""===e.currentQuery.query&&(e.currentQuery.query=" "),t((function(){window.editor.setValue(e.currentQuery.query),e.yasr.updateDownloadDropdown(),e.$broadcast("tabLoaded",e.currentQuery.id),e.yasr.options.output=o.outputType,o.yasrData&&(o.yasrData.customError?(e.yasr.results={getException:function(){return o.yasrData.customError}},b(!1)):t((function(){e.setYasrResponse(o.yasrData,o.textStatus,o.jqXhrOrErrorString),b(!1),$(".yasr_btnGroup li:nth-child(2)").hasClass("active")&&t((function(){$(".yasr_btnGroup li:nth-child(2) a").get(0).click()}),0)}),0))}),0)}),0),y.set(f.TABS_STATE_CURRENT_ID,n),e.currentQuery=o,t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=o.queryType,e.currentTabConfig.resultsCount=o.resultsCount,e.currentTabConfig.offset=o.offset,e.currentTabConfig.allResultsCount=o.allResultsCount,e.currentTabConfig.allResultsCountExact=o.allResultsCountExact,e.currentTabConfig.page=o.page,e.currentTabConfig.pageSize=o.pageSize,e.currentTabConfig.timeFinished=o.timeFinished,e.currentTabConfig.timeTook=o.timeTook,e.currentTabConfig.sizeDelta=o.sizeDelta,e.currentTabConfig.customUpdateMessage=o.customUpdateMessage,e.currentTabConfig.errorMessage=o.errorMessage,e.currentTabConfig.warningMessage=o.warningMessage,e.$apply()}),0),$("#yasr").css("padding","0"),T||(T=setInterval(_,200));!function(){const t=i.isActiveRepoOntopType(),n=i.isActiveRepoFedXType();(function(e){const t=document.getElementById("sameAs"),n=document.getElementById("inference");t&&(t.disabled=!!e);n&&(n.disabled=!!e)})(t),e.nocount=!(!t&&!n)||!h.appSettings.EXECUTE_COUNT,t&&(e.currentQuery.inference=!0,e.currentQuery.sameAs=!0)}()},e.addNewTab=function(n,r,i){if(!z(!0))return;let o;o=r||i?{id:"1",name:r,query:i,inference:h.appSettings.DEFAULT_INFERENCE,sameAs:h.appSettings.DEFAULT_SAMEAS}:{id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:h.appSettings.DEFAULT_INFERENCE,sameAs:h.appSettings.DEFAULT_SAMEAS};R++;const a=""+R;e.tabsData=e.tabs;const s=o;s.id=a,e.tabsData.push(s),y.set(f.TABS_STATE_MAXID,R),y.set(f.TABS_STATE,e.tabsData);const u=Array.prototype.slice.call(arguments,1);t((function(){e.$apply(),E(a),n&&n.apply(this,u)}),0),e.tabs=e.tabsData},e.isTabChangeOk=z,e.runQuery=v,e.abortCurrentQuery=function(){g.deleteQuery(e.currentTrackAlias,i.getActiveRepository()).success((function(){e.abortRequested=!0}))},e.editQuery=function(t){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:p.instant("query.editor.edit.saved.query",{name:t.name}),query:t,edit:!0,okButtonText:p.instant("common.save.btn")}}}}).result.then((function(r){const i={name:r.name,body:r.body,shared:r.shared};t.name!==r.name?s.addNewSavedQuery(i).success((function(){e.deleteQueryHttp(t.name,!0)})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.edit.saved.query.error"))})):s.editSavedQuery(i).success((function(){$("#editQueryContainer").modal("hide"),e.toggleSampleQueries(),n.success(p.instant("query.editor.edit.saved.query.success.msg",{name:t.name}))})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.edit.saved.query.error"))}))}))},e.getNamespaces=function(){b(!0,p.instant("common.refreshing.namespaces"),p.instant("common.extra.message")),e.namespacesLoading=!0,l.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){b(!1),e.namespacesLoading=!1}))},e.changePagination=function(){v(!0,e.explainRequested)},e.toggleSampleQueries=Q,e.addKnownPrefixes=function(){s.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){const t=getError(e);return n.error(t,p.instant("common.add.known.prefixes.error")),!0}))},e.getExistingTabId=M,e.querySelected=function(t){const n=M(t);e.toggleSampleQueries(),e.isTabChangeOk(!1)&&(e.highlightNextTabChange=!0,angular.isDefined(n)?E(n):e.addNewTab(null,t.name,t.body))},e.deleteQuery=function(t){a.openSimpleModal({title:p.instant("common.confirm"),message:p.instant("query.editor.delete.saved.query.warning.msg",{savedQueryName:t}),warning:!0}).result.then((function(){e.deleteQueryHttp(t)}))},e.deleteQueryHttp=function(t,r){s.deleteSavedQuery(t).success((function(){e.toggleSampleQueries(),r||n.success(p.instant("query.editor.delete.saved.query.success.msg",{savedQueryName:t}))})).error((function(e){const t=getError(e);n.error(t,p.instant("query.editor.delete.saved.query.error"))}))},e.saveQuery=function(t,n){o.open({templateUrl:"js/angular/core/directives/queryeditor/templates/query-sample.html",controller:"QuerySampleModalCtrl",resolve:{data:function(){return{title:p.instant("query.editor.create.saved.query.msg"),query:{name:t.name,body:t.query,shared:t.shared},edit:!1,okButtonText:p.instant("common.create.btn"),queryExists:n,existingQueryErrMsg:Object(r.decodeHTML)(p.instant("query.sample.existing.query.warning",{name:t.name}))}}}}).result.then((function(t){e.saveQueryHttp(t)}),(function(){}))},e.saveQueryHttp=function(t){s.addNewSavedQuery(t).success((function(){n.success(p.instant("query.editor.save.saved.query.success.msg",{name:t.name}))})).error((function(r,i){const o=getError(r);n.error(o,p.instant("query.editor.create.saved.query.error"));let a=!1;409===i&&(a=!0),t.query=t.body,e.saveQuery(t,a)}))},e.saveQueryToLocal=w,e.setLoader=b,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3;let n="",r="";e.noLoaderTimer||(n=e.getHumanReadableSeconds(t));r=e.progressMessage?p.instant("query.editor.progress.msg",{progressMessage:e.progressMessage,timeHuman:n}):p.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+=p.instant("query.editor.extra.msg",{extraMessage:e.extraMessage}));return r},e.fixSizesOnHorizontalViewModeSwitch=C,e.changeViewMode=function(){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,y.set(f.VIEW_MODE,e.orientationViewMode),C()},e.showHideEditor=S,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!y.get(f.VIEW_MODE)||"true"===y.get(f.VIEW_MODE),e.viewMode="none",e.getActiveRepository=function(){return i.getActiveRepository()},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return i.getActiveRepository()},e.orientationViewMode||S(),window.onbeforeunload=function(){e.currentQuery&&e.saveTab(e.currentQuery.id),y.set(f.TABS_STATE,e.tabs)},e.$on("$destroy",(function(){e.currentQuery&&e.saveTab(e.currentQuery.id),y.set(f.TABS_STATE,e.tabs),clearInterval(T)})),e.$on("$destroy",(function(){clearInterval(T),window.editor=null,window.yasr=null})),$(document).mouseup((function(t){const n=$("#sampleQueriesCollapse");!n.is(t.target)&&0===n.has(t.target).length&&e.showSampleQueries&&Q()}));let R=y.get(f.TABS_STATE_MAXID)||1;function x(e){return $(e).attr("data-id")}function _(){if(e.currentTabConfig.resultsCount>=0){const e=$(".saveAsDropDown");e.length>0&&!window.editor.queryValid?yasr.header.find(".saveAsDropDown").remove():0===e.length&&window.editor.queryValid&&yasr.updateDownloadDropdown()}}function z(t){return!(e.queryIsRunning&&!e.namespacesLoading)||(t?n.info(p.instant("query.editor.new.tab.running.query.warning.msg")):n.info(p.instant("query.editor.tab.switching.running.query.warning.msg")),!1)}e.highlightNextTabChange=!1,e.$on("tabAction",(function(n,r){r.relatedTarget&&(t.cancel(r.relatedTarget.timer),$(r.relatedTarget).css("color",""),e.saveTab(x(r.relatedTarget))),e.loadTab(x(r.target));const i=["var(--onto-orange)","","var(--onto-orange)"],o=[400,400,400];if(e.highlightNextTabChange){e.highlightNextTabChange=!1;let n=0;$(r.target).css("color",i[n]);const a=function(){n++,n<i.length?($(r.target).css("color",i[n]),r.target.timer=t(a,o[n])):$(r.target).css("color","")};t(a,o[n])}})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery={},e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.editQueryModal=A("#editQueryContainer"),e.deleteQueryModal=A("#confirmDeleteContainer"),e.saveQueryModal=A("#saveQueryContainer"),e.getResultsDescription=function(){let t;if(0===e.currentTabConfig.resultsCount)t="No results.";else{const n=(e.currentTabConfig.page-1)*e.currentTabConfig.pageSize+Math.min(e.currentTabConfig.resultsCount,e.currentTabConfig.pageSize);t=p.instant("query.editor.showing.results.from.msg")+u("currency")(e.currentTabConfig.offset,"",0)+p.instant("query.editor.to")+u("currency")(n,"",0),e.currentTabConfig.allResultsCount>0&&(t+=p.instant(e.currentTabConfig.allResultsCountExact?"query.editor.of":"query.editor.of.at.least"),t+=u("currency")(e.currentTabConfig.allResultsCount,"",0)),t+="."}return t},e.getUpdateDescription=function(){return e.currentTabConfig.customUpdateMessage?p.instant(e.currentTabConfig.customUpdateMessage.msg,{name:e.currentTabConfig.customUpdateMessage.name}):void 0===e.currentTabConfig.sizeDelta?"":e.currentTabConfig.sizeDelta<0?p.instant("yasr.removed.statements.result.msg",{sizeDelta:Math.abs(e.currentTabConfig.sizeDelta)}):e.currentTabConfig.sizeDelta>0?p.instant("yasr.added.statements.result.msg",{sizeDelta:e.currentTabConfig.sizeDelta}):p.instant("yasr.statements.no.change.msg")},e.getStaleWarningMessage=function(){const t=60*Math.round((Date.now()-e.currentTabConfig.timeFinished)/6e4);if(t>=3600)return p.instant("yasr.stale.result.msg",{secondsAgo:e.getHumanReadableSeconds(t)})};const N=function(){};angular.element(c).bind("resize",N),e.$on("$destroy",(function(){angular.element(c).unbind("resize",N)}))}function o(e,t,n,r){n.queryExists&&(e.queryExists=!0),e.query=angular.copy(n.query),e.title=n.title,e.edit=n.edit,e.okButtonText=n.okButtonText,e.existingQueryErrMsg=r.trustAsHtml(n.existingQueryErrMsg),e.ok=function(){e.form.$valid&&t.close(e.query)},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.core.directives.queryeditor.controllers",["graphdb.framework.utils.localstorageadapter","graphdb.framework.rest.sparql.service"]).controller("QueryEditorCtrl",i).controller("QuerySampleModalCtrl",o),i.$inject=["$scope","$timeout","toastr","$repositories","$uibModal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys","$translate"],o.$inject=["$scope","$uibModalInstance","data","$sce"]}}]);
2
- //# sourceMappingURL=62.35e111a570b5e038fdea.bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/core/directives/queryeditor/query-editor.controller.js"],"names":["QueryEditorCtrl","$scope","$timeout","toastr","$repositories","$uibModal","ModalService","SparqlRestService","$filter","$window","$jwtAuth","RDF4JRepositoriesRestService","MonitoringRestService","LocalStorageAdapter","LSKeys","$translate","defaultTabConfig","id","name","query","inference","sameAs","principal","checkQueryIntervalId","saveQueryToLocal","currentQueryTab","isActiveRepoOntopType","sameAsBtn","document","getElementById","currentQuery","disabled","removeAttribute","appSettings","DEFAULT_SAMEAS","shouldDisableSameAs","tabs","forEach","tab","index","set","TABS_STATE","setLoader","isRunning","progressMessage","extraMessage","noTimer","yasrInnerContainer","angular","element","queryIsRunning","queryStartTime","Date","now","countTimeouted","noLoaderTimer","addClass","currentTrackAlias","abortRequested","removeClass","$$phase","$apply","fixSizesOnHorizontalViewModeSwitch","verticalView","visibleWindowHeight","window","innerHeight","documentElement","clientHeight","body","orientationViewMode","viewMode","newHeight","querySelector","getBoundingClientRect","style","height","noPadding","minHeight","paddingRight","paddingLeft","editor","timer","$on","cancel","yasr","container","resize","showHideEditor","deleteCachedSparqlResults","foo","params","newRepo","tabsData","get","item","yasrData","undefined","queryType","resultsCount","allResultsCount","sizeDelta","errorMessage","repositoryError","selectTab","$","runQuery","changePage","explain","executedQueryTab","getQueryType","warning","instant","explainRequested","currentTabConfig","resetCurrentTabConfig","lastRunQueryMode","getQueryMode","toggleSampleQueries","showSampleQueries","getSavedQueries","success","data","sampleQueries","collapse","width","error","msg","getError","getExistingTabId","existingTabId","showModal","modalSelector","shared","savedQuery","getValue","modal","findTabIndexByID","i","length","getPrincipal","then","response","scope","DEFAULT_INFERENCE","skipCountQuery","EXECUTE_COUNT","ignoreSharedQueries","IGNORE_SHARED_QUERIES","$watchCollection","newVal","oldVal","initTabs","this","hint","createElement","innerHTML","fontSize","color","backgroundColor","position","zIndex","$watch","newValue","elRect","appendChild","top","left","right","offsetWidth","parentNode","removeChild","pageSize","page","queryExists","saveTab","idx","loadTab","setValue","updateDownloadDropdown","$broadcast","options","output","outputType","customError","results","getException","setYasrResponse","textStatus","jqXhrOrErrorString","hasClass","click","TABS_STATE_CURRENT_ID","offset","allResultsCountExact","timeFinished","timeTook","customUpdateMessage","warningMessage","css","setInterval","showOrHideSaveAsDropDown","isOntop","isFedX","isActiveRepoFedXType","inferenceBtn","handleSameAsAndInferenceBtns","nocount","overrideSameAsInferenceAndNoCountIfNeeded","addNewTab","callback","tabName","isTabChangeOk","maxID","newID","newTab","push","TABS_STATE_MAXID","callbackArgs","Array","prototype","slice","call","arguments","apply","abortCurrentQuery","deleteQuery","getActiveRepository","editQuery","open","templateUrl","controller","resolve","title","edit","okButtonText","result","queryModal","addNewSavedQuery","deleteQueryHttp","editSavedQuery","getNamespaces","namespacesLoading","getRepositoryNamespaces","usedPrefixes","bindings","e","prefix","value","namespace","namespaces","finally","changePagination","addKnownPrefixes","JSON","stringify","isDefined","querySelected","tabId","highlightNextTabChange","savedQueryName","openSimpleModal","message","deleteSavedQuery","saveQuery","existingQueryErrMsg","saveQueryHttp","status","getLoaderMessage","timeSeconds","timeHuman","getHumanReadableSeconds","changeViewMode","VIEW_MODE","focusQueryEditor","find","is","focus","getActiveRepositoryNoError","onbeforeunload","clearInterval","mouseup","event","target","has","getQueryID","attr","$saveAsDropDown","queryValid","header","remove","isNew","info","tabEvent","relatedTarget","colors","times","highlightFun","editQueryModal","deleteQueryModal","saveQueryModal","getResultsDescription","desc","currentPageEnd","Math","min","getUpdateDescription","abs","getStaleWarningMessage","secondsAgo","round","bind","unbind","QuerySampleModalCtrl","$uibModalInstance","$sce","copy","trustAsHtml","ok","form","$valid","close","dismiss","module","$inject"],"mappings":"0FAAA,6BAcA,SAASA,EAAgBC,EAAQC,EAAUC,EAAQC,EAAeC,EAAWC,EAAcC,EAAmBC,EAASC,EAASC,EAAUC,EAA8BC,EAAuBC,EAAqBC,EAAQC,GACxN,MAAMC,EAAmB,CACrBC,GAAI,IACJC,KAAM,GACNC,MAAO,kDAGPC,WAAW,EACXC,QAAQ,GAGZ,IAAIC,EAWAC,EAmGJ,SAASC,EAAiBC,IA4wB1B,WAEI,GAAIrB,EAAcsB,wBACd,OAEJ,MAAMC,EAAYC,SAASC,eAAe,WACtCF,GAAc1B,EAAO6B,aAAaV,WAAcO,EAAUI,SAGnD9B,EAAO6B,aAAaV,WAAaO,EAAUI,WAClDJ,EAAUK,gBAAgB,YAC1B/B,EAAO6B,aAAaT,OAASC,EAAUW,YAAYC,iBAJnDP,EAAUI,UAAW,EACrB9B,EAAO6B,aAAaT,QAAS,GAnxBjCc,GACAlC,EAAOmC,KAAKC,SAAQ,SAAUC,EAAKC,GAC3BD,EAAIrB,KAAOQ,EAAgBR,KAC3BhB,EAAOmC,KAAKG,GAAOpB,MAAQM,EAAgBN,MAGtCf,EAAcsB,0BACfzB,EAAOmC,KAAKG,GAAOnB,UAAYK,EAAgBL,UAC/CnB,EAAOmC,KAAKG,GAAOlB,OAASI,EAAgBJ,YAIxDR,EAAoB2B,IAAI1B,EAAO2B,WAAYxC,EAAOmC,MAGtD,SAASM,EAAUC,EAAWC,EAAiBC,EAAcC,GACzD,MAAMC,EAAqBC,QAAQC,QAAQrB,SAASC,eAAe,eACnE5B,EAAOiD,eAAiBP,EACpBA,GACA1C,EAAOkD,eAAiBC,KAAKC,MAC7BpD,EAAOqD,gBAAiB,EACxB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/G,EAAK+G,MACpBxO,EAAOyO,KAAOhH,EAAKgH,KACnBzO,EAAO0O,aAAejH,EAAKiH,aAC5B1O,EAAOwQ,oBAAsBkD,EAAKE,YAAYnM,EAAK+I,qBAClDxQ,EAAO6T,GAAK,WACJ7T,EAAO8T,KAAKC,QACZN,EAAkBO,MAAMhU,EAAOkB,QAIvClB,EAAOmF,OAAS,WACZsO,EAAkBQ,QAAQ,WAj7BlClR,QACKmR,OAAO,4DAA6D,CACjE,8CACA,0CAEH5F,WAAW,kBAAmBvO,GAC9BuO,WAAW,uBAAwBkF,GAExCzT,EAAgBoU,QAAU,CAAC,SAAU,WAAY,SAAU,gBAAiB,YAAa,eAAgB,oBAAqB,UAAW,UAAW,WAAY,+BAAgC,wBAAyB,sBAAuB,SAAU,cAu5B1PX,EAAqBW,QAAU,CAAC,SAAU,oBAAqB,OAAQ","file":"62.35e111a570b5e038fdea.bundle.js","sourcesContent":["import 'angular/utils/local-storage-adapter';\nimport 'angular/rest/sparql.rest.service';\nimport {decodeHTML} from \"../../../../../app\";\n\nangular\n .module('graphdb.framework.core.directives.queryeditor.controllers', [\n 'graphdb.framework.utils.localstorageadapter',\n 'graphdb.framework.rest.sparql.service'\n ])\n .controller('QueryEditorCtrl', QueryEditorCtrl)\n .controller('QuerySampleModalCtrl', QuerySampleModalCtrl);\n\nQueryEditorCtrl.$inject = ['$scope', '$timeout', 'toastr', '$repositories', '$uibModal', 'ModalService', 'SparqlRestService', '$filter', '$window', '$jwtAuth', 'RDF4JRepositoriesRestService', 'MonitoringRestService', 'LocalStorageAdapter', 'LSKeys', '$translate'];\n\nfunction QueryEditorCtrl($scope, $timeout, toastr, $repositories, $uibModal, ModalService, SparqlRestService, $filter, $window, $jwtAuth, RDF4JRepositoriesRestService, MonitoringRestService, LocalStorageAdapter, LSKeys, $translate) {\n const defaultTabConfig = {\n id: \"1\",\n name: '',\n query: 'select * where { \\n' +\n '\\t?s ?p ?o .\\n' +\n '} limit 100 \\n',\n inference: true,\n sameAs: true\n };\n\n let principal;\n // Wrapped in function for ease of testing\n $scope.getPrincipal = function () {\n return $jwtAuth.getPrincipal()\n .then((response) => {\n principal = response;\n initTabs($scope, principal);\n });\n };\n\n $scope.getPrincipal();\n let checkQueryIntervalId;\n\n function initTabs(scope, principal) {\n defaultTabConfig.inference = principal.appSettings.DEFAULT_INFERENCE;\n defaultTabConfig.sameAs = principal.appSettings.DEFAULT_SAMEAS;\n\n scope.skipCountQuery = !principal.appSettings.EXECUTE_COUNT;\n scope.ignoreSharedQueries = principal.appSettings.IGNORE_SHARED_QUERIES;\n scope.tabsData = scope.tabs = LocalStorageAdapter.get(LSKeys.TABS_STATE) || [defaultTabConfig];\n\n scope.$watchCollection('[currentQuery.inference, currentQuery.sameAs]', function (newVal, oldVal, scope) {\n saveQueryToLocal(scope.currentQuery);\n });\n\n scope.$on('repositoryIsSet', deleteCachedSparqlResults);\n }\n\n this.hint = document.createElement(\"span\");\n this.hint.innerHTML = $translate.instant('query.editor.autocomplete.hint');\n this.hint.style.fontSize = \"12px\";\n this.hint.style.color = \"gray\";\n this.hint.style.backgroundColor = \"white\";\n this.hint.style.position = \"absolute\";\n this.hint.style.zIndex = \"3\";\n this.hint.style.paddingLeft = 12 + \"px\";\n\n $scope.$watch(function() {\n return angular.element('.CodeMirror-hints').length;\n }, (newValue) => {\n if (newValue) {\n const elRect = angular.element('.CodeMirror-hints')[0].getBoundingClientRect();\n document.body.appendChild(this.hint);\n this.hint.style.top = elRect.top - 20 + \"px\";\n this.hint.style.left = elRect.right - this.hint.offsetWidth - 12 + \"px\";\n } else {\n this.hint && this.hint.parentNode && this.hint.parentNode.removeChild(this.hint);\n }\n });\n\n $scope.resetCurrentTabConfig = function () {\n $scope.currentTabConfig = {\n pageSize: 1000,\n page: 1,\n allResultsCount: 0,\n resultsCount: 0\n };\n };\n\n $scope.queryExists = false;\n\n $scope.resetCurrentTabConfig();\n\n // query tab operations\n $scope.saveTab = saveTab;\n $scope.loadTab = loadTab;\n $scope.addNewTab = addNewTab;\n $scope.isTabChangeOk = isTabChangeOk;\n\n // query operations\n $scope.runQuery = runQuery;\n $scope.abortCurrentQuery = abortCurrentQuery;\n $scope.editQuery = editQuery;\n $scope.getNamespaces = getNamespaces;\n $scope.changePagination = changePagination;\n $scope.toggleSampleQueries = toggleSampleQueries;\n $scope.addKnownPrefixes = addKnownPrefixes;\n $scope.getExistingTabId = getExistingTabId;\n $scope.querySelected = querySelected;\n $scope.deleteQuery = deleteQuery;\n $scope.deleteQueryHttp = deleteQueryHttp;\n $scope.saveQuery = saveQuery;\n $scope.saveQueryHttp = saveQueryHttp;\n $scope.saveQueryToLocal = saveQueryToLocal;\n\n $scope.setLoader = setLoader;\n $scope.getLoaderMessage = getLoaderMessage;\n\n // query editor and results orientation\n $scope.fixSizesOnHorizontalViewModeSwitch = fixSizesOnHorizontalViewModeSwitch;\n $scope.changeViewMode = changeViewMode;\n $scope.showHideEditor = showHideEditor;\n $scope.focusQueryEditor = focusQueryEditor;\n $scope.orientationViewMode = LocalStorageAdapter.get(LSKeys.VIEW_MODE) ? LocalStorageAdapter.get(LSKeys.VIEW_MODE) === \"true\" : true;\n $scope.viewMode = 'none';\n\n // start of repository actions\n // FIXME: do we need this??\n // $scope.getActiveRepository();\n $scope.getActiveRepository = function () {\n // same as getActiveRepository() but takes into account repo errors\n return $repositories.getActiveRepository();\n };\n\n $scope.getActiveRepositoryNoError = function () {\n if (!$scope.repositoryError) {\n return $repositories.getActiveRepository();\n }\n };\n\n function saveQueryToLocal(currentQueryTab) {\n shouldDisableSameAs();\n $scope.tabs.forEach(function (tab, index) {\n if (tab.id === currentQueryTab.id) {\n $scope.tabs[index].query = currentQueryTab.query;\n // Don't store inference and sameAs values for Ontop repository,\n // because they are overridden afterwards to true\n if (!$repositories.isActiveRepoOntopType()) {\n $scope.tabs[index].inference = currentQueryTab.inference;\n $scope.tabs[index].sameAs = currentQueryTab.sameAs;\n }\n }\n });\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabs);\n }\n\n function setLoader(isRunning, progressMessage, extraMessage, noTimer) {\n const yasrInnerContainer = angular.element(document.getElementById(\"yasr-inner\"));\n $scope.queryIsRunning = isRunning;\n if (isRunning) {\n $scope.queryStartTime = Date.now();\n $scope.countTimeouted = false;\n $scope.progressMessage = progressMessage;\n $scope.extraMessage = extraMessage;\n $scope.noLoaderTimer = noTimer;\n yasrInnerContainer.addClass(\"hide\");\n } else {\n $scope.progressMessage = \"\";\n $scope.extraMessage = \"\";\n $scope.noLoaderTimer = false;\n $scope.currentTrackAlias = null;\n $scope.abortRequested = false;\n yasrInnerContainer.removeClass(\"hide\");\n }\n // We might call this from angular or outside angular so take care of applying the scope.\n if ($scope.$$phase === null) {\n $scope.$apply();\n }\n }\n\n function getLoaderMessage() {\n const timeSeconds = (Date.now() - $scope.queryStartTime) / 1000;\n let timeHuman = \"\";\n let message = \"\";\n\n if (!$scope.noLoaderTimer) {\n timeHuman = $scope.getHumanReadableSeconds(timeSeconds);\n }\n\n if ($scope.progressMessage) {\n message = $translate.instant('query.editor.progress.msg', {progressMessage: $scope.progressMessage, timeHuman: timeHuman});\n } else {\n message = $translate.instant('common.running.operation', {timeHuman: timeHuman});\n }\n if ($scope.extraMessage && timeSeconds > 10) {\n message += $translate.instant('query.editor.extra.msg', {extraMessage: $scope.extraMessage});\n }\n\n return message;\n }\n\n // start of query editor results orientation operations\n function fixSizesOnHorizontalViewModeSwitch(verticalView) {\n function visibleWindowHeight() {\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;\n }\n\n if (!$scope.orientationViewMode) {\n $scope.noPadding = {paddingRight: 15, paddingLeft: 0};\n\n // window.editor is undefined if no repo is selected\n if (window.editor && document.querySelector('.CodeMirror-wrap')) {\n let newHeight = visibleWindowHeight() - (document.querySelector('.CodeMirror-wrap').getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector('.CodeMirror-wrap').style.height = newHeight + 'px';\n document.getElementById('yasr').style.minHeight = newHeight + 'px';\n //window.editor.refresh();\n } else {\n let timer;\n if (verticalView) {\n timer = $timeout(function () {\n $scope.fixSizesOnHorizontalViewModeSwitch(verticalView);\n }, 100);\n } else {\n timer = $timeout($scope.fixSizesOnHorizontalViewModeSwitch, 100);\n }\n\n $scope.$on(\"$destroy\", function () {\n $timeout.cancel(timer);\n });\n }\n } else {\n if ($scope.viewMode === 'yasr') {\n let newHeight = visibleWindowHeight() - (document.querySelector('.CodeMirror-wrap').getBoundingClientRect().top);\n newHeight -= 40;\n document.querySelector('.CodeMirror-wrap').style.height = newHeight + 'px';\n //window.editor.refresh();\n } else {\n $scope.noPadding = {};\n document.querySelector('.CodeMirror-wrap').style.height = '';\n //window.editor.refresh();\n }\n document.getElementById('yasr').style.minHeight = '';\n }\n if (window.yasr && window.yasr.container) {\n $timeout(function () {\n window.yasr.container.resize();\n }, 100);\n }\n }\n\n if (!$scope.orientationViewMode) {\n showHideEditor();\n }\n\n function changeViewMode() {\n $scope.viewMode = 'none';\n $scope.orientationViewMode = !$scope.orientationViewMode;\n LocalStorageAdapter.set(LSKeys.VIEW_MODE, $scope.orientationViewMode);\n fixSizesOnHorizontalViewModeSwitch();\n }\n\n function showHideEditor() {\n fixSizesOnHorizontalViewModeSwitch(true);\n }\n\n function focusQueryEditor() {\n if (!angular.element(document).find('.editable-input').is(\":focus\")) {\n angular.element(document).find('.CodeMirror textarea:first-child').focus();\n }\n }\n\n // end of query editor results orientation operations\n\n function deleteCachedSparqlResults(foo, params) {\n if (params.newRepo) {\n $scope.tabsData = LocalStorageAdapter.get(LSKeys.TABS_STATE);\n $scope.tabsData.forEach(function (item) {\n item.yasrData = undefined;\n item.queryType = undefined;\n item.resultsCount = 0;\n item.allResultsCount = 0;\n item.sizeDelta = undefined;\n });\n\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabsData);\n $scope.tabs = $scope.tabsData;\n\n // The repository is changed. Remove error messages as well, if any\n $scope.currentQuery = {};\n $scope.errorMessage = null;\n $scope.repositoryError = null;\n }\n }\n\n function selectTab(id) {\n $timeout(function () {\n $('a[data-id = \"' + id + '\"]').tab('show');\n }, 0);\n }\n\n window.onbeforeunload = function () {\n if ($scope.currentQuery) {\n $scope.saveTab($scope.currentQuery.id);\n }\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabs);\n };\n\n $scope.$on('$destroy', function () {\n if ($scope.currentQuery) {\n $scope.saveTab($scope.currentQuery.id);\n }\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabs);\n clearInterval(checkQueryIntervalId);\n });\n\n // start of query operations\n function runQuery(changePage, explain) {\n $scope.executedQueryTab = $scope.currentQuery ;\n if (explain) {\n if (!(window.editor.getQueryType() === 'SELECT' || window.editor.getQueryType() === 'CONSTRUCT')) {\n toastr.warning($translate.instant('query.editor.warning.msg'));\n return;\n }\n\n if ($repositories.isActiveRepoOntopType()) {\n toastr.warning($translate.instant('query.editor.virtual.repo.warning.msg'));\n return;\n }\n }\n\n $scope.explainRequested = explain;\n if (!$scope.queryIsRunning) {\n if (changePage) {\n $scope.currentTabConfig.resultsCount = 0;\n } else {\n $scope.resetCurrentTabConfig();\n }\n\n $scope.lastRunQueryMode = window.editor.getQueryMode();\n\n if ($scope.lastRunQueryMode === 'update' && $repositories.isActiveRepoOntopType()) {\n toastr.warning($translate.instant('query.editor.virtual.repo.update.warning.msg'));\n return;\n }\n\n setLoader(true, $scope.lastRunQueryMode === 'update' ? $translate.instant('query.editor.executing.update') : $translate.instant('query.editor.evaluating.query'));\n if ($scope.viewMode !== 'none') {\n $scope.viewMode = 'none';\n if ($scope.orientationViewMode) {\n $scope.fixSizesOnHorizontalViewModeSwitch();\n }\n const timer = $timeout(window.editor.query, 500);\n $scope.$on('$destroy', function () {\n $timeout.cancel(timer);\n });\n } else {\n window.editor.query();\n }\n }\n }\n\n function abortCurrentQuery() {\n MonitoringRestService.deleteQuery($scope.currentTrackAlias, $repositories.getActiveRepository())\n .success(function () {\n $scope.abortRequested = true;\n });\n }\n\n function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, $translate.instant('common.refreshing.namespaces'), $translate.instant('common.extra.message'));\n $scope.namespacesLoading = true;\n\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n $scope.namespacesLoading = false;\n });\n }\n\n function changePagination() {\n runQuery(true, $scope.explainRequested);\n }\n\n $scope.$on(\"$destroy\", function () {\n clearInterval(checkQueryIntervalId);\n window.editor = null;\n window.yasr = null;\n });\n\n function toggleSampleQueries() {\n $scope.showSampleQueries = !$scope.showSampleQueries;\n if ($scope.showSampleQueries) {\n SparqlRestService.getSavedQueries()\n .success(function (data) {\n $scope.sampleQueries = data;\n $('#sampleQueriesCollapse').collapse('show').width('300px');\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('query.editor.get.saved.queries.error'));\n });\n } else {\n $('#sampleQueriesCollapse').collapse('hide');\n }\n }\n\n // Hide the sample queries when the user clicks somewhere else in the UI.\n $(document).mouseup(function (event) {\n const container = $('#sampleQueriesCollapse');\n if (!container.is(event.target) // if the target of the click isn't the container..\n && container.has(event.target).length === 0 //... nor a descendant of the container\n && $scope.showSampleQueries) {\n toggleSampleQueries();\n }\n });\n\n // Add known prefixes\n function addKnownPrefixes() {\n SparqlRestService.addKnownPrefixes(JSON.stringify(window.editor.getValue()))\n .success(function (data) {\n if (angular.isDefined(window.editor) && angular.isDefined(data) && data !== window.editor.getValue()) {\n window.editor.setValue(data);\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.add.known.prefixes.error'));\n return true;\n });\n }\n\n function querySelected(query) {\n const tabId = getExistingTabId(query);\n $scope.toggleSampleQueries();\n\n if ($scope.isTabChangeOk(false)) {\n $scope.highlightNextTabChange = true;\n if (!angular.isDefined(tabId)) {\n $scope.addNewTab(null, query.name, query.body);\n } else {\n selectTab(tabId);\n }\n }\n }\n\n function getExistingTabId(query) {\n let existingTabId = undefined;\n $scope.tabsData.forEach(function (item) {\n if (item.name === query.name && item.query === query.body) {\n existingTabId = item.id;\n return item;\n }\n });\n return existingTabId;\n }\n\n function editQuery(query) {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/core/directives/queryeditor/templates/query-sample.html',\n controller: 'QuerySampleModalCtrl',\n resolve: {\n data: function () {\n return {\n title: $translate.instant('query.editor.edit.saved.query', {name: query.name}),\n query: query,\n edit: true,\n okButtonText: $translate.instant('common.save.btn')\n };\n }\n }\n });\n\n modalInstance.result.then(function (queryModal) {\n const data = {\n name: queryModal.name,\n body: queryModal.body,\n shared: queryModal.shared\n };\n if (query.name !== queryModal.name) {\n SparqlRestService.addNewSavedQuery(data)\n .success(function () {\n $scope.deleteQueryHttp(query.name, true);\n })\n .error(function (error) {\n const msg = getError(error);\n toastr.error(msg, $translate.instant('query.editor.edit.saved.query.error'));\n });\n } else {\n SparqlRestService.editSavedQuery(data)\n .success(function () {\n $('#editQueryContainer').modal('hide');\n $scope.toggleSampleQueries();\n toastr.success($translate.instant('query.editor.edit.saved.query.success.msg', {name: query.name}));\n })\n .error(function (error) {\n const msg = getError(error);\n toastr.error(msg, $translate.instant('query.editor.edit.saved.query.error'));\n });\n }\n });\n }\n\n function deleteQueryHttp(savedQueryName, edit) {\n SparqlRestService.deleteSavedQuery(savedQueryName)\n .success(function () {\n $scope.toggleSampleQueries();\n if (!edit) {\n toastr.success($translate.instant('query.editor.delete.saved.query.success.msg', {savedQueryName: savedQueryName}));\n }\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('query.editor.delete.saved.query.error'));\n });\n }\n\n function deleteQuery(savedQueryName) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm'),\n message: $translate.instant('query.editor.delete.saved.query.warning.msg', {savedQueryName: savedQueryName}),\n warning: true\n }).result\n .then(function () {\n $scope.deleteQueryHttp(savedQueryName);\n });\n }\n\n function saveQueryHttp(query) {\n SparqlRestService.addNewSavedQuery(query)\n .success(function () {\n toastr.success($translate.instant('query.editor.save.saved.query.success.msg', {name: query.name}));\n })\n .error(function (data, status) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('query.editor.create.saved.query.error'));\n let queryExists = false;\n if (status === 409) {\n queryExists = true;\n }\n query.query = query.body;\n $scope.saveQuery(query, queryExists);\n });\n }\n\n function saveQuery(query, queryExists) {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/core/directives/queryeditor/templates/query-sample.html',\n controller: 'QuerySampleModalCtrl',\n resolve: {\n data: function () {\n return {\n title: $translate.instant('query.editor.create.saved.query.msg'),\n query: {name: query.name, body: query.query, shared: query.shared},\n edit: false,\n okButtonText: $translate.instant('common.create.btn'),\n queryExists: queryExists,\n existingQueryErrMsg: decodeHTML($translate.instant('query.sample.existing.query.warning', {name: query.name}))\n };\n }\n }\n });\n\n modalInstance.result.then(function (query) {\n $scope.saveQueryHttp(query);\n }, function () {\n });\n }\n\n // end of query operations\n\n function showModal(modalSelector) {\n return function (name, query, shared) {\n $scope.savedQuery = {\n name: name,\n query: query || window.editor.getValue(),\n shared: shared\n };\n $(modalSelector).modal('show');\n };\n }\n\n\n // start of query tab operations\n function findTabIndexByID(id) {\n for (let i = 0; i < $scope.tabsData.length; i++) {\n const tab = $scope.tabsData[i];\n if (tab.id === id) {\n return i;\n }\n }\n }\n\n function saveTab(id) {\n const idx = findTabIndexByID(id);\n // Tab was deleted, don't try to save it's state\n if (idx === undefined) {\n return {};\n }\n const tab = $scope.tabsData[idx];\n //tab.query = window.editor.getValue();\n $scope.saveQueryToLocal(tab);\n return tab;\n }\n\n let maxID = LocalStorageAdapter.get(LSKeys.TABS_STATE_MAXID) || 1;\n\n function addNewTab(callback, tabName, savedQuery) { // optional callback to call after tab has been added\n if (!isTabChangeOk(true)) {\n return;\n }\n let defaultTabConfig;\n if (tabName || savedQuery) {\n defaultTabConfig = {\n id: \"1\",\n name: tabName,\n query: savedQuery,\n inference: principal.appSettings.DEFAULT_INFERENCE,\n sameAs: principal.appSettings.DEFAULT_SAMEAS\n };\n } else {\n defaultTabConfig = {\n id: \"1\",\n name: '',\n query: 'select * where { \\n' +\n '\\t?s ?p ?o .\\n' +\n '} limit 100 \\n',\n inference: principal.appSettings.DEFAULT_INFERENCE,\n sameAs: principal.appSettings.DEFAULT_SAMEAS\n };\n }\n\n maxID++;\n const newID = '' + maxID;\n $scope.tabsData = $scope.tabs;\n\n const newTab = defaultTabConfig;\n newTab.id = newID;\n\n $scope.tabsData.push(newTab);\n\n LocalStorageAdapter.set(LSKeys.TABS_STATE_MAXID, maxID);\n LocalStorageAdapter.set(LSKeys.TABS_STATE, $scope.tabsData);\n const callbackArgs = Array.prototype.slice.call(arguments, 1); // skip one argument, i.e. the callback itself\n $timeout(function () {\n $scope.$apply();\n selectTab(newID);\n if (callback) {\n callback.apply(this, callbackArgs);\n }\n }, 0);\n $scope.tabs = $scope.tabsData;\n }\n\n function loadTab(id) {\n $scope.tabsData = LocalStorageAdapter.get(LSKeys.TABS_STATE) || [defaultTabConfig];\n\n // find available tab\n const idx = findTabIndexByID(id);\n const tab = $scope.tabsData[idx];\n\n if (tab.yasrData) {\n setLoader(true, $translate.instant('query.editor.render.results.msg'), null, true);\n }\n\n // set query in editor available on the current tab\n $timeout(function () {\n if ($scope.currentQuery.query === '') {\n $scope.currentQuery.query = \" \";\n }\n $timeout(function () {\n window.editor.setValue($scope.currentQuery.query);\n $scope.yasr.updateDownloadDropdown();\n $scope.$broadcast('tabLoaded', $scope.currentQuery.id);\n\n // set query results in query results sections after\n // previous query execution. Yasr response rendering depends on the\n // query type of window.editor!\n $scope.yasr.options.output = tab.outputType; // this may be undefined, that's fine!\n if (tab.yasrData) {\n if (tab.yasrData.customError) {\n // Our injected custom (not real HTTP) error\n $scope.yasr.results = {\n getException: function () {\n return tab.yasrData.customError;\n }\n };\n setLoader(false);\n } else {\n // Real YASR result\n $timeout(function () {\n $scope.setYasrResponse(tab.yasrData, tab.textStatus, tab.jqXhrOrErrorString);\n setLoader(false);\n if ($('.yasr_btnGroup li:nth-child(2)').hasClass(\"active\")) {\n $timeout(function () {\n $('.yasr_btnGroup li:nth-child(2) a').get(0).click();\n }, 0);\n }\n }, 0);\n }\n }\n }, 0);\n }, 0);\n\n\n // persist current tab id in local storage\n LocalStorageAdapter.set(LSKeys.TABS_STATE_CURRENT_ID, id);\n\n $scope.currentQuery = tab;\n\n $timeout(function () {\n $scope.currentTabConfig = {};\n $scope.currentTabConfig.queryType = tab.queryType;\n $scope.currentTabConfig.resultsCount = tab.resultsCount;\n\n $scope.currentTabConfig.offset = tab.offset;\n $scope.currentTabConfig.allResultsCount = tab.allResultsCount;\n $scope.currentTabConfig.allResultsCountExact = tab.allResultsCountExact;\n $scope.currentTabConfig.page = tab.page;\n $scope.currentTabConfig.pageSize = tab.pageSize;\n\n $scope.currentTabConfig.timeFinished = tab.timeFinished;\n $scope.currentTabConfig.timeTook = tab.timeTook;\n $scope.currentTabConfig.sizeDelta = tab.sizeDelta;\n $scope.currentTabConfig.customUpdateMessage = tab.customUpdateMessage;\n $scope.currentTabConfig.errorMessage = tab.errorMessage;\n $scope.currentTabConfig.warningMessage = tab.warningMessage;\n\n $scope.$apply();\n }, 0);\n\n //Remove paddign of yasr so it will be aligned with sparql editor\n $('#yasr').css('padding', '0');\n\n if (!checkQueryIntervalId) {\n checkQueryIntervalId = setInterval(showOrHideSaveAsDropDown, 200);\n }\n overrideSameAsInferenceAndNoCountIfNeeded();\n }\n\n function getQueryID(element) {\n return $(element).attr('data-id');\n }\n\n function showOrHideSaveAsDropDown() {\n // If selected tab has results and query in editor controller is invalid save as\n // dropdown menu will be removed and on fixing query latter will be added\n if ($scope.currentTabConfig.resultsCount >= 0) {\n const $saveAsDropDown = $('.saveAsDropDown');\n if ($saveAsDropDown.length > 0 && !window.editor.queryValid) {\n yasr.header.find('.saveAsDropDown').remove();\n } else if ($saveAsDropDown.length === 0 && window.editor.queryValid) {\n yasr.updateDownloadDropdown();\n }\n }\n }\n\n function isTabChangeOk(isNew) {\n if ($scope.queryIsRunning && !$scope.namespacesLoading) {\n if (isNew) {\n toastr.info($translate.instant('query.editor.new.tab.running.query.warning.msg'));\n } else {\n toastr.info($translate.instant('query.editor.tab.switching.running.query.warning.msg'));\n }\n\n return false;\n }\n\n return true;\n }\n\n // Raise this flag to provide visual feedback to the user the next time a tab changes\n // (either manually or by the system). See GDB-1983.\n $scope.highlightNextTabChange = false;\n $scope.$on('tabAction', function (e, tabEvent) {\n if (tabEvent.relatedTarget) {\n // Cancel any highlight timer that might have been left by the last highlight\n $timeout.cancel(tabEvent.relatedTarget.timer);\n $(tabEvent.relatedTarget).css('color', '');\n\n $scope.saveTab(getQueryID(tabEvent.relatedTarget));\n }\n\n $scope.loadTab(getQueryID(tabEvent.target));\n\n // These arrays define how the tab change will be visually enhanced.\n // colors contains the colors to set to the tab name,\n // while times defines the times in milliseconds to keep each color.\n // Once we cycle through the arrays we restore the default color.\n const colors = ['var(--onto-orange)', '', 'var(--onto-orange)'];\n const times = [400, 400, 400];\n if ($scope.highlightNextTabChange) {\n $scope.highlightNextTabChange = false;\n let index = 0;\n $(tabEvent.target).css('color', colors[index]);\n const highlightFun = function () {\n index++;\n if (index < colors.length) {\n $(tabEvent.target).css('color', colors[index]);\n tabEvent.target.timer = $timeout(highlightFun, times[index]);\n } else {\n $(tabEvent.target).css('color', '');\n }\n };\n $timeout(highlightFun, times[index]);\n }\n });\n\n $scope.$on('deleteAllexeptSelected', function (e, tabs) {\n $scope.tabsData = tabs;\n $scope.tabs = tabs;\n });\n // end of query tab operations\n\n $scope.currentQuery = {};\n // $scope.state = {};\n $scope.showSampleQueries = false;\n $scope.savedQuery = {};\n $scope.sampleQueries = {};\n $scope.editQueryModal = showModal('#editQueryContainer');\n $scope.deleteQueryModal = showModal('#confirmDeleteContainer');\n $scope.saveQueryModal = showModal('#saveQueryContainer');\n\n $scope.getResultsDescription = function () {\n let desc;\n if ($scope.currentTabConfig.resultsCount === 0) {\n desc = \"No results.\";\n } else {\n const currentPageEnd = ($scope.currentTabConfig.page - 1) * $scope.currentTabConfig.pageSize\n + Math.min($scope.currentTabConfig.resultsCount, $scope.currentTabConfig.pageSize);\n desc = $translate.instant('query.editor.showing.results.from.msg') + $filter('currency')($scope.currentTabConfig.offset, '', 0)\n + $translate.instant('query.editor.to') + $filter('currency')(currentPageEnd, '', 0);\n if ($scope.currentTabConfig.allResultsCount > 0) {\n // Unsure total results count \"of at least\" happens if counting timed out or\n // counting was disabled and we got at least $pageSize + 1 results for the current page.\n // It may reset become exact when we navigate and reach the end of results.\n desc += $translate.instant(($scope.currentTabConfig.allResultsCountExact\n ? 'query.editor.of' : 'query.editor.of.at.least'));\n desc += $filter('currency')($scope.currentTabConfig.allResultsCount, '', 0);\n }\n desc += \".\";\n }\n\n return desc;\n };\n\n $scope.getUpdateDescription = function () {\n if ($scope.currentTabConfig.customUpdateMessage) {\n return $translate.instant($scope.currentTabConfig.customUpdateMessage.msg, {name: $scope.currentTabConfig.customUpdateMessage.name});\n } else if ($scope.currentTabConfig.sizeDelta === undefined) {\n return '';\n } else if ($scope.currentTabConfig.sizeDelta < 0) {\n return $translate.instant('yasr.removed.statements.result.msg', {sizeDelta: Math.abs($scope.currentTabConfig.sizeDelta)});\n } else if ($scope.currentTabConfig.sizeDelta > 0) {\n return $translate.instant('yasr.added.statements.result.msg', {sizeDelta: $scope.currentTabConfig.sizeDelta});\n } else {\n return $translate.instant('yasr.statements.no.change.msg');\n }\n };\n\n $scope.getStaleWarningMessage = function () {\n const secondsAgo = Math.round((Date.now() - $scope.currentTabConfig.timeFinished) / 60000) * 60;\n if (secondsAgo >= 3600) { // must be at least an hour\n return $translate.instant('yasr.stale.result.msg', {secondsAgo: $scope.getHumanReadableSeconds(secondsAgo)});\n }\n };\n\n const resize = function () {\n // $scope.fixSizesOnHorizontalViewModeSwitch();\n };\n\n angular.element($window).bind('resize', resize);\n\n $scope.$on('$destroy', function () {\n angular.element($window).unbind('resize', resize);\n });\n\n /**\n * In case of Ontop repository, sameAs, inference and nocount are\n * overridden to true and #sameAs and #inference buttons are disabled, In case of FedX repo nocount is overridden\n */\n function overrideSameAsInferenceAndNoCountIfNeeded() {\n const isOntop = $repositories.isActiveRepoOntopType();\n const isFedX = $repositories.isActiveRepoFedXType();\n handleSameAsAndInferenceBtns(isOntop);\n\n $scope.nocount = (isOntop || isFedX) ? true : !principal.appSettings.EXECUTE_COUNT;\n if (isOntop) {\n $scope.currentQuery.inference = true;\n $scope.currentQuery.sameAs = true;\n }\n }\n\n function handleSameAsAndInferenceBtns(isOntop) {\n const sameAsBtn = document.getElementById('sameAs');\n const inferenceBtn = document.getElementById('inference');\n\n if (sameAsBtn) {\n sameAsBtn.disabled = !!isOntop;\n }\n\n if (inferenceBtn) {\n inferenceBtn.disabled = !!isOntop;\n }\n }\n\n // The sameAs is meaningless without inference.\n // Set its value to false and disable button\n function shouldDisableSameAs() {\n // don't try to override sameAs if repository is Ontop type\n if ($repositories.isActiveRepoOntopType()) {\n return;\n }\n const sameAsBtn = document.getElementById('sameAs');\n if (sameAsBtn && !$scope.currentQuery.inference && !sameAsBtn.disabled) {\n sameAsBtn.disabled = true;\n $scope.currentQuery.sameAs = false;\n } else if ($scope.currentQuery.inference && sameAsBtn.disabled) {\n sameAsBtn.removeAttribute('disabled');\n $scope.currentQuery.sameAs = principal.appSettings.DEFAULT_SAMEAS;\n }\n }\n}\n\nQuerySampleModalCtrl.$inject = ['$scope', '$uibModalInstance', 'data', '$sce'];\n\nfunction QuerySampleModalCtrl($scope, $uibModalInstance, data, $sce) {\n if (data.queryExists) {\n $scope.queryExists = true;\n }\n $scope.query = angular.copy(data.query);\n $scope.title = data.title;\n $scope.edit = data.edit;\n $scope.okButtonText = data.okButtonText;\n $scope.existingQueryErrMsg = $sce.trustAsHtml(data.existingQueryErrMsg);\n $scope.ok = function () {\n if ($scope.form.$valid) {\n $uibModalInstance.close($scope.query);\n }\n };\n\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n}\n"],"sourceRoot":""}