graphdb-workbench 3.3.0-RC1 → 3.3.0-RC2
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.
- package/dist/{38644.33213220244e95f341d6.bundle.js → 38644.2e388a5c9bfb880c79da.bundle.js} +2 -2
- package/dist/{38644.33213220244e95f341d6.bundle.js.map → 38644.2e388a5c9bfb880c79da.bundle.js.map} +1 -1
- package/dist/{39518.88269112c580888a2e32.bundle.js → 39518.a028597ca2f97f8e8cd6.bundle.js} +2 -2
- package/dist/{39518.88269112c580888a2e32.bundle.js.map → 39518.a028597ca2f97f8e8cd6.bundle.js.map} +1 -1
- package/dist/{67888.191af20d65ad96771abb.bundle.js → 67888.58e7f7058516d3d8f782.bundle.js} +2 -2
- package/dist/{67888.191af20d65ad96771abb.bundle.js.map → 67888.58e7f7058516d3d8f782.bundle.js.map} +1 -1
- package/dist/68685.7ff6ade23d27ade4d1ef.bundle.js +2 -0
- package/dist/68685.7ff6ade23d27ade4d1ef.bundle.js.map +1 -0
- package/dist/{78070.a0426f85ecb3c3c5a368.bundle.js → 78070.06ebae9b4ebdb4749c29.bundle.js} +2 -2
- package/dist/{78070.a0426f85ecb3c3c5a368.bundle.js.map → 78070.06ebae9b4ebdb4749c29.bundle.js.map} +1 -1
- package/dist/{82926.ad4dd11d09d9aecb2f8c.bundle.js → 82926.7b2eb86c228751481414.bundle.js} +2 -2
- package/dist/{82926.ad4dd11d09d9aecb2f8c.bundle.js.map → 82926.7b2eb86c228751481414.bundle.js.map} +1 -1
- package/dist/{99448.a2a554daef4a4650faf7.bundle.js → 99448.e071084bd5eb06401e14.bundle.js} +2 -2
- package/dist/{99448.a2a554daef4a4650faf7.bundle.js.map → 99448.e071084bd5eb06401e14.bundle.js.map} +1 -1
- package/dist/index.html +9 -9
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
- package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
- package/dist/js/angular/core/templates/search-resource-input.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +2 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
- package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/{legacyWorkbench.4a686207dacd36d36696.js → legacyWorkbench.bf3ed4e2d45baaada292.js} +3 -3
- package/dist/{legacyWorkbench.4a686207dacd36d36696.js.map → legacyWorkbench.bf3ed4e2d45baaada292.js.map} +1 -1
- package/dist/{main.5bdc9e5662018863e37b.js → main.799b2a40cedbd165fe35.js} +3 -3
- package/dist/main.799b2a40cedbd165fe35.js.map +1 -0
- package/dist/pages/aclmanagement.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/home.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/jdbc.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/sparql-templates.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/plugins.js +1 -1
- package/dist/res/swagger5/index.html +11 -11
- package/package.json +1 -1
- package/dist/68685.0a7882a756516e48b3c4.bundle.js +0 -2
- package/dist/68685.0a7882a756516e48b3c4.bundle.js.map +0 -1
- package/dist/main.5bdc9e5662018863e37b.js.map +0 -1
- /package/dist/{legacyWorkbench.4a686207dacd36d36696.js.LICENSE.txt → legacyWorkbench.bf3ed4e2d45baaada292.js.LICENSE.txt} +0 -0
- /package/dist/{main.5bdc9e5662018863e37b.js.LICENSE.txt → main.799b2a40cedbd165fe35.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const __webpack_esm_id__=67888;export const __webpack_esm_ids__=[9717,67888,73702,82926,96248];export const __webpack_esm_modules__={9717(){function e(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:o=>{const t=[];o.popoverTemplate="resourceStatusInfoTemplate.html",o.popoverIsOpen=!1,o.context=o.resource.importResource.context,o.replaceGraphs=o.resource.importResource.replaceGraphs,o.baseUrl=decodeURIComponent(o.resource.importResource.baseURI),o.forceSerial=o.resource.importResource.forceSerial,o.importedOn=o.resource.importResource.importedOn,o.parserSettings=o.resource.importResource.parserSettings,o.open=()=>{o.closeAllDialogs(),o.popoverIsOpen=!0},o.closeAllDialogs=()=>{e.$broadcast("closePopovers")},o.close=()=>{o.popoverIsOpen=!1};const s=e=>{"Escape"===e.key&&o.$apply(()=>{o.close()})};t.push(o.$on("closePopovers",o.close)),r.on("keydown",s),o.$on("$destroy",()=>{r.off("keydown",s),t.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",e),e.$inject=["$rootScope","$document"]},54419(e,r,o){o(96248);var t=o(28847),s=o(78618);function i(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.I,r.toTitleCase=e=>s.Sn(e),r.showMessage=r=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return r?r.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",i),i.$inject=["$uibModal"]},67888(e,r,o){o(82493),o(5687),o(39324),o(73702),o(82926),o(83136),o(76933),o(47195),o(56669),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},73702(){function e(e){return{restrict:"A",require:"ngModel",link:function(r,o,t,s){s.$parsers.unshift(function(r){if(s.$setValidity("validateUri",!0),!s.$isEmpty(r)){const o=e.isValidIri(r,r.toString());s.$setValidity("validateUri",o)}return r})}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]},82926(){function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.3.0-
|
|
2
|
-
//# sourceMappingURL=67888.
|
|
1
|
+
export const __webpack_esm_id__=67888;export const __webpack_esm_ids__=[9717,67888,73702,82926,96248];export const __webpack_esm_modules__={9717(){function e(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:o=>{const t=[];o.popoverTemplate="resourceStatusInfoTemplate.html",o.popoverIsOpen=!1,o.context=o.resource.importResource.context,o.replaceGraphs=o.resource.importResource.replaceGraphs,o.baseUrl=decodeURIComponent(o.resource.importResource.baseURI),o.forceSerial=o.resource.importResource.forceSerial,o.importedOn=o.resource.importResource.importedOn,o.parserSettings=o.resource.importResource.parserSettings,o.open=()=>{o.closeAllDialogs(),o.popoverIsOpen=!0},o.closeAllDialogs=()=>{e.$broadcast("closePopovers")},o.close=()=>{o.popoverIsOpen=!1};const s=e=>{"Escape"===e.key&&o.$apply(()=>{o.close()})};t.push(o.$on("closePopovers",o.close)),r.on("keydown",s),o.$on("$destroy",()=>{r.off("keydown",s),t.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",e),e.$inject=["$rootScope","$document"]},54419(e,r,o){o(96248);var t=o(28847),s=o(78618);function i(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.I,r.toTitleCase=e=>s.Sn(e),r.showMessage=r=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return r?r.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",i),i.$inject=["$uibModal"]},67888(e,r,o){o(82493),o(5687),o(39324),o(73702),o(82926),o(83136),o(76933),o(47195),o(56669),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},73702(){function e(e){return{restrict:"A",require:"ngModel",link:function(r,o,t,s){s.$parsers.unshift(function(r){if(s.$setValidity("validateUri",!0),!s.$isEmpty(r)){const o=e.isValidIri(r,r.toString());s.$setValidity("validateUri",o)}return r})}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]},82926(){function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.3.0-RC2">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},83136(e,r,o){var t=o(28847),s=(o(54419),o(9717),o(18025)),i=o(57436),c=o(7796),a=o(56636),l=o(25079);const p={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},n={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function u(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-tree.html",scope:{columnKeys:"=",showTypeFilter:"=",sortBy:"=",asc:"=",onImport:"&",onImportAll:"&",onReset:"&",onRemove:"&",onStopImport:"&",onEditResource:"&"},link:(o,u,m)=>{o.resources=new i.k,o.displayResources=[],o.TYPE_FILTER_OPTIONS=p,o.filterByType=p.ALL,o.filterByFileName="",o.STATUS_OPTIONS=n,o.selectedByStatus=void 0,o.areAllDisplayedImportResourcesSelected=!1,o.areAllDisplayedImportResourcesPartialSelected=!1,o.ImportResourceStatus=t.I,o.canRemoveResource=angular.isDefined(m.onRemove),o.canResetSelectedResources=!1,o.SORTING_TYPES=s.R,o.sortAsc=!angular.isDefined(m.asc)||o.asc,o.sortedBy=o.sortBy,o.showLoader=r.getShowLoader(),o.hasSelection=!1,o.selectionChanged=e=>{e.setSelection(e.selected),I(),d(),g()},o.selectResourceWithStatus=e=>{o.selectedByStatus=e,o.resources.setSelection(!1),n.ALL===o.selectedByStatus?o.resources.setSelection(!0):n.IMPORTED===o.selectedByStatus?o.resources.selectAllWithStatus([t.I.DONE]):n.NOT_IMPORTED===o.selectedByStatus&&o.resources.selectAllWithStatus([t.I.IMPORTING,t.I.NONE,t.I.ERROR,t.I.PENDING,t.I.INTERRUPTING]),R(),d()},o.filterByTypeChanged=e=>{o.filterByType=e,R()},o.filterByFileNameChanged=e=>{o.filterByFileName=e,N(R,100)},o.onResetStatus=()=>{const e=o.resources.getAllSelected().map(e=>e.path);e.length>0&&o.onReset({resources:e})},o.resetStatus=e=>{o.onReset({resources:[e.path]})},o.onRemoveResources=()=>{const e=o.resources.getAllSelected();e&&e.length>0&&o.onRemove({resources:e})},o.removeResource=e=>{o.onRemove({resources:[e]})},o.importAll=e=>{const r=o.resources.getAllSelectedForImport();r.length>0&&o.onImportAll({selectedResources:r,withoutChangingSettings:e})},o.stopImport=e=>{o.onStopImport({resource:e})},o.sort=e=>{o.sortedBy===e?o.sortAsc=!o.sortAsc:o.sortAsc=!0,o.sortedBy=e,R()},o.editResource=e=>{o.onEditResource({resource:e})};const d=()=>{o.canResetSelectedResources=o.resources.getSelectedImportedResources()},R=()=>{o.resources.getRoot().updateSelectionState(),f(),o.displayResources=o.resources.toList().filter(E).filter(v),g(),I()},g=()=>{const e=o.resources.getAllSelectedFilesNames();o.hasSelection=e.length>0,r.updateSelectedFilesNames(e)},I=()=>{const e=o.displayResources.some(e=>!e.selected),r=o.displayResources.some(e=>e.selected);o.areAllDisplayedImportResourcesSelected=r&&!e,o.areAllDisplayedImportResourcesPartialSelected=r&&e},f=()=>{s.R.NAME===o.sortedBy?o.resources.sort(h(o.sortAsc)):s.R.SIZE===o.sortedBy?o.resources.sort(y(o.sortAsc)):s.R.MODIFIED===o.sortedBy?o.resources.sort(S(o.sortAsc)):s.R.IMPORTED===o.sortedBy?o.resources.sort(T(o.sortAsc)):s.R.CONTEXT===o.sortedBy&&o.resources.sort(A(o.sortAsc))},h=e=>(r,o)=>e?r.importResource.name.localeCompare(o.importResource.name):o.importResource.name.localeCompare(r.importResource.name),y=e=>(r,o)=>{const t=(0,l.O)(r.importResource.size),s=(0,l.O)(o.importResource.size);return e?t-s:s-t},S=e=>(r,o)=>{const t=r.importResource.modifiedOn||Number.MAX_VALUE,s=o.importResource.modifiedOn||Number.MAX_VALUE;return e?t-s:s-t},T=e=>(r,o)=>{const t=r.importResource.importedOn||Number.MAX_VALUE,s=o.importResource.importedOn||Number.MAX_VALUE;return e?t-s:s-t},A=e=>(r,o)=>e?r.importResource.context.localeCompare(o.importResource.context):o.importResource.context.localeCompare(r.importResource.context),E=e=>p.ALL===o.filterByType||(o.filterByType===p.FILE?e.isFile():o.filterByType===p.DIRECTORY&&e.isDirectory()),v=e=>!o.filterByFileName||(o.filterByType===p.DIRECTORY?e.hasTextInDirectoriesName(o.filterByFileName):o.filterByType===p.FILE?e.hasTextInFilesName(o.filterByFileName):e.hasTextInResourcesName(o.filterByFileName));let O;const N=(r,o)=>{O&&e.cancel(O),O=e(r,o)},b=[];b.push(r.onResourcesUpdated((e=[])=>{const t=c.D.USER===r.getActiveTabId();o.resources.isEmpty()?(o.resources=a.Fp.toImportResourceTree(e,t),t&&(o.sortedBy=s.R.MODIFIED)):a.Fp.mergeResourceTree(o.resources,e,t),a.Fp.calculateElementIndent(o.resources),a.Fp.setupAfterTreeInitProperties(o.resources),R(),d()})),b.push(r.onShowLoaderUpdated(e=>o.showLoader=e)),b.push(r.onActiveTabIdUpdated(()=>o.resources=new i.k)),o.$on("$destroy",()=>{b.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-tree",["graphdb.framework.import.directives.import-resource-message","graphdb.framework.import.directives.import-resource-status-info"]).directive("importResourceTree",u),u.$inject=["$timeout","ImportContextService"]},96248(e,r,o){var t=o(304);angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",i),i.$inject=["$scope","$uibModalInstance","$translate","toastr","message"];const s=t.I.logger;function i(e,r,o,t,i){e.message=i,e.close=()=>{r.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{t.success(o.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{s.error("Could not copy text: ",e)})}}}};
|
|
2
|
+
//# sourceMappingURL=67888.58e7f7058516d3d8f782.bundle.js.map
|
package/dist/{67888.191af20d65ad96771abb.bundle.js.map → 67888.58e7f7058516d3d8f782.bundle.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"67888.191af20d65ad96771abb.bundle.js","mappings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AOmF,UAAW4G,EAAcC,GAEhFK,EAAAA,GAA0BG,uBAAuBxM,EAAOmF,WACxDkH,EAAAA,GAA0BI,6BAA6BzM,EAAOmF,WAC9DqC,IACAb,OASJiF,EAAcvK,KAAKkD,EAAqBmI,oBAAqBtG,GAAepG,EAAOoG,WAAaA,IAChGwF,EAAcvK,KAAKkD,EAAqBoI,qBAAqB,IAAM3M,EAAOmF,UAAY,IAAIC,EAAAA,IAO1FpF,EAAOsB,IAAI,WALkBsL,KACzBhB,EAAcnK,QAASoL,GAAiBA,QAOxD,CAxTAlL,QACKC,OAAO,2DANI,CACZ,8DACA,oEAKCC,UAAU,qBAAsBwC,GAErCA,EAA4BvC,QAAU,CAAC,WAAY,uB,4BC7BnDH,QACKC,OAAO,4EAA6E,IACpFW,WAAW,wCAAyCuK,GAEzDA,EAAsChL,QAAU,CAAC,SAAU,oBAAqB,aAAc,SAAU,WAExG,MAAMiL,EAASC,EAAAA,EAAeD,OAE9B,SAASD,EAAsC9M,EAAQiN,EAAmBC,EAAYC,EAAQvK,GAC1F5C,EAAO4C,QAAUA,EAGjB5C,EAAOgB,MAAQ,KACXiM,EAAkBG,WAGtBpN,EAAOqN,gBAAkB,KACrBC,UAAUC,UAAUC,UAAUxN,EAAO4C,SAChC6K,KAAK,KACFN,EAAOO,QAAQR,EAAWS,QAAQ,6CAClC3N,EAAOgB,SACP4M,IACAb,EAAOc,MAAM,wBAAyBD,KAGtD,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js"],"sourcesContent":["const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\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=3.3.0-RC1\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {convertToBytes} from \"../../utils/size-util\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL'\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED'\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info'\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&'\n },\n link: ($scope, element, attrs) => {\n\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = convertToBytes(r1.importResource.size);\n const r2Size = convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n }\n };\n}\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n"],"names":["importResourceStatusInfoDirective","$rootScope","$document","restrict","templateUrl","scope","resource","link","$scope","subscribers","popoverTemplate","popoverIsOpen","context","importResource","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","open","closeAllDialogs","$broadcast","close","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","angular","module","directive","$inject","importResourceMessageDirective","$uibModal","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","controller","size","windowClass","backdrop","resolve","message","validateUri","UriUtils","require","element","attr","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString","ImportProgressIndicator","$watch","file","status","$","has","length","append","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","ImportResourceMessageDialogController","logger","LoggerProvider","$uibModalInstance","$translate","toastr","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error"],"ignoreList":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"67888.58e7f7058516d3d8f782.bundle.js","mappings":"mJAQA,SAASA,EAAkCC,EAAYC,GACnD,MAAO,CACHC,SAAU,IACVC,YAAa,+DACbC,MAAO,CACHC,SAAU,KAEdC,KAAOC,IACH,MAAMC,EAAc,GAKpBD,EAAOE,gBAAkB,kCACzBF,EAAOG,eAAgB,EACvBH,EAAOI,QAAUJ,EAAOF,SAASO,eAAeD,QAChDJ,EAAOM,cAAgBN,EAAOF,SAASO,eAAeC,cACtDN,EAAOO,QAAUC,mBAAmBR,EAAOF,SAASO,eAAeI,SACnET,EAAOU,YAAcV,EAAOF,SAASO,eAAeK,YACpDV,EAAOW,WAAaX,EAAOF,SAASO,eAAeM,WACnDX,EAAOY,eAAiBZ,EAAOF,SAASO,eAAeO,eAKvDZ,EAAOa,KAAO,KACVb,EAAOc,kBACPd,EAAOG,eAAgB,GAG3BH,EAAOc,gBAAkB,KACrBrB,EAAWsB,WAAW,kBAG1Bf,E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U,WAExG,MAAMiL,EAASC,EAAAA,EAAeD,OAE9B,SAASD,EAAsC9M,EAAQiN,EAAmBC,EAAYC,EAAQvK,GAC1F5C,EAAO4C,QAAUA,EAGjB5C,EAAOgB,MAAQ,KACXiM,EAAkBG,WAGtBpN,EAAOqN,gBAAkB,KACrBC,UAAUC,UAAUC,UAAUxN,EAAO4C,SAChC6K,KAAK,KACFN,EAAOO,QAAQR,EAAWS,QAAQ,6CAClC3N,EAAOgB,SACP4M,IACAb,EAAOc,MAAM,wBAAyBD,KAGtD,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js"],"sourcesContent":["const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\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=3.3.0-RC2\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {convertToBytes} from \"../../utils/size-util\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL'\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED'\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info'\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&'\n },\n link: ($scope, element, attrs) => {\n\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = convertToBytes(r1.importResource.size);\n const r2Size = convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n }\n };\n}\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n"],"names":["importResourceStatusInfoDirective","$rootScope","$document","restrict","templateUrl","scope","resource","link","$scope","subscribers","popoverTemplate","popoverIsOpen","context","importResource","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","open","closeAllDialogs","$broadcast","close","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","angular","module","directive","$inject","importResourceMessageDirective","$uibModal","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","controller","size","windowClass","backdrop","resolve","message","validateUri","UriUtils","require","element","attr","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString","ImportProgressIndicator","$watch","file","status","$","has","length","append","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","ImportResourceMessageDialogController","logger","LoggerProvider","$uibModalInstance","$translate","toastr","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=68685;export const __webpack_esm_ids__=[68685];export const __webpack_esm_modules__={68685(){const e="menu.ttyg.label";PluginRegistry.add("guide.step",[{guideBlockName:"configure-top-p",getSteps:(t,o)=>{const i=o.GuideUtils,n=i.getGuideElementSelector("top-p-control"),l=i.getGuideElementSelector("top-p-control-input");return{guideBlockName:"focus-element",options:{url:"ttyg",elementSelector:n,placement:"bottom",class:"configure-top-p",content:"guide.step_plugin.configure-top-p.info",onNextValidate:()=>Promise.resolve(i.validateTextInput(l,t.topP)),...t.mainAction?{}:{title:e},...t}}}},{guideBlockName:"configure-temperature",getSteps:(t,o)=>{const i=o.GuideUtils,n=i.getGuideElementSelector("temperature-control"),l=i.getGuideElementSelector("temperature-control-input");return{guideBlockName:"focus-element",options:{url:"ttyg",elementSelector:n,placement:"bottom",class:"configure-temperature",content:"guide.step_plugin.configure-temperature.info",onNextValidate:()=>Promise.resolve(i.validateTextInput(l,t.temperature)),...t.mainAction?{}:{title:e},...t}}}},{guideBlockName:"configure-iri-discovery-search",getSteps:(t,o)=>{const i=o.GuideUtils,n=i.getGuideElementSelector("iri-discovery-search-input"),l=t.disable;let r;r=l?"guide.step_plugin.iri-discovery-search.disable-toggle":"guide.step_plugin.iri-discovery-search.enable-toggle";const s=i.getGuideElementSelector("iri-discovery-search");return{guideBlockName:"toggle-element",options:{content:r,class:"toggle-iri-discovery-search",...t.mainAction?{}:{title:e},...t,url:"ttyg",elementSelector:s,toggleableElementSelector:n,onNextValidate:()=>{const e=i.isChecked(n);return Promise.resolve(l?!e:e)},scrollToHandler:()=>i.scrollIntoView(s,{block:"center"})}}}},{guideBlockName:"configure-agent-type-agent-name",getSteps:(t,o)=>{const i=o.GuideUtils;return[{guideBlockName:"input-element",options:{content:"guide.step_plugin.configure-agent.name-input",class:"input-agent-name",disablePreviousFlow:!1,...t.mainAction?{}:{title:e},...t,url:"ttyg",beforeShowPromise:()=>i.waitFor(i.getGuideElementSelector("agent-form"),5).catch(e=>{throw o.toastr.error(o.$translate.instant("guide.unexpected.error.message")),e}),elementSelector:i.getGuideElementSelector("agent-name"),onNextValidate:()=>Promise.resolve(i.validateTextInputNotEmpty(i.getGuideElementSelector("agent-name")))}}]}},{guideBlockName:"configure-agent-type-model-name",getSteps:(t,o)=>{const i=o.GuideUtils;return[{guideBlockName:"input-element",options:{content:"guide.step_plugin.configure-agent.model-input",...t.mainAction?{}:{title:e},class:"input-model",disablePreviousFlow:!1,...t,url:"ttyg",elementSelector:i.getGuideElementSelector("model"),onNextValidate:()=>Promise.resolve(i.validateTextInput(i.getGuideElementSelector("model"),t.model,!1))}}]}},{guideBlockName:"configure-agent-additional-instructions",getSteps:(t,o)=>{const i=o.GuideUtils;return[{guideBlockName:"copy-text-element",options:{extraContent:"guide.step_plugin.configure-agent.user-instructions-input",...t.mainAction?{}:{title:e},class:"input-user-instructions",disablePreviousFlow:!1,text:t.userInstructions,...t,url:"ttyg",elementSelector:i.getGuideElementSelector("user-instructions"),onNextValidate:()=>Promise.resolve(i.validateTextInput(i.getGuideElementSelector("user-instructions"),t.userInstructions,!1))}}]}},{guideBlockName:"configure-agent",getSteps:(e,t)=>{const o=t.GuideUtils,i=e.editName,n=e.model,l=e.userInstructions,r=!!e.methods?.length,s=void 0!==e.topP,u=void 0!==e.temperature,c=!!e.iriDiscoverySearch,a=[{guideBlockName:"wait-for-element-to-show",options:angular.extend({},{elementSelectorToShow:o.getElementSelector(".agent-settings-modal"),timeToWait:10},e)}];return i&&a.push({guideBlockName:"configure-agent-type-agent-name",options:{...e}}),n&&a.push({guideBlockName:"configure-agent-type-model-name",options:{...e}}),u&&a.push({guideBlockName:"configure-temperature",options:{...e}}),s&&a.push({guideBlockName:"configure-top-p",options:{...e}}),r&&a.push(...((e,t)=>(t.methods||[]).map(e=>({guideBlockName:e.guideBlockName,options:{disablePreviousFlow:!1,...e.options}})))(0,e)),c&&a.push({guideBlockName:"configure-iri-discovery-search",options:{disable:e.iriDiscoverySearch.disable,...e}}),l&&a.push({guideBlockName:"configure-agent-additional-instructions",options:{...e}}),a[1].options.disablePreviousFlow=!0,a}},{guideBlockName:"configure-autocomplete-iri-discovery",getSteps:function(t,o){const i=o.GuideUtils,n=i.getGuideElementSelector("autocomplete-iri-discovery-input"),l=t.disable;return{guideBlockName:"toggle-element",options:{content:l?"guide.step_plugin.autocomplete.iri-discovery.disable-toggle":"guide.step_plugin.autocomplete.iri-discovery.enable-toggle",class:"toggle-autocomplete-iri-discovery",...t.title??{title:e},...t,url:"ttyg",elementSelector:i.getGuideElementSelector("autocomplete-iri-discovery"),toggleableElementSelector:n,onNextValidate:()=>{const e=i.isChecked(n);return Promise.resolve(l?!e:e)}}}}},{guideBlockName:"set-max-iris-per-call",getSteps:(t,o)=>{const i=o.GuideUtils,n=t.maxIrisPerCall??10,l=i.getGuideElementSelector("autocomplete-max-iris-input");return{guideBlockName:"input-element",options:{content:"guide.step_plugin.ttyg.set-max-iris-per-call",...t.title??{title:e},class:"set-max-iris-per-call",...t,url:"ttyg",elementSelector:l,onNextValidate:()=>Promise.resolve(i.validateTextInput(l,n,!1))}}}}])}};
|
|
2
|
+
//# sourceMappingURL=68685.7ff6ade23d27ade4d1ef.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"68685.7ff6ade23d27ade4d1ef.bundle.js","mappings":"6HAAA,MAAMA,EAAqB,kBAE3BC,eAAeC,IAAI,aAAc,CAC7B,CACIC,eAAgB,kBAChBC,SAAUA,CAACC,EAASC,KAChB,MAAMC,EAAaD,EAASC,WAEtBC,EAAkBD,EAAWE,wBAAwB,iBACrDC,EAAgBH,EAAWE,wBAAwB,uBAEzD,MAAO,CACHN,eAAgB,gBAChBE,QAAS,CACLM,IAAK,OACLH,kBACAI,UAAW,SACXC,MAAO,kBACPC,QAAS,yCACTC,eAAgBA,IAAM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,UAAUL,GACvC,OAAOP,QAAQC,QAAQO,GAAmBG,EAAYA,KAItE,GAEJ,CACIxB,eAAgB,wBAChBC,SAAUA,CAACC,EAASC,KAChB,MAAMC,EAAaD,EAASC,WACtB6D,EAAiB/D,EAAQ+D,gBAAkB,GAC3CC,EAAuB9D,EAAWE,wBAAwB,+BAEhE,MAAO,CACHN,eAAgB,gBAChBE,QAAS,CACLS,QAAS,kDACLT,EAAQgB,OAAS,CAACA,MAAOrB,GAC7Ba,MAAO,2BACJR,EACHM,IAAK,OACLH,gBAAiB6D,EACjBtD,eAAgBA,IACLC,QAAQC,QAAQV,EAAWW,kBAAkBmD,EAAsBD,GAAgB,S","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/guides/steps/complex/ttyg/common/configure-agent/plugin.js"],"sourcesContent":["const TTYG_DEFAULT_TITLE = 'menu.ttyg.label';\n\nPluginRegistry.add('guide.step', [\n {\n guideBlockName: 'configure-top-p',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n\n const elementSelector = GuideUtils.getGuideElementSelector('top-p-control');\n const inputSelector = GuideUtils.getGuideElementSelector('top-p-control-input');\n\n return {\n guideBlockName: 'focus-element',\n options: {\n url: 'ttyg',\n elementSelector,\n placement: 'bottom',\n class: 'configure-top-p',\n content: 'guide.step_plugin.configure-top-p.info',\n onNextValidate: () => Promise.resolve(GuideUtils.validateTextInput(inputSelector, options.topP)),\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_DEFAULT_TITLE}),\n ...options,\n },\n };\n },\n },\n {\n guideBlockName: 'configure-temperature',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n\n const elementSelector = GuideUtils.getGuideElementSelector('temperature-control');\n const inputSelector = GuideUtils.getGuideElementSelector('temperature-control-input');\n\n return {\n guideBlockName: 'focus-element',\n options: {\n url: 'ttyg',\n elementSelector,\n placement: 'bottom',\n class: 'configure-temperature',\n content: 'guide.step_plugin.configure-temperature.info',\n onNextValidate: () => Promise.resolve(GuideUtils.validateTextInput(inputSelector, options.temperature)),\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_DEFAULT_TITLE}),\n ...options,\n },\n };\n },\n },\n {\n guideBlockName: 'configure-iri-discovery-search',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n const toggleSelector = GuideUtils.getGuideElementSelector('iri-discovery-search-input');\n const shouldToggleOff = options.disable;\n\n let content;\n if (shouldToggleOff) {\n content = 'guide.step_plugin.iri-discovery-search.disable-toggle';\n } else {\n content = 'guide.step_plugin.iri-discovery-search.enable-toggle';\n }\n\n const elementSelector = GuideUtils.getGuideElementSelector('iri-discovery-search');\n return {\n guideBlockName: 'toggle-element',\n options: {\n content,\n class: 'toggle-iri-discovery-search',\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_DEFAULT_TITLE}),\n ...options,\n url: 'ttyg',\n elementSelector,\n toggleableElementSelector: toggleSelector,\n onNextValidate: () => {\n const isEnabled = GuideUtils.isChecked(toggleSelector);\n return Promise.resolve(shouldToggleOff ? !isEnabled : isEnabled);\n },\n scrollToHandler: () => GuideUtils.scrollIntoView(elementSelector, {block: 'center'}),\n },\n };\n },\n },\n {\n guideBlockName: 'configure-agent-type-agent-name',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n return [\n {\n guideBlockName: 'input-element',\n options: {\n content: 'guide.step_plugin.configure-agent.name-input',\n class: 'input-agent-name',\n disablePreviousFlow: false,\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_DEFAULT_TITLE}),\n ...options,\n url: 'ttyg',\n beforeShowPromise: () => GuideUtils.waitFor(GuideUtils.getGuideElementSelector('agent-form'), 5)\n .catch((error) => {\n services.toastr.error(services.$translate.instant('guide.unexpected.error.message'));\n throw error;\n }),\n elementSelector: GuideUtils.getGuideElementSelector('agent-name'),\n onNextValidate: () => Promise.resolve(GuideUtils.validateTextInputNotEmpty(GuideUtils.getGuideElementSelector('agent-name'))),\n },\n },\n ];\n },\n },\n {\n guideBlockName: 'configure-agent-type-model-name',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n return [\n {\n guideBlockName: 'input-element',\n options: {\n content: 'guide.step_plugin.configure-agent.model-input',\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_DEFAULT_TITLE}),\n class: 'input-model',\n disablePreviousFlow: false,\n ...options,\n url: 'ttyg',\n elementSelector: GuideUtils.getGuideElementSelector('model'),\n onNextValidate: () => Promise.resolve(GuideUtils.validateTextInput(GuideUtils.getGuideElementSelector('model'), options.model, false)),\n },\n },\n ];\n },\n },\n {\n guideBlockName: 'configure-agent-additional-instructions',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n return [\n {\n guideBlockName: 'copy-text-element',\n options: {\n extraContent: 'guide.step_plugin.configure-agent.user-instructions-input',\n // If mainAction is set the title will be set automatically\n ...(options.mainAction ? {} : {title: TTYG_DEFAULT_TITLE}),\n class: 'input-user-instructions',\n disablePreviousFlow: false,\n text: options.userInstructions,\n ...options,\n url: 'ttyg',\n elementSelector: GuideUtils.getGuideElementSelector('user-instructions'),\n onNextValidate: () => Promise.resolve(GuideUtils.validateTextInput(GuideUtils.getGuideElementSelector('user-instructions'), options.userInstructions, false)),\n },\n },\n ];\n },\n },\n {\n guideBlockName: 'configure-agent',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n\n const configureExtractionMethods = (services, options) => {\n const methods = options.methods || [];\n\n return methods.map((method) => {\n return {\n guideBlockName: method.guideBlockName,\n options: {\n disablePreviousFlow: false,\n ...method.options,\n },\n };\n });\n };\n\n const shouldEditName = options.editName;\n const hasModelName = options.model;\n const hasUserInstructions = options.userInstructions;\n const shouldConfigureExtractionMethods = !!options.methods?.length;\n const shouldConfigureTopP = options.topP !== undefined;\n const shouldConfigureTemperature = options.temperature !== undefined;\n const shouldConfigureIriDiscoverySearch = !!options.iriDiscoverySearch;\n\n const steps = [\n {\n guideBlockName: 'wait-for-element-to-show',\n options: angular.extend({}, {\n elementSelectorToShow: GuideUtils.getElementSelector('.agent-settings-modal'),\n timeToWait: 10,\n }, options),\n },\n ];\n\n if (shouldEditName) {\n steps.push({\n guideBlockName: 'configure-agent-type-agent-name', options: {...options},\n });\n }\n\n if (hasModelName) {\n steps.push({\n guideBlockName: 'configure-agent-type-model-name', options: {...options},\n });\n }\n\n if (shouldConfigureTemperature) {\n steps.push({\n guideBlockName: 'configure-temperature',\n options: {...options},\n });\n }\n\n if (shouldConfigureTopP) {\n steps.push({\n guideBlockName: 'configure-top-p',\n options: {...options},\n });\n }\n\n if (shouldConfigureExtractionMethods) {\n steps.push(...configureExtractionMethods(services, options));\n }\n\n if (shouldConfigureIriDiscoverySearch) {\n steps.push({\n guideBlockName: 'configure-iri-discovery-search',\n options: {\n disable: options.iriDiscoverySearch.disable,\n ...options,\n },\n });\n /**/\n }\n\n if (hasUserInstructions) {\n steps.push({\n guideBlockName: 'configure-agent-additional-instructions', options: {...options},\n });\n }\n // Removes the \"Previous\" button from the first method control step, because there is no previous step in the form.\n steps[1].options.disablePreviousFlow = true;\n return steps;\n },\n },\n {\n guideBlockName: 'configure-autocomplete-iri-discovery',\n getSteps: function(options, pluginService) {\n const GuideUtils = pluginService.GuideUtils;\n const toggleSelector = GuideUtils.getGuideElementSelector('autocomplete-iri-discovery-input');\n const shouldToggleOff = options.disable;\n\n const content = shouldToggleOff\n ? 'guide.step_plugin.autocomplete.iri-discovery.disable-toggle'\n : 'guide.step_plugin.autocomplete.iri-discovery.enable-toggle';\n\n return {\n guideBlockName: 'toggle-element',\n options: {\n content,\n class: 'toggle-autocomplete-iri-discovery',\n ...(options.title ?? {title: TTYG_DEFAULT_TITLE}),\n ...options,\n url: 'ttyg',\n elementSelector: GuideUtils.getGuideElementSelector('autocomplete-iri-discovery'),\n toggleableElementSelector: toggleSelector,\n onNextValidate: () => {\n const isEnabled = GuideUtils.isChecked(toggleSelector);\n return Promise.resolve(shouldToggleOff ? !isEnabled : isEnabled);\n },\n },\n };\n },\n },\n {\n guideBlockName: 'set-max-iris-per-call',\n getSteps: (options, services) => {\n const GuideUtils = services.GuideUtils;\n const maxIrisPerCall = options.maxIrisPerCall ?? 10;\n const maxIrisInputSelector = GuideUtils.getGuideElementSelector('autocomplete-max-iris-input');\n\n return {\n guideBlockName: 'input-element',\n options: {\n content: 'guide.step_plugin.ttyg.set-max-iris-per-call',\n ...(options.title ?? {title: TTYG_DEFAULT_TITLE}),\n class: 'set-max-iris-per-call',\n ...options,\n url: 'ttyg',\n elementSelector: maxIrisInputSelector,\n onNextValidate: () => {\n return Promise.resolve(GuideUtils.validateTextInput(maxIrisInputSelector, maxIrisPerCall, false));\n },\n },\n };\n },\n },\n]);\n"],"names":["TTYG_DEFAULT_TITLE","PluginRegistry","add","guideBlockName","getSteps","options","services","GuideUtils","elementSelector","getGuideElementSelector","inputSelector","url","placement","class","content","onNextValidate","Promise","resolve","validateTextInput","topP","mainAction","title","temperature","toggleSelector","shouldToggleOff","disable","toggleableElementSelector","isEnabled","isChecked","scrollToHandler","scrollIntoView","block","disablePreviousFlow","beforeShowPromise","waitFor","catch","error","toastr","$translate","instant","validateTextInputNotEmpty","model","extraContent","text","userInstructions","shouldEditName","editName","hasModelName","hasUserInstructions","shouldConfigureExtractionMethods","methods","length","shouldConfigureTopP","undefined","shouldConfigureTemperature","shouldConfigureIriDiscoverySearch","iriDiscoverySearch","steps","angular","extend","elementSelectorToShow","getElementSelector","timeToWait","push","configureExtractionMethods","map","method","pluginService","maxIrisPerCall","maxIrisInputSelector"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const __webpack_esm_id__=78070;export const __webpack_esm_ids__=[2134,27899,43006,78070,78618];export const __webpack_esm_modules__={2134(e,t,n){n.d(t,{x:()=>r});class r extends Error{}},27899(e,t,n){n.d(t,{Q:()=>a,y:()=>r});class r{constructor(e,t,n,r){this.status=e,this.mesage=r,this.messageLabelKey=t,this.parameters=n}}const a={ERROR:"error",SUCCESS:"success"}},43006(e,t,n){n.d(t,{H:()=>r});const r={CREATE:"create",REPAIR:"repair",DROP:"drop"}},78070(e,t,n){var r=n(98857),a=n(85694),o=(n(61105),n(20227),n(85727)),s=n(14604),i=n(43006),c=n(27899),u=n(97421),d=n(60529),l=n(78618),p=n(22201),g=n(2134),m=n(10799),y=(n(81655),n(304)),h=n(57154);const S=y.I.logger;function v(e,t,n,y,v,E,f,C,R,w,q,A,_,b,x,L,T){const P=(0,h.service)(h.SecurityContextService);this.repository="";const O="#query-editor";let U=E.getActiveRepository(),Q=E.isActiveRepoOntopType();t.yasguiConfig=void 0,t.savedQueryConfig=void 0,t.prefixes={},t.inferUserSetting=!0,t.sameAsUserSetting=!0;const N=new Map;let k=!1;t.updateConfig=e=>{t.yasguiConfig={endpoint:I,componentId:p.y,prefixes:t.prefixes,infer:Q||t.inferUserSetting,sameAs:Q||t.sameAsUserSetting,yasrToolbarPlugins:[z],beforeUpdateQuery:V(),outputHandlers:new Map([[u.r.QUERY_EXECUTED,$],[u.r.REQUEST_ABORTED,M]]),clearState:void 0!==e&&e}},t.getActiveRepositoryNoError=()=>U;const I=e=>{const t=(e=>{const t=e.getTab();if(t)return t.getYasqe()})(e);if(t)return E.resolveSparqlEndpoint(t.getQueryMode())},$=e=>{const t=N.get(e.tabId);t&&(t.dismiss(),N.delete(e.tabId))},M=e=>{if(e&&m.g.UPDATE!==e.queryMode){const t=e.getRepository(),n=e.getQueryTrackAlias();t&&n&&b.deleteQuery(n,t)}},D=e=>o.p3.getOntotextYasguiElementAsync(O).then(t=>t.openTab(e)).then(e=>o.p3.highlightTabName(e)),Y=()=>{k=!0;const e=y.search()[h.REPOSITORY_ID_PARAM];y.search(e?{repositoryId:e}:{}),y.replace()},H=()=>(0,l.G4)(y.search().execute)?o.p3.getOntotextYasguiElementAsync(O).then(G).then(j):Promise.resolve(),G=e=>e.getQueryMode().then(t=>({yasguiComponent:e,queryMode:t})),j=({yasguiComponent:e,queryMode:t})=>"update"!==t?e.query():new Promise(t=>{const n=R.instant("confirm.execute"),r=(0,d.Gz)(R.instant("query.editor.automatically.execute.update.warning"));_.openConfirmation(n,r,()=>t(e.query()),()=>t())}),z={createElement:e=>{const t=document.createElement("span");t.classList.add("explore-visual-graph-button-name");const n=document.createElement("button");return n.classList.add("explore-visual-graph-button"),n.classList.add("icon-data"),n.onclick=function(){const t={query:e.yasqe.getValue(),sameAs:e.yasqe.getSameAs(),inference:e.yasqe.getInfer()};y.path("graphs-visualizations").search(t)},n.appendChild(t),n},updateElement:(e,t)=>{if(e.classList.add("hidden"),!t.hasResults())return;const n=t.yasqe.getQueryType();s.b.CONSTRUCT!==n&&s.b.DESCRIBE!==n||e.classList.remove("hidden"),e.querySelector(".explore-visual-graph-button-name").innerText=R.instant("query.editor.visual.btn")},getOrder:()=>2},B=(e,t)=>({key:e,value:t}),F=e=>[B("name",e.data.name)],K=(e,n,r)=>{const a=t.$new(!0);a.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:e,eta:"-",inline:!1,iri:n,name:r,doneCallback:function(){o.dismiss("cancel")}},a.getHumanReadableSeconds=t.getHumanReadableSeconds;const o=f.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:a});return o},V=()=>(e,t)=>q.checkConnector(e).then(e=>e.data.
|
|
2
|
-
//# sourceMappingURL=78070.
|
|
1
|
+
export const __webpack_esm_id__=78070;export const __webpack_esm_ids__=[2134,27899,43006,78070,78618];export const __webpack_esm_modules__={2134(e,t,n){n.d(t,{x:()=>r});class r extends Error{}},27899(e,t,n){n.d(t,{Q:()=>a,y:()=>r});class r{constructor(e,t,n,r){this.status=e,this.mesage=r,this.messageLabelKey=t,this.parameters=n}}const a={ERROR:"error",SUCCESS:"success"}},43006(e,t,n){n.d(t,{H:()=>r});const r={CREATE:"create",REPAIR:"repair",DROP:"drop"}},78070(e,t,n){var r=n(98857),a=n(85694),o=(n(61105),n(20227),n(85727)),s=n(14604),i=n(43006),c=n(27899),u=n(97421),d=n(60529),l=n(78618),p=n(22201),g=n(2134),m=n(10799),y=(n(81655),n(304)),h=n(57154);const S=y.I.logger;function v(e,t,n,y,v,E,f,C,R,w,q,A,_,b,x,L,T){const P=(0,h.service)(h.SecurityContextService);this.repository="";const O="#query-editor";let U=E.getActiveRepository(),Q=E.isActiveRepoOntopType();t.yasguiConfig=void 0,t.savedQueryConfig=void 0,t.prefixes={},t.inferUserSetting=!0,t.sameAsUserSetting=!0;const N=new Map;let k=!1;t.updateConfig=e=>{t.yasguiConfig={endpoint:I,componentId:p.y,prefixes:t.prefixes,infer:Q||t.inferUserSetting,sameAs:Q||t.sameAsUserSetting,yasrToolbarPlugins:[z],beforeUpdateQuery:V(),outputHandlers:new Map([[u.r.QUERY_EXECUTED,$],[u.r.REQUEST_ABORTED,M]]),clearState:void 0!==e&&e}},t.getActiveRepositoryNoError=()=>U;const I=e=>{const t=(e=>{const t=e.getTab();if(t)return t.getYasqe()})(e);if(t)return E.resolveSparqlEndpoint(t.getQueryMode())},$=e=>{const t=N.get(e.tabId);t&&(t.dismiss(),N.delete(e.tabId))},M=e=>{if(e&&m.g.UPDATE!==e.queryMode){const t=e.getRepository(),n=e.getQueryTrackAlias();t&&n&&b.deleteQuery(n,t)}},D=e=>o.p3.getOntotextYasguiElementAsync(O).then(t=>t.openTab(e)).then(e=>o.p3.highlightTabName(e)),Y=()=>{k=!0;const e=y.search()[h.REPOSITORY_ID_PARAM];y.search(e?{repositoryId:e}:{}),y.replace()},H=()=>(0,l.G4)(y.search().execute)?o.p3.getOntotextYasguiElementAsync(O).then(G).then(j):Promise.resolve(),G=e=>e.getQueryMode().then(t=>({yasguiComponent:e,queryMode:t})),j=({yasguiComponent:e,queryMode:t})=>"update"!==t?e.query():new Promise(t=>{const n=R.instant("confirm.execute"),r=(0,d.Gz)(R.instant("query.editor.automatically.execute.update.warning"));_.openConfirmation(n,r,()=>t(e.query()),()=>t())}),z={createElement:e=>{const t=document.createElement("span");t.classList.add("explore-visual-graph-button-name");const n=document.createElement("button");return n.classList.add("explore-visual-graph-button"),n.classList.add("icon-data"),n.onclick=function(){const t={query:e.yasqe.getValue(),sameAs:e.yasqe.getSameAs(),inference:e.yasqe.getInfer()};y.path("graphs-visualizations").search(t)},n.appendChild(t),n},updateElement:(e,t)=>{if(e.classList.add("hidden"),!t.hasResults())return;const n=t.yasqe.getQueryType();s.b.CONSTRUCT!==n&&s.b.DESCRIBE!==n||e.classList.remove("hidden"),e.querySelector(".explore-visual-graph-button-name").innerText=R.instant("query.editor.visual.btn")},getOrder:()=>2},B=(e,t)=>({key:e,value:t}),F=e=>[B("name",e.data.name)],K=(e,n,r)=>{const a=t.$new(!0);a.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:e,eta:"-",inline:!1,iri:n,name:r,doneCallback:function(){o.dismiss("cancel")}},a.getHumanReadableSeconds=t.getHumanReadableSeconds;const o=f.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:a});return o},V=()=>(e,t)=>q.checkConnector(e).then(e=>e.data.command?e.data.hasSupport?i.H.CREATE===e.data.command?((e,t)=>{const n=K(R.instant("externalsync.creating"),e.data.iri,e.data.name);return N.set(t,n),new c.y(c.Q.SUCCESS,"created.connector",F(e))})(e,t):i.H.REPAIR===e.data.command?((e,t)=>{const n=K(R.instant("externalsync.repairing"),e.data.iri,e.data.name);return N.set(t,n),new c.y(c.Q.SUCCESS,"query.editor.repaired.connector",F(e))})(e,t):i.H.DROP===e.data.command?(e=>new c.y(c.Q.SUCCESS,"externalsync.delete.success.msg",F(e)))(e):void 0:(e=>{const t=[B("connectorName",e.data.connectorName),B("pluginName",e.data.pluginName)];return new c.y(c.Q.ERROR,"query.editor.inactive.plugin.warning.msg",t)})(e):new c.y(c.Q.SUCCESS)).catch(e=>{S.error("Checking connector error: ",e)}),X=e=>{const o=document.querySelectorAll('script[src*="https://www.gstatic.com/"]');if(o.length>0){const e=v.getLanguage();let t="module.js";if("en"!==e&&(t=`module__${e}.js`),!Array.prototype.some.call(o,e=>e.src.includes(t)))return void location.reload()}const s=P.getAuthenticatedUser();n.when(E.getPrefixes(U)).then(n=>{t.prefixes=n,(e=>{t.inferUserSetting=e?.appSettings.DEFAULT_INFERENCE,t.sameAsUserSetting=e?.appSettings.DEFAULT_SAMEAS})(s),((e=!1)=>{t.updateConfig(e);const n=y.search();n.hasOwnProperty(a.L.savedQueryName)?(e=>{const t=e[a.L.savedQueryName],n=e[a.L.savedQueryOwner];w.getSavedQuery(t,n).then(e=>{const t=(0,r.YS)(e);D(t).then(H).finally(Y)}).catch(e=>{C.error(R.instant("query.editor.missing.saved.query.data.error",{savedQueryName:t,error:getError(e)}))})})(n):n.hasOwnProperty(a.L.query)?(e=>{const t=e[a.L.name],n=e[a.L.query],o=e[a.L.owner],s=(0,r.mX)(n,t,o,!0);D(s).then(H).finally(Y)})(n):A.isActive()&&D()})(e)})},J=[],W=e=>{const t=o.p3.getOntotextYasguiElement(O);t&&t.abortAllRequests().then(()=>{})};window.addEventListener("beforeunload",W);let Z;J.push(h.ServiceProvider.get(h.EventService).subscribe(h.EventName.NAVIGATION_START,e=>(e=>{if(k)return void(k=!1);const t=o.p3.getOntotextYasguiElement(O);if(!t||Z)return;const n=new URL(e.newUrl),r=n.pathname+n.search+n.hash;e.cancelNavigation(),t.getOngoingRequestsInfo().then(e=>{return t=e,new Promise((e,n)=>{if(!t||t.queriesCount<1&&t.updatesCount<1)return void e();const r=R.instant("common.confirm"),a=(0,d.Gz)((e=>{let t="view.sparql-editor.leave_page.run_queries.confirmation.";!e||e.queriesCount<1?t+="none_queries_":1===e.queriesCount?t+="one_query_":t+="queries_",e.updatesCount&&0!==e.updatesCount?1===e.updatesCount?t+="one_update":t+="updates":t+="non_updates",t+=".message";const n={queriesCount:e.queriesCount,updatesCount:e.updatesCount};return R.instant(t,n)})(t));_.openSimpleModal({title:r,message:a,warning:!0}).result.then(function(){e()},function(){n(new g.x)})});var t}).then(()=>t.abortAllRequests()).then(()=>{Z=!0,(0,h.navigateTo)(r)()}).catch(e=>{e instanceof g.x||(S.error(e),Z=!0,(0,h.navigateTo)(r)())})})(e)));const ee=()=>{L.set(T.SPARQL_LAST_REPO,U)};J.push(t.$on("language-changed",function(){location.reload()}));const te=h.ServiceProvider.get(h.LanguageContextService).onSelectedLanguageChanged(()=>{},()=>new Promise(e=>{_.openSimpleModal({title:R.instant("query.editor.language.change.warning.title"),message:R.instant("query.editor.reload.page.warning"),warning:!0}).result.then(function(){e(!0)},function(){e(!1)})}));J.push(te),J.push(t.$on("$destroy",()=>{ee(),J.forEach(e=>e()),window.removeEventListener("beforeunload",W)})),J.push(t.$watch(t.getActiveRepositoryObject,e=>{e&&(U=E.getActiveRepository(),Q=E.isActiveRepoOntopType(e),L.get(T.SPARQL_LAST_REPO)!==U?(X(!0),ee()):X(!1))}))}angular.module("graphdb.framework.sparql-editor.controllers",["ui.bootstrap","graphdb.framework.rest.connectors.service","graphdb.framework.externalsync.controllers","graphdb.framework.utils.event-emitter-service","graphdb.framework.utils.localstorageadapter"]).controller("SparqlEditorCtrl",v),v.$inject=["$rootScope","$scope","$q","$location","$languageService","$repositories","$uibModal","toastr","$translate","SparqlRestService","ConnectorsRestService","GuidesService","ModalService","MonitoringRestService","EventEmitterService","LocalStorageAdapter","LSKeys"]},78618(e,t,n){n.d(t,{G4:()=>o,Sn:()=>s,hK:()=>a});var r=n(98980);const a=e=>e.replace(/[()']/g,""),o=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?(0,r.upperFirst)(e.toLowerCase()):e}};
|
|
2
|
+
//# sourceMappingURL=78070.06ebae9b4ebdb4749c29.bundle.js.map
|
package/dist/{78070.a0426f85ecb3c3c5a368.bundle.js.map → 78070.06ebae9b4ebdb4749c29.bundle.js.map}
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H,WAAW,mBAAoB1J,GAEpCA,EAAiBgR,QAAU,CACvB,aACA,SACA,KACA,YACA,mBACA,gBACA,YACA,SACA,aACA,oBACA,wBACA,gBACA,eACA,wBACA,sBACA,sBACA,S,kECjDJ,MAAMC,EAAsBC,GACjBA,EAAOzL,QAAQ,SAAU,IAG9BE,EAAawC,GACM,iBAAVA,EACU,SAAVA,EAEJgJ,QAAQhJ,GAGbiJ,EAAeC,GACZA,GAGEC,EAAAA,EAAAA,YAAWD,EAAKE,eAFZF,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/models/sparql/cancel-aborting-query.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ontotext-yasgui/before-update-query-result.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/connectors/connector-command.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/sparql-editor/controllers.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/utils/string-utils.js"],"sourcesContent":["export class CancelAbortingQuery extends Error {}\n","export class BeforeUpdateQueryResult {\n constructor(status, messageLabelKey, parameters, mesage) {\n this.status = status;\n this.mesage = mesage;\n this.messageLabelKey = messageLabelKey;\n this.parameters = parameters;\n }\n}\n\nexport const BeforeUpdateQueryResultStatus = {\n ERROR: 'error',\n SUCCESS: 'success'\n};\n","export const ConnectorCommand = {\n 'CREATE': 'create',\n 'REPAIR': 'repair',\n 'DROP': 'drop'\n};\n","import {\n savedQueryResponseMapper, buildQueryModel,\n} from \"../rest/mappers/saved-query-mapper\";\nimport {RouteConstants} from \"../utils/route-constants\";\nimport 'angular/rest/connectors.rest.service';\nimport 'angular/externalsync/controllers';\nimport {YasguiComponentDirectiveUtil} from \"../core/directives/yasgui-component/yasgui-component-directive.util\";\nimport {QueryType} from \"../models/ontotext-yasgui/query-type\";\nimport {ConnectorCommand} from \"../models/connectors/connector-command\";\nimport {BeforeUpdateQueryResult, BeforeUpdateQueryResultStatus} from \"../models/ontotext-yasgui/before-update-query-result\";\nimport {EventDataType} from \"../models/ontotext-yasgui/event-data-type\";\nimport {decodeHTML} from \"../../../app\";\nimport {toBoolean} from \"../utils/string-utils\";\nimport {VIEW_SPARQL_EDITOR} from \"../models/sparql/constants\";\nimport {CancelAbortingQuery} from \"../models/sparql/cancel-aborting-query\";\nimport {QueryMode} from \"../models/ontotext-yasgui/query-mode\";\nimport 'angular/core/services/event-emitter-service';\nimport {LoggerProvider} from \"../core/services/logger-provider\";\nimport {\n navigateTo,\n LanguageContextService,\n ServiceProvider,\n EventService,\n EventName,\n SecurityContextService,\n service,\n REPOSITORY_ID_PARAM,\n} from \"@ontotext/workbench-api\";\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.rest.connectors.service',\n 'graphdb.framework.externalsync.controllers',\n 'graphdb.framework.utils.event-emitter-service',\n 'graphdb.framework.utils.localstorageadapter',\n];\n\nconst logger = LoggerProvider.logger;\n\nangular\n .module('graphdb.framework.sparql-editor.controllers', modules)\n .controller('SparqlEditorCtrl', SparqlEditorCtrl);\n\nSparqlEditorCtrl.$inject = [\n '$rootScope',\n '$scope',\n '$q',\n '$location',\n '$languageService',\n '$repositories',\n '$uibModal',\n 'toastr',\n '$translate',\n 'SparqlRestService',\n 'ConnectorsRestService',\n 'GuidesService',\n 'ModalService',\n 'MonitoringRestService',\n 'EventEmitterService',\n 'LocalStorageAdapter',\n 'LSKeys'];\n\nfunction SparqlEditorCtrl($rootScope,\n $scope,\n $q,\n $location,\n $languageService,\n $repositories,\n $uibModal,\n toastr,\n $translate,\n SparqlRestService,\n ConnectorsRestService,\n GuidesService,\n ModalService,\n MonitoringRestService,\n EventEmitterService,\n LocalStorageAdapter,\n LSKeys) {\n const securityContextService = service(SecurityContextService);\n\n this.repository = '';\n\n const QUERY_EDITOR_ID = '#query-editor';\n let activeRepository = $repositories.getActiveRepository();\n let isOntopRepo = $repositories.isActiveRepoOntopType();\n\n /**\n * @type {OntotextYasguiConfig}\n */\n $scope.yasguiConfig = undefined;\n $scope.savedQueryConfig = undefined;\n $scope.prefixes = {};\n $scope.inferUserSetting = true;\n $scope.sameAsUserSetting = true;\n\n const tabIdToConnectorProgressModalMapping = new Map();\n let internallyReloaded = false;\n\n // =========================\n // Public functions\n // =========================\n /**\n * Updates the Yasgui configuration\n * @param {boolean} clearYasguiState if set to true, the Yasgui will reinitialize and clear all tab results. Queries will remain.\n */\n $scope.updateConfig = (clearYasguiState) => {\n $scope.yasguiConfig = {\n endpoint: getEndpoint,\n componentId: VIEW_SPARQL_EDITOR,\n prefixes: $scope.prefixes,\n infer: isOntopRepo || $scope.inferUserSetting,\n sameAs: isOntopRepo || $scope.sameAsUserSetting,\n yasrToolbarPlugins: [exploreVisualGraphYasrToolbarElementBuilder],\n beforeUpdateQuery: getBeforeUpdateQueryHandler(),\n outputHandlers: new Map([\n [EventDataType.QUERY_EXECUTED, queryExecutedHandler],\n [EventDataType.REQUEST_ABORTED, requestAbortedHandler],\n ]),\n clearState: clearYasguiState !== undefined ? clearYasguiState : false,\n };\n };\n\n $scope.getActiveRepositoryNoError = () => {\n return activeRepository;\n };\n\n // =========================\n // Private functions\n // =========================\n const getYasqe = (yasgui) => {\n const tab = yasgui.getTab();\n if (!tab) {\n return;\n }\n return tab.getYasqe();\n };\n\n const getEndpoint = (yasgui) => {\n const yasqe = getYasqe(yasgui);\n if (!yasqe) {\n // this can happen if open saprql view for first time (browser local store is clear);\n return;\n }\n return $repositories.resolveSparqlEndpoint(yasqe.getQueryMode());\n };\n\n /**\n * Initializes the editor from the URL parameters.\n * @param {boolean} clearYasguiState if set to true, the Yasgui will reinitialize and clear all tab results. Queries will remain.\n * The default is false.\n */\n const initViewFromUrlParams = (clearYasguiState = false) => {\n $scope.updateConfig(clearYasguiState);\n const queryParams = $location.search();\n if (queryParams.hasOwnProperty(RouteConstants.savedQueryName)) {\n // init new tab from shared saved query link\n initTabFromSavedQuery(queryParams);\n } else if (queryParams.hasOwnProperty(RouteConstants.query)) {\n // init new tab from shared query link\n initTabFromSharedQuery(queryParams);\n } else if (GuidesService.isActive()) {\n openNewTab();\n }\n };\n\n // ================================\n // = Setup output handlers\n // ================================\n /**\n * Handles the \"queryExecuted\" event emitted by ontotext-yasgui. The event is fired immediately after the request is executed, whether it succeeds or fails.\n * @param {QueryExecutedEvent} queryExecutedRequest - the event payload.\n */\n const queryExecutedHandler = (queryExecutedRequest) => {\n const connectorProgressModal = tabIdToConnectorProgressModalMapping.get(queryExecutedRequest.tabId);\n if (connectorProgressModal) {\n connectorProgressModal.dismiss();\n tabIdToConnectorProgressModalMapping.delete(queryExecutedRequest.tabId);\n }\n };\n\n /**\n * Handles the \"requestAborted\" event emitted by the ontotext-yasgui. The event is fired when a request is aborted.\n *\n * @param {RequestAbortedEvent} requestAbortedEvent the event payload containing the request object and the query mode.\n */\n const requestAbortedHandler = (requestAbortedEvent) => {\n if (requestAbortedEvent && QueryMode.UPDATE !== requestAbortedEvent.queryMode) {\n const repository = requestAbortedEvent.getRepository();\n const currentTrackAlias = requestAbortedEvent.getQueryTrackAlias();\n if (repository && currentTrackAlias) {\n MonitoringRestService.deleteQuery(currentTrackAlias, repository);\n }\n }\n };\n\n // =========================\n // Private function\n // =========================\n\n const initTabFromSavedQuery = (queryParams) => {\n const savedQueryName = queryParams[RouteConstants.savedQueryName];\n const savedQueryOwner = queryParams[RouteConstants.savedQueryOwner];\n SparqlRestService.getSavedQuery(savedQueryName, savedQueryOwner).then((res) => {\n const savedQuery = savedQueryResponseMapper(res);\n openNewTab(savedQuery)\n .then(autoExecuteQueryIfRequested)\n .finally(clearUrlParameters);\n }).catch((err) => {\n toastr.error($translate.instant('query.editor.missing.saved.query.data.error', {\n savedQueryName: savedQueryName,\n error: getError(err),\n }));\n });\n };\n\n const initTabFromSharedQuery = (queryParams) => {\n const queryName = queryParams[RouteConstants.name];\n const query = queryParams[RouteConstants.query];\n const queryOwner = queryParams[RouteConstants.owner];\n const sharedQueryModel = buildQueryModel(query, queryName, queryOwner, true);\n openNewTab(sharedQueryModel)\n .then(autoExecuteQueryIfRequested)\n .finally(clearUrlParameters);\n };\n\n /**\n * Open a new tab with query described in <code>sparqlQuery</code>.\n *\n * @param {TabQueryModel} sparqlQuery\n *\n * @return {Promise<void>}\n */\n const openNewTab = (sparqlQuery) => {\n return YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync(QUERY_EDITOR_ID)\n .then((yasguiComponent) => yasguiComponent.openTab(sparqlQuery))\n .then((tab) => YasguiComponentDirectiveUtil.highlightTabName(tab));\n };\n\n const clearUrlParameters = () => {\n internallyReloaded = true;\n const currentParams = $location.search();\n // Keep only the repositoryId parameter (if any). This will prevent router event from being triggered again and\n // reinitializing the repositoryId param this adding a new history entry.\n const repositoryId = currentParams[REPOSITORY_ID_PARAM];\n $location.search(repositoryId ? {repositoryId} : {});\n // Replace current URL without adding a new history entry\n $location.replace();\n };\n\n const autoExecuteQueryIfRequested = () => {\n const isRequested = toBoolean($location.search().execute);\n if (isRequested) {\n return YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync(QUERY_EDITOR_ID)\n .then(getQueryMode)\n .then(confirmAndExecuteQuery);\n }\n return Promise.resolve();\n };\n\n const getQueryMode = (yasguiComponent) => {\n return yasguiComponent.getQueryMode()\n .then((queryMode) => {\n return {yasguiComponent, queryMode};\n });\n };\n\n const confirmAndExecuteQuery = ({yasguiComponent, queryMode}) => {\n if (queryMode !== 'update') {\n return yasguiComponent.query();\n }\n\n return new Promise((resolve) => {\n const title = $translate.instant('confirm.execute');\n const message = decodeHTML($translate.instant('query.editor.automatically.execute.update.warning'));\n ModalService.openConfirmation(title, message, () => resolve(yasguiComponent.query()), () => resolve());\n });\n };\n\n const setInferAndSameAs = (principal) => {\n $scope.inferUserSetting = principal?.appSettings.DEFAULT_INFERENCE;\n $scope.sameAsUserSetting = principal?.appSettings.DEFAULT_SAMEAS;\n };\n\n const exploreVisualGraphYasrToolbarElementBuilder = {\n createElement: (yasr) => {\n const buttonName = document.createElement('span');\n buttonName.classList.add(\"explore-visual-graph-button-name\");\n const exploreVisualButtonWrapperElement = document.createElement('button');\n exploreVisualButtonWrapperElement.classList.add(\"explore-visual-graph-button\");\n exploreVisualButtonWrapperElement.classList.add(\"icon-data\");\n exploreVisualButtonWrapperElement.onclick = function() {\n const paramsToParse = {\n query: yasr.yasqe.getValue(),\n sameAs: yasr.yasqe.getSameAs(),\n inference: yasr.yasqe.getInfer(),\n };\n $location.path('graphs-visualizations').search(paramsToParse);\n };\n exploreVisualButtonWrapperElement.appendChild(buttonName);\n return exploreVisualButtonWrapperElement;\n },\n updateElement: (element, yasr) => {\n element.classList.add('hidden');\n if (!yasr.hasResults()) {\n return;\n }\n const queryType = yasr.yasqe.getQueryType();\n\n if (QueryType.CONSTRUCT === queryType || QueryType.DESCRIBE === queryType) {\n element.classList.remove('hidden');\n }\n element.querySelector('.explore-visual-graph-button-name').innerText = $translate.instant(\"query.editor.visual.btn\");\n },\n getOrder: () => {\n return 2;\n },\n };\n\n const createParameter = (key, value) => {\n return {key, value};\n };\n\n const getCommandParameters = (response) => {\n return [createParameter('name', response.data.name)];\n };\n\n const toNoCommandResponse = () => {\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS);\n };\n\n const toHasNotSupport = (response) => {\n const parameters = [\n createParameter('connectorName', response.data.connectorName),\n createParameter('pluginName', response.data.pluginName),\n ];\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.ERROR, 'query.editor.inactive.plugin.warning.msg', parameters);\n };\n\n const createConnectorProgressDialog = (actionName, iri, connectorName) => {\n const progressScope = $scope.$new(true);\n progressScope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0,\n },\n actionName,\n eta: \"-\",\n inline: false,\n iri,\n name: connectorName,\n doneCallback: function() {\n connectorProgressModal.dismiss('cancel');\n },\n };\n progressScope.getHumanReadableSeconds = $scope.getHumanReadableSeconds;\n\n const connectorProgressModal = $uibModal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: progressScope,\n });\n return connectorProgressModal;\n };\n\n const toCreateCommandResponse = (response, tabId) => {\n const connectorProgressModal = createConnectorProgressDialog($translate.instant('externalsync.creating'), response.data.iri, response.data.name);\n tabIdToConnectorProgressModalMapping.set(tabId, connectorProgressModal);\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'created.connector', getCommandParameters(response));\n };\n\n const toRepairCommandResponse = (response, tabId) => {\n const connectorProgressModal = createConnectorProgressDialog($translate.instant('externalsync.repairing'), response.data.iri, response.data.name);\n tabIdToConnectorProgressModalMapping.set(tabId, connectorProgressModal);\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'query.editor.repaired.connector', getCommandParameters(response));\n };\n\n const toDropCommandResponse = (response) => {\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'externalsync.delete.success.msg', getCommandParameters(response));\n };\n\n const getBeforeUpdateQueryHandler = () => (query, tabId) => {\n return ConnectorsRestService.checkConnector(query)\n .then((response) => {\n if (!response.data.hasSupport) {\n return toHasNotSupport(response);\n }\n\n if (!response.data.command) {\n return toNoCommandResponse();\n }\n\n if (ConnectorCommand.CREATE === response.data.command) {\n return toCreateCommandResponse(response, tabId);\n }\n\n if (ConnectorCommand.REPAIR === response.data.command) {\n return toRepairCommandResponse(response, tabId);\n }\n\n if (ConnectorCommand.DROP === response.data.command) {\n return toDropCommandResponse(response);\n }\n }).catch((error) => {\n // For some reason we couldn't check if this is a connector update, so just catch the exception,\n // to not stop the execution of query.\n logger.error('Checking connector error: ', error);\n });\n };\n\n const getExitPageConfirmMessage = (ongoingRequestsInfo) => {\n let exitPageConfirmMessage = \"view.sparql-editor.leave_page.run_queries.confirmation.\";\n if (!ongoingRequestsInfo || ongoingRequestsInfo.queriesCount < 1) {\n exitPageConfirmMessage += \"none_queries_\";\n } else if (ongoingRequestsInfo.queriesCount === 1) {\n exitPageConfirmMessage += \"one_query_\";\n } else {\n exitPageConfirmMessage += \"queries_\";\n }\n\n if (!ongoingRequestsInfo.updatesCount || ongoingRequestsInfo.updatesCount === 0) {\n exitPageConfirmMessage += \"non_updates\";\n } else if (ongoingRequestsInfo.updatesCount === 1) {\n exitPageConfirmMessage += \"one_update\";\n } else {\n exitPageConfirmMessage += \"updates\";\n }\n\n exitPageConfirmMessage += \".message\";\n const params = {\n queriesCount: ongoingRequestsInfo.queriesCount,\n updatesCount: ongoingRequestsInfo.updatesCount,\n };\n return $translate.instant(exitPageConfirmMessage, params);\n };\n\n // Initialization and bootstrap\n const init = (clearYasguiState) => {\n // This script check is required, because of the following scenario:\n // I am in the SPARQL view;\n // Then I go to a different view and change the language;\n // Then I return to the SPARQL view. I will see that the Google chart and Pivot table will have their\n // original scripts loaded still.\n // THE FIX: Get all the scripts (if there are none, the correct language will be loaded). If there are\n // scripts, and they don't match those, which are loaded already, the page needs to reload when opening\n // the SPARQL view, otherwise the Google chart and Pivot table configs will be in the old language.\n const googleScripts = document.querySelectorAll(`script[src*=\"https://www.gstatic.com/\"]`);\n if (googleScripts.length > 0) {\n const currentLang = $languageService.getLanguage();\n let searchTerm = 'module.js';\n if ('en' !== currentLang) {\n searchTerm = `module__${currentLang}.js`;\n }\n if (!Array.prototype.some.call(googleScripts, (script) => script.src.includes(searchTerm))) {\n location.reload();\n return;\n }\n }\n const principal = securityContextService.getAuthenticatedUser();\n $q.when($repositories.getPrefixes(activeRepository))\n .then((usedPrefixes) => {\n $scope.prefixes = usedPrefixes;\n setInferAndSameAs(principal);\n // check is there is a saved query or query url parameter and init the editor\n initViewFromUrlParams(clearYasguiState);\n });\n // TODO: we should also watch for changes in namespaces\n // scope.$watch('namespaces', function () {});\n };\n\n // =========================\n // Event handlers\n // =========================\n const subscriptions = [];\n\n const repositoryChangedHandler = (object) => {\n if (!object) {\n return;\n }\n activeRepository = $repositories.getActiveRepository();\n isOntopRepo = $repositories.isActiveRepoOntopType(object);\n if (LocalStorageAdapter.get(LSKeys.SPARQL_LAST_REPO) !== activeRepository) {\n init(true);\n persistLasstUsedRepository();\n } else {\n init(false);\n }\n };\n\n const beforeunloadHandler = (event) => {\n const ontotextYasguiElement = YasguiComponentDirectiveUtil.getOntotextYasguiElement(QUERY_EDITOR_ID);\n if (!ontotextYasguiElement) {\n return;\n }\n // If we set event.returnValue, the browser will prompt the user for confirmation to leave the page,\n // but we don't have a way to handle the user's choice.\n // Therefore, we can't take any action, so we simply proceed to abort all requests.\n ontotextYasguiElement.abortAllRequests().then(() => {});\n };\n\n window.addEventListener('beforeunload', beforeunloadHandler);\n\n const confirmIfHaveRunQuery = (ongoingRequestsInfo) => new Promise((resolve, reject) => {\n if (!ongoingRequestsInfo || ongoingRequestsInfo.queriesCount < 1 && ongoingRequestsInfo.updatesCount < 1) {\n resolve();\n return;\n }\n\n const title = $translate.instant('common.confirm');\n const message = decodeHTML(getExitPageConfirmMessage(ongoingRequestsInfo));\n ModalService.openSimpleModal({\n title,\n message,\n warning: true,\n }).result.then(function() {\n resolve();\n }, function() {\n reject(new CancelAbortingQuery());\n });\n });\n let queriesAreCanceled = undefined;\n const locationChangeHandler = (eventPayload) => {\n if (internallyReloaded) {\n internallyReloaded = false;\n return;\n }\n const ontotextYasguiElement = YasguiComponentDirectiveUtil.getOntotextYasguiElement(QUERY_EDITOR_ID);\n if (!ontotextYasguiElement || queriesAreCanceled) {\n return;\n }\n\n const url = new URL(eventPayload.newUrl);\n const newUrl = url.pathname + url.search + url.hash;\n eventPayload.cancelNavigation();\n // First, we check if there are any ongoing requests initiated by the user.\n // If the user has ongoing requests, we request confirmation to abort them.\n // If the user confirms or there are no ongoing requests, we call the \"abortAllRequests\" method. This method will abort all requests.\n ontotextYasguiElement\n .getOngoingRequestsInfo()\n .then((hasRunQuery) => confirmIfHaveRunQuery(hasRunQuery))\n .then(() => ontotextYasguiElement.abortAllRequests())\n .then(() => {\n queriesAreCanceled = true;\n navigateTo(newUrl)();\n })\n .catch((error) => {\n if (!(error instanceof CancelAbortingQuery)) {\n logger.error(error);\n queriesAreCanceled = true;\n navigateTo(newUrl)();\n }\n });\n };\n\n subscriptions.push(\n ServiceProvider.get(EventService).subscribe(EventName.NAVIGATION_START, (eventPayload) => locationChangeHandler(eventPayload)),\n );\n\n const removeAllListeners = () => {\n subscriptions.forEach((subscription) => subscription());\n window.removeEventListener('beforeunload', beforeunloadHandler);\n };\n\n const finalizeAndDestroy = () => {\n persistLasstUsedRepository();\n removeAllListeners();\n };\n\n const persistLasstUsedRepository = () => {\n // The active repository is set when the controller is initialized and when the repository is changed.\n // It holds the actual repository when the YASGUI is initialized. DON'T use runtime fetching of the actual repository here, because there is a scenario:\n // 1. Open a tab with the SPARQL view open;\n // 2. Open the SPARQL view in another tab and execute a query;\n // 3. Switch to the repositories view and change the repository;\n // 4. Switch back to the SPARQL view, and the YASR is not cleared.\n // The problem occurs because of the second tab. When the repository is changed, its ID is persisted to local storage, which triggers the \"storage\" event to be fired.\n // In the main controller, a listener has been registered to listen to that event and refresh the page outside of the Angular scope.\n // Reloading the page triggers the destruction of the component and persistence of the active repository. The reloading of the page is out of the Angular scope, so the \"activeRepository\"\n // holds the real repository when the YASGUI is created. If we use $$repositories.getActiveRepository(), the new value will be fetched, which in this case will be incorrect.\n LocalStorageAdapter.set(LSKeys.SPARQL_LAST_REPO, activeRepository);\n };\n\n subscriptions.push(\n $scope.$on('language-changed', function() {\n location.reload();\n }),\n );\n\n const onLanguageChange = () => {\n // Do nothing on language change\n };\n\n const showLanguageChangeConfirmation = () => {\n return new Promise((resolve) => {\n ModalService.openSimpleModal({\n title: $translate.instant('query.editor.language.change.warning.title'),\n message: $translate.instant('query.editor.reload.page.warning'),\n warning: true,\n }).result.then(function() {\n resolve(true);\n }, function() {\n resolve(false);\n });\n });\n };\n\n const languageContextService = ServiceProvider.get(LanguageContextService);\n const onLanguageChangeSubscription = languageContextService.onSelectedLanguageChanged(onLanguageChange, showLanguageChangeConfirmation);\n\n // Subscribe to language change and ask to reload the page\n subscriptions.push(onLanguageChangeSubscription);\n\n // Deregister the watcher when the scope/directive is destroyed\n subscriptions.push($scope.$on('$destroy', finalizeAndDestroy));\n\n // Wait until the active repository object is set, otherwise \"canWriteActiveRepo()\" may return a wrong result and the \"ontotext-yasgui\"\n // readOnly configuration may be incorrect.\n subscriptions.push($scope.$watch($scope.getActiveRepositoryObject, repositoryChangedHandler));\n}\n","import {upperFirst} from \"lodash\";\n\n/**\n * Removes brackets and serial commas from IRIs\n * when used to create ids for links and markers,\n * because elements with ids that contain such\n * are not valid XHTML and cause a host problems\n * when trying to style individual elements\n * @param {string} string The string to be processed.\n * @return {string} A string where the special characters are removed.\n */\nconst removeSpecialChars = (string) => {\n return string.replace(/[()']/g, \"\");\n};\n\nconst toBoolean = (value) => {\n if (typeof value === 'string') {\n return value === 'true';\n }\n return Boolean(value);\n};\n\nconst toTitleCase = (text) => {\n if (!text) {\n return text;\n }\n return upperFirst(text.toLowerCase());\n};\n\nexport {\n removeSpecialChars,\n toBoolean,\n toTitleCase\n};\n\n"],"names":["CancelAbortingQuery","Error","BeforeUpdateQueryResult","constructor","status","messageLabelKey","parameters","mesage","this","BeforeUpdateQueryResultStatus","ERROR","SUCCESS","ConnectorCommand","logger","LoggerProvider","SparqlEditorCtrl","$rootScope","$scope","$q","$location","$languageService","$repositories","$uibModal","toastr","$translate","SparqlRestService","ConnectorsRestService","GuidesService","ModalService","MonitoringRestService","EventEmitterService","LocalStorageAdapter","LSKeys","securityContextService","service","SecurityContextService","repository","QUERY_EDITOR_ID","activeRepository","getActiveRepository","isOntopRepo","isActiveRepoOntopType","yasguiConfig","undefined","savedQueryConfig","prefixes","inferUserSetting","sameAsUserSetting","tabIdToConnectorProgressModalMapping","Map","internallyReloaded","updateConfig","clearYasguiState","endpoint","getEndpoint","componentId","VIEW_SPARQL_EDITOR","infer","sameAs","yasrToolbarPlugins","exploreVisualGraphYasrToolbarElementBuilder","beforeUpdateQuery","getBeforeUpdateQueryHandler","outputHandlers","EventDataType","QUERY_EXECUTED","queryExecutedHandler","REQUEST_ABORTED","requestAbortedHandler","clearState","getActiveRepositoryNoError","yasgui","yasqe","tab","getTab","getYasqe","resolveSparqlEndpoint","getQueryMode","queryExecutedRequest","connectorProgressModal","get","tabId","dismiss","delete","requestAbortedEvent","QueryMode","UPDATE","queryMode","getRepository","currentTrackAlias","getQueryTrackAlias","deleteQuery","openNewTab","sparqlQuery","YasguiComponentDirectiveUtil","getOntotextYasguiElementAsync","then","yasguiComponent","openTab","highlightTabName","clearUrlParameters","repositoryId","search","REPOSITORY_ID_PARAM","replace","autoExecuteQueryIfRequested","toBoolean","execute","confirmAndExecuteQuery","Promise","resolve","query","title","instant","message","decodeHTML","openConfirmation","createElement","yasr","buttonName","document","classList","add","exploreVisualButtonWrapperElement","onclick","paramsToParse","getValue","getSameAs","inference","getInfer","path","appendChild","updateElement","element","hasResults","queryType","getQueryType","QueryType","CONSTRUCT","DESCRIBE","remove","querySelector","innerText","getOrder","createParameter","key","value","getCommandParameters","response","data","name","createConnectorProgressDialog","actionName","iri","connectorName","progressScope","$new","beingBuiltConnector","percentDone","processedEntities","estimatedEntities","indexedEntities","entitiesPerSecond","eta","inline","doneCallback","getHumanReadableSeconds","open","templateUrl","controller","size","backdrop","scope","checkConnector","hasSupport","command","CREATE","toCreateCommandResponse","set","REPAIR","toRepairCommandResponse","DROP","toDropCommandResponse","pluginName","toHasNotSupport","catch","error","init","googleScripts","querySelectorAll","length","currentLang","getLanguage","searchTerm","Array","prototype","some","call","script","src","includes","location","reload","principal","getAuthenticatedUser","when","getPrefixes","usedPrefixes","appSettings","DEFAULT_INFERENCE","DEFAULT_SAMEAS","setInferAndSameAs","initViewFromUrlParams","queryParams","hasOwnProperty","RouteConstants","savedQueryName","savedQueryOwner","getSavedQuery","res","savedQuery","savedQueryResponseMapper","finally","err","getError","initTabFromSavedQuery","queryName","queryOwner","owner","sharedQueryModel","buildQueryModel","initTabFromSharedQuery","isActive","subscriptions","beforeunloadHandler","event","ontotextYasguiElement","getOntotextYasguiElement","abortAllRequests","window","addEventListener","queriesAreCanceled","push","ServiceProvider","EventService","subscribe","EventName","NAVIGATION_START","eventPayload","url","URL","newUrl","pathname","hash","cancelNavigation","getOngoingRequestsInfo","hasRunQuery","confirmIfHaveRunQuery","ongoingRequestsInfo","reject","queriesCount","updatesCount","exitPageConfirmMessage","params","getExitPageConfirmMessage","openSimpleModal","warning","result","navigateTo","locationChangeHandler","persistLasstUsedRepository","SPARQL_LAST_REPO","$on","onLanguageChangeSubscription","LanguageContextService","onSelectedLanguageChanged","onLanguageChange","showLanguageChangeConfirmation","finalizeAndDestroy","forEach","subscription","removeEventListener","$watch","getActiveRepositoryObject","object","angular","module","$inject","removeSpecialChars","string","Boolean","toTitleCase","text","upperFirst","toLowerCase"],"ignoreList":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"78070.06ebae9b4ebdb4749c29.bundle.js","mappings":"yKAAO,MAAMA,UAA4BC,O,wCCAlC,MAAMC,EACTC,WAAAA,CAAYC,EAAQC,EAAiBC,EAAYC,GAC7CC,KAAKJ,OAASA,EACdI,KAAKD,OAASA,EACdC,KAAKH,gBAAkBA,EACvBG,KAAKF,WAAaA,CACtB,EAGG,MAAMG,EAAgC,CACzCC,MAAO,QACPC,QAAS,U,gCCXN,MAAMC,EAAmB,CAC5B,OAAU,SACV,OAAU,SACV,KAAQ,O,yMC0BZ,MAQMC,EAASC,EAAAA,EAAeD,OAyB9B,SAASE,EAAiBC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GACtB,MAAMC,GAAyBC,EAAAA,EAAAA,SAAQC,EAAAA,wBAEvC3B,KAAK4B,WAAa,GAElB,MAAMC,EAAkB,gBACxB,IAAIC,EAAmBjB,EAAckB,sBACjCC,EAAcnB,EAAcoB,wBAKhCxB,EAAOyB,kBAAeC,EACtB1B,EAAO2B,s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,SAAS,IACVC,OAAO3K,KAAK,WACXc,GAAQ,EACZ,EAAG,WACCA,GAAQ,EACZ,MAQR2H,EAAcS,KAAK+B,IAGnBxC,EAAcS,KAAKjO,EAAO+P,IAAI,WAlDHM,KACvBR,KALArC,EAAc8C,QAASC,GAAiBA,KACxCzC,OAAO0C,oBAAoB,eAAgB/C,MAyD/CD,EAAcS,KAAKjO,EAAOyQ,OAAOzQ,EAAO0Q,0BA9INC,IACzBA,IAGLtP,EAAmBjB,EAAckB,sBACjCC,EAAcnB,EAAcoB,sBAAsBmP,GAC9C7P,EAAoBiD,IAAIhD,EAAO+O,oBAAsBzO,GACrDqJ,GAAK,GACLmF,MAEAnF,GAAK,MAqIjB,CAvkBAkG,QACKC,OAAO,8CAXI,CACZ,eACA,4CACA,6CACA,gDACA,gDAOCrH,WAAW,mBAAoB1J,GAEpCA,EAAiBgR,QAAU,CACvB,aACA,SACA,KACA,YACA,mBACA,gBACA,YACA,SACA,aACA,oBACA,wBACA,gBACA,eACA,wBACA,sBACA,sBACA,S,kECjDJ,MAAMC,EAAsBC,GACjBA,EAAOzL,QAAQ,SAAU,IAG9BE,EAAawC,GACM,iBAAVA,EACU,SAAVA,EAEJgJ,QAAQhJ,GAGbiJ,EAAeC,GACZA,GAGEC,EAAAA,EAAAA,YAAWD,EAAKE,eAFZF,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/models/sparql/cancel-aborting-query.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ontotext-yasgui/before-update-query-result.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/connectors/connector-command.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/sparql-editor/controllers.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/utils/string-utils.js"],"sourcesContent":["export class CancelAbortingQuery extends Error {}\n","export class BeforeUpdateQueryResult {\n constructor(status, messageLabelKey, parameters, mesage) {\n this.status = status;\n this.mesage = mesage;\n this.messageLabelKey = messageLabelKey;\n this.parameters = parameters;\n }\n}\n\nexport const BeforeUpdateQueryResultStatus = {\n ERROR: 'error',\n SUCCESS: 'success'\n};\n","export const ConnectorCommand = {\n 'CREATE': 'create',\n 'REPAIR': 'repair',\n 'DROP': 'drop'\n};\n","import {\n savedQueryResponseMapper, buildQueryModel,\n} from \"../rest/mappers/saved-query-mapper\";\nimport {RouteConstants} from \"../utils/route-constants\";\nimport 'angular/rest/connectors.rest.service';\nimport 'angular/externalsync/controllers';\nimport {YasguiComponentDirectiveUtil} from \"../core/directives/yasgui-component/yasgui-component-directive.util\";\nimport {QueryType} from \"../models/ontotext-yasgui/query-type\";\nimport {ConnectorCommand} from \"../models/connectors/connector-command\";\nimport {BeforeUpdateQueryResult, BeforeUpdateQueryResultStatus} from \"../models/ontotext-yasgui/before-update-query-result\";\nimport {EventDataType} from \"../models/ontotext-yasgui/event-data-type\";\nimport {decodeHTML} from \"../../../app\";\nimport {toBoolean} from \"../utils/string-utils\";\nimport {VIEW_SPARQL_EDITOR} from \"../models/sparql/constants\";\nimport {CancelAbortingQuery} from \"../models/sparql/cancel-aborting-query\";\nimport {QueryMode} from \"../models/ontotext-yasgui/query-mode\";\nimport 'angular/core/services/event-emitter-service';\nimport {LoggerProvider} from \"../core/services/logger-provider\";\nimport {\n navigateTo,\n LanguageContextService,\n ServiceProvider,\n EventService,\n EventName,\n SecurityContextService,\n service,\n REPOSITORY_ID_PARAM,\n} from \"@ontotext/workbench-api\";\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.rest.connectors.service',\n 'graphdb.framework.externalsync.controllers',\n 'graphdb.framework.utils.event-emitter-service',\n 'graphdb.framework.utils.localstorageadapter',\n];\n\nconst logger = LoggerProvider.logger;\n\nangular\n .module('graphdb.framework.sparql-editor.controllers', modules)\n .controller('SparqlEditorCtrl', SparqlEditorCtrl);\n\nSparqlEditorCtrl.$inject = [\n '$rootScope',\n '$scope',\n '$q',\n '$location',\n '$languageService',\n '$repositories',\n '$uibModal',\n 'toastr',\n '$translate',\n 'SparqlRestService',\n 'ConnectorsRestService',\n 'GuidesService',\n 'ModalService',\n 'MonitoringRestService',\n 'EventEmitterService',\n 'LocalStorageAdapter',\n 'LSKeys'];\n\nfunction SparqlEditorCtrl($rootScope,\n $scope,\n $q,\n $location,\n $languageService,\n $repositories,\n $uibModal,\n toastr,\n $translate,\n SparqlRestService,\n ConnectorsRestService,\n GuidesService,\n ModalService,\n MonitoringRestService,\n EventEmitterService,\n LocalStorageAdapter,\n LSKeys) {\n const securityContextService = service(SecurityContextService);\n\n this.repository = '';\n\n const QUERY_EDITOR_ID = '#query-editor';\n let activeRepository = $repositories.getActiveRepository();\n let isOntopRepo = $repositories.isActiveRepoOntopType();\n\n /**\n * @type {OntotextYasguiConfig}\n */\n $scope.yasguiConfig = undefined;\n $scope.savedQueryConfig = undefined;\n $scope.prefixes = {};\n $scope.inferUserSetting = true;\n $scope.sameAsUserSetting = true;\n\n const tabIdToConnectorProgressModalMapping = new Map();\n let internallyReloaded = false;\n\n // =========================\n // Public functions\n // =========================\n /**\n * Updates the Yasgui configuration\n * @param {boolean} clearYasguiState if set to true, the Yasgui will reinitialize and clear all tab results. Queries will remain.\n */\n $scope.updateConfig = (clearYasguiState) => {\n $scope.yasguiConfig = {\n endpoint: getEndpoint,\n componentId: VIEW_SPARQL_EDITOR,\n prefixes: $scope.prefixes,\n infer: isOntopRepo || $scope.inferUserSetting,\n sameAs: isOntopRepo || $scope.sameAsUserSetting,\n yasrToolbarPlugins: [exploreVisualGraphYasrToolbarElementBuilder],\n beforeUpdateQuery: getBeforeUpdateQueryHandler(),\n outputHandlers: new Map([\n [EventDataType.QUERY_EXECUTED, queryExecutedHandler],\n [EventDataType.REQUEST_ABORTED, requestAbortedHandler],\n ]),\n clearState: clearYasguiState !== undefined ? clearYasguiState : false,\n };\n };\n\n $scope.getActiveRepositoryNoError = () => {\n return activeRepository;\n };\n\n // =========================\n // Private functions\n // =========================\n const getYasqe = (yasgui) => {\n const tab = yasgui.getTab();\n if (!tab) {\n return;\n }\n return tab.getYasqe();\n };\n\n const getEndpoint = (yasgui) => {\n const yasqe = getYasqe(yasgui);\n if (!yasqe) {\n // this can happen if open saprql view for first time (browser local store is clear);\n return;\n }\n return $repositories.resolveSparqlEndpoint(yasqe.getQueryMode());\n };\n\n /**\n * Initializes the editor from the URL parameters.\n * @param {boolean} clearYasguiState if set to true, the Yasgui will reinitialize and clear all tab results. Queries will remain.\n * The default is false.\n */\n const initViewFromUrlParams = (clearYasguiState = false) => {\n $scope.updateConfig(clearYasguiState);\n const queryParams = $location.search();\n if (queryParams.hasOwnProperty(RouteConstants.savedQueryName)) {\n // init new tab from shared saved query link\n initTabFromSavedQuery(queryParams);\n } else if (queryParams.hasOwnProperty(RouteConstants.query)) {\n // init new tab from shared query link\n initTabFromSharedQuery(queryParams);\n } else if (GuidesService.isActive()) {\n openNewTab();\n }\n };\n\n // ================================\n // = Setup output handlers\n // ================================\n /**\n * Handles the \"queryExecuted\" event emitted by ontotext-yasgui. The event is fired immediately after the request is executed, whether it succeeds or fails.\n * @param {QueryExecutedEvent} queryExecutedRequest - the event payload.\n */\n const queryExecutedHandler = (queryExecutedRequest) => {\n const connectorProgressModal = tabIdToConnectorProgressModalMapping.get(queryExecutedRequest.tabId);\n if (connectorProgressModal) {\n connectorProgressModal.dismiss();\n tabIdToConnectorProgressModalMapping.delete(queryExecutedRequest.tabId);\n }\n };\n\n /**\n * Handles the \"requestAborted\" event emitted by the ontotext-yasgui. The event is fired when a request is aborted.\n *\n * @param {RequestAbortedEvent} requestAbortedEvent the event payload containing the request object and the query mode.\n */\n const requestAbortedHandler = (requestAbortedEvent) => {\n if (requestAbortedEvent && QueryMode.UPDATE !== requestAbortedEvent.queryMode) {\n const repository = requestAbortedEvent.getRepository();\n const currentTrackAlias = requestAbortedEvent.getQueryTrackAlias();\n if (repository && currentTrackAlias) {\n MonitoringRestService.deleteQuery(currentTrackAlias, repository);\n }\n }\n };\n\n // =========================\n // Private function\n // =========================\n\n const initTabFromSavedQuery = (queryParams) => {\n const savedQueryName = queryParams[RouteConstants.savedQueryName];\n const savedQueryOwner = queryParams[RouteConstants.savedQueryOwner];\n SparqlRestService.getSavedQuery(savedQueryName, savedQueryOwner).then((res) => {\n const savedQuery = savedQueryResponseMapper(res);\n openNewTab(savedQuery)\n .then(autoExecuteQueryIfRequested)\n .finally(clearUrlParameters);\n }).catch((err) => {\n toastr.error($translate.instant('query.editor.missing.saved.query.data.error', {\n savedQueryName: savedQueryName,\n error: getError(err),\n }));\n });\n };\n\n const initTabFromSharedQuery = (queryParams) => {\n const queryName = queryParams[RouteConstants.name];\n const query = queryParams[RouteConstants.query];\n const queryOwner = queryParams[RouteConstants.owner];\n const sharedQueryModel = buildQueryModel(query, queryName, queryOwner, true);\n openNewTab(sharedQueryModel)\n .then(autoExecuteQueryIfRequested)\n .finally(clearUrlParameters);\n };\n\n /**\n * Open a new tab with query described in <code>sparqlQuery</code>.\n *\n * @param {TabQueryModel} sparqlQuery\n *\n * @return {Promise<void>}\n */\n const openNewTab = (sparqlQuery) => {\n return YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync(QUERY_EDITOR_ID)\n .then((yasguiComponent) => yasguiComponent.openTab(sparqlQuery))\n .then((tab) => YasguiComponentDirectiveUtil.highlightTabName(tab));\n };\n\n const clearUrlParameters = () => {\n internallyReloaded = true;\n const currentParams = $location.search();\n // Keep only the repositoryId parameter (if any). This will prevent router event from being triggered again and\n // reinitializing the repositoryId param this adding a new history entry.\n const repositoryId = currentParams[REPOSITORY_ID_PARAM];\n $location.search(repositoryId ? {repositoryId} : {});\n // Replace current URL without adding a new history entry\n $location.replace();\n };\n\n const autoExecuteQueryIfRequested = () => {\n const isRequested = toBoolean($location.search().execute);\n if (isRequested) {\n return YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync(QUERY_EDITOR_ID)\n .then(getQueryMode)\n .then(confirmAndExecuteQuery);\n }\n return Promise.resolve();\n };\n\n const getQueryMode = (yasguiComponent) => {\n return yasguiComponent.getQueryMode()\n .then((queryMode) => {\n return {yasguiComponent, queryMode};\n });\n };\n\n const confirmAndExecuteQuery = ({yasguiComponent, queryMode}) => {\n if (queryMode !== 'update') {\n return yasguiComponent.query();\n }\n\n return new Promise((resolve) => {\n const title = $translate.instant('confirm.execute');\n const message = decodeHTML($translate.instant('query.editor.automatically.execute.update.warning'));\n ModalService.openConfirmation(title, message, () => resolve(yasguiComponent.query()), () => resolve());\n });\n };\n\n const setInferAndSameAs = (principal) => {\n $scope.inferUserSetting = principal?.appSettings.DEFAULT_INFERENCE;\n $scope.sameAsUserSetting = principal?.appSettings.DEFAULT_SAMEAS;\n };\n\n const exploreVisualGraphYasrToolbarElementBuilder = {\n createElement: (yasr) => {\n const buttonName = document.createElement('span');\n buttonName.classList.add(\"explore-visual-graph-button-name\");\n const exploreVisualButtonWrapperElement = document.createElement('button');\n exploreVisualButtonWrapperElement.classList.add(\"explore-visual-graph-button\");\n exploreVisualButtonWrapperElement.classList.add(\"icon-data\");\n exploreVisualButtonWrapperElement.onclick = function() {\n const paramsToParse = {\n query: yasr.yasqe.getValue(),\n sameAs: yasr.yasqe.getSameAs(),\n inference: yasr.yasqe.getInfer(),\n };\n $location.path('graphs-visualizations').search(paramsToParse);\n };\n exploreVisualButtonWrapperElement.appendChild(buttonName);\n return exploreVisualButtonWrapperElement;\n },\n updateElement: (element, yasr) => {\n element.classList.add('hidden');\n if (!yasr.hasResults()) {\n return;\n }\n const queryType = yasr.yasqe.getQueryType();\n\n if (QueryType.CONSTRUCT === queryType || QueryType.DESCRIBE === queryType) {\n element.classList.remove('hidden');\n }\n element.querySelector('.explore-visual-graph-button-name').innerText = $translate.instant(\"query.editor.visual.btn\");\n },\n getOrder: () => {\n return 2;\n },\n };\n\n const createParameter = (key, value) => {\n return {key, value};\n };\n\n const getCommandParameters = (response) => {\n return [createParameter('name', response.data.name)];\n };\n\n const toNoCommandResponse = () => {\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS);\n };\n\n const toHasNotSupport = (response) => {\n const parameters = [\n createParameter('connectorName', response.data.connectorName),\n createParameter('pluginName', response.data.pluginName),\n ];\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.ERROR, 'query.editor.inactive.plugin.warning.msg', parameters);\n };\n\n const createConnectorProgressDialog = (actionName, iri, connectorName) => {\n const progressScope = $scope.$new(true);\n progressScope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0,\n },\n actionName,\n eta: \"-\",\n inline: false,\n iri,\n name: connectorName,\n doneCallback: function() {\n connectorProgressModal.dismiss('cancel');\n },\n };\n progressScope.getHumanReadableSeconds = $scope.getHumanReadableSeconds;\n\n const connectorProgressModal = $uibModal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: progressScope,\n });\n return connectorProgressModal;\n };\n\n const toCreateCommandResponse = (response, tabId) => {\n const connectorProgressModal = createConnectorProgressDialog($translate.instant('externalsync.creating'), response.data.iri, response.data.name);\n tabIdToConnectorProgressModalMapping.set(tabId, connectorProgressModal);\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'created.connector', getCommandParameters(response));\n };\n\n const toRepairCommandResponse = (response, tabId) => {\n const connectorProgressModal = createConnectorProgressDialog($translate.instant('externalsync.repairing'), response.data.iri, response.data.name);\n tabIdToConnectorProgressModalMapping.set(tabId, connectorProgressModal);\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'query.editor.repaired.connector', getCommandParameters(response));\n };\n\n const toDropCommandResponse = (response) => {\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'externalsync.delete.success.msg', getCommandParameters(response));\n };\n\n const getBeforeUpdateQueryHandler = () => (query, tabId) => {\n return ConnectorsRestService.checkConnector(query)\n .then((response) => {\n if (!response.data.command) {\n return toNoCommandResponse();\n }\n if (!response.data.hasSupport) {\n return toHasNotSupport(response);\n }\n\n if (ConnectorCommand.CREATE === response.data.command) {\n return toCreateCommandResponse(response, tabId);\n }\n\n if (ConnectorCommand.REPAIR === response.data.command) {\n return toRepairCommandResponse(response, tabId);\n }\n\n if (ConnectorCommand.DROP === response.data.command) {\n return toDropCommandResponse(response);\n }\n }).catch((error) => {\n // For some reason we couldn't check if this is a connector update, so just catch the exception,\n // to not stop the execution of query.\n logger.error('Checking connector error: ', error);\n });\n };\n\n const getExitPageConfirmMessage = (ongoingRequestsInfo) => {\n let exitPageConfirmMessage = \"view.sparql-editor.leave_page.run_queries.confirmation.\";\n if (!ongoingRequestsInfo || ongoingRequestsInfo.queriesCount < 1) {\n exitPageConfirmMessage += \"none_queries_\";\n } else if (ongoingRequestsInfo.queriesCount === 1) {\n exitPageConfirmMessage += \"one_query_\";\n } else {\n exitPageConfirmMessage += \"queries_\";\n }\n\n if (!ongoingRequestsInfo.updatesCount || ongoingRequestsInfo.updatesCount === 0) {\n exitPageConfirmMessage += \"non_updates\";\n } else if (ongoingRequestsInfo.updatesCount === 1) {\n exitPageConfirmMessage += \"one_update\";\n } else {\n exitPageConfirmMessage += \"updates\";\n }\n\n exitPageConfirmMessage += \".message\";\n const params = {\n queriesCount: ongoingRequestsInfo.queriesCount,\n updatesCount: ongoingRequestsInfo.updatesCount,\n };\n return $translate.instant(exitPageConfirmMessage, params);\n };\n\n // Initialization and bootstrap\n const init = (clearYasguiState) => {\n // This script check is required, because of the following scenario:\n // I am in the SPARQL view;\n // Then I go to a different view and change the language;\n // Then I return to the SPARQL view. I will see that the Google chart and Pivot table will have their\n // original scripts loaded still.\n // THE FIX: Get all the scripts (if there are none, the correct language will be loaded). If there are\n // scripts, and they don't match those, which are loaded already, the page needs to reload when opening\n // the SPARQL view, otherwise the Google chart and Pivot table configs will be in the old language.\n const googleScripts = document.querySelectorAll(`script[src*=\"https://www.gstatic.com/\"]`);\n if (googleScripts.length > 0) {\n const currentLang = $languageService.getLanguage();\n let searchTerm = 'module.js';\n if ('en' !== currentLang) {\n searchTerm = `module__${currentLang}.js`;\n }\n if (!Array.prototype.some.call(googleScripts, (script) => script.src.includes(searchTerm))) {\n location.reload();\n return;\n }\n }\n const principal = securityContextService.getAuthenticatedUser();\n $q.when($repositories.getPrefixes(activeRepository))\n .then((usedPrefixes) => {\n $scope.prefixes = usedPrefixes;\n setInferAndSameAs(principal);\n // check is there is a saved query or query url parameter and init the editor\n initViewFromUrlParams(clearYasguiState);\n });\n // TODO: we should also watch for changes in namespaces\n // scope.$watch('namespaces', function () {});\n };\n\n // =========================\n // Event handlers\n // =========================\n const subscriptions = [];\n\n const repositoryChangedHandler = (object) => {\n if (!object) {\n return;\n }\n activeRepository = $repositories.getActiveRepository();\n isOntopRepo = $repositories.isActiveRepoOntopType(object);\n if (LocalStorageAdapter.get(LSKeys.SPARQL_LAST_REPO) !== activeRepository) {\n init(true);\n persistLasstUsedRepository();\n } else {\n init(false);\n }\n };\n\n const beforeunloadHandler = (event) => {\n const ontotextYasguiElement = YasguiComponentDirectiveUtil.getOntotextYasguiElement(QUERY_EDITOR_ID);\n if (!ontotextYasguiElement) {\n return;\n }\n // If we set event.returnValue, the browser will prompt the user for confirmation to leave the page,\n // but we don't have a way to handle the user's choice.\n // Therefore, we can't take any action, so we simply proceed to abort all requests.\n ontotextYasguiElement.abortAllRequests().then(() => {});\n };\n\n window.addEventListener('beforeunload', beforeunloadHandler);\n\n const confirmIfHaveRunQuery = (ongoingRequestsInfo) => new Promise((resolve, reject) => {\n if (!ongoingRequestsInfo || ongoingRequestsInfo.queriesCount < 1 && ongoingRequestsInfo.updatesCount < 1) {\n resolve();\n return;\n }\n\n const title = $translate.instant('common.confirm');\n const message = decodeHTML(getExitPageConfirmMessage(ongoingRequestsInfo));\n ModalService.openSimpleModal({\n title,\n message,\n warning: true,\n }).result.then(function() {\n resolve();\n }, function() {\n reject(new CancelAbortingQuery());\n });\n });\n let queriesAreCanceled = undefined;\n const locationChangeHandler = (eventPayload) => {\n if (internallyReloaded) {\n internallyReloaded = false;\n return;\n }\n const ontotextYasguiElement = YasguiComponentDirectiveUtil.getOntotextYasguiElement(QUERY_EDITOR_ID);\n if (!ontotextYasguiElement || queriesAreCanceled) {\n return;\n }\n\n const url = new URL(eventPayload.newUrl);\n const newUrl = url.pathname + url.search + url.hash;\n eventPayload.cancelNavigation();\n // First, we check if there are any ongoing requests initiated by the user.\n // If the user has ongoing requests, we request confirmation to abort them.\n // If the user confirms or there are no ongoing requests, we call the \"abortAllRequests\" method. This method will abort all requests.\n ontotextYasguiElement\n .getOngoingRequestsInfo()\n .then((hasRunQuery) => confirmIfHaveRunQuery(hasRunQuery))\n .then(() => ontotextYasguiElement.abortAllRequests())\n .then(() => {\n queriesAreCanceled = true;\n navigateTo(newUrl)();\n })\n .catch((error) => {\n if (!(error instanceof CancelAbortingQuery)) {\n logger.error(error);\n queriesAreCanceled = true;\n navigateTo(newUrl)();\n }\n });\n };\n\n subscriptions.push(\n ServiceProvider.get(EventService).subscribe(EventName.NAVIGATION_START, (eventPayload) => locationChangeHandler(eventPayload)),\n );\n\n const removeAllListeners = () => {\n subscriptions.forEach((subscription) => subscription());\n window.removeEventListener('beforeunload', beforeunloadHandler);\n };\n\n const finalizeAndDestroy = () => {\n persistLasstUsedRepository();\n removeAllListeners();\n };\n\n const persistLasstUsedRepository = () => {\n // The active repository is set when the controller is initialized and when the repository is changed.\n // It holds the actual repository when the YASGUI is initialized. DON'T use runtime fetching of the actual repository here, because there is a scenario:\n // 1. Open a tab with the SPARQL view open;\n // 2. Open the SPARQL view in another tab and execute a query;\n // 3. Switch to the repositories view and change the repository;\n // 4. Switch back to the SPARQL view, and the YASR is not cleared.\n // The problem occurs because of the second tab. When the repository is changed, its ID is persisted to local storage, which triggers the \"storage\" event to be fired.\n // In the main controller, a listener has been registered to listen to that event and refresh the page outside of the Angular scope.\n // Reloading the page triggers the destruction of the component and persistence of the active repository. The reloading of the page is out of the Angular scope, so the \"activeRepository\"\n // holds the real repository when the YASGUI is created. If we use $$repositories.getActiveRepository(), the new value will be fetched, which in this case will be incorrect.\n LocalStorageAdapter.set(LSKeys.SPARQL_LAST_REPO, activeRepository);\n };\n\n subscriptions.push(\n $scope.$on('language-changed', function() {\n location.reload();\n }),\n );\n\n const onLanguageChange = () => {\n // Do nothing on language change\n };\n\n const showLanguageChangeConfirmation = () => {\n return new Promise((resolve) => {\n ModalService.openSimpleModal({\n title: $translate.instant('query.editor.language.change.warning.title'),\n message: $translate.instant('query.editor.reload.page.warning'),\n warning: true,\n }).result.then(function() {\n resolve(true);\n }, function() {\n resolve(false);\n });\n });\n };\n\n const languageContextService = ServiceProvider.get(LanguageContextService);\n const onLanguageChangeSubscription = languageContextService.onSelectedLanguageChanged(onLanguageChange, showLanguageChangeConfirmation);\n\n // Subscribe to language change and ask to reload the page\n subscriptions.push(onLanguageChangeSubscription);\n\n // Deregister the watcher when the scope/directive is destroyed\n subscriptions.push($scope.$on('$destroy', finalizeAndDestroy));\n\n // Wait until the active repository object is set, otherwise \"canWriteActiveRepo()\" may return a wrong result and the \"ontotext-yasgui\"\n // readOnly configuration may be incorrect.\n subscriptions.push($scope.$watch($scope.getActiveRepositoryObject, repositoryChangedHandler));\n}\n","import {upperFirst} from \"lodash\";\n\n/**\n * Removes brackets and serial commas from IRIs\n * when used to create ids for links and markers,\n * because elements with ids that contain such\n * are not valid XHTML and cause a host problems\n * when trying to style individual elements\n * @param {string} string The string to be processed.\n * @return {string} A string where the special characters are removed.\n */\nconst removeSpecialChars = (string) => {\n return string.replace(/[()']/g, \"\");\n};\n\nconst toBoolean = (value) => {\n if (typeof value === 'string') {\n return value === 'true';\n }\n return Boolean(value);\n};\n\nconst toTitleCase = (text) => {\n if (!text) {\n return text;\n }\n return upperFirst(text.toLowerCase());\n};\n\nexport {\n removeSpecialChars,\n toBoolean,\n toTitleCase\n};\n\n"],"names":["CancelAbortingQuery","Error","BeforeUpdateQueryResult","constructor","status","messageLabelKey","parameters","mesage","this","BeforeUpdateQueryResultStatus","ERROR","SUCCESS","ConnectorCommand","logger","LoggerProvider","SparqlEditorCtrl","$rootScope","$scope","$q","$location","$languageService","$repositories","$uibModal","toastr","$translate","SparqlRestService","ConnectorsRestService","GuidesService","ModalService","MonitoringRestService","EventEmitterService","LocalStorageAdapter","LSKeys","securityContextService","service","SecurityContextService","repository","QUERY_EDITOR_ID","activeRepository","getActiveRepository","isOntopRepo","isActiveRepoOntopType","yasguiConfig","undefined","savedQueryConfig","prefixes","inferUserSetting","sameAsUserSetting","tabIdToConnectorProgressModalMapping","Map","internallyReloaded","updateConfig","clearYasguiState","endpoint","getEndpoint","componentId","VIEW_SPARQL_EDITOR","infer","sameAs","yasrToolbarPlugins","exploreVisualGraphYasrToolbarElementBuilder","beforeUpdateQuery","getBeforeUpdateQueryHandler","outputHandlers","EventDataType","QUERY_EXECUTED","queryExecutedHandler","REQUEST_ABORTED","requestAbortedHandler","clearState","getActiveRepositoryNoError","yasgui","yasqe","tab","getTab","getYasqe","resolveSparqlEndpoint","getQueryMode","queryExecutedRequest","connectorProgressModal","get","tabId","dismiss","delete","requestAbortedEvent","QueryMode","UPDATE","queryMode","getRepository","currentTrackAlias","getQueryTrackAlias","deleteQuery","openNewTab","sparqlQuery","YasguiComponentDirectiveUtil","getOntotextYasguiElementAsync","then","yasguiComponent","openTab","highlightTabName","clearUrlParameters","repositoryId","search","REPOSITORY_ID_PARAM","replace","autoExecuteQueryIfRequested","toBoolean","execute","confirmAndExecuteQuery","Promise","resolve","query","title","instant","message","decodeHTML","openConfirmation","createElement","yasr","buttonName","document","classList","add","exploreVisualButtonWrapperElement","onclick","paramsToParse","getValue","getSameAs","inference","getInfer","path","appendChild","updateElement","element","hasResults","queryType","getQueryType","QueryType","CONSTRUCT","DESCRIBE","remove","querySelector","innerText","getOrder","createParameter","key","value","getCommandParameters","response","data","name","createConnectorProgressDialog","actionName","iri","connectorName","progressScope","$new","beingBuiltConnector","percentDone","processedEntities","estimatedEntities","indexedEntities","entitiesPerSecond","eta","inline","doneCallback","getHumanReadableSeconds","open","templateUrl","controller","size","backdrop","scope","checkConnector","command","hasSupport","CREATE","toCreateCommandResponse","set","REPAIR","toRepairCommandResponse","DROP","toDropCommandResponse","pluginName","toHasNotSupport","catch","error","init","googleScripts","querySelectorAll","length","currentLang","getLanguage","searchTerm","Array","prototype","some","call","script","src","includes","location","reload","principal","getAuthenticatedUser","when","getPrefixes","usedPrefixes","appSettings","DEFAULT_INFERENCE","DEFAULT_SAMEAS","setInferAndSameAs","initViewFromUrlParams","queryParams","hasOwnProperty","RouteConstants","savedQueryName","savedQueryOwner","getSavedQuery","res","savedQuery","savedQueryResponseMapper","finally","err","getError","initTabFromSavedQuery","queryName","queryOwner","owner","sharedQueryModel","buildQueryModel","initTabFromSharedQuery","isActive","subscriptions","beforeunloadHandler","event","ontotextYasguiElement","getOntotextYasguiElement","abortAllRequests","window","addEventListener","queriesAreCanceled","push","ServiceProvider","EventService","subscribe","EventName","NAVIGATION_START","eventPayload","url","URL","newUrl","pathname","hash","cancelNavigation","getOngoingRequestsInfo","hasRunQuery","confirmIfHaveRunQuery","ongoingRequestsInfo","reject","queriesCount","updatesCount","exitPageConfirmMessage","params","getExitPageConfirmMessage","openSimpleModal","warning","result","navigateTo","locationChangeHandler","persistLasstUsedRepository","SPARQL_LAST_REPO","$on","onLanguageChangeSubscription","LanguageContextService","onSelectedLanguageChanged","onLanguageChange","showLanguageChangeConfirmation","finalizeAndDestroy","forEach","subscription","removeEventListener","$watch","getActiveRepositoryObject","object","angular","module","$inject","removeSpecialChars","string","Boolean","toTitleCase","text","upperFirst","toLowerCase"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const __webpack_esm_id__=82926;export const __webpack_esm_ids__=[82926];export const __webpack_esm_modules__={82926(){function t(){return{link:function(t,e,o){t.$watch("file.status",function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.3.0-
|
|
2
|
-
//# sourceMappingURL=82926.
|
|
1
|
+
export const __webpack_esm_id__=82926;export const __webpack_esm_ids__=[82926];export const __webpack_esm_modules__={82926(){function t(){return{link:function(t,e,o){t.$watch("file.status",function(){"IMPORTING"!==t.file.status&&"UPLOADING"!==t.file.status||!$(e).has("object").length>0&&$(e).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.3.0-RC2">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",t),t.$inject=[]}};
|
|
2
|
+
//# sourceMappingURL=82926.7b2eb86c228751481414.bundle.js.map
|
package/dist/{82926.ad4dd11d09d9aecb2f8c.bundle.js.map → 82926.7b2eb86c228751481414.bundle.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"82926.
|
|
1
|
+
{"version":3,"file":"82926.7b2eb86c228751481414.bundle.js","mappings":"6HASA,SAASA,IACL,MAAO,CACHC,KAAM,SAAUC,EAAOC,EAASC,GAC5BF,EAAMG,OAAO,cAAe,WACE,cAAtBH,EAAMI,KAAKC,QAAgD,cAAtBL,EAAMI,KAAKC,SAC3CC,EAAEL,GAASM,IAAI,UAAUC,OAAS,GACnCF,EAAEL,GAASQ,OAAO,kBAAoBP,EAAKQ,KAAO,aAAeR,EAAKQ,KAAO,6GAGzF,EACJ,EAER,CAnBAC,QACKC,OAAO,gEAHI,IAIXC,UAAU,0BAA2Bf,GAE1CA,EAAwBgB,QAAU,E","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js"],"sourcesContent":["const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\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=3.3.0-RC2\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n"],"names":["ImportProgressIndicator","link","scope","element","attr","$watch","file","status","$","has","length","append","size","angular","module","directive","$inject"],"ignoreList":[],"sourceRoot":""}
|