graphdb-workbench 2.0.0-M3-RC1 → 2.0.0-M3-RC4

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 (63) hide show
  1. package/dist/{104.42f8ece72006965c902d.bundle.js → 104.7e16b2863108db706fe7.bundle.js} +2 -2
  2. package/dist/104.7e16b2863108db706fe7.bundle.js.map +1 -0
  3. package/dist/11.32f5a72d66bb699e9e8b.bundle.js +1 -1
  4. package/dist/11.32f5a72d66bb699e9e8b.bundle.js.map +1 -1
  5. package/dist/120.80843604737b7c260788.bundle.js +1 -1
  6. package/dist/120.80843604737b7c260788.bundle.js.map +1 -1
  7. package/dist/18.44723ea06155c72f46ae.bundle.js +1 -1
  8. package/dist/18.44723ea06155c72f46ae.bundle.js.map +1 -1
  9. package/dist/19.50d07be48e86feaaa2a8.bundle.js +2 -0
  10. package/dist/{19.cafe4adeaab529231727.bundle.js.map → 19.50d07be48e86feaaa2a8.bundle.js.map} +1 -1
  11. package/dist/25.fffc5233e718b047a34f.bundle.js +1 -1
  12. package/dist/25.fffc5233e718b047a34f.bundle.js.map +1 -1
  13. package/dist/29.9bdb27c21d6eacac1341.bundle.js +1 -1
  14. package/dist/29.9bdb27c21d6eacac1341.bundle.js.map +1 -1
  15. package/dist/{3.36fe2e671f737648a477.bundle.js → 3.05b11b64e7a5a996a0dc.bundle.js} +2 -2
  16. package/dist/3.05b11b64e7a5a996a0dc.bundle.js.map +1 -0
  17. package/dist/30.e2cd19e99cf6ecdad6ac.bundle.js +1 -1
  18. package/dist/30.e2cd19e99cf6ecdad6ac.bundle.js.map +1 -1
  19. package/dist/5.f64fe1c133cf7c3726a8.bundle.js +2 -0
  20. package/dist/5.f64fe1c133cf7c3726a8.bundle.js.map +1 -0
  21. package/dist/68.e25480b7770a679a9654.bundle.js +1 -1
  22. package/dist/68.e25480b7770a679a9654.bundle.js.map +1 -1
  23. package/dist/{82.37392f6b8c81e32a27b5.bundle.js → 82.6f82f4ca0efec1b20486.bundle.js} +2 -2
  24. package/dist/{82.37392f6b8c81e32a27b5.bundle.js.map → 82.6f82f4ca0efec1b20486.bundle.js.map} +1 -1
  25. package/dist/{bundle.75e471af3a644493fb37.bundle.js → bundle.caab550307cb547ae255.bundle.js} +3 -3
  26. package/dist/bundle.caab550307cb547ae255.bundle.js.map +1 -0
  27. package/dist/index.html +3 -3
  28. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  29. package/dist/pages/autocomplete.html +1 -1
  30. package/dist/pages/choose-repository-type.html +1 -1
  31. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  32. package/dist/pages/create-index.html +5 -5
  33. package/dist/pages/dependencies.html +1 -1
  34. package/dist/pages/domainRangeInfo.html +2 -2
  35. package/dist/pages/edit.html +1 -1
  36. package/dist/pages/explore.html +1 -1
  37. package/dist/pages/export.html +1 -1
  38. package/dist/pages/find.html +1 -1
  39. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  40. package/dist/pages/graphs-visualizations.html +7 -7
  41. package/dist/pages/import.html +1 -1
  42. package/dist/pages/jdbc-create.html +5 -5
  43. package/dist/pages/monitor/queries.html +1 -1
  44. package/dist/pages/monitor/resources.html +2 -2
  45. package/dist/pages/namespaces.html +2 -2
  46. package/dist/pages/plugins.html +1 -1
  47. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  48. package/dist/pages/rdfrank.html +2 -2
  49. package/dist/pages/repositories.html +2 -2
  50. package/dist/pages/repository.html +2 -2
  51. package/dist/pages/similarity-indexes.html +3 -3
  52. package/dist/pages/sparql-template-create.html +5 -5
  53. package/dist/pages/sparql.html +3 -3
  54. package/dist/pages/webapi.html +2 -2
  55. package/dist/plugins.js +3 -12
  56. package/dist/res/swagger/index.html +27 -27
  57. package/package.json +1 -1
  58. package/dist/104.42f8ece72006965c902d.bundle.js.map +0 -1
  59. package/dist/19.cafe4adeaab529231727.bundle.js +0 -2
  60. package/dist/3.36fe2e671f737648a477.bundle.js.map +0 -1
  61. package/dist/5.e112b0d6e101e0766cda.bundle.js +0 -2
  62. package/dist/5.e112b0d6e101e0766cda.bundle.js.map +0 -1
  63. package/dist/bundle.75e471af3a644493fb37.bundle.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///./src/js/angular/repositories/repository.constants.js","webpack:///./src/js/angular/repositories/controllers.js"],"names":["STATIC_RULESETS","id","name","REPOSITORY_TYPES","graphdbRepo","free","eeWorker","eeMaster","ontop","se","fedx","FILENAME_PATTERN","RegExp","NUMBER_PATTERN","getFileName","path","lastIdx","lastIndexOf","substring","parseNumberParamsIfNeeded","params","queryTimeout","value","parseInt","queryLimitResults","validationResultsLimitTotal","validationResultsLimitPerConstraint","leftJoinWorkerThreads","boundJoinBlockSize","joinWorkerThreads","unionWorkerThreads","parseMemberParamIfNeeded","param","member","getShaclOptionsClass","optionsModule","document","getElementById","isAriaExpanded","getAttribute","validateNumberFields","invalidValues","isInvalidQueryTimeout","test","isInvalidValidationResultsLimitTotal","isInvalidValidationResultsLimitPerConstraint","isInvalidQueryLimit","isInvalidLeftJoinWorkerThreads","isInvalidBoundJoinBlockSize","isInvalidJoinWorkerThreads","isInvalidUnionWorkerThreads","getInvalidParameterErrorMessage","$translate","instant","checkInvalidValues","invalidValuesKeys","Object","keys","invalidValuesVal","values","i","length","getDocBase","productInfo","productShortVersion","getFilteredLocations","$repositories","getLocations","then","locations","result","filter","location","errorMsg","degradedReason","filterLocations","LocationsAndRepositoriesCtrl","$scope","$modal","toastr","ModalService","$jwtAuth","LocationsRestService","LocalStorageAdapter","$interval","loader","isLocationInactive","active","hasActiveLocation","finally","getActiveLocation","getLocationError","getDegradedReason","getRepositories","isRepoActive","repo","deleteLocation","uri","openSimpleModal","title","message","warning","addLocationHttp","dataAddLocation","addLocation","success","data","init","error","msg","getError","open","templateUrl","windowClass","controller","editLocationHttp","dataEditLocation","editLocation","resolve","setRepository","deleteRepository","repository","repositoryId","cashedDependenciesGraphPrefix","cashedClassHierarchyGraphPrefix","angular","forEach","key","startsWith","remove","removeCachedGraphsOnDelete","restartRepository","toggleDefaultRepository","getDefaultRepository","setDefaultRepository","getRepositoryDownloadLink","url","type","token","getAuthToken","encodeURIComponent","copyToClipboard","openCopyToClipboardModal","fromFile","openActiveLocationSettings","timer","initQuick","$on","cancel","getRepositoriesFromLocation","locationId","UploadRepositoryConfigCtrl","$modalInstance","Upload","upload","files","uploadFile","ok","uploadFileLoader","method","config","close","dismiss","AddLocationCtrl","newLocation","docBase","isValidLocation","indexOf","EditLocationCtrl","editedLocation","copy","ChooseRepositoryCtrl","$location","repositoryTypes","chooseRepositoryType","repoType","AddRepositoryCtrl","$timeout","$routeParams","RepositoriesRestService","repositoryType","rulesets","slice","enable","pageTitle","repositoryInfo","changedLocation","$broadcast","getConfig","getRepositoryConfiguration","element","find","focus","isEnterprise","isValidEERepository","isFreeEdition","isValidSERepository","isValidFRRepository","isValidOntopRepository","isValidFedXRepository","setPageTitle","activeLocation","isInvalidPieFile","uploadRuleset","ruleset","progress","evt","fileName","newValue","fileLocation","rulesetPie","unshift","rulesetPieFile","errorMessage","noMembersError","goBackToPreviousLocation","isDefined","previous","$$search","createRepoHttp","createRepository","repoId","createRepo","isInvalidRepoName","rulesetWarning","pp","undefined","disableSameAs","validateNumberInput","autofocusId","EditRepositoryFileCtrl","file","getRepositoryFileContent","fileContent","content","EditRepositoryCtrl","editRepoPage","canEditRepoId","restartRequested","saveRepoId","$watch","getRepository","response","ifRulesetExists","item","setRepositoryType","saveId","catch","status","toastrMsg","allowHtml","setTimeout","editRepoHttp","editRepository","modalMsg","editRepositoryId","module","$inject"],"mappings":"4FAAA,wMAAO,MAAMA,EAAkB,CAC3B,CAACC,GAAI,QAASC,KAAM,gBACpB,CAACD,GAAI,iBAAkBC,KAAM,oBAC7B,CAACD,GAAI,OAAQC,KAAM,QACnB,CAACD,GAAI,qBAAsBC,KAAM,yBACjC,CAACD,GAAI,sBAAuBC,KAAM,yBA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dfs-optimized', name: 'RDFS (Optimized)'},\n {id: 'rdfs', name: 'RDFS'},\n {id: 'rdfsplus-optimized', name: 'RDFS-Plus (Optimized)'},\n {id: 'owl-horst-optimized', name: 'OWL-Horst (Optimized)'},\n {id: 'owl-horst', name: 'OWL-Horst'},\n {id: 'owl2-ql-optimized', name: 'OWL2-QL (Optimized)'},\n {id: 'owl2-ql', name: 'OWL2-QL'},\n {id: 'owl-max-optimized', name: 'OWL-Max (Optimized)'},\n {id: 'owl-max', name: 'OWL-Max'},\n {id: 'owl2-rl-optimized', name: 'OWL2-RL (Optimized)'},\n {id: 'owl2-rl', name: 'OWL2-RL'},\n\n];\n\nexport const REPOSITORY_TYPES = {graphdbRepo: 'graphdb', free: 'free', eeWorker: 'worker', eeMaster: 'master', ontop: 'ontop', se: 'se', fedx: 'fedx'};\nexport const FILENAME_PATTERN = new RegExp('^[a-zA-Z0-9-_]+$');\nexport const NUMBER_PATTERN = new RegExp('^[0-9]+$');\n","import {\n FILENAME_PATTERN,\n NUMBER_PATTERN,\n REPOSITORY_TYPES,\n STATIC_RULESETS\n} from \"./repository.constants\";\nimport {decodeHTML} from \"../../../app\";\n\nexport const getFileName = function (path) {\n let lastIdx = path.lastIndexOf('/');\n if (lastIdx === -1) {\n lastIdx = path.lastIndexOf('\\\\');\n }\n let name = path;\n if (lastIdx !== -1) {\n name = name.substring(lastIdx + 1);\n }\n return name;\n};\n\nconst parseNumberParamsIfNeeded = function (params) {\n if (params) {\n if (params.queryTimeout) {\n params.queryTimeout.value = parseInt(params.queryTimeout.value);\n }\n if (params.queryLimitResults && params.validationResultsLimitTotal && params.validationResultsLimitPerConstraint) {\n // Parse parameters properly to number\n params.queryLimitResults.value = parseInt(params.queryLimitResults.value);\n params.validationResultsLimitTotal.value = parseInt(params.validationResultsLimitTotal.value);\n params.validationResultsLimitPerConstraint.value = parseInt(params.validationResultsLimitPerConstraint.value);\n } else if (params.leftJoinWorkerThreads && params.boundJoinBlockSize && params.joinWorkerThreads && params.unionWorkerThreads) {\n params.leftJoinWorkerThreads.value = parseInt(params.leftJoinWorkerThreads.value);\n params.boundJoinBlockSize.value = parseInt(params.boundJoinBlockSize.value);\n params.joinWorkerThreads.value = parseInt(params.joinWorkerThreads.value);\n params.unionWorkerThreads.value = parseInt(params.unionWorkerThreads.value);\n }\n }\n};\n\nconst parseMemberParamIfNeeded = function (param) {\n if (param && param.member) {\n param.member.value = [];\n }\n};\n\nconst getShaclOptionsClass = function () {\n const optionsModule = document.getElementById('shaclOptions');\n\n if (optionsModule) {\n const isAriaExpanded = optionsModule.getAttribute('aria-expanded');\n if (isAriaExpanded && isAriaExpanded === 'true') {\n return 'fa fa-angle-down';\n }\n }\n return 'fa fa-angle-right';\n};\n\nconst validateNumberFields = function (params, invalidValues) {\n if (params.queryTimeout) {\n invalidValues.isInvalidQueryTimeout = !NUMBER_PATTERN.test(params.queryTimeout.value);\n }\n if (params.validationResultsLimitTotal && params.validationResultsLimitPerConstraint && params.queryLimitResults) {\n invalidValues.isInvalidValidationResultsLimitTotal = !NUMBER_PATTERN.test(params.validationResultsLimitTotal.value);\n invalidValues.isInvalidValidationResultsLimitPerConstraint = !NUMBER_PATTERN.test(params.validationResultsLimitPerConstraint.value);\n invalidValues.isInvalidQueryLimit = !NUMBER_PATTERN.test(params.queryLimitResults.value);\n } else if (params.leftJoinWorkerThreads && params.boundJoinBlockSize && params.joinWorkerThreads\n && params.unionWorkerThreads) {\n invalidValues.isInvalidLeftJoinWorkerThreads = !NUMBER_PATTERN.test(params.leftJoinWorkerThreads.value);\n invalidValues.isInvalidBoundJoinBlockSize = !NUMBER_PATTERN.test(params.boundJoinBlockSize.value);\n invalidValues.isInvalidJoinWorkerThreads = !NUMBER_PATTERN.test(params.joinWorkerThreads.value);\n invalidValues.isInvalidUnionWorkerThreads = !NUMBER_PATTERN.test(params.unionWorkerThreads.value);\n }\n};\n\nconst getInvalidParameterErrorMessage = function (param, $translate) {\n if (param === \"isInvalidQueryLimit\") {\n return $translate.instant('invalid.query.limit');\n } else if (param === \"isInvalidQueryTimeout\") {\n return $translate.instant('invalid.query.timeout');\n } else if (param === \"isInvalidValidationResultsLimitTotal\") {\n return $translate.instant('invalid.validation.results.limit.total');\n } else if (param === \"isInvalidValidationResultsLimitPerConstraint\") {\n return $translate.instant('invalid.validation.results.limit.per.constraint');\n } else if (param === \"isInvalidJoinWorkerThreads\") {\n return $translate.instant('invalid.join.worker.threads');\n } else if (param === \"isInvalidLeftJoinWorkerThreads\") {\n return $translate.instant('invalid.left.join.worker.threads');\n } else if (param === \"isInvalidUnionWorkerThreads\") {\n return $translate.instant('invalid.union.worker.threads');\n } else if (param === \"isInvalidBoundJoinBlockSize\") {\n return $translate.instant('invalid.bound.join.block.size');\n }\n};\n\nconst checkInvalidValues = function (invalidValues, $translate) {\n const invalidValuesKeys = Object.keys(invalidValues);\n const invalidValuesVal = Object.values(invalidValues);\n\n for (let i = 0; i < invalidValuesKeys.length; i++) {\n if (invalidValuesVal[i]) {\n return getInvalidParameterErrorMessage(invalidValuesKeys[i], $translate);\n }\n }\n return '';\n};\n\nconst getDocBase = function (productInfo) {\n return `https://graphdb.ontotext.com/documentation/${productInfo.productShortVersion}`;\n};\nconst filterLocations = function (result) {\n return result.filter((location) => !location.errorMsg && !location.degradedReason);\n};\n\n/**\n * Gets the remote locations that are error free and without degraded reason\n * @param {*} $repositories the repositories service\n * @return {[] | Promise} returns the locations as array or a promise of the array\n */\nconst getFilteredLocations = function ($repositories) {\n // Don't allow the user to create repository on location with error or degradeded reason\n return $repositories.getLocations().then((locations) => filterLocations(locations));\n};\n\nconst modules = [\n 'ngCookies',\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.utils.localstorageadapter',\n 'toastr',\n 'ngFileUpload'\n];\n\nangular.module('graphdb.framework.repositories.controllers', modules)\n .controller('LocationsAndRepositoriesCtrl', LocationsAndRepositoriesCtrl)\n .controller('AddLocationCtrl', AddLocationCtrl)\n .controller('EditLocationCtrl', EditLocationCtrl)\n .controller('ChooseRepositoryCtrl', ChooseRepositoryCtrl)\n .controller('AddRepositoryCtrl', AddRepositoryCtrl)\n .controller('EditRepositoryCtrl', EditRepositoryCtrl)\n .controller('EditRepositoryFileCtrl', EditRepositoryFileCtrl)\n .controller('UploadRepositoryConfigCtrl', UploadRepositoryConfigCtrl);\n\nLocationsAndRepositoriesCtrl.$inject = ['$scope', '$modal', 'toastr', '$repositories', 'ModalService', '$jwtAuth', 'LocationsRestService',\n 'LocalStorageAdapter', '$interval', '$translate'];\n\nfunction LocationsAndRepositoriesCtrl($scope, $modal, toastr, $repositories, ModalService, $jwtAuth, LocationsRestService,\n LocalStorageAdapter, $interval, $translate) {\n $scope.loader = true;\n\n\n $scope.isLocationInactive = function (location) {\n return !location.active || !$scope.hasActiveLocation();\n };\n\n //Get locations\n $repositories.getLocations()\n .then((locations) => {\n $scope.locations = locations;\n })\n .finally(() => $scope.loader = false);\n\n $scope.hasActiveLocation = function () {\n return $repositories.hasActiveLocation();\n };\n\n $scope.getActiveLocation = function () {\n return $repositories.getActiveLocation();\n };\n\n $scope.getLocationError = function () {\n return $repositories.getLocationError();\n };\n\n $scope.getDegradedReason = function () {\n return $repositories.getDegradedReason();\n };\n\n $scope.getRepositories = function () {\n return $repositories.getRepositories();\n };\n\n $scope.isRepoActive = function (repo) {\n return $repositories.isRepoActive(repo);\n };\n\n //Delete location\n $scope.deleteLocation = function (uri) {\n ModalService.openSimpleModal({\n title: $translate.instant('location.confirm.detach'),\n message: $translate.instant('location.confirm.detach.warning', {uri: uri}),\n warning: true\n }).result\n .then(function () {\n $scope.loader = true;\n $repositories.deleteLocation(uri).finally(() => $scope.loader = false);\n });\n };\n\n //Add new location\n\n $scope.addLocationHttp = function (dataAddLocation) {\n $scope.loader = true;\n LocationsRestService.addLocation(dataAddLocation)\n .success(function (data) {\n $scope.locations = data;\n //Reload locations and repositories\n $repositories.init();\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n })\n .finally(() => $scope.loader = false);\n };\n\n $scope.addLocation = function () {\n $modal.open({\n templateUrl: 'js/angular/templates/modal/add-location.html',\n windowClass: 'addLocationDialog',\n controller: 'AddLocationCtrl'\n }).result\n .then(function (dataAddLocation) {\n $scope.addLocationHttp(dataAddLocation);\n });\n };\n\n //Edit location\n $scope.editLocationHttp = function (dataEditLocation) {\n $scope.loader = true;\n LocationsRestService.editLocation(dataEditLocation)\n .success(function (data) {\n $scope.locations = data;\n //Reload locations and repositories\n $repositories.init();\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n })\n .finally(() => $scope.loader = false);\n };\n\n $scope.editLocation = function (location) {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/templates/modal/edit-location.html',\n controller: 'EditLocationCtrl',\n resolve: {\n location: function () {\n return location;\n }\n }\n });\n\n modalInstance.result.then(function (dataEditLocation) {\n $scope.editLocationHttp(dataEditLocation);\n }, function () {\n });\n };\n\n //Change repository\n $scope.setRepository = function (repo) {\n $repositories.setRepository(repo);\n };\n\n //Delete repository\n $scope.deleteRepository = function (repository) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: decodeHTML($translate.instant('delete.repo.warning.msg', {repositoryId: repository.id})),\n warning: true\n }).result\n .then(function () {\n $scope.loader = true;\n $repositories.deleteRepository(repository).finally(() => $scope.loader = false);\n removeCachedGraphsOnDelete(repository);\n });\n };\n\n $scope.restartRepository = function (repository) {\n ModalService.openSimpleModal({\n title: $translate.instant('confirm.restart.repo'),\n message: decodeHTML($translate.instant('confirm.restart.repo.warning.msg', {repositoryId: repository.id})),\n warning: true\n }).result\n .then(function () {\n $scope.loader = true;\n $repositories.restartRepository(repository).finally(() => $scope.loader = false);\n });\n };\n\n $scope.toggleDefaultRepository = function (repositoryId) {\n if ($scope.getDefaultRepository() === repositoryId) {\n // unset\n $repositories.setDefaultRepository(null);\n } else {\n // set\n $repositories.setDefaultRepository(repositoryId);\n }\n };\n\n $scope.getDefaultRepository = function () {\n return $repositories.getDefaultRepository();\n };\n\n /* Unused, data urls don't behave well in all browsers, avoid them when possible\n $scope.getRepoTurtleConfig = function (repository) {\n function downloadRepoConfig(repoTurtleConfig, repository) {\n $('.download-turtle-config')\n .mouseup(function () {\n $(this)\n .attr('href', repoTurtleConfig)\n .attr('download', repository.id + '-config.ttl')\n });\n }\n\n $repositories.getRepositoryTurtleConfig(repository)\n .success(function (response) {\n var repoTurtleConfigDownload = 'data:application/octet-stream;charset=utf-8;base64,'\n + btoa(unescape(encodeURIComponent(response)));\n downloadRepoConfig(repoTurtleConfigDownload, repository);\n })\n .error(function () {\n toastr.error('Error getting repository configuration for '' + repository.id + ''');\n });\n };\n */\n\n $scope.getRepositoryDownloadLink = function (repository) {\n let url = `rest/repositories/${repository.id}${(repository.type === REPOSITORY_TYPES.ontop ? '/download-zip'\n : '/download-ttl')}?location=${repository.location}`;\n const token = $jwtAuth.getAuthToken();\n if (token) {\n url = `${url}&authToken=${encodeURIComponent(token)}`;\n }\n return url;\n };\n\n ///Copy to clipboard popover options\n $scope.copyToClipboard = function (uri) {\n ModalService.openCopyToClipboardModal(uri);\n };\n\n $scope.fromFile = function () {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/templates/modal/upload-repository-config.html',\n controller: 'UploadRepositoryConfigCtrl'\n });\n modalInstance.result.then(function () {\n $repositories.init();\n });\n };\n\n //Delete repository\n $scope.openActiveLocationSettings = function () {\n $modal.open({\n templateUrl: 'js/angular/settings/modal/location-settings.html',\n controller: 'ActiveLocationSettingsCtrl'\n });\n };\n\n const timer = $interval(function () {\n // Update repositories state\n $repositories.initQuick();\n }, 5000);\n\n $scope.$on('$destroy', function () {\n $interval.cancel(timer);\n });\n\n function removeCachedGraphsOnDelete(repo) {\n const cashedDependenciesGraphPrefix = `dependencies-selectedGraph-${repo.id}`;\n const cashedClassHierarchyGraphPrefix = `classHierarchy-selectedGraph-${repo.id}`;\n angular.forEach(LocalStorageAdapter.keys(), function (key) {\n // remove everything but the hide prefixes setting, it should always persist\n if (key.startsWith(cashedClassHierarchyGraphPrefix) || key.startsWith(cashedDependenciesGraphPrefix)) {\n LocalStorageAdapter.remove(key);\n }\n });\n }\n\n $scope.getRepositoriesFromLocation = function (locationId) {\n return $repositories.getRepositoriesFromLocation(locationId);\n };\n}\n\nUploadRepositoryConfigCtrl.$inject = ['$scope', '$modalInstance', 'Upload', 'toastr', '$translate'];\n\nfunction UploadRepositoryConfigCtrl($scope, $modalInstance, Upload, toastr, $translate) {\n $scope.upload = function (files) {\n if (files && files.length) {\n $scope.uploadFile = files[0];\n }\n };\n $scope.ok = function () {\n if ($scope.uploadFile) {\n $scope.uploadFileLoader = true;\n Upload.upload({\n url: 'rest/repositories',\n method: 'POST',\n data: {config: $scope.uploadFile}\n })\n .success(function () {\n $scope.uploadFileLoader = false;\n $modalInstance.close();\n })\n .error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.uploadFileLoader = false;\n });\n }\n };\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nAddLocationCtrl.$inject = ['$scope', '$modalInstance', 'toastr', 'productInfo', '$translate'];\n\nfunction AddLocationCtrl($scope, $modalInstance, toastr, productInfo, $translate) {\n\n $scope.newLocation = {\n 'uri': '',\n 'authType': 'none',\n 'username': '',\n 'password': '',\n 'active': false\n };\n $scope.docBase = getDocBase(productInfo);\n\n $scope.isValidLocation = function () {\n return ($scope.newLocation.uri.length < 6 ||\n $scope.newLocation.uri.indexOf('http:') === 0 || $scope.newLocation.uri.indexOf('https:') === 0)\n && $scope.newLocation.uri.indexOf('/repositories') <= -1;\n };\n\n $scope.ok = function () {\n if (!$scope.newLocation) {\n toastr.error($translate.instant('location.cannot.be.empty.error'));\n return;\n }\n $modalInstance.close($scope.newLocation);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nEditLocationCtrl.$inject = ['$scope', '$modalInstance', 'location', 'productInfo'];\n\nfunction EditLocationCtrl($scope, $modalInstance, location, productInfo) {\n\n $scope.editedLocation = angular.copy(location);\n $scope.docBase = getDocBase(productInfo);\n\n $scope.ok = function () {\n $modalInstance.close($scope.editedLocation);\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nChooseRepositoryCtrl.$inject = ['$scope', '$location'];\n\nfunction ChooseRepositoryCtrl($scope, $location) {\n $scope.repositoryTypes = REPOSITORY_TYPES;\n $scope.chooseRepositoryType = function (repoType) {\n $location.path(`${$location.path()}/${repoType}`);\n };\n}\n\nAddRepositoryCtrl.$inject = ['$scope', 'toastr', '$repositories', '$location', '$timeout', 'Upload', '$routeParams',\n 'RepositoriesRestService', '$translate'];\n\nfunction AddRepositoryCtrl($scope, toastr, $repositories, $location, $timeout, Upload, $routeParams, RepositoriesRestService, $translate) {\n $scope.rulesets = STATIC_RULESETS.slice();\n $scope.repositoryTypes = REPOSITORY_TYPES;\n $scope.params = $routeParams;\n $scope.repositoryType = $routeParams.repositoryType;\n $scope.enable = true;\n\n $scope.loader = true;\n $scope.pageTitle = $translate.instant('view.create.repo.title');\n $scope.repositoryInfo = {\n id: '',\n params: {},\n title: '',\n type: '',\n location: ''\n };\n\n $scope.invalidValues = {\n isInvalidQueryTimeout: false,\n isInvalidQueryLimit: false,\n isInvalidLeftJoinWorkerThreads: false,\n isInvalidBoundJoinBlockSize: false,\n isInvalidJoinWorkerThreads: false,\n isInvalidUnionWorkerThreads: false,\n isInvalidValidationResultsLimitPerConstraint: false,\n isInvalidValidationResultsLimitTotal: false\n };\n\n getFilteredLocations($repositories)\n .then((locations) => {\n $scope.locations = locations;\n });\n\n $scope.changedLocation = function () {\n $scope.$broadcast('changedLocation');\n };\n\n function isValidEERepository(repositoryType) {\n return $scope.isEnterprise() && (repositoryType === REPOSITORY_TYPES.graphdbRepo);\n }\n\n function isValidSERepository(repositoryType) {\n return !$scope.isFreeEdition() && !$scope.isEnterprise() && repositoryType === REPOSITORY_TYPES.graphdbRepo;\n }\n\n function isValidFRRepository(repositoryType) {\n return $scope.isFreeEdition() && repositoryType === REPOSITORY_TYPES.graphdbRepo;\n }\n\n function isValidOntopRepository(repositoryType) {\n return repositoryType === REPOSITORY_TYPES.ontop;\n }\n\n function isValidFedXRepository(repositoryType) {\n return repositoryType === REPOSITORY_TYPES.fedx;\n }\n\n function isRepositoryTypeValid(repositoryType) {\n return isValidEERepository(repositoryType) || isValidSERepository(repositoryType)\n || isValidFRRepository(repositoryType) || isValidOntopRepository(repositoryType)\n || isValidFedXRepository(repositoryType);\n }\n\n function setPageTitle(repositoryType) {\n switch (repositoryType) {\n case REPOSITORY_TYPES.graphdbRepo:\n $scope.pageTitle = $translate.instant('view.create.repo.title', {repoType: 'GraphDB'});\n break;\n case REPOSITORY_TYPES.ontop:\n $scope.pageTitle = $translate.instant('view.create.repo.title', {repoType: 'Ontop Virtual SPARQL'});\n break;\n case REPOSITORY_TYPES.fedx:\n $scope.pageTitle = $translate.instant('view.create.repo.title', {repoType: 'FedX Virtual SPARQL'});\n break;\n }\n }\n\n $scope.getConfig = function (repoType) {\n RepositoriesRestService.getRepositoryConfiguration(repoType).success(function (data) {\n $scope.repositoryInfo.params = data.params;\n $scope.repositoryInfo.type = data.type;\n parseNumberParamsIfNeeded($scope.repositoryInfo.params);\n parseMemberParamIfNeeded($scope.repositoryInfo.params);\n $scope.loader = false;\n // The clean way is the \"autofocus\" attribute and we use it but it doesn't seem to\n // work in all browsers because of the way dynamic content is handled so give it another\n // try here.\n $timeout(function () {\n // Focus the ID field\n angular.element(document).find('#id').focus();\n }, 50);\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n if ($scope.repositoryType && isRepositoryTypeValid($scope.repositoryType)) {\n $scope.repositoryInfo.type = $scope.repositoryType;\n $scope.getConfig($scope.repositoryType);\n setPageTitle($scope.repositoryType);\n } else {\n $location.path('/repository/create');\n }\n\n $scope.hasActiveLocation = function () {\n return $repositories.hasActiveLocation();\n };\n\n $scope.activeLocation = function () {\n return $repositories.getActiveLocation();\n };\n\n let isInvalidPieFile = false;\n $scope.uploadRuleset = function (files) {\n if (files && files.length) {\n $scope.uploadFile = files[0];\n $scope.uploadFileLoader = true;\n Upload.upload({\n url: 'rest/repositories/ruleset/upload',\n data: {ruleset: $scope.uploadFile, location: $scope.repositoryInfo.location}\n }).progress(function (evt) {\n /*\t\t\t\t\t\tvar progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\n console.log('progress: ' + progressPercentage + '% ' + evt.config.file.name);*/\n }).success(function (data) {\n if (!data.success) {\n toastr.error(data.errorMessage);\n isInvalidPieFile = true;\n } else {\n const fileName = $scope.uploadFile.name;\n const newValue = {id: data.fileLocation, name: 'Custom: ' + fileName};\n if ($scope.rulesetPie) {\n // file was previously uploaded\n $scope.rulesets[0] = newValue;\n } else {\n // file uploaded for the first time\n $scope.rulesets.unshift(newValue);\n }\n $scope.rulesetPie = data.fileLocation;\n $scope.rulesetPieFile = fileName;\n $scope.repositoryInfo.params.ruleset.value = $scope.rulesetPie;\n }\n $scope.uploadFileLoader = false;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.uploadFile = '';\n $scope.uploadFileLoader = false;\n });\n }\n };\n\n $scope.noMembersError = function () {\n toastr.error($translate.instant('fedx.create.repo.no.members.warning'));\n };\n\n $scope.goBackToPreviousLocation = function () {\n if (angular.isDefined($routeParams.previous)) {\n delete $location.$$search.previous;\n $location.path('/');\n } else {\n $location.path('/repository');\n }\n };\n\n $scope.createRepoHttp = function () {\n $scope.loader = true;\n RepositoriesRestService.createRepository($scope.repositoryInfo).success(function () {\n toastr.success($translate.instant('created.repo.success.msg', {repoId: $scope.repositoryInfo.id}));\n $repositories.init($scope.goBackToPreviousLocation);\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n $scope.createRepo = function () {\n if (!$scope.repositoryInfo.id) {\n toastr.error($translate.instant('empty.repoid.warning'));\n return;\n }\n\n $scope.isInvalidRepoName = !FILENAME_PATTERN.test($scope.repositoryInfo.id);\n validateNumberFields($scope.repositoryInfo.params, $scope.invalidValues);\n const invalidValues = checkInvalidValues($scope.invalidValues, $translate);\n\n if (isInvalidPieFile) {\n toastr.error($translate.instant('invalid.ruleset.file.error'));\n } else if ($scope.isInvalidRepoName) {\n toastr.error($translate.instant('wrong.repo.name.error'));\n } else if ($scope.repositoryType === \"fedx\" && $scope.repositoryInfo.params.member.value.length === 0) {\n $scope.noMembersError();\n } else if (invalidValues) {\n toastr.error(invalidValues);\n } else {\n $scope.createRepoHttp();\n }\n };\n\n $scope.rulesetWarning = function () {\n const pp = $scope.repositoryInfo.params;\n if (pp === undefined || pp.ruleset === undefined || pp.disableSameAs === undefined) {\n return '';\n }\n\n if (pp.ruleset.value.indexOf('owl') === 0 && pp.disableSameAs.value === 'true') {\n return $translate.instant('repoTooltips.rulesetWarnings.needsSameAs');\n } else if (pp.ruleset.value.indexOf('rdfs') === 0 && pp.disableSameAs.value === 'false') {\n return $translate.instant('repoTooltips.rulesetWarnings.doesntNeedSameAs');\n } else if (pp.ruleset.value === $scope.rulesetPie) {\n return $translate.instant('repoTooltips.rulesetWarnings.customRuleset');\n } else {\n return '';\n }\n };\n\n $scope.validateNumberInput = function () {\n validateNumberFields($scope.repositoryInfo.params, $scope.invalidValues);\n };\n\n $scope.getShaclOptionsClass = function () {\n return getShaclOptionsClass();\n };\n //TODO - check if repositoryID exist\n\n // Request auto-focus of the ID input when creating a repo (but not when editing)\n $scope.autofocusId = 'autofocus';\n}\n\nEditRepositoryFileCtrl.$inject = ['$scope', '$modalInstance', 'RepositoriesRestService', 'file', 'toastr', '$translate'];\n\nfunction EditRepositoryFileCtrl($scope, $modalInstance, RepositoriesRestService, file, toastr, $translate) {\n\n if (file) {\n RepositoriesRestService.getRepositoryFileContent(file).success(function (data) {\n $scope.fileContent = data;\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n });\n }\n\n $scope.ok = function () {\n $modalInstance.close({\n content: $scope.fileContent,\n fileLocation: file\n });\n };\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n}\n\nEditRepositoryCtrl.$inject = ['$scope', '$routeParams', 'toastr', '$repositories', '$location', 'ModalService', 'RepositoriesRestService',\n '$translate'];\n\nfunction EditRepositoryCtrl($scope, $routeParams, toastr, $repositories, $location, ModalService, RepositoriesRestService, $translate) {\n\n $scope.rulesets = STATIC_RULESETS.slice();\n $scope.repositoryTypes = REPOSITORY_TYPES;\n\n $scope.editRepoPage = true;\n $scope.canEditRepoId = false;\n $scope.params = $routeParams;\n $scope.loader = true;\n $scope.repositoryInfo = {};\n $scope.repositoryInfo.id = $scope.params.repositoryId;\n $scope.repositoryInfo.location = $scope.params.location;\n $scope.repositoryInfo.restartRequested = false;\n $scope.repositoryType = '';\n $scope.saveRepoId = $scope.params.repositoryId;\n $scope.pageTitle = $translate.instant('view.edit.repo.title', {repositoryId: $scope.params.repositoryId});\n $scope.invalidValues = {\n isInvalidQueryTimeout: false,\n isInvalidQueryLimit: false,\n isInvalidLeftJoinWorkerThreads: false,\n isInvalidBoundJoinBlockSize: false,\n isInvalidJoinWorkerThreads: false,\n isInvalidUnionWorkerThreads: false,\n isInvalidValidationResultsLimitPerConstraint: false,\n isInvalidValidationResultsLimitTotal: false\n };\n $scope.hasActiveLocation = function () {\n return $repositories.hasActiveLocation();\n };\n\n $scope.$watch($scope.hasActiveLocation, function () {\n if ($scope.hasActiveLocation) {\n // Should get locations before getting repository info\n getFilteredLocations($repositories).then((locations) => {\n $scope.locations = locations;\n return RepositoriesRestService.getRepository($scope.repositoryInfo);\n })\n .then(function (response) {\n const data = response.data;\n if (angular.isDefined(data.params.ruleset)) {\n let ifRulesetExists = false;\n angular.forEach($scope.rulesets, function (item) {\n if (item.id === data.params.ruleset.value) {\n ifRulesetExists = true;\n }\n });\n if (data.params.ruleset && !ifRulesetExists) {\n const name = getFileName(data.params.ruleset.value);\n $scope.rulesets.unshift({id: data.params.ruleset.value, name: 'Custom: ' + name});\n }\n }\n $scope.repositoryInfo = data;\n $scope.setRepositoryType(data.type);\n parseNumberParamsIfNeeded($scope.repositoryInfo.params);\n $scope.repositoryInfo.saveId = $scope.saveRepoId;\n $scope.loader = false;\n })\n .catch(function (response) {\n const data = response.data;\n const status = response.status;\n const repositoryId = $routeParams.repositoryId;\n let toastrMsg;\n\n if (status === 404 && repositoryId !== 'system') {\n toastrMsg = decodeHTML($translate.instant('edit.repo.error.not.exists', {repositoryId}));\n } else if (status === 404 && repositoryId === 'system') {\n toastrMsg = decodeHTML($translate.instant('edit.system.repo.warning'));\n } else {\n toastrMsg = getError(data);\n }\n\n toastr.error(toastrMsg, $translate.instant('common.error'), {allowHtml: true});\n\n if (status === 404) {\n setTimeout(function () {\n $scope.loader = false;\n $location.path('repository');\n }, 1000);\n } else {\n $scope.loader = false;\n }\n });\n }\n });\n\n $scope.setRepositoryType = function (type) {\n $scope.repositoryType = type;\n };\n\n $scope.noMembersError = function () {\n toastr.error($translate.instant('fedx.create.repo.no.members.warning'));\n };\n\n $scope.editRepoHttp = function () {\n $scope.loader = true;\n RepositoriesRestService.editRepository($scope.repositoryInfo.saveId, $scope.repositoryInfo)\n .success(function () {\n toastr.success($translate.instant('edit.repo.success.msg', {saveId: $scope.repositoryInfo.saveId}));\n $repositories.init($scope.goBackToPreviousLocation);\n if ($scope.repositoryInfo.saveId === $scope.repositoryInfo.id && $scope.repositoryInfo.restartRequested) {\n $repositories.restartRepository($scope.repositoryInfo.id);\n }\n }).error(function (data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n $scope.editRepository = function () {\n $scope.isInvalidRepoName = !FILENAME_PATTERN.test($scope.repositoryInfo.id);\n validateNumberFields($scope.repositoryInfo.params, $scope.invalidValues);\n const invalidValues = checkInvalidValues($scope.invalidValues, $translate);\n let modalMsg = decodeHTML($translate.instant('edit.repo.save.changes.msg', {repoId: $scope.repositoryInfo.id}));\n if ($scope.repositoryInfo.saveId !== $scope.repositoryInfo.id) {\n modalMsg += decodeHTML($translate.instant('edit.repo.rename.changes.msg'));\n } else if ($scope.repositoryInfo.restartRequested) {\n modalMsg += decodeHTML($translate.instant('edit.repo.restart.requested.msg'));\n } else {\n modalMsg += decodeHTML($translate.instant('edit.repo.restart.needed.msg'));\n }\n if ($scope.isInvalidRepoName) {\n toastr.error($translate.instant('wrong.repo.name.error'));\n } else if ($scope.repositoryType === \"fedx\" && $scope.repositoryInfo.params.member.value.length === 0) {\n $scope.noMembersError();\n } else if (invalidValues) {\n toastr.error(invalidValues);\n } else {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.save'),\n message: modalMsg,\n warning: true\n }).result\n .then(function () {\n $scope.editRepoHttp();\n });\n }\n };\n\n $scope.editRepositoryId = function () {\n let msg = decodeHTML($translate.instant('edit.repo.id.warning.msg'));\n if ($scope.isEnterprise()) {\n msg += decodeHTML($translate.instant('edit.repo.id.cluster.warning.msg'));\n }\n ModalService.openSimpleModal({\n title: $translate.instant('confirm.enable.edit'),\n message: msg,\n warning: true\n }).result.then(function () {\n $scope.canEditRepoId = true;\n });\n };\n\n $scope.goBackToPreviousLocation = function () {\n if (angular.isDefined($routeParams.previous)) {\n delete $location.$$search.previous;\n $location.path('/');\n } else {\n $location.path('/repository');\n }\n };\n\n $scope.validateNumberInput = function () {\n validateNumberFields($scope.repositoryInfo.params, $scope.invalidValues);\n };\n\n $scope.getShaclOptionsClass = function () {\n return getShaclOptionsClass();\n };\n}\n"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[68],{74:function(t,e,i){"use strict";i.r(e);i(3),i(11);const r=angular.module("graphdb.framework.impex.import.directives",["graphdb.framework.utils.uriutils"]);r.directive("validateUri",["UriUtils",function(t){return{restrict:"A",require:"ngModel",link:function(e,i,r,a){a.$parsers.unshift((function(i){let r=!0;return"named"===e.target&&(r=t.isValidIri(i)),a.$setValidity("validateUri",r),i}))}}}]),r.directive("filesTable",(function(){return{restrict:"A",templateUrl:"js/angular/import/templates/filesTable.html"}})),r.directive("filesOntoLoader",(function(){return{link:function(t,e,i){t.$watch("file.status",(function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+i.size+'" height="'+i.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.0.0-M3-RC1">{{\'common.loading\' | translate}}</object>')}))}}}))}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[68],{74:function(t,e,i){"use strict";i.r(e);i(3),i(11);const r=angular.module("graphdb.framework.impex.import.directives",["graphdb.framework.utils.uriutils"]);r.directive("validateUri",["UriUtils",function(t){return{restrict:"A",require:"ngModel",link:function(e,i,r,a){a.$parsers.unshift((function(i){let r=!0;return"named"===e.target&&(r=t.isValidIri(i)),a.$setValidity("validateUri",r),i}))}}}]),r.directive("filesTable",(function(){return{restrict:"A",templateUrl:"js/angular/import/templates/filesTable.html"}})),r.directive("filesOntoLoader",(function(){return{link:function(t,e,i){t.$watch("file.status",(function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+i.size+'" height="'+i.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.0.0-M3-RC4">{{\'common.loading\' | translate}}</object>')}))}}}))}}]);
2
2
  //# sourceMappingURL=68.e25480b7770a679a9654.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/import/directives.js"],"names":["importDirectives","angular","module","directive","UriUtils","restrict","require","link","scope","element","attr","ctrl","$parsers","unshift","value","valid","target","isValidIri","$setValidity","templateUrl","$watch","file","status","$","has","length","append","size"],"mappings":"0FAAA,kBAGA,MAAMA,EAAmBC,QAAQC,OAAO,4CAA6C,CACjF,qCAGJF,EAAiBG,UAAU,cAAe,CAAC,WAAY,SAAUC,GAC7D,MAAO,CACHC,SAAU,IACVC,QAAS,UACTC,KAAM,SAAUC,EAAOC,EAASC,EAAMC,GAClCA,EAAKC,SAASC,SAAQ,SAAUC,GAC5B,IAAIC,GAAQ,EAQZ,MANqB,UAAjBP,EAAMQ,SACND,EAAQX,EAASa,WAAWH,IAGhCH,EAAKO,aAAa,cAAeH,GAE1BD,UAMvBd,EAAiBG,UAAU,cAAc,WACrC,MAAO,CACHE,SAAU,IACVc,YAAa,kDAIrBnB,EAAiBG,UAAU,mBAAmB,WAC1C,MAAO,CACHI,KAAM,SAAUC,EAAOC,EAASC,GAC5BF,EAAMY,OAAO,eAAe,WACE,cAAtBZ,EAAMa,KAAKC,QAAgD,cAAtBd,EAAMa,KAAKC,SAC3CC,EAAEd,GAASe,IAAI,UAAUC,OAAS,GACnCF,EAAEd,GAASiB,OAAO,kBAAoBhB,EAAKiB,KAAO,aAAejB,EAAKiB,KAAO","file":"68.e25480b7770a679a9654.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/utils/uri-utils';\n\nconst importDirectives = angular.module('graphdb.framework.impex.import.directives', [\n 'graphdb.framework.utils.uriutils'\n]);\n\nimportDirectives.directive('validateUri', ['UriUtils', function (UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n let valid = true;\n\n if (scope.target === 'named') {\n valid = UriUtils.isValidIri(value);\n }\n\n ctrl.$setValidity('validateUri', valid);\n\n return value;\n });\n }\n };\n}]);\n\nimportDirectives.directive('filesTable', function () {\n return {\n restrict: 'A',\n templateUrl: 'js/angular/import/templates/filesTable.html'\n };\n});\n\nimportDirectives.directive('filesOntoLoader', function () {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=2.0.0-M3-RC1\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n});\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/import/directives.js"],"names":["importDirectives","angular","module","directive","UriUtils","restrict","require","link","scope","element","attr","ctrl","$parsers","unshift","value","valid","target","isValidIri","$setValidity","templateUrl","$watch","file","status","$","has","length","append","size"],"mappings":"0FAAA,kBAGA,MAAMA,EAAmBC,QAAQC,OAAO,4CAA6C,CACjF,qCAGJF,EAAiBG,UAAU,cAAe,CAAC,WAAY,SAAUC,GAC7D,MAAO,CACHC,SAAU,IACVC,QAAS,UACTC,KAAM,SAAUC,EAAOC,EAASC,EAAMC,GAClCA,EAAKC,SAASC,SAAQ,SAAUC,GAC5B,IAAIC,GAAQ,EAQZ,MANqB,UAAjBP,EAAMQ,SACND,EAAQX,EAASa,WAAWH,IAGhCH,EAAKO,aAAa,cAAeH,GAE1BD,UAMvBd,EAAiBG,UAAU,cAAc,WACrC,MAAO,CACHE,SAAU,IACVc,YAAa,kDAIrBnB,EAAiBG,UAAU,mBAAmB,WAC1C,MAAO,CACHI,KAAM,SAAUC,EAAOC,EAASC,GAC5BF,EAAMY,OAAO,eAAe,WACE,cAAtBZ,EAAMa,KAAKC,QAAgD,cAAtBd,EAAMa,KAAKC,SAC3CC,EAAEd,GAASe,IAAI,UAAUC,OAAS,GACnCF,EAAEd,GAASiB,OAAO,kBAAoBhB,EAAKiB,KAAO,aAAejB,EAAKiB,KAAO","file":"68.e25480b7770a679a9654.bundle.js","sourcesContent":["import 'angular/core/services';\nimport 'angular/utils/uri-utils';\n\nconst importDirectives = angular.module('graphdb.framework.impex.import.directives', [\n 'graphdb.framework.utils.uriutils'\n]);\n\nimportDirectives.directive('validateUri', ['UriUtils', function (UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n let valid = true;\n\n if (scope.target === 'named') {\n valid = UriUtils.isValidIri(value);\n }\n\n ctrl.$setValidity('validateUri', valid);\n\n return value;\n });\n }\n };\n}]);\n\nimportDirectives.directive('filesTable', function () {\n return {\n restrict: 'A',\n templateUrl: 'js/angular/import/templates/filesTable.html'\n };\n});\n\nimportDirectives.directive('filesOntoLoader', function () {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=2.0.0-M3-RC4\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n});\n"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[82],{82:function(e,r,o){"use strict";o.r(r);var t=o(48);function i(e,r,o,i,s){return{restrict:"E",scope:!1,templateUrl:"js/angular/repositories/templates/ontop-repo.html",link:function(n){n.selectedDriver={driverType:"generic",driverName:"Generic JDBC Driver",jdbc:{hostName:"",port:"",databaseName:"",userName:"",password:"",driverClass:"",url:""},urlTemplate:"",downloadDriverUrl:""},n.ontopRepoFileNames={},n.supportedDriversData=[],n.ontopRepoFileLabels={propertiesFile:"JDBC properties",obdaFile:"OBDA or R2RML",owlFile:"ontology file",constraintFile:"constraint file",dbMetadataFile:"DB metadata file"},n.ontopRepoFiles=Object.keys(n.ontopRepoFileLabels),n.ontopRepoFiles.forEach((function(e){n.repositoryInfo.params[e]&&(n.ontopRepoFileNames[e]=Object(t.getFileName)(n.repositoryInfo.params[e].value))})),n.supportedDriverLabels={hostName:"Hostname",port:"Port",databaseName:"Database name",userName:"Username",password:"Password",driverClass:"Driver class",url:"URL"},n.propertiesFileParams=Object.keys(n.supportedDriverLabels),n.classAvailable=!1,n.genericDriverType="generic",n.propertiesFile="propertiesFile";const a=[n.propertiesFile,"obdaFile"],l=["hostName","databaseName","userName"];function p(){return n.selectedDriver.driverType!==n.genericDriverType?l.filter((function(e){return!n.selectedDriver.jdbc[e]})).length>0&&(o.error(s.instant("missing.required.field.error")),1)?Promise.reject(s.instant("missing.required.field.error")):(n.uploadFileLoader=!0,r.updatePropertiesFile(n.repositoryInfo.params[n.propertiesFile].value,n.selectedDriver.jdbc,n.repositoryInfo.location).success((function(e){n.ontopRepoFileNames[n.propertiesFile]=Object(t.getFileName)(e.fileLocation),n.repositoryInfo.params[n.propertiesFile].value=e.fileLocation,n.uploadFileLoader=!1})).error((function(e){c(s.instant("common.error"),e),n.uploadFileLoader=!1}))):Promise.resolve()}function c(e,r){const t=getError(r);o.error(t,e)}n.loadDriverByClass=function(e){const r=n.supportedDriversData.find(r=>r.driverClass===e);return r&&n.copyDriverProperties(r),r},n.selectDriverByType=function(e){n.copyDriverProperties(n.supportedDriversData.find(r=>r.driverType===e)),n.concatURL("hostName",n)},n.copyDriverProperties=function(e){n.selectedDriver.driverType=e.driverType,n.selectedDriver.jdbc.driverClass=e.driverClass,n.selectedDriver.jdbc.url=e.urlTemplate,n.selectedDriver.urlTemplate=e.urlTemplate,n.selectedDriver.downloadDriverUrl=e.downloadDriverUrl,n.selectedDriver.portRequired=e.portRequired,n.classAvailable=e.classAvailable},n.isReadOnly=function(e){return"driverClass"===e||"url"===e},n.editFile=function(o){e.open({templateUrl:"js/angular/templates/modal/editRepoFile.html",controller:"EditRepositoryFileCtrl",resolve:{file:function(){return n.repositoryInfo.params[o]?n.repositoryInfo.params[o].value:""}}}).result.then((function(e){r.updateRepositoryFileContent(e.fileLocation,e.content,n.repositoryInfo.location).success((function(e){n.ontopRepoFileNames[o]=Object(t.getFileName)(e.fileLocation),n.repositoryInfo.params[o].value=e.fileLocation})).error((function(e){c(s.instant("common.error"),e)}))}))},n.uploadOntopRepoFile=function(e,r){e&&e.length&&(n.uploadFile=e[0],n.uploadFileLoader=!0,i.upload({url:"rest/repositories/file/upload",data:{uploadFile:n.uploadFile,location:n.repositoryInfo.location}}).success((function(e){e.success?(n.ontopRepoFileNames[r]=n.uploadFile.name,n.repositoryInfo.params[r].value=e.fileLocation):o.error(e.errorMessage),n.uploadFileLoader=!1})).error((function(e){c(s.instant("common.error"),e),n.uploadFile="",n.uploadFileLoader=!1})))},n.concatURL=function(e){if("hostName"===e||"port"===e||"databaseName"===e){let e=n.selectedDriver.urlTemplate;n.selectedDriver.jdbc.hostName&&(e=n.selectedDriver.jdbc.port?e.replace("{hostport}",`${n.selectedDriver.jdbc.hostName}:${n.selectedDriver.jdbc.port}`):e.replace("{hostport}",n.selectedDriver.jdbc.hostName)),n.selectedDriver.jdbc.databaseName&&(e=e.replace("{database}",n.selectedDriver.jdbc.databaseName)),n.selectedDriver.jdbc.url=e}},n.getInputType=function(e){switch(e){case"password":return"password";case"port":return"number";default:return"text"}},n.checkForRequiredOntopFiles=function(){return p().then((function(){return a.filter((function(e){return!n.repositoryInfo.params[e].value})).length>0?(o.error(s.instant("ontop.repo.missing.required.file.error")),Promise.reject(s.instant("ontop.repo.missing.required.file.error"))):Promise.resolve()}))},n.validateOntopPropertiesConnection=function(){p().then((function(){r.validateOntopPropertiesConnection(n.repositoryInfo).success((function(){o.success(s.instant("ontop.repo.successful.connection.msg"))})).error((function(e){c(s.instant("ontop.repo.failed.to.connect"),e)}))}))},n.isOntopRepoFileUploaded=function(){return n.repositoryInfo.params.propertiesFile&&n.repositoryInfo.params.propertiesFile.value.length>0},n.isRequiredOntopRepoFile=function(e){return a.indexOf(e)>-1},n.isRequiredField=function(e){return l.indexOf(e)>-1||"port"===e&&n.selectedDriver.portRequired},n.getFieldTooltip=function(e){return"port"===e&&n.selectedDriver.portRequired&&(e="portIfRequired"),n.repoTooltips.ontop[e]},n.editOntopRepo=function(){n.checkForRequiredOntopFiles().then((function(){n.editRepository()})).catch((function(e){}))},n.createOntopRepo=function(){n.repositoryInfo.id?n.checkForRequiredOntopFiles().then((function(){n.createRepo()})).catch((function(e){})):o.error(s.instant("empty.repoid.warning"))},n.goBackToPrevious=function(){n.goBackToPreviousLocation()},r.getSupportedDriversData(n.repositoryInfo).success((function(e){n.supportedDriversData=e})).error((function(e){c(s.instant("common.error"),e)})).then((function(){n.editRepoPage&&r.loadPropertiesFile(n.repositoryInfo.params[n.propertiesFile].value,n.repositoryInfo.location).success((function(e){n.loadDriverByClass(e.driverClass)&&(n.selectedDriver.jdbc.hostName=e.hostName,n.selectedDriver.jdbc.port=parseInt(e.port),n.selectedDriver.jdbc.databaseName=e.databaseName,n.selectedDriver.jdbc.userName=e.userName,n.selectedDriver.jdbc.password=e.password,n.selectedDriver.jdbc.url=e.url)})).error((function(e){c(s.instant("common.error"),e),n.uploadFileLoader=!1}))}))}}}angular.module("graphdb.framework.repositories.ontop-repo.directive",[]).directive("ontopRepo",i),i.$inject=["$modal","RepositoriesRestService","toastr","Upload","$translate"]}}]);
2
- //# sourceMappingURL=82.37392f6b8c81e32a27b5.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[82],{82:function(e,r,o){"use strict";o.r(r);var t=o(48);function i(e,r,o,i,s){return{restrict:"E",scope:!1,templateUrl:"js/angular/repositories/templates/ontop-repo.html",link:function(n){n.selectedDriver={driverType:"generic",driverName:"Generic JDBC Driver",jdbc:{hostName:"",port:"",databaseName:"",userName:"",password:"",driverClass:"",url:""},urlTemplate:"",downloadDriverUrl:""},n.ontopRepoFileNames={},n.supportedDriversData=[],n.ontopRepoFileLabels={propertiesFile:"JDBC properties",obdaFile:"OBDA or R2RML",owlFile:"ontology file",constraintFile:"constraint file",dbMetadataFile:"DB metadata file"},n.ontopRepoFiles=Object.keys(n.ontopRepoFileLabels),n.ontopRepoFiles.forEach((function(e){n.repositoryInfo.params[e]&&(n.ontopRepoFileNames[e]=Object(t.getFileName)(n.repositoryInfo.params[e].value))})),n.supportedDriverLabels={hostName:"Hostname",port:"Port",databaseName:"Database name",userName:"Username",password:"Password",driverClass:"Driver class",url:"URL"},n.propertiesFileParams=Object.keys(n.supportedDriverLabels),n.classAvailable=!1,n.genericDriverType="generic",n.propertiesFile="propertiesFile";const a=[n.propertiesFile,"obdaFile"],l=["hostName","databaseName","userName"];function p(){return n.selectedDriver.driverType!==n.genericDriverType?l.filter((function(e){return!n.selectedDriver.jdbc[e]})).length>0&&(o.error(s.instant("missing.required.field.error")),1)?Promise.reject(s.instant("missing.required.field.error")):(n.uploadFileLoader=!0,r.updatePropertiesFile(n.repositoryInfo.params[n.propertiesFile].value,n.selectedDriver.jdbc,n.repositoryInfo.location).success((function(e){n.ontopRepoFileNames[n.propertiesFile]=Object(t.getFileName)(e.fileLocation),n.repositoryInfo.params[n.propertiesFile].value=e.fileLocation,n.uploadFileLoader=!1})).error((function(e){c(s.instant("common.error"),e),n.uploadFileLoader=!1}))):Promise.resolve()}function c(e,r){const t=getError(r);o.error(t,e)}n.loadDriverByClass=function(e){const r=n.supportedDriversData.find(r=>r.driverClass===e);return r&&n.copyDriverProperties(r),r},n.selectDriverByType=function(e){n.copyDriverProperties(n.supportedDriversData.find(r=>r.driverType===e)),n.concatURL("hostName",n)},n.copyDriverProperties=function(e){n.selectedDriver.driverType=e.driverType,n.selectedDriver.jdbc.driverClass=e.driverClass,n.selectedDriver.jdbc.url=e.urlTemplate,n.selectedDriver.urlTemplate=e.urlTemplate,n.selectedDriver.downloadDriverUrl=e.downloadDriverUrl,n.selectedDriver.portRequired=e.portRequired,n.classAvailable=e.classAvailable},n.isReadOnly=function(e){return"driverClass"===e||"url"===e},n.editFile=function(o){e.open({templateUrl:"js/angular/templates/modal/editRepoFile.html",controller:"EditRepositoryFileCtrl",resolve:{file:function(){return n.repositoryInfo.params[o]?n.repositoryInfo.params[o].value:""}}}).result.then((function(e){r.updateRepositoryFileContent(e.fileLocation,e.content,n.repositoryInfo.location).success((function(e){n.ontopRepoFileNames[o]=Object(t.getFileName)(e.fileLocation),n.repositoryInfo.params[o].value=e.fileLocation})).error((function(e){c(s.instant("common.error"),e)}))}))},n.uploadOntopRepoFile=function(e,r){e&&e.length&&(n.uploadFile=e[0],n.uploadFileLoader=!0,i.upload({url:"rest/repositories/file/upload",data:{file:n.uploadFile,location:n.repositoryInfo.location}}).success((function(e){e.success?(n.ontopRepoFileNames[r]=n.uploadFile.name,n.repositoryInfo.params[r].value=e.fileLocation):o.error(e.errorMessage),n.uploadFileLoader=!1})).error((function(e){c(s.instant("common.error"),e),n.uploadFile="",n.uploadFileLoader=!1})))},n.concatURL=function(e){if("hostName"===e||"port"===e||"databaseName"===e){let e=n.selectedDriver.urlTemplate;n.selectedDriver.jdbc.hostName&&(e=n.selectedDriver.jdbc.port?e.replace("{hostport}",`${n.selectedDriver.jdbc.hostName}:${n.selectedDriver.jdbc.port}`):e.replace("{hostport}",n.selectedDriver.jdbc.hostName)),n.selectedDriver.jdbc.databaseName&&(e=e.replace("{database}",n.selectedDriver.jdbc.databaseName)),n.selectedDriver.jdbc.url=e}},n.getInputType=function(e){switch(e){case"password":return"password";case"port":return"number";default:return"text"}},n.checkForRequiredOntopFiles=function(){return p().then((function(){return a.filter((function(e){return!n.repositoryInfo.params[e].value})).length>0?(o.error(s.instant("ontop.repo.missing.required.file.error")),Promise.reject(s.instant("ontop.repo.missing.required.file.error"))):Promise.resolve()}))},n.validateOntopPropertiesConnection=function(){p().then((function(){r.validateOntopPropertiesConnection(n.repositoryInfo).success((function(){o.success(s.instant("ontop.repo.successful.connection.msg"))})).error((function(e){c(s.instant("ontop.repo.failed.to.connect"),e)}))}))},n.isOntopRepoFileUploaded=function(){return n.repositoryInfo.params.propertiesFile&&n.repositoryInfo.params.propertiesFile.value.length>0},n.isRequiredOntopRepoFile=function(e){return a.indexOf(e)>-1},n.isRequiredField=function(e){return l.indexOf(e)>-1||"port"===e&&n.selectedDriver.portRequired},n.getFieldTooltip=function(e){return"port"===e&&n.selectedDriver.portRequired&&(e="portIfRequired"),n.repoTooltips.ontop[e]},n.editOntopRepo=function(){n.checkForRequiredOntopFiles().then((function(){n.editRepository()})).catch((function(e){}))},n.createOntopRepo=function(){n.repositoryInfo.id?n.checkForRequiredOntopFiles().then((function(){n.createRepo()})).catch((function(e){})):o.error(s.instant("empty.repoid.warning"))},n.goBackToPrevious=function(){n.goBackToPreviousLocation()},r.getSupportedDriversData(n.repositoryInfo).success((function(e){n.supportedDriversData=e})).error((function(e){c(s.instant("common.error"),e)})).then((function(){n.editRepoPage&&r.loadPropertiesFile(n.repositoryInfo.params[n.propertiesFile].value,n.repositoryInfo.location).success((function(e){n.loadDriverByClass(e.driverClass)&&(n.selectedDriver.jdbc.hostName=e.hostName,n.selectedDriver.jdbc.port=parseInt(e.port),n.selectedDriver.jdbc.databaseName=e.databaseName,n.selectedDriver.jdbc.userName=e.userName,n.selectedDriver.jdbc.password=e.password,n.selectedDriver.jdbc.url=e.url)})).error((function(e){c(s.instant("common.error"),e),n.uploadFileLoader=!1}))}))}}}angular.module("graphdb.framework.repositories.ontop-repo.directive",[]).directive("ontopRepo",i),i.$inject=["$modal","RepositoriesRestService","toastr","Upload","$translate"]}}]);
2
+ //# sourceMappingURL=82.6f82f4ca0efec1b20486.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/repositories/ontop-repo.directive.js"],"names":["ontopRepoDirective","$modal","RepositoriesRestService","toastr","Upload","$translate","restrict","scope","templateUrl","link","$scope","selectedDriver","driverType","driverName","jdbc","hostName","port","databaseName","userName","password","driverClass","url","urlTemplate","downloadDriverUrl","ontopRepoFileNames","supportedDriversData","ontopRepoFileLabels","propertiesFile","obdaFile","owlFile","constraintFile","dbMetadataFile","ontopRepoFiles","Object","keys","forEach","key","repositoryInfo","params","value","supportedDriverLabels","propertiesFileParams","classAvailable","genericDriverType","REQUIRED_ONTOP_REPO_PARAMS","REQUIRED_PROPERTIES_FIELD_PARAMS","updateProperties","filter","requiredField","length","error","instant","Promise","reject","uploadFileLoader","updatePropertiesFile","location","success","data","fileLocation","showErrorMsg","resolve","title","msg","getError","loadDriverByClass","foundDriver","find","driver","copyDriverProperties","selectDriverByType","concatURL","portRequired","isReadOnly","labelName","editFile","file","open","controller","result","then","updateRepositoryFileContent","content","uploadOntopRepoFile","files","param","uploadFile","upload","name","errorMessage","replace","getInputType","checkForRequiredOntopFiles","requiredFile","validateOntopPropertiesConnection","isOntopRepoFileUploaded","isRequiredOntopRepoFile","indexOf","isRequiredField","field","getFieldTooltip","repoTooltips","ontop","editOntopRepo","editRepository","catch","err","createOntopRepo","id","createRepo","goBackToPrevious","goBackToPreviousLocation","getSupportedDriversData","response","editRepoPage","loadPropertiesFile","driverData","parseInt","angular","module","directive","$inject"],"mappings":"0FAAA,mBAQA,SAASA,EAAmBC,EAAQC,EAAyBC,EAAQC,EAAQC,GACzE,MAAO,CACHC,SAAU,IACVC,OAAO,EACPC,YAAa,oDAEbC,KAGJ,SAAkBC,GAEdA,EAAOC,eAAiB,CACpBC,WAAY,UACZC,WAAY,sBACZC,KAAM,CACFC,SAAU,GACVC,KAAM,GACNC,aAAc,GACdC,SAAU,GACVC,SAAU,GACVC,YAAa,GACbC,IAAK,IAETC,YAAa,GACbC,kBAAmB,IAEvBb,EAAOc,mBAAqB,GAC5Bd,EAAOe,qBAAuB,GAC9Bf,EAAOgB,oBACH,CAACC,eAAgB,kBAAmBC,SAAU,gBAAiBC,QAAS,gBACpEC,eAAgB,kBAAmBC,eAAgB,oBAC3DrB,EAAOsB,eAAiBC,OAAOC,KAAKxB,EAAOgB,qBAC3ChB,EAAOsB,eAAeG,SAAQ,SAASC,GAC/B1B,EAAO2B,eAAeC,OAAOF,KAC7B1B,EAAOc,mBAAmBY,GAAO,sBAAY1B,EAAO2B,eAAeC,OAAOF,GAAKG,WAGvF7B,EAAO8B,sBAAwB,CAACzB,SAAU,WAAYC,KAAM,OAAQC,aAAc,gBAClDC,SAAU,WAAYC,SAAU,WAAYC,YAAa,eAAgBC,IAAK,OAC9GX,EAAO+B,qBAAuBR,OAAOC,KAAKxB,EAAO8B,uBACjD9B,EAAOgC,gBAA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AeG,KAAKO,IAAM+F,EAAW/F,QAEjD6B,OAAM,SAAUQ,GACnBE,EAAavD,EAAW8C,QAAQ,gBAAiBO,GACjDhD,EAAO4C,kBAAmB,UAxM1CgE,QACKC,OAAO,sDAAuD,IAC9DC,UAAU,YAAaxH,GAE5BA,EAAmByH,QAAU,CAAC,SAAU,0BAA2B,SAAU,SAAU","file":"82.37392f6b8c81e32a27b5.bundle.js","sourcesContent":["import {getFileName} from \"./controllers\";\n\nangular\n .module('graphdb.framework.repositories.ontop-repo.directive', [])\n .directive('ontopRepo', ontopRepoDirective);\n\nontopRepoDirective.$inject = ['$modal', 'RepositoriesRestService', 'toastr', 'Upload', '$translate'];\n\nfunction ontopRepoDirective($modal, RepositoriesRestService, toastr, Upload, $translate) {\n return {\n restrict: 'E',\n scope: false,\n templateUrl: 'js/angular/repositories/templates/ontop-repo.html',\n\n link: linkFunc\n };\n\n function linkFunc($scope) {\n\n $scope.selectedDriver = {\n driverType: \"generic\",\n driverName: \"Generic JDBC Driver\",\n jdbc: {\n hostName: \"\",\n port: \"\",\n databaseName: \"\",\n userName: \"\",\n password: \"\",\n driverClass: \"\",\n url: \"\"\n },\n urlTemplate: \"\",\n downloadDriverUrl: \"\"\n };\n $scope.ontopRepoFileNames = {};\n $scope.supportedDriversData = [];\n $scope.ontopRepoFileLabels =\n {propertiesFile: 'JDBC properties', obdaFile: 'OBDA or R2RML', owlFile: 'ontology file',\n constraintFile: 'constraint file', dbMetadataFile: 'DB metadata file'};\n $scope.ontopRepoFiles = Object.keys($scope.ontopRepoFileLabels);\n $scope.ontopRepoFiles.forEach(function(key) {\n if ($scope.repositoryInfo.params[key]) {\n $scope.ontopRepoFileNames[key] = getFileName($scope.repositoryInfo.params[key].value);\n }\n });\n $scope.supportedDriverLabels = {hostName: 'Hostname', port: \"Port\", databaseName: 'Database name',\n userName: 'Username', password: 'Password', driverClass: 'Driver class', url: 'URL'};\n $scope.propertiesFileParams = Object.keys($scope.supportedDriverLabels);\n $scope.classAvailable = false;\n $scope.genericDriverType = 'generic';\n $scope.propertiesFile = 'propertiesFile';\n\n const REQUIRED_ONTOP_REPO_PARAMS = [$scope.propertiesFile, 'obdaFile'];\n const REQUIRED_PROPERTIES_FIELD_PARAMS = ['hostName', 'databaseName', 'userName'];\n\n function getSupportedDriversData() {\n return RepositoriesRestService.getSupportedDriversData($scope.repositoryInfo)\n .success(function (response) {\n $scope.supportedDriversData = response;\n }).error(function (response) {\n showErrorMsg($translate.instant('common.error'), response);\n });\n }\n\n $scope.loadDriverByClass = function (driverClass) {\n const foundDriver = $scope.supportedDriversData\n .find((driver) => driver.driverClass === driverClass);\n if (foundDriver) {\n $scope.copyDriverProperties(foundDriver);\n }\n return foundDriver;\n };\n\n $scope.selectDriverByType = function (driverType) {\n $scope.copyDriverProperties($scope.supportedDriversData\n .find((driver) => driver.driverType === driverType));\n // Call concatURL with proper labelName to apply changes to url field\n $scope.concatURL('hostName', $scope);\n };\n\n $scope.copyDriverProperties = function (driver) {\n $scope.selectedDriver.driverType = driver.driverType;\n $scope.selectedDriver.jdbc.driverClass = driver.driverClass;\n $scope.selectedDriver.jdbc.url = driver.urlTemplate;\n $scope.selectedDriver.urlTemplate = driver.urlTemplate;\n $scope.selectedDriver.downloadDriverUrl = driver.downloadDriverUrl;\n $scope.selectedDriver.portRequired = driver.portRequired;\n $scope.classAvailable = driver.classAvailable;\n };\n\n $scope.isReadOnly = function (labelName) {\n return labelName === 'driverClass' || labelName === 'url';\n }\n\n $scope.editFile = function(file) {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/templates/modal/editRepoFile.html',\n controller: 'EditRepositoryFileCtrl',\n resolve: {\n file: function () {\n return $scope.repositoryInfo.params[file] ? $scope.repositoryInfo.params[file].value : '';\n }\n }\n });\n\n modalInstance.result.then(function (data) {\n // send data to backend\n RepositoriesRestService.updateRepositoryFileContent(data.fileLocation, data.content, $scope.repositoryInfo.location).success(function(result) {\n $scope.ontopRepoFileNames[file] = getFileName(result.fileLocation);\n $scope.repositoryInfo.params[file].value = result.fileLocation;\n }).error(function (error) {\n showErrorMsg($translate.instant('common.error'), error);\n })\n });\n }\n\n $scope.uploadOntopRepoFile = function(files, param) {\n if (files && files.length) {\n $scope.uploadFile = files[0];\n $scope.uploadFileLoader = true;\n Upload.upload({\n url: 'rest/repositories/file/upload',\n data: {uploadFile: $scope.uploadFile, location: $scope.repositoryInfo.location}\n })\n .success(function (data) {\n if (!data.success) {\n toastr.error(data.errorMessage);\n } else {\n $scope.ontopRepoFileNames[param] = $scope.uploadFile.name;\n $scope.repositoryInfo.params[param].value = data.fileLocation;\n }\n $scope.uploadFileLoader = false;\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFile = '';\n $scope.uploadFileLoader = false;\n });\n }\n }\n\n $scope.concatURL = function(labelName) {\n if (labelName === 'hostName' || labelName === 'port' || labelName === 'databaseName') {\n let result = $scope.selectedDriver.urlTemplate;\n if ($scope.selectedDriver.jdbc.hostName) {\n if ($scope.selectedDriver.jdbc.port) {\n result = result.replace('{hostport}',\n `${$scope.selectedDriver.jdbc.hostName}:${$scope.selectedDriver.jdbc.port}`);\n } else {\n result = result.replace('{hostport}', $scope.selectedDriver.jdbc.hostName);\n }\n }\n\n if ($scope.selectedDriver.jdbc.databaseName) {\n result = result.replace('{database}', $scope.selectedDriver.jdbc.databaseName);\n }\n\n $scope.selectedDriver.jdbc.url = result;\n }\n }\n\n $scope.getInputType = function (labelName) {\n switch (labelName) {\n case 'password':\n return 'password';\n case 'port':\n return 'number';\n default:\n return 'text';\n }\n }\n\n $scope.checkForRequiredOntopFiles = function () {\n // Should guarantee that code will be executed in sequential manner,\n // because properties file is not created yet\n return updateProperties()\n .then(function () {\n const missingRequired = REQUIRED_ONTOP_REPO_PARAMS.filter(function (requiredFile) {\n return !$scope.repositoryInfo.params[requiredFile].value;\n });\n if (missingRequired.length > 0) {\n toastr.error($translate.instant('ontop.repo.missing.required.file.error'));\n return Promise.reject($translate.instant('ontop.repo.missing.required.file.error'));\n }\n return Promise.resolve();\n });\n }\n\n function loadPropertiesFile() {\n RepositoriesRestService.loadPropertiesFile($scope.repositoryInfo.params[$scope.propertiesFile].value, $scope.repositoryInfo.location)\n .success(function (driverData) {\n const driver = $scope.loadDriverByClass(driverData.driverClass);\n // If driver class is not found means that the selected driver is a GENERIC ONE\n if (driver) {\n $scope.selectedDriver.jdbc.hostName = driverData.hostName;\n $scope.selectedDriver.jdbc.port = parseInt(driverData.port);\n $scope.selectedDriver.jdbc.databaseName = driverData.databaseName;\n $scope.selectedDriver.jdbc.userName = driverData.userName;\n $scope.selectedDriver.jdbc.password = driverData.password;\n $scope.selectedDriver.jdbc.url = driverData.url;\n }\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFileLoader = false;\n });\n }\n\n $scope.validateOntopPropertiesConnection = function () {\n updateProperties()\n .then(function () {\n RepositoriesRestService.validateOntopPropertiesConnection($scope.repositoryInfo)\n .success(function () {\n toastr.success($translate.instant('ontop.repo.successful.connection.msg'));\n }).error(function (data) {\n showErrorMsg($translate.instant('ontop.repo.failed.to.connect'), data);\n });\n });\n }\n\n $scope.isOntopRepoFileUploaded = function() {\n return $scope.repositoryInfo.params.propertiesFile &&\n $scope.repositoryInfo.params.propertiesFile.value.length > 0\n };\n\n function missingRequiredField() {\n const missing = REQUIRED_PROPERTIES_FIELD_PARAMS\n .filter(function (requiredField) {\n return !$scope.selectedDriver.jdbc[requiredField]\n });\n if (missing.length > 0) {\n toastr.error($translate.instant('missing.required.field.error'));\n return true;\n }\n return false;\n }\n\n function updateProperties() {\n if ($scope.selectedDriver.driverType !== $scope.genericDriverType) {\n if (missingRequiredField()) {\n return Promise.reject($translate.instant('missing.required.field.error'));\n }\n return updatePropertiesFile();\n }\n return Promise.resolve();\n }\n\n function updatePropertiesFile() {\n $scope.uploadFileLoader = true;\n return RepositoriesRestService\n .updatePropertiesFile($scope.repositoryInfo.params[$scope.propertiesFile].value, $scope.selectedDriver.jdbc, $scope.repositoryInfo.location)\n .success(function (data) {\n $scope.ontopRepoFileNames[$scope.propertiesFile] = getFileName(data.fileLocation);\n $scope.repositoryInfo.params[$scope.propertiesFile].value = data.fileLocation;\n $scope.uploadFileLoader = false;\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFileLoader = false;\n });\n }\n\n $scope.isRequiredOntopRepoFile = function(file) {\n return REQUIRED_ONTOP_REPO_PARAMS.indexOf(file) > -1;\n };\n\n $scope.isRequiredField = function (field) {\n return REQUIRED_PROPERTIES_FIELD_PARAMS.indexOf(field) > -1\n || field === 'port' && $scope.selectedDriver.portRequired;\n };\n\n $scope.getFieldTooltip = function (field) {\n if (field === 'port' && $scope.selectedDriver.portRequired) {\n field = 'portIfRequired';\n }\n return $scope.repoTooltips.ontop[field];\n };\n\n $scope.editOntopRepo = function () {\n $scope.checkForRequiredOntopFiles()\n .then(function () {\n $scope.editRepository();\n }).catch(function (err) {\n // The catch block is empty, because error is handled in promise\n });\n }\n\n $scope.createOntopRepo = function () {\n if (!$scope.repositoryInfo.id) {\n toastr.error($translate.instant('empty.repoid.warning'));\n return;\n }\n\n $scope.checkForRequiredOntopFiles()\n .then(function () {\n $scope.createRepo();\n }).catch(function (err) {\n // The catch block is empty, because error is handled in promise\n });\n };\n\n $scope.goBackToPrevious = function () {\n $scope.goBackToPreviousLocation();\n }\n\n function showErrorMsg (title, data) {\n const msg = getError(data);\n toastr.error(msg, title);\n }\n\n getSupportedDriversData()\n .then(function () {\n if ($scope.editRepoPage) {\n loadPropertiesFile();\n }\n });\n }\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/repositories/ontop-repo.directive.js"],"names":["ontopRepoDirective","$modal","RepositoriesRestService","toastr","Upload","$translate","restrict","scope","templateUrl","link","$scope","selectedDriver","driverType","driverName","jdbc","hostName","port","databaseName","userName","password","driverClass","url","urlTemplate","downloadDriverUrl","ontopRepoFileNames","supportedDriversData","ontopRepoFileLabels","propertiesFile","obdaFile","owlFile","constraintFile","dbMetadataFile","ontopRepoFiles","Object","keys","forEach","key","repositoryInfo","params","value","supportedDriverLabels","propertiesFileParams","classAvailable","genericDriverType","REQUIRED_ONTOP_REPO_PARAMS","REQUIRED_PROPERTIES_FIELD_PARAMS","updateProperties","filter","requiredField","length","error","instant","Promise","reject","uploadFileLoader","updatePropertiesFile","location","success","data","fileLocation","showErrorMsg","resolve","title","msg","getError","loadDriverByClass","foundDriver","find","driver","copyDriverProperties","selectDriverByType","concatURL","portRequired","isReadOnly","labelName","editFile","file","open","controller","result","then","updateRepositoryFileContent","content","uploadOntopRepoFile","files","param","uploadFile","upload","name","errorMessage","replace","getInputType","checkForRequiredOntopFiles","requiredFile","validateOntopPropertiesConnection","isOntopRepoFileUploaded","isRequiredOntopRepoFile","indexOf","isRequiredField","field","getFieldTooltip","repoTooltips","ontop","editOntopRepo","editRepository","catch","err","createOntopRepo","id","createRepo","goBackToPrevious","goBackToPreviousLocation","getSupportedDriversData","response","editRepoPage","loadPropertiesFile","driverData","parseInt","angular","module","directive","$inject"],"mappings":"0FAAA,mBAQA,SAASA,EAAmBC,EAAQC,EAAyBC,EAAQC,EAAQC,GACzE,MAAO,CACHC,SAAU,IACVC,OAAO,EACPC,YAAa,oDAEbC,KAGJ,SAAkBC,GAEdA,EAAOC,eAAiB,CACpBC,WAAY,UACZC,WAAY,sBACZC,KAAM,CACFC,SAAU,GACVC,KAAM,GACNC,aAAc,GACdC,SAAU,GACVC,SAAU,GACVC,YAAa,GACbC,IAAK,IAETC,YAAa,GACbC,kBAAmB,IAEvBb,EAAOc,mBAAqB,GAC5Bd,EAAOe,qBAAuB,GAC9Bf,EAAOgB,oBACH,CAACC,eAAgB,kBAAmBC,SAAU,gBAAiBC,QAAS,gBACpEC,eAAgB,kBAAmBC,eAAgB,oBAC3DrB,EAAOsB,eAAiBC,OAAOC,KAAKxB,EAAOgB,qBAC3ChB,EAAOsB,eAAeG,SAAQ,SAASC,GAC/B1B,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2D,GACA1G,EAAOuD,kBAAkBmD,EAAWhG,eAG/CV,EAAOC,eAAeG,KAAKC,SAAWqG,EAAWrG,SACjDL,EAAOC,eAAeG,KAAKE,KAAOqG,SAASD,EAAWpG,MACtDN,EAAOC,eAAeG,KAAKG,aAAemG,EAAWnG,aACrDP,EAAOC,eAAeG,KAAKI,SAAWkG,EAAWlG,SACjDR,EAAOC,eAAeG,KAAKK,SAAWiG,EAAWjG,SACjDT,EAAOC,eAAeG,KAAKO,IAAM+F,EAAW/F,QAEjD6B,OAAM,SAAUQ,GACnBE,EAAavD,EAAW8C,QAAQ,gBAAiBO,GACjDhD,EAAO4C,kBAAmB,UAxM1CgE,QACKC,OAAO,sDAAuD,IAC9DC,UAAU,YAAaxH,GAE5BA,EAAmByH,QAAU,CAAC,SAAU,0BAA2B,SAAU,SAAU","file":"82.6f82f4ca0efec1b20486.bundle.js","sourcesContent":["import {getFileName} from \"./controllers\";\n\nangular\n .module('graphdb.framework.repositories.ontop-repo.directive', [])\n .directive('ontopRepo', ontopRepoDirective);\n\nontopRepoDirective.$inject = ['$modal', 'RepositoriesRestService', 'toastr', 'Upload', '$translate'];\n\nfunction ontopRepoDirective($modal, RepositoriesRestService, toastr, Upload, $translate) {\n return {\n restrict: 'E',\n scope: false,\n templateUrl: 'js/angular/repositories/templates/ontop-repo.html',\n\n link: linkFunc\n };\n\n function linkFunc($scope) {\n\n $scope.selectedDriver = {\n driverType: \"generic\",\n driverName: \"Generic JDBC Driver\",\n jdbc: {\n hostName: \"\",\n port: \"\",\n databaseName: \"\",\n userName: \"\",\n password: \"\",\n driverClass: \"\",\n url: \"\"\n },\n urlTemplate: \"\",\n downloadDriverUrl: \"\"\n };\n $scope.ontopRepoFileNames = {};\n $scope.supportedDriversData = [];\n $scope.ontopRepoFileLabels =\n {propertiesFile: 'JDBC properties', obdaFile: 'OBDA or R2RML', owlFile: 'ontology file',\n constraintFile: 'constraint file', dbMetadataFile: 'DB metadata file'};\n $scope.ontopRepoFiles = Object.keys($scope.ontopRepoFileLabels);\n $scope.ontopRepoFiles.forEach(function(key) {\n if ($scope.repositoryInfo.params[key]) {\n $scope.ontopRepoFileNames[key] = getFileName($scope.repositoryInfo.params[key].value);\n }\n });\n $scope.supportedDriverLabels = {hostName: 'Hostname', port: \"Port\", databaseName: 'Database name',\n userName: 'Username', password: 'Password', driverClass: 'Driver class', url: 'URL'};\n $scope.propertiesFileParams = Object.keys($scope.supportedDriverLabels);\n $scope.classAvailable = false;\n $scope.genericDriverType = 'generic';\n $scope.propertiesFile = 'propertiesFile';\n\n const REQUIRED_ONTOP_REPO_PARAMS = [$scope.propertiesFile, 'obdaFile'];\n const REQUIRED_PROPERTIES_FIELD_PARAMS = ['hostName', 'databaseName', 'userName'];\n\n function getSupportedDriversData() {\n return RepositoriesRestService.getSupportedDriversData($scope.repositoryInfo)\n .success(function (response) {\n $scope.supportedDriversData = response;\n }).error(function (response) {\n showErrorMsg($translate.instant('common.error'), response);\n });\n }\n\n $scope.loadDriverByClass = function (driverClass) {\n const foundDriver = $scope.supportedDriversData\n .find((driver) => driver.driverClass === driverClass);\n if (foundDriver) {\n $scope.copyDriverProperties(foundDriver);\n }\n return foundDriver;\n };\n\n $scope.selectDriverByType = function (driverType) {\n $scope.copyDriverProperties($scope.supportedDriversData\n .find((driver) => driver.driverType === driverType));\n // Call concatURL with proper labelName to apply changes to url field\n $scope.concatURL('hostName', $scope);\n };\n\n $scope.copyDriverProperties = function (driver) {\n $scope.selectedDriver.driverType = driver.driverType;\n $scope.selectedDriver.jdbc.driverClass = driver.driverClass;\n $scope.selectedDriver.jdbc.url = driver.urlTemplate;\n $scope.selectedDriver.urlTemplate = driver.urlTemplate;\n $scope.selectedDriver.downloadDriverUrl = driver.downloadDriverUrl;\n $scope.selectedDriver.portRequired = driver.portRequired;\n $scope.classAvailable = driver.classAvailable;\n };\n\n $scope.isReadOnly = function (labelName) {\n return labelName === 'driverClass' || labelName === 'url';\n }\n\n $scope.editFile = function(file) {\n const modalInstance = $modal.open({\n templateUrl: 'js/angular/templates/modal/editRepoFile.html',\n controller: 'EditRepositoryFileCtrl',\n resolve: {\n file: function () {\n return $scope.repositoryInfo.params[file] ? $scope.repositoryInfo.params[file].value : '';\n }\n }\n });\n\n modalInstance.result.then(function (data) {\n // send data to backend\n RepositoriesRestService.updateRepositoryFileContent(data.fileLocation, data.content, $scope.repositoryInfo.location).success(function(result) {\n $scope.ontopRepoFileNames[file] = getFileName(result.fileLocation);\n $scope.repositoryInfo.params[file].value = result.fileLocation;\n }).error(function (error) {\n showErrorMsg($translate.instant('common.error'), error);\n })\n });\n }\n\n $scope.uploadOntopRepoFile = function(files, param) {\n if (files && files.length) {\n $scope.uploadFile = files[0];\n $scope.uploadFileLoader = true;\n Upload.upload({\n url: 'rest/repositories/file/upload',\n data: {file: $scope.uploadFile, location: $scope.repositoryInfo.location}\n })\n .success(function (data) {\n if (!data.success) {\n toastr.error(data.errorMessage);\n } else {\n $scope.ontopRepoFileNames[param] = $scope.uploadFile.name;\n $scope.repositoryInfo.params[param].value = data.fileLocation;\n }\n $scope.uploadFileLoader = false;\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFile = '';\n $scope.uploadFileLoader = false;\n });\n }\n }\n\n $scope.concatURL = function(labelName) {\n if (labelName === 'hostName' || labelName === 'port' || labelName === 'databaseName') {\n let result = $scope.selectedDriver.urlTemplate;\n if ($scope.selectedDriver.jdbc.hostName) {\n if ($scope.selectedDriver.jdbc.port) {\n result = result.replace('{hostport}',\n `${$scope.selectedDriver.jdbc.hostName}:${$scope.selectedDriver.jdbc.port}`);\n } else {\n result = result.replace('{hostport}', $scope.selectedDriver.jdbc.hostName);\n }\n }\n\n if ($scope.selectedDriver.jdbc.databaseName) {\n result = result.replace('{database}', $scope.selectedDriver.jdbc.databaseName);\n }\n\n $scope.selectedDriver.jdbc.url = result;\n }\n }\n\n $scope.getInputType = function (labelName) {\n switch (labelName) {\n case 'password':\n return 'password';\n case 'port':\n return 'number';\n default:\n return 'text';\n }\n }\n\n $scope.checkForRequiredOntopFiles = function () {\n // Should guarantee that code will be executed in sequential manner,\n // because properties file is not created yet\n return updateProperties()\n .then(function () {\n const missingRequired = REQUIRED_ONTOP_REPO_PARAMS.filter(function (requiredFile) {\n return !$scope.repositoryInfo.params[requiredFile].value;\n });\n if (missingRequired.length > 0) {\n toastr.error($translate.instant('ontop.repo.missing.required.file.error'));\n return Promise.reject($translate.instant('ontop.repo.missing.required.file.error'));\n }\n return Promise.resolve();\n });\n }\n\n function loadPropertiesFile() {\n RepositoriesRestService.loadPropertiesFile($scope.repositoryInfo.params[$scope.propertiesFile].value, $scope.repositoryInfo.location)\n .success(function (driverData) {\n const driver = $scope.loadDriverByClass(driverData.driverClass);\n // If driver class is not found means that the selected driver is a GENERIC ONE\n if (driver) {\n $scope.selectedDriver.jdbc.hostName = driverData.hostName;\n $scope.selectedDriver.jdbc.port = parseInt(driverData.port);\n $scope.selectedDriver.jdbc.databaseName = driverData.databaseName;\n $scope.selectedDriver.jdbc.userName = driverData.userName;\n $scope.selectedDriver.jdbc.password = driverData.password;\n $scope.selectedDriver.jdbc.url = driverData.url;\n }\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFileLoader = false;\n });\n }\n\n $scope.validateOntopPropertiesConnection = function () {\n updateProperties()\n .then(function () {\n RepositoriesRestService.validateOntopPropertiesConnection($scope.repositoryInfo)\n .success(function () {\n toastr.success($translate.instant('ontop.repo.successful.connection.msg'));\n }).error(function (data) {\n showErrorMsg($translate.instant('ontop.repo.failed.to.connect'), data);\n });\n });\n }\n\n $scope.isOntopRepoFileUploaded = function() {\n return $scope.repositoryInfo.params.propertiesFile &&\n $scope.repositoryInfo.params.propertiesFile.value.length > 0\n };\n\n function missingRequiredField() {\n const missing = REQUIRED_PROPERTIES_FIELD_PARAMS\n .filter(function (requiredField) {\n return !$scope.selectedDriver.jdbc[requiredField]\n });\n if (missing.length > 0) {\n toastr.error($translate.instant('missing.required.field.error'));\n return true;\n }\n return false;\n }\n\n function updateProperties() {\n if ($scope.selectedDriver.driverType !== $scope.genericDriverType) {\n if (missingRequiredField()) {\n return Promise.reject($translate.instant('missing.required.field.error'));\n }\n return updatePropertiesFile();\n }\n return Promise.resolve();\n }\n\n function updatePropertiesFile() {\n $scope.uploadFileLoader = true;\n return RepositoriesRestService\n .updatePropertiesFile($scope.repositoryInfo.params[$scope.propertiesFile].value, $scope.selectedDriver.jdbc, $scope.repositoryInfo.location)\n .success(function (data) {\n $scope.ontopRepoFileNames[$scope.propertiesFile] = getFileName(data.fileLocation);\n $scope.repositoryInfo.params[$scope.propertiesFile].value = data.fileLocation;\n $scope.uploadFileLoader = false;\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFileLoader = false;\n });\n }\n\n $scope.isRequiredOntopRepoFile = function(file) {\n return REQUIRED_ONTOP_REPO_PARAMS.indexOf(file) > -1;\n };\n\n $scope.isRequiredField = function (field) {\n return REQUIRED_PROPERTIES_FIELD_PARAMS.indexOf(field) > -1\n || field === 'port' && $scope.selectedDriver.portRequired;\n };\n\n $scope.getFieldTooltip = function (field) {\n if (field === 'port' && $scope.selectedDriver.portRequired) {\n field = 'portIfRequired';\n }\n return $scope.repoTooltips.ontop[field];\n };\n\n $scope.editOntopRepo = function () {\n $scope.checkForRequiredOntopFiles()\n .then(function () {\n $scope.editRepository();\n }).catch(function (err) {\n // The catch block is empty, because error is handled in promise\n });\n }\n\n $scope.createOntopRepo = function () {\n if (!$scope.repositoryInfo.id) {\n toastr.error($translate.instant('empty.repoid.warning'));\n return;\n }\n\n $scope.checkForRequiredOntopFiles()\n .then(function () {\n $scope.createRepo();\n }).catch(function (err) {\n // The catch block is empty, because error is handled in promise\n });\n };\n\n $scope.goBackToPrevious = function () {\n $scope.goBackToPreviousLocation();\n }\n\n function showErrorMsg (title, data) {\n const msg = getError(data);\n toastr.error(msg, title);\n }\n\n getSupportedDriversData()\n .then(function () {\n if ($scope.editRepoPage) {\n loadPropertiesFile();\n }\n });\n }\n}\n"],"sourceRoot":""}