graphdb-workbench 3.3.2 → 3.3.3-RC1
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/{10759.b2e1d643d681ebd9c124.bundle.js → 10759.57059f90014058a86952.bundle.js} +2 -2
- package/dist/10759.57059f90014058a86952.bundle.js.map +1 -0
- package/dist/{13231.d7107e7549453805e13a.bundle.js → 13231.8bbbe30c10e6c0dfdba3.bundle.js} +2 -2
- package/dist/13231.8bbbe30c10e6c0dfdba3.bundle.js.map +1 -0
- package/dist/{18961.01ff5fcc0f4b9f99236e.bundle.js → 18961.732c0c355509452ac6da.bundle.js} +2 -2
- package/dist/18961.732c0c355509452ac6da.bundle.js.map +1 -0
- package/dist/{20694.4becb7771236462dcc5a.bundle.js → 20694.03b5abf23347ae0bad65.bundle.js} +2 -2
- package/dist/{20694.4becb7771236462dcc5a.bundle.js.map → 20694.03b5abf23347ae0bad65.bundle.js.map} +1 -1
- package/dist/21015.6db2b66597f78d4b83cc.bundle.js +2 -0
- package/dist/21015.6db2b66597f78d4b83cc.bundle.js.map +1 -0
- package/dist/2975.c5ebc3e3ad52df3ab907.bundle.js +2 -0
- package/dist/2975.c5ebc3e3ad52df3ab907.bundle.js.map +1 -0
- package/dist/38644.8585127c40697ea58e00.bundle.js +2 -0
- package/dist/38644.8585127c40697ea58e00.bundle.js.map +1 -0
- package/dist/39518.0acc5eb68f38cc6b62a5.bundle.js +2 -0
- package/dist/{39518.4d72b74fffba395c6b2a.bundle.js.map → 39518.0acc5eb68f38cc6b62a5.bundle.js.map} +1 -1
- package/dist/{39874.710e94f211579215f997.bundle.js → 39874.17dde6245fc4cc91bb58.bundle.js} +2 -2
- package/dist/39874.17dde6245fc4cc91bb58.bundle.js.map +1 -0
- package/dist/{45758.1212136a37dd4f7528f8.bundle.js → 45758.b9ce5fe0ed6c8c4fc141.bundle.js} +2 -2
- package/dist/45758.b9ce5fe0ed6c8c4fc141.bundle.js.map +1 -0
- package/dist/{60560.6ba1b091a34af6c00770.bundle.js → 60560.62ed0cb0b3d07fecbf28.bundle.js} +2 -2
- package/dist/60560.62ed0cb0b3d07fecbf28.bundle.js.map +1 -0
- package/dist/{60730.35493812d428872eddb6.bundle.js → 60730.a9fc5342637039776562.bundle.js} +2 -2
- package/dist/60730.a9fc5342637039776562.bundle.js.map +1 -0
- package/dist/{64118.b06aebc9f8d7e822244f.bundle.js → 64118.177457589341de779668.bundle.js} +2 -2
- package/dist/64118.177457589341de779668.bundle.js.map +1 -0
- package/dist/67888.0f7d008c6f62683e2c62.bundle.js +2 -0
- package/dist/67888.0f7d008c6f62683e2c62.bundle.js.map +1 -0
- package/dist/71099.ba1073458b96d9789756.bundle.js +2 -0
- package/dist/71099.ba1073458b96d9789756.bundle.js.map +1 -0
- package/dist/75881.148ce498d06784abfd6c.bundle.js +2 -0
- package/dist/75881.148ce498d06784abfd6c.bundle.js.map +1 -0
- package/dist/78070.d54ede951a08e1c8689d.bundle.js +2 -0
- package/dist/78070.d54ede951a08e1c8689d.bundle.js.map +1 -0
- package/dist/{7815.2aec5ebbcd434f5582ff.bundle.js → 7815.89cc59b6625e84913351.bundle.js} +2 -2
- package/dist/7815.89cc59b6625e84913351.bundle.js.map +1 -0
- package/dist/{78681.9e1d4e064e9e1fb5fb21.bundle.js → 78681.6c8614aad7e5465be505.bundle.js} +2 -2
- package/dist/78681.6c8614aad7e5465be505.bundle.js.map +1 -0
- package/dist/{82206.229877d7931849236456.bundle.js → 82206.473f6d4f79e12f6a9da6.bundle.js} +2 -2
- package/dist/82206.473f6d4f79e12f6a9da6.bundle.js.map +1 -0
- package/dist/{82926.ce1d6bf65b09288a2b10.bundle.js → 82926.7d300bdaae879f385185.bundle.js} +2 -2
- package/dist/{82926.ce1d6bf65b09288a2b10.bundle.js.map → 82926.7d300bdaae879f385185.bundle.js.map} +1 -1
- package/dist/{94229.47dbdba202106c61dff1.bundle.js → 94229.5a853fae006f6ef633af.bundle.js} +2 -2
- package/dist/94229.5a853fae006f6ef633af.bundle.js.map +1 -0
- package/dist/95953.1350a9dc14b22372b4e2.bundle.js +2 -0
- package/dist/95953.1350a9dc14b22372b4e2.bundle.js.map +1 -0
- package/dist/98268.a1bd17e40ede031a0a00.bundle.js +2 -0
- package/dist/98268.a1bd17e40ede031a0a00.bundle.js.map +1 -0
- package/dist/99448.147164e93b1ab3a87d36.bundle.js +2 -0
- package/dist/99448.147164e93b1ab3a87d36.bundle.js.map +1 -0
- 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 +3 -2
- 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.f1ed8e359786e8adeab2.js +3 -0
- package/dist/{legacyWorkbench.40eba9e09196e1483221.js.map → legacyWorkbench.f1ed8e359786e8adeab2.js.map} +1 -1
- package/dist/main.a67c284710a8b9a98ca2.js +3 -0
- package/dist/main.a67c284710a8b9a98ca2.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 +4 -3
- package/dist/res/swagger5/index.html +11 -11
- package/dist/res/swagger5/swagger-initializer.js +1 -1
- package/dist/shared-components/cjs/index-CTK5NoJt.js +2 -0
- package/dist/shared-components/cjs/loader.cjs.js +1 -1
- package/dist/shared-components/cjs/onto-cookie-consent_2.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-dialog_2.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-dropdown.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-footer_5.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-language-selector_9.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-layout.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-permission-banner.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-test-context.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-toastr.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/shared-components.cjs.js +1 -1
- package/dist/shared-components/cjs/translate-label.cjs.entry.js +1 -1
- package/dist/shared-components/collection/collection-manifest.json +2 -2
- package/dist/shared-components/collection/components/dialogs/onto-dialog.js +1 -1
- package/dist/shared-components/collection/components/onto-dropdown/onto-dropdown.js +1 -1
- package/dist/shared-components/collection/components/onto-language-selector/onto-language-selector.js +1 -1
- package/dist/shared-components/collection/components/onto-license-alert/onto-license-alert.js +1 -1
- package/dist/shared-components/collection/components/onto-loader/onto-loader.js +1 -1
- package/dist/shared-components/collection/components/onto-navbar/onto-navbar.js +1 -1
- package/dist/shared-components/collection/components/onto-operations-notification/onto-operations-notification.js +1 -1
- package/dist/shared-components/collection/components/onto-repository-selector/onto-repository-selector.js +1 -1
- package/dist/shared-components/collection/components/onto-search-resource-input/onto-search-resource-input.js +1 -1
- package/dist/shared-components/collection/components/onto-test-context/onto-test-context.js +1 -1
- package/dist/shared-components/collection/components/onto-toggle-switch/onto-toggle-switch.js +1 -1
- package/dist/shared-components/collection/components/onto-user-menu/onto-user-menu.js +1 -1
- package/dist/shared-components/collection/components/translate-label/translate-label.js +1 -1
- package/dist/shared-components/esm/index-EiAqSNMq.js +2 -0
- package/dist/shared-components/esm/loader.js +1 -1
- package/dist/shared-components/esm/onto-cookie-consent_2.entry.js +1 -1
- package/dist/shared-components/esm/onto-dialog_2.entry.js +1 -1
- package/dist/shared-components/esm/onto-dropdown.entry.js +1 -1
- package/dist/shared-components/esm/onto-footer_5.entry.js +1 -1
- package/dist/shared-components/esm/onto-language-selector_9.entry.js +1 -1
- package/dist/shared-components/esm/onto-layout.entry.js +1 -1
- package/dist/shared-components/esm/onto-permission-banner.entry.js +1 -1
- package/dist/shared-components/esm/onto-test-context.entry.js +1 -1
- package/dist/shared-components/esm/onto-toastr.entry.js +1 -1
- package/dist/shared-components/esm/shared-components.js +1 -1
- package/dist/shared-components/esm/translate-label.entry.js +1 -1
- package/dist/shared-components/shared-components/{p-6d34b2cb.entry.js → p-1103d100.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-9b2c6e80.entry.js → p-2e2bb175.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-b754971e.entry.js → p-50735428.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-7e47d850.entry.js → p-59707503.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-598d33d7.entry.js → p-6a37f808.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-9214bb16.entry.js → p-6fb5eec5.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-c27fe716.entry.js → p-97930684.entry.js} +1 -1
- package/dist/shared-components/shared-components/p-EiAqSNMq.js +2 -0
- package/dist/shared-components/shared-components/{p-b5d4081d.entry.js → p-a5a49d87.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-74888633.entry.js → p-d134e207.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-5886e663.entry.js → p-ec2f4ea5.entry.js} +1 -1
- package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
- package/dist/shared-components/types/stencil-public-runtime.d.ts +10 -147
- package/package.json +1 -1
- package/dist/10759.b2e1d643d681ebd9c124.bundle.js.map +0 -1
- package/dist/13231.d7107e7549453805e13a.bundle.js.map +0 -1
- package/dist/18961.01ff5fcc0f4b9f99236e.bundle.js.map +0 -1
- package/dist/21015.ea34b563b4149ad0975e.bundle.js +0 -2
- package/dist/21015.ea34b563b4149ad0975e.bundle.js.map +0 -1
- package/dist/2975.8be1a79816fd811be223.bundle.js +0 -2
- package/dist/2975.8be1a79816fd811be223.bundle.js.map +0 -1
- package/dist/38644.0e8652c647a0f341abd7.bundle.js +0 -2
- package/dist/38644.0e8652c647a0f341abd7.bundle.js.map +0 -1
- package/dist/39518.4d72b74fffba395c6b2a.bundle.js +0 -2
- package/dist/39874.710e94f211579215f997.bundle.js.map +0 -1
- package/dist/45758.1212136a37dd4f7528f8.bundle.js.map +0 -1
- package/dist/60560.6ba1b091a34af6c00770.bundle.js.map +0 -1
- package/dist/60730.35493812d428872eddb6.bundle.js.map +0 -1
- package/dist/64118.b06aebc9f8d7e822244f.bundle.js.map +0 -1
- package/dist/67888.41803878170b6c7a5ca5.bundle.js +0 -2
- package/dist/67888.41803878170b6c7a5ca5.bundle.js.map +0 -1
- package/dist/71099.ca7720893604e9d908d6.bundle.js +0 -2
- package/dist/71099.ca7720893604e9d908d6.bundle.js.map +0 -1
- package/dist/75881.54dc716f79b6fe29232a.bundle.js +0 -2
- package/dist/75881.54dc716f79b6fe29232a.bundle.js.map +0 -1
- package/dist/78070.13538271878de6a98862.bundle.js +0 -2
- package/dist/78070.13538271878de6a98862.bundle.js.map +0 -1
- package/dist/7815.2aec5ebbcd434f5582ff.bundle.js.map +0 -1
- package/dist/78681.9e1d4e064e9e1fb5fb21.bundle.js.map +0 -1
- package/dist/82206.229877d7931849236456.bundle.js.map +0 -1
- package/dist/94229.47dbdba202106c61dff1.bundle.js.map +0 -1
- package/dist/95953.ec1b9d5e568d43ec3dcf.bundle.js +0 -2
- package/dist/95953.ec1b9d5e568d43ec3dcf.bundle.js.map +0 -1
- package/dist/98268.86ff371dde616b4e2a76.bundle.js +0 -2
- package/dist/98268.86ff371dde616b4e2a76.bundle.js.map +0 -1
- package/dist/99448.2a87f387a8062617d893.bundle.js +0 -2
- package/dist/99448.2a87f387a8062617d893.bundle.js.map +0 -1
- package/dist/legacyWorkbench.40eba9e09196e1483221.js +0 -3
- package/dist/main.14f083264cd64618d96a.js +0 -3
- package/dist/main.14f083264cd64618d96a.js.map +0 -1
- package/dist/shared-components/cjs/app-globals-V2Kpy_OQ.js +0 -1
- package/dist/shared-components/cjs/index-L_ZmIeD5.js +0 -2
- package/dist/shared-components/esm/app-globals-DQuL1Twl.js +0 -1
- package/dist/shared-components/esm/index-CGqARDX4.js +0 -2
- package/dist/shared-components/shared-components/p-CGqARDX4.js +0 -2
- package/dist/shared-components/shared-components/p-DQuL1Twl.js +0 -1
- /package/dist/{legacyWorkbench.40eba9e09196e1483221.js.LICENSE.txt → legacyWorkbench.f1ed8e359786e8adeab2.js.LICENSE.txt} +0 -0
- /package/dist/{main.14f083264cd64618d96a.js.LICENSE.txt → main.a67c284710a8b9a98ca2.js.LICENSE.txt} +0 -0
- /package/dist/shared-components/cjs/{index-L_ZmIeD5.js.LICENSE.txt → index-CTK5NoJt.js.LICENSE.txt} +0 -0
- /package/dist/shared-components/esm/{index-CGqARDX4.js.LICENSE.txt → index-EiAqSNMq.js.LICENSE.txt} +0 -0
- /package/dist/shared-components/shared-components/{p-CGqARDX4.js.LICENSE.txt → p-EiAqSNMq.js.LICENSE.txt} +0 -0
|
@@ -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.
|
|
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.3-RC1">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",t),t.$inject=[]}};
|
|
2
|
+
//# sourceMappingURL=82926.7d300bdaae879f385185.bundle.js.map
|
package/dist/{82926.ce1d6bf65b09288a2b10.bundle.js.map → 82926.7d300bdaae879f385185.bundle.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"82926.
|
|
1
|
+
{"version":3,"file":"82926.7d300bdaae879f385185.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.3-RC1\">{{\\'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":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const __webpack_esm_id__=94229;export const __webpack_esm_ids__=[33760,48477,94229];export const __webpack_esm_modules__={33760(e,t,r){r.d(t,{B1:()=>u,DX:()=>i,_5:()=>c,aj:()=>o,n5:()=>s,w0:()=>a,xF:()=>n});const s="SYSTEM",o="READ_REPO",n="READ_REPO_",i="WRITE_REPO",a="GRAPHQL",c="WRITE_REPO_",u="GRAPHQL_"},48477(){angular.module("graphdb.framework.security.directives",[]).directive("customPrefixTagsInput",function(){return{restrict:"A",link:function(e,t,r){const s=[];function o(e){return e.startsWith("CUSTOM_")||e.startsWith("!CUSTOM_")}const n="tags-input"===t[0].nodeName.toLowerCase();if(n&&r.ngModel){const i=t.controller("ngModel");n&&(i.$parsers.push(function(e){return Array.isArray(e)&&(i.$warning=e.some(e=>o(e))),e}),s.push(e.$watch(r.ngModel,function(e){Array.isArray(e)&&(i.$warning=e.some(e=>o(e)))},!0)))}s.push(e.$on("$destroy",()=>{s.forEach(e=>e())}))}}})},94229(e,t,r){r(82493),r(98599),r(2243);var s=r(92900),o=(r(48477),r(33760)),n=r(57154);const i=angular.module("graphdb.framework.security.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","graphdb.framework.core.services.security-service","toastr","ngTagsInput"]);i.controller("UsersCtrl",["$scope","$uibModal","toastr","$window","$jwtAuth","$timeout","ModalService","SecurityService","$translate",function(e,t,r,s,i,a,c,u,d){const p=(0,n.service)(n.AuthorizationService),l=(0,n.service)(n.AuthenticationService),h=(0,n.service)(n.SecurityService),E=(0,n.service)(n.OntoToastrService),A=(0,n.service)(n.UsersService),g=(0,n.service)(n.RepositoryService);e.usersData=[],e.loader=!0,e.securityEnabled=function(){return l.isSecurityEnabled()},e.hasExternalAuth=function(){return i.hasExternalAuth()},e.getAuthImplementation=function(){return i.getAuthImplementation()},e.freeAccessEnabled=function(){return p.hasFreeAccess()},e.getUsers=()=>A.getUsers().then(function(t){e.usersData=t.map(e=>({username:e.username,dateCreated:e.dateCreated,userType:e.getUserType(),userTypeDescription:e.getUserTypeDescription(),repositories:e.authorities.getRepositoriesPermissions(),customRoles:e.authorities.getCustomRoles()})),e.loader=!1}).catch(function(t){const s=getError(t);r.error(s,d.instant("common.error")),e.loader=!1}),e.getUsers(),e.$on("repositoryIsSet",function(){e.getUsers()}),e.toggleSecurity=function(){const e=l.isSecurityEnabled();i.toggleSecurity(!e).then(()=>{s.location.reload()})};const f=function(e,t){return h.setFreeAccess(e,t)};e.toggleFreeAccess=function(e){!p.hasFreeAccess()||p.hasFreeAccess()&&e?h.getFreeAccess().then(t=>{const r=(0,n.mapGrantedAuthoritiesResponseToModel)(t.authorities).getItems(),s=t.appSettings??{DEFAULT_SAMEAS:!0,DEFAULT_INFERENCE:!0,EXECUTE_COUNT:!0,IGNORE_SHARED_QUERIES:!1,DEFAULT_VIS_GRAPH_SCHEMA:!0};return m(s,r,e)}).then(t=>f(e||!i.isFreeAccessEnabled(),t)).then(()=>{const t=e?"jwt.auth.free.access.updated.msg":"jwt.auth.free.access.status";E.success(d.instant(t,{status:d.instant("enabled.status")}))}).catch(e=>{"cancel"!==e&&E.error(e.data??e,d.instant("common.error"))}):f(!p.hasFreeAccess()).then(()=>{E.success(d.instant("jwt.auth.free.access.status",{status:d.instant("disabled.status")}))}).catch(e=>{E.error(e.data,d.instant("common.error"))})};const m=(r,s,i)=>t.open({templateUrl:"js/angular/security/templates/modal/default-authorities.html",controller:"DefaultAuthoritiesCtrl",resolve:{data:function(){return{defaultAuthorities:function(){const t={[o.aj]:{},[o.DX]:{},[o.w0]:{}},r=_.mapKeys(e.getRepositories(),function(e){return g.getLocationSpecificId(e)});return _.each(s,function(e){0===e.indexOf(o._5)?r.hasOwnProperty(e.substr(11))&&(t[o.DX][e.substr(11)]=!0):0===e.indexOf(o.xF)?r.hasOwnProperty(e.substr(10))&&(t[o.aj][e.substr(10)]=!0):0===e.indexOf(o.B1)&&r.hasOwnProperty(e.substr(8))&&(t[o.w0][e.substr(8)]=!0)}),t},appSettings:r}}}}).result.then(function(e){return s=e.authorities,r=e.appSettings,(0,n.mapAuthSettingsResponseToModel)({enabled:i||!p.hasFreeAccess(),appSettings:r,authorities:s})});e.editFreeAccess=function(){e.toggleFreeAccess(!0)},e.removeUser=function(t){c.openSimpleModal({title:d.instant("common.confirm.delete"),message:d.instant("security.confirm.delete.user",{name:t}),warning:!0}).result.then(function(){e.loader=!0,A.deleteUser(t).then(()=>e.getUsers()).catch(t=>{const s=getError(t);r.error(s,d.instant("common.error")),e.loader=!1})})},e.encodeURIComponent=function(e){return encodeURIComponent(e)}}]),i.controller("DefaultAuthoritiesCtrl",["$scope","$http","$uibModalInstance","data","$rootScope",function(e,t,r,s,i){const a=(0,n.service)(n.RepositoryService);e.grantedAuthorities=s.defaultAuthorities(),e.appSettings=s.appSettings,e.hasActiveLocation=function(){return!_.isEmpty(i.globalLocation)},e.getRepositories=function(){return i.globalRepositories},e.ok=function(){const t=[];e.repositoryCheckError=!0;for(const r in e.grantedAuthorities.WRITE_REPO)e.grantedAuthorities.WRITE_REPO[r]&&(t.push(o._5+r),t.push(o.xF+r),e.repositoryCheckError=!1);for(const r in e.grantedAuthorities.READ_REPO)e.grantedAuthorities.READ_REPO[r]&&-1===t.indexOf(o.xF+r)&&(t.push(o.xF+r),e.repositoryCheckError=!1);for(const r in e.grantedAuthorities.GRAPHQL)e.grantedAuthorities.GRAPHQL[r]&&-1===t.indexOf(o.B1+r)&&t.push(o.B1+r);e.repositoryCheckError||r.close({authorities:t,appSettings:e.appSettings})},e.cancel=function(){r.dismiss("cancel")},e.createUniqueKey=function(e){return a.getLocationSpecificId(e)}}]),i.controller("CommonUserCtrl",["$rootScope","$scope","$http","toastr","$window","$timeout","$location","$jwtAuth","$translate","passwordPlaceholder",function(e,t,r,i,a,c,u,d,p,l){const h=(0,n.service)(n.AuthorizationService),E=(0,n.service)(n.RepositoryService);e.$on("$translateChangeSuccess",function(){t.passwordPlaceholder=p.instant(l)}),t.isAdmin=function(){return h.hasRole(s.gG.ROLE_ADMIN)},t.hasExternalAuth=function(){return d.hasExternalAuth()},t.hasEditRestrictions=function(){return t.user&&t.user.username===s.ut.ADMIN},t.isOverrideAuth=function(){return d.isDefaultAuthEnabled()},t.setGrantedAuthorities=function(){function e(...e){for(let r=0;r<e.length;r++){const s=e[r];_.indexOf(t.user.grantedAuthorities,s)<0&&t.user.grantedAuthorities.push(s)}}if(t.user.grantedAuthorities=[],t.repositoryCheckError=!0,t.userType===s.ut.ADMIN)t.repositoryCheckError=!1,e(s.gG.ROLE_ADMIN);else if(t.userType===s.ut.REPO_MANAGER)t.repositoryCheckError=!1,e(s.gG.ROLE_REPO_MANAGER);else{e(s.gG.ROLE_USER);for(const r in t.grantedAuthorities.WRITE_REPO)t.grantedAuthorities.WRITE_REPO[r]&&(t.repositoryCheckError=!1,e(o._5+r,o.xF+r));for(const r in t.grantedAuthorities.READ_REPO)t.grantedAuthorities.READ_REPO[r]&&(t.repositoryCheckError=!1,e(o.xF+r));for(const r in t.grantedAuthorities.GRAPHQL)t.grantedAuthorities.GRAPHQL[r]&&e(o.B1+r)}t.customRoles&&t.customRoles.forEach(t=>e("CUSTOM_"+t))},t.$watch("userType",function(){t.isUser()||(t.customRoles="")}),t.isUser=function(){return t.userType===s.ut.USER},t.hasReadPermission=function(e){const r=E.getLocationSpecificId(e);return t.userType===s.ut.ADMIN||t.userType===s.ut.REPO_MANAGER||e.id!==o.n5&&(t.grantedAuthorities.READ_REPO["*"]||t.grantedAuthorities.WRITE_REPO["*"])||t.grantedAuthorities.READ_REPO[r]||t.grantedAuthorities.WRITE_REPO[r]},t.hasWritePermission=function(e){const r=E.getLocationSpecificId(e);return t.userType===s.ut.ADMIN||t.userType===s.ut.REPO_MANAGER||e.id!==o.n5&&t.grantedAuthorities.WRITE_REPO["*"]||t.grantedAuthorities.WRITE_REPO[r]},t.hasGraphqlPermission=function(e){const r=E.getLocationSpecificId(e);return e.id!==o.n5&&t.grantedAuthorities.GRAPHQL["*"]||t.grantedAuthorities.GRAPHQL[r]},t.readCheckDisabled=function(e){return t.hasWritePermission(e)||e.id!==o.n5&&"*"!==e&&t.grantedAuthorities.READ_REPO["*"]||t.hasEditRestrictions()},t.writeCheckDisabled=function(e){return t.userType===s.ut.ADMIN||t.userType===s.ut.REPO_MANAGER||e.id!==o.n5&&"*"!==e&&t.grantedAuthorities.WRITE_REPO["*"]||t.hasEditRestrictions()},t.graphqlCheckDisabled=function(e){if(t.userType===s.ut.ADMIN||t.userType===s.ut.REPO_MANAGER)return!0;if(t.hasEditRestrictions())return!0;if("*"!==e&&t.grantedAuthorities.GRAPHQL["*"])return!0;if("*"===e&&t.grantedAuthorities.GRAPHQL["*"])return!1;let r;r=null!==e&&"object"==typeof e?E.getLocationSpecificId(e):e;const o=t.grantedAuthorities.READ_REPO["*"],n=t.grantedAuthorities.WRITE_REPO["*"],i=t.grantedAuthorities.READ_REPO[r],a=t.grantedAuthorities.WRITE_REPO[r];return!(o||n||i||a)},t.createUniqueKey=function(e){return E.getLocationSpecificId(e)},t.userType=s.ut.USER,t.grantedAuthorities={[o.aj]:{},[o.DX]:{},[o.w0]:{}},t.validatePassword=function(){return t.noPassword?(t.passwordError="",t.confirmPasswordError="",!0):t.user.password!==t.user.confirmpassword?(t.user.password?(t.passwordError="",t.confirmPasswordError=p.instant("security.confirm.password")):(t.passwordError=p.instant("security.enter.password"),t.confirmPasswordError=""),!1):(t.passwordError="",t.confirmPasswordError="",!0)},t.isLocalAuthentication=function(){return"Local"===d.getAuthImplementation()},t.updateUser=function(){if(!t.validateForm())return!1;t.isLocalAuthentication()&&t.setGrantedAuthorities(),t.repositoryCheckError||t.updateUserHttp()},t.setNoPassword=function(){t.noPassword&&(t.user.password="",t.user.confirmpassword="",t.passwordError="",t.confirmPasswordError="")},t.shouldDisableSameAs=function(){const e=$("#sameAsCheck");return t.user&&!t.user.appSettings.DEFAULT_INFERENCE&&e.prop("checked")&&(e.prop("checked",!1),t.user.appSettings.DEFAULT_SAMEAS=!1),t.user&&!t.user.appSettings.DEFAULT_INFERENCE},t.isRoleValid=!0,t.addCustomRole=function(e){return t.isRoleValid=!0,e.text=e.text.toUpperCase(),e},t.isCustomRoleValid=function(e){return t.isRoleValid=e.text.length>=2,t.isRoleValid},t.checkUserInput=function(e){8!==e.keyCode&&46!==e.keyCode||(t.isRoleValid=!0)},t.removeErrorOnCut=function(){t.isRoleValid=!0}}]),i.controller("AddUserCtrl",["$scope","$http","toastr","$window","$timeout","$location","$jwtAuth","$controller","SecurityService","ModalService","$translate",function(e,t,r,o,i,a,c,u,d,p,l){angular.extend(this,u("CommonUserCtrl",{$scope:e,passwordPlaceholder:"security.password.placeholder"}));const h=(0,n.service)(n.UsersService);e.mode="add",e.saveButtonText=l.instant("common.create.btn"),e.goBack=function(){const t=i(function(){o.history.back()},100);e.$on("$destroy",function(){i.cancel(t)})},e.pageTitle=l.instant("view.create.user.title"),e.passwordPlaceholder=l.instant("security.password.placeholder"),e.user={username:"",password:"",confirmpassword:"",grantedAuthorities:[],appSettings:{DEFAULT_SAMEAS:!0,DEFAULT_INFERENCE:!0,EXECUTE_COUNT:!0,IGNORE_SHARED_QUERIES:!1,DEFAULT_VIS_GRAPH_SCHEMA:!0}},e.submit=function(){e.noPassword&&e.userType===s.ut.ADMIN?p.openSimpleModal({title:l.instant("security.create.admin"),message:l.instant("security.admin.login.warning"),warning:!0}).result.then(function(){e.createUser()}):e.createUser()},e.createUserHttp=function(){e.loader=!0;const t=new n.User({username:e.user.username,password:e.user.password,appSettings:new n.AppSettings(e.user.appSettings),authorities:new n.AuthorityList(e.user.grantedAuthorities)});h.createUser(t).then(()=>{r.success(l.instant("security.user.created",{name:e.user.username}));const t=i(function(){e.loader=!1,a.path("/users")},2e3);e.$on("$destroy",function(){i.cancel(t)})}).catch(async t=>{e.loader=!1,r.error(getError(t),l.instant("common.error"))})},e.createUser=function(){e.validateForm()&&(e.setGrantedAuthorities(),e.repositoryCheckError||e.createUserHttp())},e.validateForm=function(){let t=!0;return e.user.username?e.usernameError="":(e.usernameError=l.instant("security.enter.username"),t=!1),e.noPassword?(e.passwordError="",e.confirmPasswordError=""):(e.user.password?e.passwordError="":(e.passwordError=l.instant("security.enter.password"),t=!1),e.user.confirmpassword&&e.user.password===e.user.confirmpassword?e.confirmPasswordError="":(e.confirmPasswordError=l.instant("security.confirm.password"),t=!1)),t}}]),i.controller("EditUserCtrl",["$scope","$http","toastr","$window","$routeParams","$timeout","$location","$jwtAuth","$controller","SecurityService","ModalService","$translate",function(e,t,r,o,i,a,c,u,d,p,l,h){angular.extend(this,d("CommonUserCtrl",{$scope:e,passwordPlaceholder:"security.new.password"}));const E=(0,n.service)(n.UsersService),A=(0,n.service)(n.AuthorizationService),g=(0,n.service)(n.SecurityContextService);e.mode="edit",e.saveButtonText=h.instant("common.save.btn"),e.goBack=function(){const t=a(function(){o.history.back()},100);e.$on("$destroy",function(){a.cancel(t)})},e.params=i,e.pageTitle=h.instant("view.edit.user.title",{userId:e.params.userId}),e.passwordPlaceholder=h.instant("security.new.password"),e.userType=s.ut.USER;const f={DEFAULT_SAMEAS:!0,DEFAULT_INFERENCE:!0,EXECUTE_COUNT:!0,IGNORE_SHARED_QUERIES:!1,DEFAULT_VIS_GRAPH_SCHEMA:!0};A.hasRole(s.gG.ROLE_ADMIN)||c.url("settings"),e.getUserData=function(){E.getUser(e.params.userId).then(function(t){e.user={username:t.username},e.user.password="",e.user.confirmpassword="",e.user.external=t.external,e.user.appSettings=t.appSettings||f,e.userType=t.getUserType(),e.grantedAuthorities=t.authorities.toUIModel(),e.customRoles=t.authorities.getCustomRoles()}).catch(function(e){const t=getError(e);r.error(t,h.instant("common.error"))})},e.getUserData(),e.submit=function(){e.noPassword&&e.userType===s.ut.ADMIN?l.openSimpleModal({title:h.instant("security.save.admin.settings"),message:h.instant("security.admin.pass.unset"),warning:!0}).result.then(function(){e.updateUser()}):e.updateUser()},e.updateUserHttp=function(){e.loader=!0;const t=new n.User({username:e.user.username,password:e.noPassword?"":e.user.password||void 0,appSettings:new n.AppSettings(e.user.appSettings),authorities:new n.AuthorityList(e.user.grantedAuthorities)});E.updateUser(t).then(()=>{r.success(h.instant("security.user.updated",{name:e.user.username}));const t=a(function(){e.loader=!1,o.history.back()},2e3);e.$on("$destroy",function(){a.cancel(t)});const s=g.getAuthenticatedUser();e.user.username===s.username&&s.setAppSettings(new n.AppSettings(e.user.appSettings))}).catch(t=>{const s=getError(t);e.loader=!1,r.error(s,h.instant("common.error"))})},e.validateForm=function(){return e.validatePassword()}}]),i.controller("RolesMappingController",["$scope","toastr","SecurityService","$translate",function(e,t,r,s){e.debugMapping=function(e,t){const s=t.split(":");r.getRolesMapping({role:e,method:s[1],mapping:s[0]})},e.$on("repositoryIsSet",function(){r.getRoles().success(function(t){e.roleMappings=t,e.roles=_.keys(e.roleMappings),e.mappings=_.keys(e.roleMappings[e.roles[0]]);const r=_.map(e.roles,function(t){return[t,_.filter(e.roleMappings[t]).length]});e.roles=_.reverse(_.map(_.orderBy(r,function(e){return e[1]}),function(e){return e[0]}))}).error(function(r){const o=getError(r);e.loader=!1,t.error(o,s.instant("common.error"))})})}]),i.controller("DeleteUserCtrl",["$scope","$uibModalInstance","username",function(e,t,r){e.username=r,e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")}}])}};
|
|
2
|
-
//# sourceMappingURL=94229.
|
|
1
|
+
export const __webpack_esm_id__=94229;export const __webpack_esm_ids__=[33760,48477,94229];export const __webpack_esm_modules__={33760(e,t,r){r.d(t,{B1:()=>c,DX:()=>i,_5:()=>u,aj:()=>o,n5:()=>s,w0:()=>a,xF:()=>n});const s="SYSTEM",o="READ_REPO",n="READ_REPO_",i="WRITE_REPO",a="GRAPHQL",u="WRITE_REPO_",c="GRAPHQL_"},48477(){angular.module("graphdb.framework.security.directives",[]).directive("customPrefixTagsInput",function(){return{restrict:"A",link:function(e,t,r){const s=[];function o(e){return e.startsWith("CUSTOM_")||e.startsWith("!CUSTOM_")}const n="tags-input"===t[0].nodeName.toLowerCase();if(n&&r.ngModel){const i=t.controller("ngModel");n&&(i.$parsers.push(function(e){return Array.isArray(e)&&(i.$warning=e.some(e=>o(e))),e}),s.push(e.$watch(r.ngModel,function(e){Array.isArray(e)&&(i.$warning=e.some(e=>o(e)))},!0)))}s.push(e.$on("$destroy",()=>{s.forEach(e=>e())}))}}})},94229(e,t,r){r(82493),r(98599),r(2243);var s=r(92900),o=(r(48477),r(33760)),n=r(57154);const i=angular.module("graphdb.framework.security.controllers",["ngCookies","ui.bootstrap","graphdb.framework.core.services.jwtauth","graphdb.framework.core.services.security-service","toastr","ngTagsInput"]);i.controller("UsersCtrl",["$scope","$uibModal","toastr","$window","$jwtAuth","$timeout","ModalService","SecurityService","$translate",function(e,t,r,s,i,a,u,c,d){const p=(0,n.service)(n.AuthorizationService),l=(0,n.service)(n.AuthenticationService),h=(0,n.service)(n.SecurityService),E=(0,n.service)(n.OntoToastrService),A=(0,n.service)(n.UsersService),g=(0,n.service)(n.RepositoryService);e.usersData=[],e.loader=!0,e.securityEnabled=function(){return l.isSecurityEnabled()},e.hasExternalAuth=function(){return i.hasExternalAuth()},e.getAuthImplementation=function(){return i.getAuthImplementation()},e.freeAccessEnabled=function(){return p.hasFreeAccess()},e.getUsers=()=>A.getUsers().then(function(t){e.usersData=t.map(e=>({username:e.username,dateCreated:e.dateCreated,userType:e.getUserType(),userTypeDescription:e.getUserTypeDescription(),repositories:e.authorities.getRepositoriesPermissions(),customRoles:e.authorities.getCustomRoles()})),e.loader=!1}).catch(function(t){const s=getError(t);r.error(s,d.instant("common.error")),e.loader=!1}),e.getUsers(),e.$on("repositoryIsSet",function(){e.getUsers()}),e.toggleSecurity=function(){const e=l.isSecurityEnabled();i.toggleSecurity(!e).then(()=>{s.location.reload()})};const m=function(e,t){return h.setFreeAccess(e,t)};e.toggleFreeAccess=function(e){!p.hasFreeAccess()||p.hasFreeAccess()&&e?h.getFreeAccess().then(t=>{const r=(0,n.mapGrantedAuthoritiesResponseToModel)(t.authorities).getItems(),s=t.appSettings??{DEFAULT_SAMEAS:!0,DEFAULT_INFERENCE:!0,EXECUTE_COUNT:!0,IGNORE_SHARED_QUERIES:!1,DEFAULT_VIS_GRAPH_SCHEMA:!0};return f(s,r,e)}).then(t=>m(e||!i.isFreeAccessEnabled(),t)).then(()=>{const t=e?"jwt.auth.free.access.updated.msg":"jwt.auth.free.access.status";E.success(d.instant(t,{status:d.instant("enabled.status")}))}).catch(e=>{"cancel"!==e&&E.error(e.data??e,d.instant("common.error"))}):m(!p.hasFreeAccess()).then(()=>{E.success(d.instant("jwt.auth.free.access.status",{status:d.instant("disabled.status")}))}).catch(e=>{E.error(e.data,d.instant("common.error"))})};const f=(r,s,i)=>t.open({templateUrl:"js/angular/security/templates/modal/default-authorities.html",controller:"DefaultAuthoritiesCtrl",resolve:{data:function(){return{defaultAuthorities:function(){const t={[o.aj]:{},[o.DX]:{},[o.w0]:{}},r=_.mapKeys(e.getRepositories(),function(e){return g.getLocationSpecificId(e)});return _.each(s,function(e){0===e.indexOf(o._5)?r.hasOwnProperty(e.substr(11))&&(t[o.DX][e.substr(11)]=!0):0===e.indexOf(o.xF)?r.hasOwnProperty(e.substr(10))&&(t[o.aj][e.substr(10)]=!0):0===e.indexOf(o.B1)&&r.hasOwnProperty(e.substr(8))&&(t[o.w0][e.substr(8)]=!0)}),t},appSettings:r}}}}).result.then(function(e){return s=e.authorities,r=e.appSettings,(0,n.mapAuthSettingsResponseToModel)({enabled:i||!p.hasFreeAccess(),appSettings:r,authorities:s})});e.editFreeAccess=function(){e.toggleFreeAccess(!0)},e.removeUser=function(t){u.openSimpleModal({title:d.instant("common.confirm.delete"),message:d.instant("security.confirm.delete.user",{name:t}),warning:!0}).result.then(function(){e.loader=!0,A.deleteUser(t).then(()=>e.getUsers()).catch(t=>{const s=getError(t);r.error(s,d.instant("common.error")),e.loader=!1})})},e.encodeURIComponent=function(e){return encodeURIComponent(e)}}]),i.controller("DefaultAuthoritiesCtrl",["$scope","$http","$uibModalInstance","data","$rootScope",function(e,t,r,s,i){const a=(0,n.service)(n.RepositoryService);e.grantedAuthorities=s.defaultAuthorities(),e.appSettings=s.appSettings,e.hasActiveLocation=function(){return!_.isEmpty(i.globalLocation)},e.getRepositories=function(){return i.globalRepositories},e.ok=function(){const t=[];e.repositoryCheckError=!0;for(const r in e.grantedAuthorities.WRITE_REPO)e.grantedAuthorities.WRITE_REPO[r]&&(t.push(o._5+r),t.push(o.xF+r),e.repositoryCheckError=!1);for(const r in e.grantedAuthorities.READ_REPO)e.grantedAuthorities.READ_REPO[r]&&-1===t.indexOf(o.xF+r)&&(t.push(o.xF+r),e.repositoryCheckError=!1);for(const r in e.grantedAuthorities.GRAPHQL)e.grantedAuthorities.GRAPHQL[r]&&-1===t.indexOf(o.B1+r)&&t.push(o.B1+r);e.repositoryCheckError||r.close({authorities:t,appSettings:e.appSettings})},e.cancel=function(){r.dismiss("cancel")},e.createUniqueKey=function(e){return a.getLocationSpecificId(e)}}]),i.controller("CommonUserCtrl",["$rootScope","$scope","$http","toastr","$window","$timeout","$location","$jwtAuth","$translate","passwordPlaceholder",function(e,t,r,i,a,u,c,d,p,l){const h=(0,n.service)(n.AuthorizationService),E=(0,n.service)(n.RepositoryService);e.$on("$translateChangeSuccess",function(){t.passwordPlaceholder=p.instant(l)}),t.isAdmin=function(){return h.hasRole(s.gG.ROLE_ADMIN)},t.hasExternalAuth=function(){return d.hasExternalAuth()},t.hasEditRestrictions=function(){return t.user&&t.user.username===s.ut.ADMIN},t.isOverrideAuth=function(){return d.isDefaultAuthEnabled()},t.setGrantedAuthorities=function(){function e(...e){for(let r=0;r<e.length;r++){const s=e[r];_.indexOf(t.user.grantedAuthorities,s)<0&&t.user.grantedAuthorities.push(s)}}if(t.user.grantedAuthorities=[],t.repositoryCheckError=!0,t.userType===s.ut.ADMIN)t.repositoryCheckError=!1,e(s.gG.ROLE_ADMIN);else if(t.userType===s.ut.REPO_MANAGER)t.repositoryCheckError=!1,e(s.gG.ROLE_REPO_MANAGER);else{e(s.gG.ROLE_USER);for(const r in t.grantedAuthorities.WRITE_REPO)t.grantedAuthorities.WRITE_REPO[r]&&(t.repositoryCheckError=!1,e(o._5+r,o.xF+r));for(const r in t.grantedAuthorities.READ_REPO)t.grantedAuthorities.READ_REPO[r]&&(t.repositoryCheckError=!1,e(o.xF+r));for(const r in t.grantedAuthorities.GRAPHQL)t.grantedAuthorities.GRAPHQL[r]&&e(o.B1+r)}t.customRoles&&t.customRoles.forEach(t=>e("CUSTOM_"+t))},t.$watch("userType",function(){t.isUser()||(t.customRoles="")}),t.isUser=function(){return t.userType===s.ut.USER},t.hasReadPermission=function(e){const r=E.getLocationSpecificId(e);return t.userType===s.ut.ADMIN||t.userType===s.ut.REPO_MANAGER||e.id!==o.n5&&(t.grantedAuthorities.READ_REPO["*"]||t.grantedAuthorities.WRITE_REPO["*"])||t.grantedAuthorities.READ_REPO[r]||t.grantedAuthorities.WRITE_REPO[r]},t.hasWritePermission=function(e){const r=E.getLocationSpecificId(e);return t.userType===s.ut.ADMIN||t.userType===s.ut.REPO_MANAGER||e.id!==o.n5&&t.grantedAuthorities.WRITE_REPO["*"]||t.grantedAuthorities.WRITE_REPO[r]},t.hasGraphqlPermission=function(e){const r=E.getLocationSpecificId(e);return e.id!==o.n5&&t.grantedAuthorities.GRAPHQL["*"]||t.grantedAuthorities.GRAPHQL[r]},t.readCheckDisabled=function(e){return t.hasWritePermission(e)||e.id!==o.n5&&"*"!==e&&t.grantedAuthorities.READ_REPO["*"]||t.hasEditRestrictions()},t.writeCheckDisabled=function(e){return t.userType===s.ut.ADMIN||t.userType===s.ut.REPO_MANAGER||e.id!==o.n5&&"*"!==e&&t.grantedAuthorities.WRITE_REPO["*"]||t.hasEditRestrictions()},t.graphqlCheckDisabled=function(e){if(t.userType===s.ut.ADMIN||t.userType===s.ut.REPO_MANAGER)return!0;if(t.hasEditRestrictions())return!0;if("*"!==e&&t.grantedAuthorities.GRAPHQL["*"])return!0;if("*"===e&&t.grantedAuthorities.GRAPHQL["*"])return!1;let r;r=null!==e&&"object"==typeof e?E.getLocationSpecificId(e):e;const o=t.grantedAuthorities.READ_REPO["*"],n=t.grantedAuthorities.WRITE_REPO["*"],i=t.grantedAuthorities.READ_REPO[r],a=t.grantedAuthorities.WRITE_REPO[r];return!(o||n||i||a)},t.createUniqueKey=function(e){return E.getLocationSpecificId(e)},t.userType=s.ut.USER,t.grantedAuthorities={[o.aj]:{},[o.DX]:{},[o.w0]:{}},t.validatePassword=function(){return t.noPassword?(t.passwordError="",t.confirmPasswordError="",!0):t.user.password!==t.user.confirmpassword?(t.user.password?(t.passwordError="",t.confirmPasswordError=p.instant("security.confirm.password")):(t.passwordError=p.instant("security.enter.password"),t.confirmPasswordError=""),!1):(t.passwordError="",t.confirmPasswordError="",!0)},t.isLocalAuthentication=function(){return"Local"===d.getAuthImplementation()},t.updateUser=function(){if(!t.validateForm())return!1;t.isLocalAuthentication()&&t.setGrantedAuthorities(),t.repositoryCheckError||t.updateUserHttp()},t.setNoPassword=function(){t.noPassword&&(t.user.password="",t.user.confirmpassword="",t.passwordError="",t.confirmPasswordError="")},t.shouldDisableSameAs=function(){const e=$("#sameAsCheck");return t.user&&!t.user.appSettings.DEFAULT_INFERENCE&&e.prop("checked")&&(e.prop("checked",!1),t.user.appSettings.DEFAULT_SAMEAS=!1),t.user&&!t.user.appSettings.DEFAULT_INFERENCE},t.isRoleValid=!0,t.addCustomRole=function(e){return t.isRoleValid=!0,e.text=e.text.toUpperCase(),e},t.isCustomRoleValid=function(e){return t.isRoleValid=e.text.length>=2,t.isRoleValid},t.checkUserInput=function(e){8!==e.keyCode&&46!==e.keyCode||(t.isRoleValid=!0)},t.removeErrorOnCut=function(){t.isRoleValid=!0}}]),i.controller("AddUserCtrl",["$scope","$http","toastr","$window","$timeout","$location","$jwtAuth","$controller","SecurityService","ModalService","$translate",function(e,t,r,o,i,a,u,c,d,p,l){angular.extend(this,c("CommonUserCtrl",{$scope:e,passwordPlaceholder:"security.password.placeholder"}));const h=(0,n.service)(n.UsersService);e.mode="add",e.saveButtonText=l.instant("common.create.btn"),e.goBack=function(){a.url("users")},e.pageTitle=l.instant("view.create.user.title"),e.passwordPlaceholder=l.instant("security.password.placeholder"),e.user={username:"",password:"",confirmpassword:"",grantedAuthorities:[],appSettings:{DEFAULT_SAMEAS:!0,DEFAULT_INFERENCE:!0,EXECUTE_COUNT:!0,IGNORE_SHARED_QUERIES:!1,DEFAULT_VIS_GRAPH_SCHEMA:!0}},e.submit=function(){e.noPassword&&e.userType===s.ut.ADMIN?p.openSimpleModal({title:l.instant("security.create.admin"),message:l.instant("security.admin.login.warning"),warning:!0}).result.then(function(){e.createUser()}):e.createUser()},e.createUserHttp=function(){e.loader=!0;const t=new n.User({username:e.user.username,password:e.user.password,appSettings:new n.AppSettings(e.user.appSettings),authorities:new n.AuthorityList(e.user.grantedAuthorities)});h.createUser(t).then(()=>{r.success(l.instant("security.user.created",{name:e.user.username}));const t=i(function(){e.loader=!1,a.path("/users")},2e3);e.$on("$destroy",function(){i.cancel(t)})}).catch(async t=>{e.loader=!1,r.error(getError(t),l.instant("common.error"))})},e.createUser=function(){e.validateForm()&&(e.setGrantedAuthorities(),e.repositoryCheckError||e.createUserHttp())},e.validateForm=function(){let t=!0;return e.user.username?e.usernameError="":(e.usernameError=l.instant("security.enter.username"),t=!1),e.noPassword?(e.passwordError="",e.confirmPasswordError=""):(e.user.password?e.passwordError="":(e.passwordError=l.instant("security.enter.password"),t=!1),e.user.confirmpassword&&e.user.password===e.user.confirmpassword?e.confirmPasswordError="":(e.confirmPasswordError=l.instant("security.confirm.password"),t=!1)),t}}]),i.controller("EditUserCtrl",["$scope","$http","toastr","$window","$routeParams","$timeout","$location","$jwtAuth","$controller","SecurityService","ModalService","$translate",function(e,t,r,o,i,a,u,c,d,p,l,h){angular.extend(this,d("CommonUserCtrl",{$scope:e,passwordPlaceholder:"security.new.password"}));const E=(0,n.service)(n.UsersService),A=(0,n.service)(n.AuthorizationService),g=(0,n.service)(n.SecurityContextService);e.mode="edit",e.saveButtonText=h.instant("common.save.btn"),e.goBack=function(){u.url("users")},e.params=i,e.pageTitle=h.instant("view.edit.user.title",{userId:e.params.userId}),e.passwordPlaceholder=h.instant("security.new.password"),e.userType=s.ut.USER;const m={DEFAULT_SAMEAS:!0,DEFAULT_INFERENCE:!0,EXECUTE_COUNT:!0,IGNORE_SHARED_QUERIES:!1,DEFAULT_VIS_GRAPH_SCHEMA:!0};A.hasRole(s.gG.ROLE_ADMIN)||u.url("settings"),e.getUserData=function(){E.getUser(e.params.userId).then(function(t){e.user={username:t.username},e.user.password="",e.user.confirmpassword="",e.user.external=t.external,e.user.appSettings=t.appSettings||m,e.userType=t.getUserType(),e.grantedAuthorities=t.authorities.toUIModel(),e.customRoles=t.authorities.getCustomRoles()}).catch(function(e){const t=getError(e);r.error(t,h.instant("common.error"))})},e.getUserData(),e.submit=function(){e.noPassword&&e.userType===s.ut.ADMIN?l.openSimpleModal({title:h.instant("security.save.admin.settings"),message:h.instant("security.admin.pass.unset"),warning:!0}).result.then(function(){e.updateUser()}):e.updateUser()},e.updateUserHttp=function(){e.loader=!0;const t=new n.User({username:e.user.username,password:e.noPassword?"":e.user.password||void 0,appSettings:new n.AppSettings(e.user.appSettings),authorities:new n.AuthorityList(e.user.grantedAuthorities)});E.updateUser(t).then(()=>{r.success(h.instant("security.user.updated",{name:e.user.username}));const t=a(function(){e.loader=!1,o.history.back()},2e3);e.$on("$destroy",function(){a.cancel(t)});const s=g.getAuthenticatedUser();e.user.username===s.username&&s.setAppSettings(new n.AppSettings(e.user.appSettings))}).catch(t=>{const s=getError(t);e.loader=!1,r.error(s,h.instant("common.error"))})},e.validateForm=function(){return e.validatePassword()}}]),i.controller("RolesMappingController",["$scope","toastr","SecurityService","$translate",function(e,t,r,s){e.debugMapping=function(e,t){const s=t.split(":");r.getRolesMapping({role:e,method:s[1],mapping:s[0]})},e.$on("repositoryIsSet",function(){r.getRoles().success(function(t){e.roleMappings=t,e.roles=_.keys(e.roleMappings),e.mappings=_.keys(e.roleMappings[e.roles[0]]);const r=_.map(e.roles,function(t){return[t,_.filter(e.roleMappings[t]).length]});e.roles=_.reverse(_.map(_.orderBy(r,function(e){return e[1]}),function(e){return e[0]}))}).error(function(r){const o=getError(r);e.loader=!1,t.error(o,s.instant("common.error"))})})}]),i.controller("DeleteUserCtrl",["$scope","$uibModalInstance","username",function(e,t,r){e.username=r,e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")}}])}};
|
|
2
|
+
//# sourceMappingURL=94229.5a853fae006f6ef633af.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"94229.5a853fae006f6ef633af.bundle.js","mappings":"sNAAO,MAAMA,EAAc,SACdC,EAAY,YACZC,EAAmB,aACnBC,EAAa,aACbC,EAAU,UACVC,EAAoB,cACpBC,EAAiB,U,UCN9BC,QACKC,OAAO,wCAAyC,IAChDC,UAAU,wBAiBf,WACI,MAAO,CACHC,SAAU,IACVC,KAAM,SAASC,EAAOC,EAASC,GAC3B,MAEMC,EAAgB,GAEtB,SAASC,EAAyBC,GAC9B,OAAOA,EAAIC,WALM,YAKsBD,EAAIC,WAJnB,WAK5B,CAGA,M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8I,KAAK1N,EAAOwN,aAAaxN,EAAOyN,MAAM,KAC1D,MAAMG,EAAmBhJ,EAAE3C,IAAIjC,EAAOyN,MAAO,SAASpF,GAClD,MAAO,CAACA,EAAMzD,EAAEiJ,OAAO7N,EAAOwN,aAAanF,IAAOL,OACtD,GACAhI,EAAOyN,MAAQ7I,EAAEkJ,QAAQlJ,EAAE3C,IAAI2C,EAAEmJ,QAAQH,EAAkB,SAASI,GAChE,OAAOA,EAAE,EACb,GAAI,SAASA,GACT,OAAOA,EAAE,EACb,GACJ,GACC/K,MAAM,SAASjB,GACZ,MAAMe,EAAMC,SAAShB,GACrBhC,EAAOuB,QAAS,EAChBrB,EAAO+C,MAAMF,EAAKvC,EAAW0C,QAAQ,gBACzC,EAKR,EACJ,IAEJnD,EAAed,WAAW,iBAAkB,CAAC,SAAU,oBAAqB,WAAY,SAASe,EAAQkG,EAAmB/D,GACxHnC,EAAOmC,SAAWA,EAElBnC,EAAOyG,GAAK,WACRP,EAAkBW,OACtB,EAEA7G,EAAO8G,OAAS,WACZZ,EAAkBa,QAAQ,SAC9B,CACJ,G","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/security/services/constants.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/security/directives/custom-prefix-tags-input.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/security/controllers.js"],"sourcesContent":["export const SYSTEM_REPO = 'SYSTEM';\nexport const READ_REPO = 'READ_REPO';\nexport const READ_REPO_PREFIX = 'READ_REPO_';\nexport const WRITE_REPO = 'WRITE_REPO';\nexport const GRAPHQL = 'GRAPHQL';\nexport const WRITE_REPO_PREFIX = 'WRITE_REPO_';\nexport const GRAPHQL_PREFIX = 'GRAPHQL_';\nexport const GRAPHQL_SUFFIX = 'GRAPHQL';\nexport const SUFFIX_DELIMITER = ':';\nexport const GRAPHQL_SUFFIX_WITH_DELIMITER = SUFFIX_DELIMITER + GRAPHQL_SUFFIX;\nexport const CUSTOM_PREFIX = 'CUSTOM_'\n","angular\n .module('graphdb.framework.security.directives', [])\n .directive('customPrefixTagsInput', customPrefixTagsInputDirective);\n\n/**\n * @ngdoc directive\n * @name customPrefixTagsInput\n * @module app\n * @restrict A\n * @description\n * The `customPrefixTagsInput` directive is used to check 'tags-input' for roles containing 'CUSTOM_' or '!CUSTOM_' prefix.\n *\n * If the value starts with either of these prefixes, a warning property will be set in ngModel.\n *\n * @usage\n * <tags-input custom-prefix-tags-input>{{yourModel.role}}</tags-input>\n *\n * @return {Object} Directive definition object with restrict and link properties.\n */\nfunction customPrefixTagsInputDirective() {\n return {\n restrict: 'A',\n link: function(scope, element, attrs) {\n const customPrefix = \"CUSTOM_\";\n const negatedCustomPrefix = \"!CUSTOM_\";\n const subscriptions = [];\n\n function hasCustomOrNegatedPrefix(tag) {\n return tag.startsWith(customPrefix) || tag.startsWith(negatedCustomPrefix);\n }\n\n // Check if the element is tags-input and has ngModel associated with it\n const isNgTagsInput = element[0].nodeName.toLowerCase() === 'tags-input';\n\n if (isNgTagsInput && attrs.ngModel) {\n const ngModelCtrl = element.controller('ngModel');\n\n if (isNgTagsInput) {\n ngModelCtrl.$parsers.push(function (viewValue) {\n if (Array.isArray(viewValue)) {\n ngModelCtrl.$warning = viewValue.some((tag) => hasCustomOrNegatedPrefix(tag));\n }\n return viewValue;\n });\n\n subscriptions.push(scope.$watch(attrs.ngModel, function (newVal) {\n if (Array.isArray(newVal)) {\n ngModelCtrl.$warning = newVal.some((tag) => hasCustomOrNegatedPrefix(tag));\n }\n }, true));\n }\n }\n\n const unsubscribeListeners = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n subscriptions.push(scope.$on('$destroy', unsubscribeListeners));\n }\n };\n}\n","import 'angular/core/services';\nimport 'angular/core/services/jwt-auth.service';\nimport 'angular/core/services/security.service';\nimport {UserRole, UserType} from 'angular/utils/user-utils';\nimport 'angular/security/directives/custom-prefix-tags-input.directive';\nimport {GRAPHQL, GRAPHQL_PREFIX, READ_REPO, READ_REPO_PREFIX, SYSTEM_REPO, WRITE_REPO, WRITE_REPO_PREFIX} from './services/constants';\nimport {\n AppSettings,\n AuthorityList,\n AuthorizationService,\n SecurityContextService,\n AuthenticationService,\n mapAuthSettingsResponseToModel,\n mapGrantedAuthoritiesResponseToModel,\n OntoToastrService,\n RepositoryService,\n SecurityService as SecurityServiceAPI,\n service,\n User,\n UsersService,\n} from '@ontotext/workbench-api';\n\nconst modules = [\n 'ngCookies',\n 'ui.bootstrap',\n 'graphdb.framework.core.services.jwtauth',\n 'graphdb.framework.core.services.security-service',\n 'toastr',\n 'ngTagsInput',\n];\n\nconst securityModule = angular.module('graphdb.framework.security.controllers', modules);\n\nsecurityModule.controller('UsersCtrl', ['$scope', '$uibModal', 'toastr', '$window', '$jwtAuth', '$timeout', 'ModalService', 'SecurityService', '$translate',\n function($scope, $uibModal, toastr, $window, $jwtAuth, $timeout, ModalService, SecurityService, $translate) {\n const authorizationService = service(AuthorizationService);\n const authenticationService = service(AuthenticationService);\n const securityServiceAPI = service(SecurityServiceAPI);\n const toastrService = service(OntoToastrService);\n const usersService = service(UsersService);\n const repositoryService = service(RepositoryService);\n\n // UI view-model\n $scope.usersData = [];\n\n $scope.loader = true;\n $scope.securityEnabled = function() {\n return authenticationService.isSecurityEnabled();\n };\n $scope.hasExternalAuth = function() {\n return $jwtAuth.hasExternalAuth();\n };\n $scope.getAuthImplementation = function() {\n return $jwtAuth.getAuthImplementation();\n };\n $scope.freeAccessEnabled = function() {\n return authorizationService.hasFreeAccess();\n };\n $scope.getUsers = () => {\n return usersService.getUsers()\n .then(function(data) {\n $scope.usersData = data.map((user) => ({\n username: user.username,\n dateCreated: user.dateCreated,\n userType: user.getUserType(),\n userTypeDescription: user.getUserTypeDescription(),\n repositories: user.authorities.getRepositoriesPermissions(),\n customRoles: user.authorities.getCustomRoles(),\n }));\n $scope.loader = false;\n }).catch(function(data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n $scope.getUsers();\n\n $scope.$on('repositoryIsSet', function() {\n $scope.getUsers();\n });\n\n $scope.toggleSecurity = function() {\n const isSecurityEnabled = authenticationService.isSecurityEnabled();\n $jwtAuth.toggleSecurity(!isSecurityEnabled)\n .then(() => {\n // reload UI\n // TODO: Not sure if we really need to reload the page here. The UI state is updated just fine. But maybe the reload is needed for something else?\n // Remove and fix this when migrated\n $window.location.reload();\n });\n };\n\n const setFreeAccess = function(enabled, authSettings) {\n // TODO: check this what app settings are provided here and if cookie settings should be updated in the storage\n return securityServiceAPI.setFreeAccess(enabled, authSettings);\n };\n\n /**\n * @param {boolean|undefined} updateFreeAccess - Whether to enable or disable free access. If undefined, the\n * free access has not been set yet.\n */\n $scope.toggleFreeAccess = function(updateFreeAccess) {\n if (!authorizationService.hasFreeAccess() || (authorizationService.hasFreeAccess() && updateFreeAccess)) {\n // enable and configure or only configure\n securityServiceAPI.getFreeAccess()\n .then((freeAccessAuthSettings) => {\n const authorities = mapGrantedAuthoritiesResponseToModel(freeAccessAuthSettings.authorities).getItems();\n const appSettings = freeAccessAuthSettings.appSettings ?? {\n 'DEFAULT_SAMEAS': true,\n 'DEFAULT_INFERENCE': true,\n 'EXECUTE_COUNT': true,\n 'IGNORE_SHARED_QUERIES': false,\n 'DEFAULT_VIS_GRAPH_SCHEMA': true,\n };\n return configureFreeAccess(appSettings, authorities, updateFreeAccess);\n })\n .then((updatedFreeAccessAuthSettings) => setFreeAccess(updateFreeAccess || !$jwtAuth.isFreeAccessEnabled(), updatedFreeAccessAuthSettings))\n .then(() => {\n const translateKey = updateFreeAccess ? 'jwt.auth.free.access.updated.msg' : 'jwt.auth.free.access.status';\n toastrService.success($translate.instant(translateKey, {status: $translate.instant('enabled.status')}));\n })\n .catch((err) => {\n if (err === 'cancel') {\n // Check if modal was dismissed by user\n return;\n }\n toastrService.error(err.data ?? err, $translate.instant('common.error'));\n });\n } else {\n // disable\n setFreeAccess(!authorizationService.hasFreeAccess())\n .then(() => {\n toastrService.success($translate.instant('jwt.auth.free.access.status', {status: ($translate.instant('disabled.status'))}));\n })\n .catch((err) => {\n toastrService.error(err.data, $translate.instant('common.error'));\n });\n }\n };\n\n const configureFreeAccess = (appSettings, authorities, updateFreeAccess) => {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/security/templates/modal/default-authorities.html',\n controller: 'DefaultAuthoritiesCtrl',\n resolve: {\n data: function() {\n return {\n // converts the array rights to hash ones. why, oh, why do we have both formats?\n defaultAuthorities: function() {\n const defaultAuthorities = {\n [READ_REPO]: {},\n [WRITE_REPO]: {},\n [GRAPHQL]: {},\n };\n // We might have old (no longer existing) repositories so we have to check that\n const repoIds = _.mapKeys($scope.getRepositories(), function(r) {\n return repositoryService.getLocationSpecificId(r);\n });\n _.each(authorities, function(a) {\n // indexOf works in IE 11, startsWith doesn't\n if (a.indexOf(WRITE_REPO_PREFIX) === 0) {\n if (repoIds.hasOwnProperty(a.substr(11))) {\n defaultAuthorities[WRITE_REPO][a.substr(11)] = true;\n }\n } else if (a.indexOf(READ_REPO_PREFIX) === 0) {\n if (repoIds.hasOwnProperty(a.substr(10))) {\n defaultAuthorities[READ_REPO][a.substr(10)] = true;\n }\n } else if (a.indexOf(GRAPHQL_PREFIX) === 0) {\n if (repoIds.hasOwnProperty(a.substr(8))) {\n defaultAuthorities[GRAPHQL][a.substr(8)] = true;\n }\n }\n });\n return defaultAuthorities;\n },\n appSettings: appSettings,\n };\n },\n },\n });\n return modalInstance.result.then(function(data) {\n authorities = data.authorities;\n appSettings = data.appSettings;\n return mapAuthSettingsResponseToModel({\n enabled: updateFreeAccess || !authorizationService.hasFreeAccess(),\n appSettings,\n authorities,\n });\n });\n };\n\n $scope.editFreeAccess = function() {\n $scope.toggleFreeAccess(true);\n };\n\n $scope.removeUser = function(username) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: $translate.instant('security.confirm.delete.user', {name: username}),\n warning: true,\n }).result.then(function() {\n $scope.loader = true;\n usersService.deleteUser(username)\n .then(() => $scope.getUsers())\n .catch((data) => {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n });\n };\n\n // Should be able to send the original username to $routeParams\n $scope.encodeURIComponent = function(name) {\n return encodeURIComponent(name);\n };\n }]);\n\nsecurityModule.controller('DefaultAuthoritiesCtrl', ['$scope', '$http', '$uibModalInstance', 'data', '$rootScope',\n function($scope, $http, $uibModalInstance, data, $rootScope) {\n const repositoryService = service(RepositoryService);\n\n $scope.grantedAuthorities = data.defaultAuthorities();\n $scope.appSettings = data.appSettings;\n\n $scope.hasActiveLocation = function() {\n // Hack to get this from root scope to avoid cyclic dependency\n return !_.isEmpty($rootScope.globalLocation);\n };\n\n $scope.getRepositories = function() {\n // Hack to get this from root scope to avoid cyclic dependency\n return $rootScope.globalRepositories;\n };\n\n $scope.ok = function() {\n const auth = [];\n $scope.repositoryCheckError = true;\n for (const index in $scope.grantedAuthorities.WRITE_REPO) {\n if ($scope.grantedAuthorities.WRITE_REPO[index]) {\n auth.push(WRITE_REPO_PREFIX + index);\n auth.push(READ_REPO_PREFIX + index);\n $scope.repositoryCheckError = false;\n }\n }\n for (const index in $scope.grantedAuthorities.READ_REPO) {\n if ($scope.grantedAuthorities.READ_REPO[index] && auth.indexOf(READ_REPO_PREFIX + index) === -1) {\n auth.push(READ_REPO_PREFIX + index);\n $scope.repositoryCheckError = false;\n }\n }\n for (const index in $scope.grantedAuthorities.GRAPHQL) {\n if ($scope.grantedAuthorities.GRAPHQL[index] && auth.indexOf(GRAPHQL_PREFIX + index) === -1) {\n auth.push(GRAPHQL_PREFIX + index);\n }\n }\n if (!$scope.repositoryCheckError) {\n $uibModalInstance.close({authorities: auth, appSettings: $scope.appSettings});\n }\n };\n\n $scope.cancel = function() {\n $uibModalInstance.dismiss('cancel');\n };\n\n $scope.createUniqueKey = function(repository) {\n return repositoryService.getLocationSpecificId(repository);\n };\n }]);\n\nsecurityModule.controller('CommonUserCtrl', ['$rootScope', '$scope', '$http', 'toastr', '$window', '$timeout', '$location', '$jwtAuth', '$translate', 'passwordPlaceholder',\n function($rootScope, $scope, $http, toastr, $window, $timeout, $location, $jwtAuth, $translate, passwordPlaceholder) {\n const authorizationService = service(AuthorizationService);\n const repositoryService = service(RepositoryService);\n\n $rootScope.$on('$translateChangeSuccess', function() {\n $scope.passwordPlaceholder = $translate.instant(passwordPlaceholder);\n });\n $scope.isAdmin = function() {\n return authorizationService.hasRole(UserRole.ROLE_ADMIN);\n };\n $scope.hasExternalAuth = function() {\n return $jwtAuth.hasExternalAuth();\n };\n\n $scope.hasEditRestrictions = function() {\n return $scope.user && $scope.user.username === UserType.ADMIN;\n };\n\n $scope.isOverrideAuth = function() {\n return $jwtAuth.isDefaultAuthEnabled();\n };\n\n $scope.setGrantedAuthorities = function() {\n function pushAuthority(...authorities) {\n for (let i = 0; i < authorities.length; i++) {\n const authority = authorities[i];\n if (_.indexOf($scope.user.grantedAuthorities, authority) < 0) {\n $scope.user.grantedAuthorities.push(authority);\n }\n }\n }\n\n $scope.user.grantedAuthorities = [];\n\n $scope.repositoryCheckError = true;\n if ($scope.userType === UserType.ADMIN) {\n $scope.repositoryCheckError = false;\n pushAuthority(UserRole.ROLE_ADMIN);\n } else if ($scope.userType === UserType.REPO_MANAGER) {\n $scope.repositoryCheckError = false;\n pushAuthority(UserRole.ROLE_REPO_MANAGER);\n } else {\n pushAuthority(UserRole.ROLE_USER);\n for (const index in $scope.grantedAuthorities.WRITE_REPO) {\n if ($scope.grantedAuthorities.WRITE_REPO[index]) {\n $scope.repositoryCheckError = false;\n pushAuthority(WRITE_REPO_PREFIX + index, READ_REPO_PREFIX + index);\n }\n }\n for (const index in $scope.grantedAuthorities.READ_REPO) {\n if ($scope.grantedAuthorities.READ_REPO[index]) {\n $scope.repositoryCheckError = false;\n pushAuthority(READ_REPO_PREFIX + index);\n }\n }\n for (const index in $scope.grantedAuthorities.GRAPHQL) {\n if ($scope.grantedAuthorities.GRAPHQL[index]) {\n pushAuthority(GRAPHQL_PREFIX + index);\n }\n }\n }\n if ($scope.customRoles) {\n $scope.customRoles.forEach((role) => pushAuthority('CUSTOM_' + role));\n }\n };\n\n $scope.$watch('userType', function() {\n if (!$scope.isUser()) {\n $scope.customRoles = '';\n }\n });\n\n $scope.isUser = function() {\n return $scope.userType === UserType.USER;\n };\n\n $scope.hasReadPermission = function(repository) {\n const uniqueKey = repositoryService.getLocationSpecificId(repository);\n return $scope.userType === UserType.ADMIN\n || $scope.userType === UserType.REPO_MANAGER\n || repository.id !== SYSTEM_REPO && ($scope.grantedAuthorities.READ_REPO['*']\n || $scope.grantedAuthorities.WRITE_REPO['*'])\n || $scope.grantedAuthorities.READ_REPO[uniqueKey]\n || $scope.grantedAuthorities.WRITE_REPO[uniqueKey];\n };\n\n $scope.hasWritePermission = function(repoOrWildCard) {\n const uniqueKey = repositoryService.getLocationSpecificId(repoOrWildCard);\n return $scope.userType === UserType.ADMIN\n || $scope.userType === UserType.REPO_MANAGER\n || repoOrWildCard.id !== SYSTEM_REPO && $scope.grantedAuthorities.WRITE_REPO['*']\n || $scope.grantedAuthorities.WRITE_REPO[uniqueKey];\n };\n\n $scope.hasGraphqlPermission = function(repository) {\n const uniqueKey = repositoryService.getLocationSpecificId(repository);\n return repository.id !== SYSTEM_REPO && $scope.grantedAuthorities.GRAPHQL['*']\n || $scope.grantedAuthorities.GRAPHQL[uniqueKey];\n };\n\n $scope.readCheckDisabled = function(repoOrWildCard) {\n return $scope.hasWritePermission(repoOrWildCard)\n || repoOrWildCard.id !== SYSTEM_REPO && repoOrWildCard !== '*' && $scope.grantedAuthorities.READ_REPO['*']\n || $scope.hasEditRestrictions();\n };\n\n $scope.writeCheckDisabled = function(repoOrWildCard) {\n return $scope.userType === UserType.ADMIN\n || $scope.userType === UserType.REPO_MANAGER\n || repoOrWildCard.id !== SYSTEM_REPO && repoOrWildCard !== '*' && $scope.grantedAuthorities.WRITE_REPO['*']\n || $scope.hasEditRestrictions();\n };\n\n /**\n * Determines whether the GraphQL checkbox for a given repository or wildcard\n * should be disabled.\n *\n * @param {Object|string} repoOrWildCard - A repo object or the string wildcard '*'\n * @returns {boolean} true if disabled, false if enabled\n */\n $scope.graphqlCheckDisabled = function(repoOrWildCard) {\n if ($scope.userType === UserType.ADMIN || $scope.userType === UserType.REPO_MANAGER) {\n return true;\n }\n\n if ($scope.hasEditRestrictions()) {\n return true;\n }\n\n if (repoOrWildCard !== '*' && $scope.grantedAuthorities.GRAPHQL['*']) {\n return true;\n }\n\n if (repoOrWildCard === '*' && $scope.grantedAuthorities.GRAPHQL['*']) {\n return false;\n }\n\n let uniqueKey;\n if (repoOrWildCard !== null && typeof repoOrWildCard === 'object') {\n uniqueKey = repositoryService.getLocationSpecificId(repoOrWildCard);\n } else {\n uniqueKey = repoOrWildCard;\n }\n\n const hasReadWildcard = $scope.grantedAuthorities.READ_REPO['*'];\n const hasWriteWildcard = $scope.grantedAuthorities.WRITE_REPO['*'];\n const hasReadForRepo = $scope.grantedAuthorities.READ_REPO[uniqueKey];\n const hasWriteForRepo = $scope.grantedAuthorities.WRITE_REPO[uniqueKey];\n\n return !(hasReadWildcard || hasWriteWildcard || hasReadForRepo || hasWriteForRepo);\n };\n\n $scope.createUniqueKey = function(repository) {\n return repositoryService.getLocationSpecificId(repository);\n };\n\n $scope.userType = UserType.USER;\n $scope.grantedAuthorities = {\n [READ_REPO]: {},\n [WRITE_REPO]: {},\n [GRAPHQL]: {},\n };\n\n $scope.validatePassword = function() {\n if ($scope.noPassword) {\n $scope.passwordError = '';\n $scope.confirmPasswordError = '';\n return true;\n }\n if ($scope.user.password !== $scope.user.confirmpassword) {\n if (!$scope.user.password) {\n $scope.passwordError = $translate.instant('security.enter.password');\n $scope.confirmPasswordError = '';\n } else {\n $scope.passwordError = '';\n $scope.confirmPasswordError = $translate.instant('security.confirm.password');\n }\n return false;\n } else {\n $scope.passwordError = '';\n $scope.confirmPasswordError = '';\n }\n return true;\n };\n\n $scope.isLocalAuthentication = function() {\n return $jwtAuth.getAuthImplementation() === 'Local';\n };\n\n $scope.updateUser = function() {\n if (!$scope.validateForm()) {\n return false;\n }\n\n if ($scope.isLocalAuthentication()) {\n $scope.setGrantedAuthorities();\n }\n\n if (!$scope.repositoryCheckError) {\n $scope.updateUserHttp();\n }\n };\n\n $scope.setNoPassword = function() {\n if ($scope.noPassword) {\n $scope.user.password = '';\n $scope.user.confirmpassword = '';\n $scope.passwordError = '';\n $scope.confirmPasswordError = '';\n }\n };\n\n $scope.shouldDisableSameAs = function() {\n const sameAsCheckbox = $('#sameAsCheck');\n if ($scope.user && !$scope.user.appSettings.DEFAULT_INFERENCE && sameAsCheckbox.prop('checked')) {\n sameAsCheckbox.prop('checked', false);\n $scope.user.appSettings.DEFAULT_SAMEAS = false;\n }\n\n return $scope.user && !$scope.user.appSettings.DEFAULT_INFERENCE;\n };\n\n /**\n * The validity of the last user typed custom role.\n * @type {boolean}\n */\n $scope.isRoleValid = true;\n const minTagLength = 2;\n\n /**\n * Adds the user typed custom role and sets role validity flag to true.\n *\n * @param {{text: string}} role the user input\n * @return {{text: string}} the user input in uppercase\n */\n $scope.addCustomRole = function(role) {\n $scope.isRoleValid = true;\n role.text = role.text.toUpperCase();\n return role;\n };\n\n /**\n * Checks if the input text is valid or not.\n *\n * @param {{text: string}} fieldValue the user input\n * @return {boolean} true if valid, otherwise false\n */\n $scope.isCustomRoleValid = function(fieldValue) {\n $scope.isRoleValid = fieldValue.text.length >= minTagLength;\n return $scope.isRoleValid;\n };\n\n /**\n * Checks if the user pressed the 'Backspace' or 'Delete' key and sets the role validity flag accordingly.\n *\n * @param {Object} event\n */\n $scope.checkUserInput = function(event) {\n // If the key pressed is the backspace or delete key, the tag error message will be hidden\n if (event.keyCode === 8 || event.keyCode === 46) {\n $scope.isRoleValid = true;\n }\n };\n\n /**\n * Sets the role validity flag to true.\n */\n $scope.removeErrorOnCut = function() {\n // If the user cuts text from the field, the tag error message will be hidden\n $scope.isRoleValid = true;\n };\n }]);\n\nsecurityModule.controller('AddUserCtrl', ['$scope', '$http', 'toastr', '$window', '$timeout', '$location', '$jwtAuth', '$controller', 'SecurityService', 'ModalService', '$translate',\n function($scope, $http, toastr, $window, $timeout, $location, $jwtAuth, $controller, SecurityService, ModalService, $translate) {\n // eslint-disable-next-line no-invalid-this\n angular.extend(this, $controller('CommonUserCtrl', {$scope: $scope, passwordPlaceholder: 'security.password.placeholder'}));\n const usersService = service(UsersService);\n\n $scope.mode = 'add';\n $scope.saveButtonText = $translate.instant('common.create.btn');\n $scope.goBack = function() {\n $location.url('users');\n };\n $scope.pageTitle = $translate.instant('view.create.user.title');\n $scope.passwordPlaceholder = $translate.instant('security.password.placeholder');\n\n $scope.user = {\n 'username': '',\n 'password': '',\n 'confirmpassword': '',\n 'grantedAuthorities': [],\n 'appSettings': {\n 'DEFAULT_SAMEAS': true,\n 'DEFAULT_INFERENCE': true,\n 'EXECUTE_COUNT': true,\n 'IGNORE_SHARED_QUERIES': false,\n 'DEFAULT_VIS_GRAPH_SCHEMA': true,\n },\n };\n\n $scope.submit = function() {\n if ($scope.noPassword && $scope.userType === UserType.ADMIN) {\n ModalService.openSimpleModal({\n title: $translate.instant('security.create.admin'),\n message: $translate.instant('security.admin.login.warning'),\n warning: true,\n }).result.then(function() {\n $scope.createUser();\n });\n } else {\n $scope.createUser();\n }\n };\n\n $scope.createUserHttp = function() {\n $scope.loader = true;\n const user = new User({\n username: $scope.user.username,\n password: $scope.user.password,\n appSettings: new AppSettings($scope.user.appSettings),\n authorities: new AuthorityList($scope.user.grantedAuthorities),\n });\n usersService.createUser(user)\n .then(() => {\n toastr.success($translate.instant('security.user.created', {name: $scope.user.username}));\n const timer = $timeout(function() {\n $scope.loader = false;\n $location.path('/users');\n }, 2000);\n $scope.$on('$destroy', function() {\n $timeout.cancel(timer);\n });\n })\n .catch(async (data) => {\n $scope.loader = false;\n toastr.error(getError(data), $translate.instant('common.error'));\n });\n };\n\n $scope.createUser = function() {\n if ($scope.validateForm()) {\n $scope.setGrantedAuthorities();\n\n if (!$scope.repositoryCheckError) {\n $scope.createUserHttp();\n }\n }\n };\n\n $scope.validateForm = function() {\n let result = true;\n if (!$scope.user.username) {\n $scope.usernameError = $translate.instant('security.enter.username');\n result = false;\n } else {\n $scope.usernameError = '';\n }\n if ($scope.noPassword) {\n $scope.passwordError = '';\n $scope.confirmPasswordError = '';\n } else {\n if (!$scope.user.password) {\n $scope.passwordError = $translate.instant('security.enter.password');\n result = false;\n } else {\n $scope.passwordError = '';\n }\n if (!$scope.user.confirmpassword || $scope.user.password !== $scope.user.confirmpassword) {\n $scope.confirmPasswordError = $translate.instant('security.confirm.password');\n result = false;\n } else {\n $scope.confirmPasswordError = '';\n }\n }\n\n return result;\n };\n }]);\n\nsecurityModule.controller('EditUserCtrl', ['$scope', '$http', 'toastr', '$window', '$routeParams', '$timeout', '$location', '$jwtAuth', '$controller', 'SecurityService', 'ModalService', '$translate',\n function($scope, $http, toastr, $window, $routeParams, $timeout, $location, $jwtAuth, $controller, SecurityService, ModalService, $translate) {\n // eslint-disable-next-line no-invalid-this\n angular.extend(this, $controller('CommonUserCtrl', {$scope: $scope, passwordPlaceholder: 'security.new.password'}));\n const usersService = service(UsersService);\n const authorizationService = service(AuthorizationService);\n const securityContextService = service(SecurityContextService);\n\n $scope.mode = 'edit';\n $scope.saveButtonText = $translate.instant('common.save.btn');\n $scope.goBack = function() {\n $location.url('users');\n };\n $scope.params = $routeParams;\n $scope.pageTitle = $translate.instant('view.edit.user.title', {userId: $scope.params.userId});\n $scope.passwordPlaceholder = $translate.instant('security.new.password');\n $scope.userType = UserType.USER;\n const defaultUserSettings = {\n 'DEFAULT_SAMEAS': true,\n 'DEFAULT_INFERENCE': true,\n 'EXECUTE_COUNT': true,\n 'IGNORE_SHARED_QUERIES': false,\n 'DEFAULT_VIS_GRAPH_SCHEMA': true,\n };\n\n if (!authorizationService.hasRole(UserRole.ROLE_ADMIN)) {\n $location.url('settings');\n }\n $scope.getUserData = function() {\n usersService.getUser($scope.params.userId).then(function(data) {\n $scope.user = {username: data.username};\n $scope.user.password = '';\n $scope.user.confirmpassword = '';\n $scope.user.external = data.external;\n $scope.user.appSettings = data.appSettings || defaultUserSettings;\n $scope.userType = data.getUserType();\n $scope.grantedAuthorities = data.authorities.toUIModel();\n $scope.customRoles = data.authorities.getCustomRoles();\n }).catch(function(data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n });\n };\n\n $scope.getUserData();\n\n $scope.submit = function() {\n if ($scope.noPassword && $scope.userType === UserType.ADMIN) {\n ModalService.openSimpleModal({\n title: $translate.instant('security.save.admin.settings'),\n message: $translate.instant('security.admin.pass.unset'),\n warning: true,\n }).result.then(function() {\n $scope.updateUser();\n });\n } else {\n $scope.updateUser();\n }\n };\n\n $scope.updateUserHttp = function() {\n $scope.loader = true;\n const user = new User({\n username: $scope.user.username,\n password: $scope.noPassword ? '' : $scope.user.password || undefined,\n appSettings: new AppSettings($scope.user.appSettings),\n authorities: new AuthorityList($scope.user.grantedAuthorities),\n });\n usersService.updateUser(user).then(() => {\n toastr.success($translate.instant('security.user.updated', {name: $scope.user.username}));\n const timer = $timeout(function() {\n $scope.loader = false;\n $window.history.back();\n }, 2000);\n $scope.$on('$destroy', function() {\n $timeout.cancel(timer);\n });\n // if we update the settings of the currently logged user, update the principal\n const principal = securityContextService.getAuthenticatedUser();\n if ($scope.user.username === principal.username) {\n // TODO: Discuss what's the point in updating the principal's appSettings here?!\n // principal.appSettings = $scope.user.appSettings;\n principal.setAppSettings(new AppSettings($scope.user.appSettings));\n }\n }).catch((data) => {\n const msg = getError(data);\n $scope.loader = false;\n toastr.error(msg, $translate.instant('common.error'));\n });\n };\n\n $scope.validateForm = function() {\n return $scope.validatePassword();\n };\n }]);\n\nsecurityModule.controller('RolesMappingController', ['$scope', 'toastr', 'SecurityService', '$translate',\n function($scope, toastr, SecurityService, $translate) {\n $scope.debugMapping = function(role, mapping) {\n const method = mapping.split(':');\n SecurityService.getRolesMapping({\n role: role,\n method: method[1],\n mapping: method[0],\n });\n };\n\n const loadRoles = function() {\n SecurityService.getRoles()\n .success(function(data) {\n $scope.roleMappings = data;\n $scope.roles = _.keys($scope.roleMappings);\n $scope.mappings = _.keys($scope.roleMappings[$scope.roles[0]]);\n const permissionsCount = _.map($scope.roles, function(role) {\n return [role, _.filter($scope.roleMappings[role]).length];\n });\n $scope.roles = _.reverse(_.map(_.orderBy(permissionsCount, function(p) {\n return p[1];\n }), function(p) {\n return p[0];\n }));\n })\n .error(function(data) {\n const msg = getError(data);\n $scope.loader = false;\n toastr.error(msg, $translate.instant('common.error'));\n });\n };\n\n $scope.$on('repositoryIsSet', function() {\n loadRoles();\n });\n }]);\n\nsecurityModule.controller('DeleteUserCtrl', ['$scope', '$uibModalInstance', 'username', function($scope, $uibModalInstance, username) {\n $scope.username = username;\n\n $scope.ok = function() {\n $uibModalInstance.close();\n };\n\n $scope.cancel = function() {\n $uibModalInstance.dismiss('cancel');\n };\n}]);\n"],"names":["SYSTEM_REPO","READ_REPO","READ_REPO_PREFIX","WRITE_REPO","GRAPHQL","WRITE_REPO_PREFIX","GRAPHQL_PREFIX","angular","module","directive","restrict","link","scope","element","attrs","subscriptions","hasCustomOrNegatedPrefix","tag","startsWith","isNgTagsInput","nodeName","toLowerCase","ngModel","ngModelCtrl","controller","$parsers","push","viewValue","Array","isArray","$warning","some","$watch","newVal","$on","unsubscribeListeners","forEach","subscription","securityModule","$scope","$uibModal","toastr","$window","$jwtAuth","$timeout","ModalService","SecurityService","$translate","authorizationService","service","AuthorizationService","authenticationService","AuthenticationService","securityServiceAPI","SecurityServiceAPI","toastrService","OntoToastrService","usersService","UsersService","repositoryService","RepositoryService","usersData","loader","securityEnabled","isSecurityEnabled","hasExternalAuth","getAuthImplementation","freeAccessEnabled","hasFreeAccess","getUsers","then","data","map","user","username","dateCreated","userType","getUserType","userTypeDescription","getUserTypeDescription","repositories","authorities","getRepositoriesPermissions","customRoles","getCustomRoles","catch","msg","getError","error","instant","toggleSecurity","location","reload","setFreeAccess","enabled","authSettings","toggleFreeAccess","updateFreeAccess","getFreeAccess","freeAccessAuthSettings","mapGrantedAuthoritiesResponseToModel","getItems","appSettings","configureFreeAccess","updatedFreeAccessAuthSettings","isFreeAccessEnabled","translateKey","success","status","err","open","templateUrl","resolve","defaultAuthorities","repoIds","_","mapKeys","getRepositories","r","getLocationSpecificId","each","a","indexOf","hasOwnProperty","substr","result","mapAuthSettingsResponseToModel","editFreeAccess","removeUser","openSimpleModal","title","message","name","warning","deleteUser","encodeURIComponent","$http","$uibModalInstance","$rootScope","grantedAuthorities","hasActiveLocation","isEmpty","globalLocation","globalRepositories","ok","auth","repositoryCheckError","index","close","cancel","dismiss","createUniqueKey","repository","$location","passwordPlaceholder","isAdmin","hasRole","UserRole","ROLE_ADMIN","hasEditRestrictions","UserType","ADMIN","isOverrideAuth","isDefaultAuthEnabled","setGrantedAuthorities","pushAuthority","i","length","authority","REPO_MANAGER","ROLE_REPO_MANAGER","ROLE_USER","role","isUser","USER","hasReadPermission","uniqueKey","id","hasWritePermission","repoOrWildCard","hasGraphqlPermission","readCheckDisabled","writeCheckDisabled","graphqlCheckDisabled","hasReadWildcard","hasWriteWildcard","hasReadForRepo","hasWriteForRepo","validatePassword","noPassword","passwordError","confirmPasswordError","password","confirmpassword","isLocalAuthentication","updateUser","validateForm","updateUserHttp","setNoPassword","shouldDisableSameAs","sameAsCheckbox","$","DEFAULT_INFERENCE","prop","DEFAULT_SAMEAS","isRoleValid","addCustomRole","text","toUpperCase","isCustomRoleValid","fieldValue","checkUserInput","event","keyCode","removeErrorOnCut","$controller","extend","this","mode","saveButtonText","goBack","url","pageTitle","submit","createUser","createUserHttp","User","AppSettings","AuthorityList","timer","path","async","usernameError","$routeParams","securityContextService","SecurityContextService","params","userId","defaultUserSettings","getUserData","getUser","external","toUIModel","undefined","history","back","principal","getAuthenticatedUser","setAppSettings","debugMapping","mapping","method","split","getRolesMapping","getRoles","roleMappings","roles","keys","mappings","permissionsCount","filter","reverse","orderBy","p"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=95953;export const __webpack_esm_ids__=[40618,62608,65191,95953];export const __webpack_esm_modules__={40618(){angular.module("graphdb.framework.core.directives.multiselect",[]).directive("multiSelectDropdown",function(){return{restrict:"E",scope:{items:"=",placeholder:"@?",onChange:"&?",labelKeys:"=?"},templateUrl:"js/angular/core/directives/multiselect-search/templates/multiselect-search.html",controller:["$scope","$document","$element","$filter","$timeout",function(e,t,o,n,r){e.open=!1,e.search={query:""},e.visibleItems=[];const i=[],a=e=>null===e?"":(""+e).toLowerCase(),s=()=>{const t=Array.isArray(e.items)?e.items:[],o=a(e.search.query);e.visibleItems=o?t.filter(e=>a(e.label).includes(o)):t},l=t=>{e.open&&(o[0].contains(t.target)||e.$applyAsync(function(){e.open=!1}))};e.toggleOpen=function(t){t&&t.stopPropagation(),e.open=!e.open,e.open&&r(function(){const e=o[0].querySelector(".multiselect-search");e&&e.focus()})},e.onKeydownMenu=function(t){"Escape"===t.key&&(e.open=!1,t.stopPropagation(),t.preventDefault(),r(function(){const e=o[0].querySelector(".multiselect-button");e&&e.focus()}))},e.selectedCount=function(){return Array.isArray(e.items)?e.items.filter(e=>e.selected).length:0},e.allFilteredSelected=function(){const t=e.visibleItems||[];return 0!==t.length&&t.every(e=>e.selected)},e.someFilteredSelected=function(){const t=e.visibleItems||[],o=t.some(e=>e.selected),n=t.every(e=>e.selected);return o&&!n},e.toggleSelectAll=function(t){t&&t.stopPropagation();const o=e.visibleItems||[],n=!e.allFilteredSelected();for(const e of o)e.selected=n;e.emitChange()},e.emitChange=function(){if("function"==typeof e.onChange){const t=(e.items||[]).filter(e=>e.selected);e.onChange({selected:t})}},t.on("click",l),i.push(e.$watch("search.query",s),e.$watchCollection("items",s)),e.$on("$destroy",()=>{t.off("click",l);for(const e of i)e()}),s()}]}})},62608(e,t,o){o.d(t,{X:()=>n});const n={SIMILARITY:"similarity",ELASTICSEARCH:"elasticsearch",OPENSEARCH:"opensearch"}},65191(){function e(e,t,o,n,r){e.externalIntegrationConfiguration=r.externalIntegrationConfiguration,e.difyExtension=r.difyExtensionUrl,e.queryMethods=r.queryMethodsUrl,e.agentId=r.agentId,e.agentName=r.agentName,e.close=()=>{t.dismiss({})},e.onCloseExternalIntegrationConfigurationModal=()=>{t.dismiss({})}}angular.module("graphdb.framework.ttyg.controllers.external-integration-configuration-modal",[]).controller("ExternalIntegrationConfigurationModalController",e),e.$inject=["$scope","$uibModalInstance","ModalService","$translate","dialogModel"]},84430(e,t,o){o(65191);var n=o(70826);function r(e,t,o){return{open:function(r){return t.getExternalUrl().then(t=>{const o=function(e,t){return{agentName:e.name,agentId:e.id,queryMethodsUrl:`${t}/rest/llm/tool/ttyg/${e.id}`,difyExtensionUrl:`${t}/rest/llm/ttyg/${e.id}/dify`}}(r,t.data);return e.open({templateUrl:"js/angular/ttyg/templates/modal/external-integration-configuration-modal.html",controller:"ExternalIntegrationConfigurationModalController",windowClass:"external-integration-configuration-modal",backdrop:"static",resolve:{dialogModel:()=>o}}).result.then(()=>{}).catch(()=>{})}).catch(e=>{o.error(getError(e,0,n.LE))})}}}angular.module("graphdb.framework.ttyg.services.externalIntegrationModal",["graphdb.framework.ttyg.controllers.external-integration-configuration-modal"]).factory("ExternalIntegrationModalService",r),r.$inject=["$uibModal","LocationsRestService","toastr"]},95953(e,t,o){var n=o(60529),r=o(28319),i=(o(51682),o(66989),o(36665),o(40618),o(69289),o(17187),o(84430),o(51445)),a=o(71920),s=o(70826),l=o(16135),c=o(76076),d=o(304),g=o(38940),m=o(62608);const u=d.I.logger;function p(e,t,o,d,p,y,h,I,f,v,S,E,M,F,x,_,C,A,T){e.AGENT_OPERATION=s.A1,e.operation=E.operation,e.savingAgent=!1,e.agentFormModel=E.agentFormModel,e.activeRepositoryInfo=E.activeRepositoryInfo,e.extractionMethodLoaderFlags={[r.Ht.SIMILARITY]:!1},e.activeRepositoryList=E.activeRepositoryList,e.extractionMethods=r.Ht,e.additionalExtractionMethods=r.eA,e.ExtractionMethodTemplates=x,e.showAdvancedSettings=!1,e.showHighTemperatureWarning=!1,e.showSystemInstructionWarning=!1,e.retrievalConnectors=[],e.ftsEnabled=!1,e.autocompleteSuggestions=[],e.showContextSize=null!==e.agentFormModel.contextSize,e.vectorFields=[],e.documentationUrlForSimilarity=c.m.getDocumentationUrl(T.productShortVersion,"talk-to-graph.html#prerequisites-and-configuration"),e.similarityOptionsGrouped=[],e.toggleExtractionMethod=t=>{t.expanded=t.selected,e.agentSettingsForm.extractionMethods.$setTouched(),k(),j[t.method](t)},e.onExtractionMethodPanelToggle=e=>{e.toggleCollapse(),j[e.method](e)},e.toggleAdditionalExtractionMethod=t=>{t.expanded=t.selected,e.checkAutocompleteIndexEnabled(),q[t.method](t)},e.onAdditionalExtractionMethodPanelToggle=e=>{e.toggleCollapse(),q[e.method](e)},e.helpInfoForModel={ttygHelpInfo:function(){const e=(0,n.Gz)(S.instant("ttyg.agent.create_agent_modal.form.model.hint"));return I.trustAsHtml(e)}(),linkText:S.instant("ttyg.agent.create_agent_modal.form.model.link_text"),documentationUrl:c.m.getDocumentationUrl(T.productShortVersion,"talk-to-graph.html#prerequisites-and-configuration")},e.getFTSDisabledHelpMessage=()=>{const t=(0,n.Gz)(S.instant("ttyg.agent.create_agent_modal.form.fts_search.fts_disabled_message",{repositoryEditPage:"repository/edit/"+e.agentFormModel.repositoryId}));return I.trustAsHtml(t)},e.goToAutocompleteView=t=>{t.preventDefault(),M.emit(a.I.GO_TO_AUTOCOMPLETE_INDEX_VIEW,{repositoryId:e.agentFormModel.repositoryId})},e.goToCreateSimilarityView=t=>{t.preventDefault(),M.emit(a.I.GO_TO_CREATE_SIMILARITY_VIEW,{repositoryId:e.agentFormModel.repositoryId})},e.goToConnectorsView=t=>{t.preventDefault(),M.emit(a.I.GO_TO_CONNECTORS_VIEW,{repositoryId:e.agentFormModel.repositoryId})},e.ok=()=>{const t=e.agentFormModel.toPayload();return R[e.operation](t)},e.cancel=()=>{t.dismiss({})},e.close=()=>{t.dismiss({})},e.updateSimilaritySearchPanel=(t=!1)=>{const o=e.agentFormModel.assistantExtractionMethods.getSimilarityExtractionMethod();o.selected?(t&&(o.similarityIndex=null),H(o,!0)):e.agentSettingsForm.$setValidity("FTSDisabled",!0)},e.updateRetrievalConnectorPanel=(t=!1)=>{const o=e.agentFormModel.assistantExtractionMethods.getRetrievalExtractionMethod();o.selected&&(t&&(o.retrievalConnectorInstance=null),N(o))},e.checkIfFTSEnabled=()=>{e.agentFormModel.repositoryId?e.agentFormModel.assistantExtractionMethods.getFTSSearchExtractionMethod().selected?(e.extractionMethodLoaderFlags[r.Ht.FTS_SEARCH]=!0,h.getRepositoryModel({id:e.agentFormModel.repositoryId}).then(t=>{e.ftsEnabled=t.getParamValue(i.YF.enableFtsIndex)}).catch(e=>{O(e,"ttyg.agent.messages.error_repository_config_loading")}).finally(()=>{e.extractionMethodLoaderFlags[r.Ht.FTS_SEARCH]=!1,e.agentSettingsForm.$setValidity("FTSDisabled",e.ftsEnabled)})):e.agentSettingsForm.$setValidity("FTSDisabled",!0):e.agentSettingsForm.$setValidity("FTSDisabled",!1)},e.openExternalIntegrationConfig=()=>{const t=e.agentFormModel;A.open(t)},e.onRepositoryChange=()=>{Y(!0,!0)},e.checkAutocompleteIndexEnabled=t=>{if(t||(t=e.agentFormModel.additionalExtractionMethods.additionalExtractionMethods.find(e=>e.method===r.eA.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH)),t&&!t.selected||!e.agentFormModel.repositoryId)return;const o=V();_.checkAutocompleteStatus(o.repositoryId,o.repositoryLocation).then(t=>{e.autocompleteEnabled=t,e.agentSettingsForm.$setValidity("autocompleteDisabled",t)}).catch(t=>{e.agentSettingsForm.$setValidity("autocompleteDisabled",!1),f.error(getError(t))})},e.onRestoreDefaultContextSize=()=>{e.agentFormModel.contextSize=e.agentFormModel.contextSizeCopy},e.onRestoreDefaultSystemInstructions=()=>{e.agentFormModel.instructions.systemInstruction=e.agentFormModel.instructions.systemInstructionCopy},e.onRestoreDefaultUserInstructions=()=>{e.agentFormModel.instructions.userInstruction=e.agentFormModel.instructions.userInstructionCopy},e.onTemperatureChange=()=>{e.showHighTemperatureWarning=e.agentFormModel.temperature.value>1},e.onSystemInstructionChange=()=>{""===e.agentFormModel.instructions.systemInstruction||e.showSystemInstructionWarning||(e.showSystemInstructionWarning=!0,o.openModalAlert({title:S.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.title"),message:S.instant("ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.body")}).result.then(function(){})),""===e.agentFormModel.instructions.systemInstruction&&(e.showSystemInstructionWarning=!1)},e.onExplainAgentSettings=()=>{const t=e.agentFormModel.toPayload();F.explainAgentSettings(t).then(e=>{const t={templateUrl:"js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html",controller:"AgentInstructionsExplainModalController",windowClass:"agent-instructions-explain-modal",backdrop:"static",resolve:{dialogModel:function(){return{agentInstructionsExplain:e}}},size:"lg"};d.open(t).result.then(()=>{})}).catch(e=>{f.error(getError(e,0,s.LE))})},e.getSuggestions=t=>{const o=t.target.value;C.getAutocompleteSuggestions(o).then(l.C).then(t=>{e.autocompleteSuggestions=t.map(e=>({text:e.value}))}).catch(e=>{f.error(getError(e,0,s.LE))})},e.onVectorFieldsChange=function(e){e.connectorFields=e.selectedConnectorField?[e.selectedConnectorField]:[]},e.hasConnectorData=()=>!(!e.connectorMap||!Object.keys(e.connectorMap).length),e.shouldShowVectorFields=t=>{if(!t)return!1;const o=t.connectorType,n=t.similarityIndex;if(!D(o))return!1;if(Array.isArray(e.vectorFields))return e.vectorFields.length>0;const r=b(o,n);return Array.isArray(r)&&r.length>0},e.onSimilarityIndexChange=t=>{const o=t&&t.similarityIndexOption;if(t.selectedConnectorField=void 0,t.connectorFields=[],!o)return t.connectorType=null,t.similarityIndex="",void(e.vectorFields=[]);t.connectorType=o.provider,t.similarityIndex=o.value,e.vectorFields=b(o.provider,o.value)};const b=(t,o)=>{const n=e.connectorMap||{};return n[t]&&n[t][o]?n[t][o]:[]},R={[s.A1.CREATE]:e=>$(e),[s.A1.EDIT]:e=>w(e),[s.A1.CLONE]:e=>L(e)},$=o=>(e.savingAgent=!0,F.createAgent(o).then(e=>{t.close(e),f.success(S.instant("ttyg.agent.messages.agent_save_successfully",{agentName:e.name}))}).catch(e=>{f.error(getError(e,0,s.LE))}).finally(()=>{e.savingAgent=!1})),w=o=>(e.savingAgent=!0,F.editAgent(o).then(e=>{t.close(e),f.success(S.instant("ttyg.agent.messages.agent_save_successfully",{agentName:e.name}))}).catch(e=>{f.error(getError(e,0,s.LE))}).finally(()=>{e.savingAgent=!1})),L=o=>(e.savingAgent=!0,F.createAgent(o).then(e=>{t.close(e),f.success(S.instant("ttyg.agent.messages.agent_save_successfully",{agentName:e.name}))}).catch(e=>{f.error(getError(e,0,s.LE))}).finally(()=>{e.savingAgent=!1})),O=(e,t)=>{u.error(e),f.error(S.instant(t))},k=()=>{e.agentSettingsForm.extractionMethods.$setValidity("required",e.agentFormModel.hasExtractionMethodSelected())},V=()=>{const t=e.activeRepositoryList.find(t=>t.value===e.agentFormModel.repositoryId);return{repositoryId:t?t.data.repository.id:void 0,repositoryLocation:t?t.data.repository.location:void 0}},D=e=>e===m.X.OPENSEARCH||e===m.X.ELASTICSEARCH,H=(t,o=!1)=>{if(!t.selected)return void e.agentSettingsForm.$setValidity("missingIndex",!0);const n=e.agentSettingsForm&&e.agentSettingsForm.connectorInstances,r=!n||n.$pristine;if(e.connectorMap&&!r)return;if(!e.agentFormModel.repositoryId)return;e.extractionMethodLoaderFlags[t.method]=!0;const i=V();p.getSimilarityIndexesWithVectorFields(i.repositoryId).then(n=>{e.connectorMap=n;const r=U(n);(t=>{e.similarityOptionsGrouped=[],Object.entries(t).forEach(([t,o])=>{const n=S.instant(`ttyg.agent.create_agent_modal.form.similarity_instance_type_label.${t}`);Object.keys(o||{}).forEach(o=>{e.similarityOptionsGrouped.push({provider:t,label:o,value:o,group:n})})})})(n),P(r,t),(t=>{const o=t.connectorType,n=t.similarityIndex;D(o)?e.vectorFields=b(o,n):e.vectorFields=[]})(t),e.agentSettingsForm.$setValidity("missingIndex",!t.selected||e.hasConnectorData()),(o||t.connectorFields&&0===t.connectorFields.length)&&e.onSimilarityIndexChange(t)}).catch(t=>{e.connectorMap=null,e.agentSettingsForm.$setValidity("missingIndex",!1),O(t,"ttyg.agent.messages.error_similarity_indexes_loading")}).finally(()=>{e.extractionMethodLoaderFlags[t.method]=!1})},P=(t,o)=>{if(!t.length)return o.connectorType="",o.similarityIndex="",void(o.similarityIndexOption=void 0);const n=o.connectorType,r=o.similarityIndex,i=t.find(e=>e.data.connectorType===n&&e.value===r)||t[0];o.connectorType=i.data.connectorType,o.similarityIndex=i.value;const a=(e.similarityOptionsGrouped||[]).find(e=>e.provider===o.connectorType&&e.value===o.similarityIndex);o.similarityIndexOption=a||void 0},U=e=>{const t=[];return Object.entries(e).forEach(([e,o])=>{Object.entries(o).forEach(([o,n])=>{t.push(new g.rx({label:o,value:o,data:{connectorType:e,connectorFields:n}}))})}),t},N=t=>{if(!e.agentFormModel.repositoryId)return;if(!t.selected)return void e.agentSettingsForm.$setValidity("missingConnector",!0);e.extractionMethodLoaderFlags[t.method]=!0;const o=V();y.getConnectorPrefixByName("ChatGPT Retrieval",o.repositoryId,o.repositoryLocation).then(e=>y.getConnectorsByTypeAsSelectMenuOptions(e,o.repositoryId,o.repositoryLocation)).then(o=>{e.retrievalConnectors=o,e.agentSettingsForm.$setValidity("missingConnector",!t.selected||!(!o||!o.length)),G(e.retrievalConnectors,t)}).catch(t=>{e.agentSettingsForm.$setValidity("missingConnector",!1),O(t,"ttyg.agent.messages.error_retrieval_connectors_loading")}).finally(()=>{e.extractionMethodLoaderFlags[t.method]=!1})},G=(e,t)=>{if(0===e.length)return void(t.retrievalConnectorInstance=null);const o=e.find(e=>e.value===t.retrievalConnectorInstance);t.retrievalConnectorInstance=o?o.value:e[0].value},j={[r.Ht.FTS_SEARCH]:t=>{e.checkIfFTSEnabled()},[r.Ht.SPARQL]:e=>{},[r.Ht.SIMILARITY]:e=>H(e),[r.Ht.RETRIEVAL]:e=>N(e)},q={[r.eA.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH]:e=>W(e),[r.eA.IRI_DISCOVERY_SEARCH]:()=>{}},W=t=>{t.selected||e.agentSettingsForm.$setValidity("autocompleteDisabled",!0),e.checkAutocompleteIndexEnabled(t)},Y=(t=!1,o=!1)=>{e.checkIfFTSEnabled(),e.updateSimilaritySearchPanel(t),e.updateRetrievalConnectorPanel(o),e.checkAutocompleteIndexEnabled()},z=()=>{document.hidden||Y()},X=(e,t)=>{const o=document.getElementById(e);o&&(o.value=t)};document.addEventListener("visibilitychange",z),e.$on("$destroy",()=>{document.removeEventListener("visibilitychange",z)}),V().repositoryId||(e.agentFormModel.repositoryId=null),setTimeout(k,0),t.rendered.then(()=>{X("temperatureSlider",e.agentFormModel.temperature.value),X("topPSlider",e.agentFormModel.topP.value),e.operation!==s.A1.CREATE&&Y()})}angular.module("graphdb.framework.ttyg.controllers.agent-settings-modal",["graphdb.framework.core.services.similarity","graphdb.framework.core.services.connectors","graphdb.framework.rest.repositories.service","graphdb.framework.ttyg.controllers.agent-instructions-explain-modal","graphdb.framework.ttyg.services.externalIntegrationModal","ngTagsInput","graphdb.framework.core.directives.multiselect"]).constant("ExtractionMethodTemplates",{iri_discovery_search:"iri-discovery-search",autocomplete_iri_discovery_search:"autocomplete-iri-discovery-search"}).filter("map",function(){return function(e,t){return Array.isArray(e)?e.map(function(e){return e[t]}):e}}).controller("AgentSettingsModalController",p),p.$inject=["$scope","$uibModalInstance","ModalService","$uibModal","SimilarityService","ConnectorsService","RepositoriesRestService","$sce","toastr","UriUtils","$translate","dialogModel","TTYGContextService","TTYGService","ExtractionMethodTemplates","AutocompleteService","AutocompleteRestService","ExternalIntegrationModalService","productInfo"]}};
|
|
2
|
+
//# sourceMappingURL=95953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G9CrT,EAAOqD,IAAI,WAPkBwQ,KACzBP,SAASQ,oBAAoB,mBAAoBT,KAelBvG,IACH7C,eACxBjK,EAAOiH,eAAegD,aAAe,MAGzC8J,WAAWlL,EAAmC,GAC9ClF,EAAkBqQ,SAAShP,KAAK,KAC5BwO,EAAkB,oBAAqBxT,EAAOiH,eAAe2G,YAAYC,OACzE2F,EAAkB,aAAcxT,EAAOiH,eAAegN,KAAKpG,OACvD7N,EAAO+G,YAAcD,EAAAA,GAAgBiJ,QACrCrD,KAKhB,CA78BArN,QACKC,OAAO,0DAA2D,CAC/D,6CACA,6CACA,8CACA,sEACA,2DACA,cACA,kDAEH4U,SAAS,4BAA6B,CACnC,qBAAwB,uBACxB,kCAAqC,sCAExChT,OAAO,MAAO,WACX,OAAO,SAASiT,EAAKlS,GACjB,OAAKlB,MAAMC,QAAQmT,GAGZA,EAAIxF,IAAI,SAASyF,GACpB,OAAOA,EAAEnS,EACb,GAJWkS,CAKf,CACJ,GACCpU,WAAW,+BAAgCmG,GAEhDA,EAA6BzB,QAAU,CACnC,SACA,oBACA,eACA,YACA,oBACA,oBACA,0BACA,OACA,SACA,WACA,aACA,cACA,qBACA,cACA,4BACA,sBACA,0BACA,kCACA,c","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/multiselect-search/multiselect-search.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/similarity/similarity-instance-type.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/controllers/external-integration-configuration-modal.controller.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/services/externalIntegrationModal.service.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/ttyg/controllers/agent-settings-modal.controller.js"],"sourcesContent":["(function() {\n angular.module('graphdb.framework.core.directives.multiselect', [])\n .directive('multiSelectDropdown', function() {\n return {\n restrict: 'E',\n scope: {\n items: '=',\n placeholder: '@?',\n onChange: '&?',\n /**\n * Keys for labels used in the multiselect dropdown.\n * <code>\n * {\n * \"select_all\": \"All\",\n * \"search_placeholder\": \"Select options\",\n * \"selected_count\": \"{{count}} selected\",\n * \"no_matches\": \"No matches\"\n * }\n * </code>\n */\n labelKeys: '=?',\n },\n templateUrl: 'js/angular/core/directives/multiselect-search/templates/multiselect-search.html',\n controller: ['$scope', '$document', '$element', '$filter', '$timeout', function($scope, $document, $element, $filter, $timeout) {\n // =========================\n // Public variables\n // =========================\n\n $scope.open = false;\n $scope.search = {query: ''};\n $scope.visibleItems = [];\n\n // =========================\n // Private variables\n // =========================\n\n const subscriptions = [];\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Normalize string for searching.\n * @param v {string|null}\n * @returns {string|string}\n */\n const normalize = (v) => {\n return v === null ? '' : ('' + v).toLowerCase();\n };\n\n /**\n * Build filtered list when query or items change.\n */\n const rebuildFiltered = () => {\n const list = Array.isArray($scope.items) ? $scope.items : [];\n const normalizedQuery = normalize($scope.search.query);\n if (normalizedQuery) {\n $scope.visibleItems = list.filter((i) => normalize(i.label).includes(normalizedQuery));\n } else {\n $scope.visibleItems = list;\n }\n };\n\n const dropTheOpenFlag = () => {\n $scope.$applyAsync(function() {\n $scope.open = false;\n });\n };\n\n /**\n * Closes the menu when clicking outside.\n * @param e {MouseEvent} The click event.\n */\n const onDocClick = (e) => {\n if (!$scope.open) {\n return;\n }\n if (!$element[0].contains(e.target)) {\n dropTheOpenFlag();\n }\n };\n\n const focusSearchInput = () => {\n // wait for the menu to open before focusing the input\n $timeout(function() {\n const input = $element[0].querySelector('.multiselect-search');\n if (input) {\n input.focus();\n }\n });\n };\n\n const focusMultiselectButton = () => {\n // wait for the menu to be removed before focusing the button\n $timeout(function() {\n const btn = $element[0].querySelector('.multiselect-button');\n if (btn) {\n btn.focus();\n }\n });\n };\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Toggles the menu open/closed.\n * @param e {MouseEvent} The click event.\n */\n $scope.toggleOpen = function(e) {\n e && e.stopPropagation();\n $scope.open = !$scope.open;\n if ($scope.open) {\n focusSearchInput();\n }\n };\n\n /**\n * Handles keydown events in the menu (for Escape key) and closes the menu.\n * @param e {KeyboardEvent} The keydown event.\n */\n $scope.onKeydownMenu = function(e) {\n if (e.key === 'Escape') {\n $scope.open = false;\n e.stopPropagation();\n e.preventDefault();\n focusMultiselectButton();\n }\n };\n\n /**\n * Gets count of selected items.\n * @returns {*|number}\n */\n $scope.selectedCount = function() {\n if (!Array.isArray($scope.items)) {\n return 0;\n }\n return $scope.items.filter((i) => i.selected).length;\n };\n\n /**\n * Checks if all filtered items are selected.\n * @returns {this is T[]|boolean}\n */\n $scope.allFilteredSelected = function() {\n const list = $scope.visibleItems || [];\n if (list.length === 0) {\n return false;\n }\n return list.every((i) => i.selected);\n };\n\n /**\n * Checks if some (but not all) filtered items are selected.\n * @returns {boolean}\n */\n $scope.someFilteredSelected = function() {\n const list = $scope.visibleItems || [];\n const any = list.some((i) => i.selected);\n const all = list.every((i) => i.selected);\n return any && !all;\n };\n\n /**\n * Toggles select all filtered items.\n * @param e {MouseEvent} The click event.\n */\n $scope.toggleSelectAll = function(e) {\n e && e.stopPropagation();\n const list = $scope.visibleItems || [];\n const makeSelected = !$scope.allFilteredSelected();\n for (const item of list) {\n item.selected = makeSelected;\n }\n $scope.emitChange();\n };\n\n /**\n * Emits change event.\n */\n $scope.emitChange = function() {\n if (typeof $scope.onChange === 'function') {\n const selected = ($scope.items || []).filter((i) => i.selected);\n $scope.onChange({selected: selected});\n }\n };\n\n // =========================\n // Watches & Listeners\n // =========================\n\n $document.on('click', onDocClick);\n subscriptions.push(\n $scope.$watch('search.query', rebuildFiltered),\n $scope.$watchCollection('items', rebuildFiltered),\n );\n\n const onDestroyCallback = () => {\n $document.off('click', onDocClick);\n for (const unsubscribe of subscriptions) {\n unsubscribe();\n }\n };\n $scope.$on('$destroy', onDestroyCallback);\n\n rebuildFiltered();\n }],\n };\n });\n})();\n","export const SimilarityInstanceType = {\n 'SIMILARITY': 'similarity',\n 'ELASTICSEARCH': 'elasticsearch',\n 'OPENSEARCH': 'opensearch',\n};\n","angular\n .module('graphdb.framework.ttyg.controllers.external-integration-configuration-modal', [])\n .controller('ExternalIntegrationConfigurationModalController', ExternalIntegrationConfigurationModalController);\n\nExternalIntegrationConfigurationModalController.$inject = [\n '$scope',\n '$uibModalInstance',\n 'ModalService',\n '$translate',\n 'dialogModel'\n];\n\nfunction ExternalIntegrationConfigurationModalController($scope, $uibModalInstance, ModalService, $translate, dialogModel) {\n // =========================\n // Public variables\n // =========================\n\n $scope.externalIntegrationConfiguration = dialogModel.externalIntegrationConfiguration;\n $scope.difyExtension = dialogModel.difyExtensionUrl;\n $scope.queryMethods = dialogModel.queryMethodsUrl;\n $scope.agentId = dialogModel.agentId;\n $scope.agentName = dialogModel.agentName;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Closes the modal when the user clicks the close button.\n */\n $scope.close = () => {\n $uibModalInstance.dismiss({});\n };\n\n $scope.onCloseExternalIntegrationConfigurationModal = () => {\n $uibModalInstance.dismiss({});\n };\n}\n","import 'angular/ttyg/controllers/external-integration-configuration-modal.controller';\nimport {TTYG_ERROR_MSG_LENGTH} from \"./constants\";\n\nangular\n .module('graphdb.framework.ttyg.services.externalIntegrationModal',\n ['graphdb.framework.ttyg.controllers.external-integration-configuration-modal'])\n .factory('ExternalIntegrationModalService', ExternalIntegrationModalService)\n\nExternalIntegrationModalService.$inject = ['$uibModal', 'LocationsRestService', 'toastr'];\n\nfunction ExternalIntegrationModalService($uibModal, LocationsRestService, toastr) {\n function buildDialogModel(agent, baseUrl) {\n return {\n agentName: agent.name,\n agentId: agent.id,\n queryMethodsUrl: `${baseUrl}/rest/llm/tool/ttyg/${agent.id}`,\n difyExtensionUrl: `${baseUrl}/rest/llm/ttyg/${agent.id}/dify`\n };\n }\n\n function open(agent) {\n return LocationsRestService.getExternalUrl()\n .then((response) => {\n const dialogModel = buildDialogModel(agent, response.data);\n\n return $uibModal.open({\n templateUrl: 'js/angular/ttyg/templates/modal/external-integration-configuration-modal.html',\n controller: 'ExternalIntegrationConfigurationModalController',\n windowClass: 'external-integration-configuration-modal',\n backdrop: 'static',\n resolve: {\n dialogModel: () => dialogModel\n }\n }).result\n .then(() => {\n // Modal was closed with success - do nothing\n })\n .catch(() => {\n // Modal was dismissed — do nothing\n });\n })\n .catch((error) => {\n // Catches API failure\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n }\n\n return {open};\n}\n","import {decodeHTML} from \"../../../../app\";\nimport {AdditionalExtractionMethod, ExtractionMethod} from \"../../models/ttyg/agents\";\nimport 'angular/core/services/similarity.service';\nimport 'angular/core/services/connectors.service';\nimport 'angular/core/services/ttyg.service';\nimport 'angular/core/directives/multiselect-search/multiselect-search.directive';\nimport 'angular/rest/repositories.rest.service';\nimport 'angular/ttyg/controllers/agent-instructions-explain-modal.controller';\nimport 'angular/ttyg/services/externalIntegrationModal.service';\nimport {REPOSITORY_PARAMS} from \"../../models/repository/repository\";\nimport {TTYGEventName} from \"../services/ttyg-context.service\";\nimport {AGENT_OPERATION, TTYG_ERROR_MSG_LENGTH} from \"../services/constants\";\nimport {mapUriAsNtripleAutocompleteResponse} from \"../../rest/mappers/autocomplete-mapper\";\nimport {DocumentationUrlResolver} from \"../../utils/documentation-url-resolver\";\nimport {LoggerProvider} from \"../../core/services/logger-provider\";\nimport {SelectMenuOptionsModel} from \"../../models/form-fields\";\nimport {SimilarityInstanceType} from '../../models/similarity/similarity-instance-type';\n\nconst logger = LoggerProvider.logger;\n/**\n * @typedef {Object} SimilarityIndexOption\n * @property {string} provider\n * @property {string} label\n * @property {string} value\n * @property {string} group\n */\n\n\nangular\n .module('graphdb.framework.ttyg.controllers.agent-settings-modal', [\n 'graphdb.framework.core.services.similarity',\n 'graphdb.framework.core.services.connectors',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.ttyg.controllers.agent-instructions-explain-modal',\n 'graphdb.framework.ttyg.services.externalIntegrationModal',\n 'ngTagsInput',\n 'graphdb.framework.core.directives.multiselect',\n ])\n .constant('ExtractionMethodTemplates', {\n 'iri_discovery_search': 'iri-discovery-search',\n 'autocomplete_iri_discovery_search': 'autocomplete-iri-discovery-search',\n })\n .filter('map', function() {\n return function(arr, key) {\n if (!Array.isArray(arr)) {\n return arr;\n }\n return arr.map(function(o) {\n return o[key];\n });\n };\n })\n .controller('AgentSettingsModalController', AgentSettingsModalController);\n\nAgentSettingsModalController.$inject = [\n '$scope',\n '$uibModalInstance',\n 'ModalService',\n '$uibModal',\n 'SimilarityService',\n 'ConnectorsService',\n 'RepositoriesRestService',\n '$sce',\n 'toastr',\n 'UriUtils',\n '$translate',\n 'dialogModel',\n 'TTYGContextService',\n 'TTYGService',\n 'ExtractionMethodTemplates',\n 'AutocompleteService',\n 'AutocompleteRestService',\n 'ExternalIntegrationModalService',\n 'productInfo'];\n\nfunction AgentSettingsModalController(\n $scope,\n $uibModalInstance,\n ModalService,\n $uibModal,\n SimilarityService,\n ConnectorsService,\n RepositoriesRestService,\n $sce,\n toastr,\n UriUtils,\n $translate,\n dialogModel,\n TTYGContextService,\n TTYGService,\n ExtractionMethodTemplates,\n AutocompleteService,\n AutocompleteRestService,\n ExternalIntegrationModalService,\n productInfo) {\n // =========================\n // Private variables\n // =========================\n\n const CHAT_GPT_RETRIEVAL_CONNECTOR_NAME = 'ChatGPT Retrieval';\n\n // =========================\n // Public variables\n // =========================\n\n $scope.AGENT_OPERATION = AGENT_OPERATION;\n\n /**\n * The operation type for the modal. This can be one of <code>AGENT_OPERATION</code> constants.\n */\n $scope.operation = dialogModel.operation;\n\n /**\n * Flag to control the visibility of the loader when creating an agent.\n * @type {boolean}\n */\n $scope.savingAgent = false;\n\n /**\n * The model used in the form.\n * @type {AgentFormModel|*}\n */\n $scope.agentFormModel = dialogModel.agentFormModel;\n\n /**\n * The active repository info model.\n * @type {RepositoryInfoModel|*}\n */\n $scope.activeRepositoryInfo = dialogModel.activeRepositoryInfo;\n\n /**\n * Flags used to show/hide the loader for the extraction methods when the user opens a panel and some data needs to\n * be loaded.\n * @type {{[string]: boolean}} - the key is the extraction method types in <code>ExtractionMethod</code>\n */\n $scope.extractionMethodLoaderFlags = {\n [ExtractionMethod.SIMILARITY]: false,\n };\n\n /**\n * The repository select menu options model.\n * @type {SelectMenuOptionsModel[]}\n */\n $scope.activeRepositoryList = dialogModel.activeRepositoryList;\n\n /**\n * The extraction method types constants.\n * @type {{SPARQL: string, FTS_SEARCH: string, SIMILARITY: string, RETRIEVAL: string}}\n */\n $scope.extractionMethods = ExtractionMethod;\n\n /**\n * The additional extraction method types constants.\n * @type {{IRI_DISCOVERY_SEARCH: string, AUTOCOMPLETE_IRI_DISCOVERY_SEARCH: string}}\n */\n $scope.additionalExtractionMethods = AdditionalExtractionMethod;\n\n /**\n * The names of the template files, containing the Extraction Method Templates.\n * @type {Object<string, string>}\n */\n $scope.ExtractionMethodTemplates = ExtractionMethodTemplates;\n\n /**\n * Flag used to show/hide the advanced settings in the modal.\n * @type {boolean}\n */\n $scope.showAdvancedSettings = false;\n\n /**\n * Flag used to show/hide the high temperature warning in the modal.\n * @type {boolean}\n */\n $scope.showHighTemperatureWarning = false;\n\n /**\n * Flag used to control the visibility of the system instruction warning.\n * @type {boolean}\n */\n $scope.showSystemInstructionWarning = false;\n\n /**\n * The retrieval connectors to be used for the retrieval extraction method as select menu options.\n * @type {SelectMenuOptionsModel[]}\n */\n $scope.retrievalConnectors = [];\n\n /**\n * Flag used to show/hide the FTS enabled state in the modal.\n * @type {boolean}\n */\n $scope.ftsEnabled = false;\n\n /**\n * The autocomplete suggestions source for the 'Autocomplete IRI discovery' extraction method.\n * @type {*[]}\n */\n $scope.autocompleteSuggestions = [];\n\n /**\n * Flag to determine if the context size field should be visible in the form.\n * @type {boolean}\n */\n $scope.showContextSize = ($scope.agentFormModel.contextSize !== null);\n\n /**\n * The model for the vector fields select dropdown (Similarity search method).\n * @type {string[]}\n */\n $scope.vectorFields = [];\n\n $scope.documentationUrlForSimilarity = DocumentationUrlResolver.getDocumentationUrl(productInfo.productShortVersion, 'talk-to-graph.html#prerequisites-and-configuration');\n\n /**\n * The similarity index select options grouped by provider for the similarity search extraction method.\n * @type {*[]}\n */\n $scope.similarityOptionsGrouped = [];\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Sets the UI touched state and validation state for the extraction methods property so that the UI can show if\n * the user has selected at least one extraction method and warn him if he hasn't.\n *\n * @param {ExtractionMethodFormModel} extractionMethod\n */\n $scope.toggleExtractionMethod = (extractionMethod) => {\n extractionMethod.expanded = extractionMethod.selected;\n $scope.agentSettingsForm.extractionMethods.$setTouched();\n setExtractionMethodValidityStatus();\n extractionPanelToggleHandlers[extractionMethod.method](extractionMethod);\n };\n\n /**\n * Handles the panel toggle event for the extraction method. This is used to do some initialization when the user\n * opens the panel for a specific extraction method.\n * @param {ExtractionMethodFormModel} extractionMethod\n */\n $scope.onExtractionMethodPanelToggle = (extractionMethod) => {\n extractionMethod.toggleCollapse();\n extractionPanelToggleHandlers[extractionMethod.method](extractionMethod);\n };\n\n /**\n * Sets the UI touched state and validation state for the additional extraction methods property so that the UI can show if\n * the user has selected at least one extraction method.\n *\n * @param {AdditionalExtractionMethodFormModel} extractionMethod\n */\n $scope.toggleAdditionalExtractionMethod = (extractionMethod) => {\n extractionMethod.expanded = extractionMethod.selected;\n $scope.checkAutocompleteIndexEnabled();\n additionalExtractionPanelToggleHandlers[extractionMethod.method](extractionMethod);\n };\n\n /**\n * Handles the panel toggle event for the additional extraction method. This is used to do some initialization when the user\n * opens the panel for a specific extraction method.\n * @param {AdditionalExtractionMethodFormModel} extractionMethod\n */\n $scope.onAdditionalExtractionMethodPanelToggle = (extractionMethod) => {\n extractionMethod.toggleCollapse();\n additionalExtractionPanelToggleHandlers[extractionMethod.method](extractionMethod);\n };\n\n $scope.helpInfoForModel = {\n ttygHelpInfo: getModelHelpMessage(),\n linkText: $translate.instant('ttyg.agent.create_agent_modal.form.model.link_text'),\n documentationUrl: DocumentationUrlResolver.getDocumentationUrl(productInfo.productShortVersion, 'talk-to-graph.html#prerequisites-and-configuration'),\n };\n\n /**\n * Resolves the hint for the FTS search missing message. This is needed because the hint contains a html link that\n * should be properly rendered.\n * @return {*}\n */\n $scope.getFTSDisabledHelpMessage = () => {\n // The hint contains a html link which should be properly rendered.\n const message = decodeHTML(\n $translate.instant(\n 'ttyg.agent.create_agent_modal.form.fts_search.fts_disabled_message',\n {repositoryEditPage: 'repository/edit/' + $scope.agentFormModel.repositoryId},\n ),\n );\n return $sce.trustAsHtml(message);\n };\n\n /**\n * Opens the 'Autocomplete index' view in a new tab.\n */\n $scope.goToAutocompleteView = (event) => {\n event.preventDefault();\n TTYGContextService.emit(TTYGEventName.GO_TO_AUTOCOMPLETE_INDEX_VIEW, {repositoryId: $scope.agentFormModel.repositoryId});\n };\n\n /**\n * Opens the 'Create Similarity' view in a new tab.\n */\n $scope.goToCreateSimilarityView = (event) => {\n event.preventDefault();\n TTYGContextService.emit(TTYGEventName.GO_TO_CREATE_SIMILARITY_VIEW, {repositoryId: $scope.agentFormModel.repositoryId});\n };\n\n /**\n * Opens the 'Connectors' view in a new tab.\n */\n $scope.goToConnectorsView = (event) => {\n event.preventDefault();\n TTYGContextService.emit(TTYGEventName.GO_TO_CONNECTORS_VIEW, {repositoryId: $scope.agentFormModel.repositoryId});\n };\n\n /**\n * Handles the selected agent operation which can be one of <code>AGENT_OPERATION</code> types. Respective handler\n * is called based on the operation type with the agent payload build based on the form model.\n * @return {Promise<void>}\n */\n $scope.ok = () => {\n const agentPayload = $scope.agentFormModel.toPayload();\n return agentOperationHandlers[$scope.operation](agentPayload);\n };\n\n /**\n * Closes the modal when the user cancels the agent creation.\n */\n $scope.cancel = () => {\n $uibModalInstance.dismiss({});\n };\n\n /**\n * Closes the modal when the user clicks the close button.\n */\n $scope.close = () => {\n $uibModalInstance.dismiss({});\n };\n\n /**\n * Updates the similarity search panel.\n *\n * @param {boolean} clearIndexSelection - If true, the selected index will be cleared.\n */\n $scope.updateSimilaritySearchPanel = (clearIndexSelection = false) => {\n const similaritySearchExtractionMethod = $scope.agentFormModel.assistantExtractionMethods.getSimilarityExtractionMethod();\n if (!similaritySearchExtractionMethod.selected) {\n // clear the validation status if the method is deselected.\n $scope.agentSettingsForm.$setValidity('FTSDisabled', true);\n return;\n }\n\n if (clearIndexSelection) {\n similaritySearchExtractionMethod.similarityIndex = null;\n }\n handleSimilaritySearchExtractionMethodPanelToggle(similaritySearchExtractionMethod, true);\n };\n\n /**\n * Updates the ChatGPT retrieval connector panel.\n *\n * @param {boolean} clearSelection - If true, the selected connector will be cleared.\n */\n $scope.updateRetrievalConnectorPanel = (clearSelection = false) => {\n const retrievalExtractionExtractionMethod = $scope.agentFormModel.assistantExtractionMethods.getRetrievalExtractionMethod();\n if (!retrievalExtractionExtractionMethod.selected) {\n return;\n }\n if (clearSelection) {\n retrievalExtractionExtractionMethod.retrievalConnectorInstance = null;\n }\n handleRetrievalConnectorExtractionMethodPanelToggle(retrievalExtractionExtractionMethod);\n };\n\n /**\n * Checks if the Full-Text Search (FTS) index is enabled for the selected repository.\n * Sets form validation state based on whether FTS is enabled and required.\n */\n $scope.checkIfFTSEnabled = () => {\n if (!$scope.agentFormModel.repositoryId) {\n $scope.agentSettingsForm.$setValidity('FTSDisabled', false);\n return;\n }\n\n const ftsSearchExtractionMethod = $scope.agentFormModel.assistantExtractionMethods.getFTSSearchExtractionMethod();\n if (!ftsSearchExtractionMethod.selected) {\n // clear the validation status if method is deselected.\n $scope.agentSettingsForm.$setValidity('FTSDisabled', true);\n return;\n }\n\n $scope.extractionMethodLoaderFlags[ExtractionMethod.FTS_SEARCH] = true;\n\n // pass a fake repository info object with only an id because we don't care for the location\n RepositoriesRestService.getRepositoryModel({id: $scope.agentFormModel.repositoryId}).then((repositoryModel) => {\n $scope.ftsEnabled = repositoryModel.getParamValue(REPOSITORY_PARAMS.enableFtsIndex);\n })\n .catch((error) => {\n logAndShowError(error, 'ttyg.agent.messages.error_repository_config_loading');\n })\n .finally(() => {\n $scope.extractionMethodLoaderFlags[ExtractionMethod.FTS_SEARCH] = false;\n $scope.agentSettingsForm.$setValidity('FTSDisabled', $scope.ftsEnabled);\n });\n };\n\n /**\n * Opens a modal to copy the external integration for the currently edited agent.\n *\n * @function\n */\n $scope.openExternalIntegrationConfig = () => {\n const agent = $scope.agentFormModel;\n ExternalIntegrationModalService.open(agent);\n };\n\n /**\n * Handles the change in the repository id field. This is needed because\n * the FTS method configuration depends on the selected repository to be\n * able to validate if the FTS is enabled for that selected repository.\n */\n $scope.onRepositoryChange = () => {\n refreshValidations(true, true);\n };\n\n /**\n * Checks the status of the autocomplete index.\n * @param {AdditionalExtractionMethodFormModel|undefined} method - The extraction method to check the autocomplete\n * index for. This function can be called in the visibilitychange handler, so the method might not be defined.\n * If not provided, it will check the 'Autocomplete IRI discovery search' method from the additional extraction\n * methods.\n */\n $scope.checkAutocompleteIndexEnabled = (method) => {\n if (!method) {\n method = $scope.agentFormModel.additionalExtractionMethods.additionalExtractionMethods\n .find((extractionMethod) => extractionMethod.method === AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH);\n }\n // If the method is not selected, we don't need to check the autocomplete index status.\n // Also, if the repository id is not set, we can't check the autocomplete index status.\n if (method && !method.selected || !$scope.agentFormModel.repositoryId) {\n return;\n }\n const selectedRepositoryInfo = getSelectedRepositoryInfo();\n AutocompleteService.checkAutocompleteStatus(selectedRepositoryInfo.repositoryId, selectedRepositoryInfo.repositoryLocation)\n .then((autocompleteEnabled) => {\n $scope.autocompleteEnabled = autocompleteEnabled;\n $scope.agentSettingsForm.$setValidity('autocompleteDisabled', autocompleteEnabled);\n })\n .catch((error) => {\n $scope.agentSettingsForm.$setValidity('autocompleteDisabled', false);\n toastr.error(getError(error));\n });\n };\n\n /**\n * Restores the default context size.\n */\n $scope.onRestoreDefaultContextSize = () => {\n $scope.agentFormModel.contextSize = $scope.agentFormModel.contextSizeCopy;\n };\n\n /**\n * Restores the default system instructions.\n */\n $scope.onRestoreDefaultSystemInstructions = () => {\n $scope.agentFormModel.instructions.systemInstruction = $scope.agentFormModel.instructions.systemInstructionCopy;\n };\n\n /**\n * Restores the default user instructions.\n */\n $scope.onRestoreDefaultUserInstructions = () => {\n $scope.agentFormModel.instructions.userInstruction = $scope.agentFormModel.instructions.userInstructionCopy;\n };\n\n /**\n * Handles the change in the temperature field. This is needed because the high temperature warning should be shown\n * when the temperature is higher than 1.\n */\n $scope.onTemperatureChange = () => {\n $scope.showHighTemperatureWarning = $scope.agentFormModel.temperature.value > 1;\n };\n\n /**\n * Handles the change in the system instructions field.\n */\n $scope.onSystemInstructionChange = () => {\n if ($scope.agentFormModel.instructions.systemInstruction !== '' && !$scope.showSystemInstructionWarning) {\n $scope.showSystemInstructionWarning = true;\n ModalService.openModalAlert({\n title: $translate.instant('ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.title'),\n message: $translate.instant('ttyg.agent.create_agent_modal.form.system_instruction.overriding_system_instruction_warning.body'),\n }).result\n .then(function() {\n // Do nothing, just warning the user\n });\n }\n if ($scope.agentFormModel.instructions.systemInstruction === '') {\n $scope.showSystemInstructionWarning = false;\n }\n };\n\n /**\n * Opens the agent instructions explain modal.\n */\n $scope.onExplainAgentSettings = () => {\n const agentPayload = $scope.agentFormModel.toPayload();\n TTYGService.explainAgentSettings(agentPayload)\n .then((agentInstructionsExplain) => {\n const options = {\n templateUrl: 'js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html',\n controller: 'AgentInstructionsExplainModalController',\n windowClass: 'agent-instructions-explain-modal',\n backdrop: 'static',\n resolve: {\n dialogModel: function() {\n return {\n agentInstructionsExplain,\n };\n },\n },\n size: 'lg',\n };\n $uibModal.open(options).result\n .then(() => {\n // Do nothing\n });\n }).catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n /**\n * Populates autocomplete suggestions for the given input text.\n * @param {Event} event - The input event containing the search text.\n */\n $scope.getSuggestions = (event) => {\n const inputText = event.target.value;\n AutocompleteRestService.getAutocompleteSuggestions(inputText)\n .then(mapUriAsNtripleAutocompleteResponse)\n .then((suggestions) => {\n $scope.autocompleteSuggestions = suggestions.map((item) => ({text: item.value}));\n }).catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n });\n };\n\n /**\n * Handles the change event for the vector fields select dropdown.\n * Updates the connector fields based on the selected vector field.\n * @param {ExtractionMethodFormModel} extractionMethod - The extraction method being updated.\n */\n $scope.onVectorFieldsChange = function(extractionMethod) {\n extractionMethod.connectorFields = extractionMethod.selectedConnectorField ? [extractionMethod.selectedConnectorField] : [];\n };\n\n /**\n * Determines whether there is connector data available for the similarity search extraction method.\n * @returns {boolean} True if connector data exists, false otherwise.\n */\n $scope.hasConnectorData = () => {\n return !!($scope.connectorMap && Object.keys($scope.connectorMap).length);\n };\n\n /**\n * Determines whether the vector fields select dropdown should be shown for the similarity search extraction method.\n * @param {ExtractionMethodFormModel} extractionMethod - The extraction method to check.\n * @returns {boolean} True if vector fields dropdown should be shown, false otherwise.\n */\n $scope.shouldShowVectorFields = (extractionMethod) => {\n if (!extractionMethod) {\n return false;\n }\n\n const provider = extractionMethod.connectorType;\n const indexName = extractionMethod.similarityIndex;\n\n if (!isVectorProvider(provider)) {\n return false;\n }\n\n if (Array.isArray($scope.vectorFields)) {\n return $scope.vectorFields.length > 0;\n }\n\n const fields = getVectorFieldsFromMap(provider, indexName);\n\n return Array.isArray(fields) && fields.length > 0;\n };\n\n /**\n * Handles the change event for the similarity index select menu.\n * Updates the connector type, similarity index, and refreshes available vector fields.\n * @param {ExtractionMethodFormModel} extractionMethod - The extraction method being updated.\n */\n $scope.onSimilarityIndexChange = (extractionMethod) => {\n const option = extractionMethod && extractionMethod.similarityIndexOption;\n // The user needs to select a vector field again.\n extractionMethod.selectedConnectorField = undefined;\n extractionMethod.connectorFields = [];\n\n if (!option) {\n extractionMethod.connectorType = null;\n extractionMethod.similarityIndex = '';\n $scope.vectorFields = [];\n return;\n }\n\n extractionMethod.connectorType = option.provider;\n extractionMethod.similarityIndex = option.value;\n\n $scope.vectorFields = getVectorFieldsFromMap(option.provider, option.value);\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Gets vector fields from the connector map for a given provider and index name.\n * @param {string} provider - The provider type.\n * @param {string} indexName - The index name.\n * @returns {Array} The vector fields array, or an empty array if not found.\n */\n const getVectorFieldsFromMap = (provider, indexName) => {\n const map = $scope.connectorMap || {};\n return (map[provider] && map[provider][indexName])\n ? map[provider][indexName]\n : [];\n };\n\n /**\n * Updates the vector fields in the select dropdown based on the selected extraction method.\n * @param extractionMethod\n */\n const updateVectorFields = (extractionMethod) => {\n const provider = extractionMethod.connectorType;\n const indexName = extractionMethod.similarityIndex;\n\n if (!isVectorProvider(provider)) {\n $scope.vectorFields = [];\n return;\n }\n\n $scope.vectorFields = getVectorFieldsFromMap(provider, indexName);\n };\n\n /**\n * Resolves the hint message for the agent model property.\n * This is needed because the hint contains a html link that\n * should be properly rendered.\n * @return {*}\n */\n function getModelHelpMessage() {\n // The hint contains a html link which should be properly rendered.\n const message = decodeHTML($translate.instant('ttyg.agent.create_agent_modal.form.model.hint'));\n return $sce.trustAsHtml(message);\n }\n\n /**\n * Mapping of agent operations to their respective handlers.\n * @type {{[AGENT_OPERATION.EDIT]: (function(*): Promise<void>), [AGENT_OPERATION.CLONE]: (function(*): Promise<void>), [AGENT_OPERATION.CREATE]: (function(*): Promise<void>)}}\n */\n const agentOperationHandlers = {\n [AGENT_OPERATION.CREATE]: (payload) => createAgent(payload),\n [AGENT_OPERATION.EDIT]: (payload) => editAgent(payload),\n [AGENT_OPERATION.CLONE]: (payload) => cloneAgent(payload),\n };\n\n /**\n * Creates a new agent with the given payload and closes the modal if no errors occur.\n * @param {*} newAgentPayload - the payload for the new agent.\n * @return {Promise<void>}\n */\n const createAgent = (newAgentPayload) => {\n $scope.savingAgent = true;\n return TTYGService.createAgent(newAgentPayload)\n .then((agentModel) => {\n $uibModalInstance.close(agentModel);\n toastr.success($translate.instant('ttyg.agent.messages.agent_save_successfully', {agentName: agentModel.name}));\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n })\n .finally(() => {\n $scope.savingAgent = false;\n });\n };\n\n /**\n * Sends the edit agent payload to the server and closes the modal if no errors occur.\n * @param {*} agentPayload - the payload for the agent to be edited.\n * @return {Promise<void>}\n */\n const editAgent = (agentPayload) => {\n $scope.savingAgent = true;\n return TTYGService.editAgent(agentPayload)\n .then((updatedAgent) => {\n $uibModalInstance.close(updatedAgent);\n toastr.success($translate.instant('ttyg.agent.messages.agent_save_successfully', {agentName: updatedAgent.name}));\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n })\n .finally(() => {\n $scope.savingAgent = false;\n });\n };\n\n /**\n * Clones the agent with the given payload and closes the modal if no errors occur.\n * @param {*} agentPayload\n * @return {Promise<void>}\n */\n const cloneAgent = (agentPayload) => {\n $scope.savingAgent = true;\n return TTYGService.createAgent(agentPayload)\n .then((updatedAgent) => {\n $uibModalInstance.close(updatedAgent);\n toastr.success($translate.instant(\"ttyg.agent.messages.agent_save_successfully\", {agentName: updatedAgent.name}));\n })\n .catch((error) => {\n toastr.error(getError(error, 0, TTYG_ERROR_MSG_LENGTH));\n })\n .finally(() => {\n $scope.savingAgent = false;\n });\n };\n\n const logAndShowError = (error, errorMessageKey) => {\n logger.error(error);\n toastr.error($translate.instant(errorMessageKey));\n };\n\n const setExtractionMethodValidityStatus = () => {\n $scope.agentSettingsForm.extractionMethods.$setValidity('required', $scope.agentFormModel.hasExtractionMethodSelected());\n };\n\n const handleFTSExtractionMethodPanelToggle = (extractionMethod) => {\n $scope.checkIfFTSEnabled();\n };\n\n /**\n * Returns the repository info model for the selected repository in the form.\n *\n * @return {{repositoryLocation: (*|undefined), repositoryId: (*|undefined)}}\n */\n const getSelectedRepositoryInfo = () => {\n const selectRepositoryInfo = $scope.activeRepositoryList.find((repository) => repository.value === $scope.agentFormModel.repositoryId);\n return {\n repositoryId: selectRepositoryInfo ? selectRepositoryInfo.data.repository.id : undefined,\n repositoryLocation: selectRepositoryInfo ? selectRepositoryInfo.data.repository.location : undefined,\n };\n };\n\n const isVectorProvider = (p) => p === SimilarityInstanceType.OPENSEARCH || p === SimilarityInstanceType.ELASTICSEARCH;\n\n /**\n * Creates grouped options for ng-options with optgroups.\n * @param connectorMap - The connector map with similarity indexes.\n */\n const buildSimilarityIndexSelectOptions = (connectorMap) => {\n /** @type {SimilarityIndexOption[]} */\n $scope.similarityOptionsGrouped = [];\n Object.entries(connectorMap).forEach(([provider, types]) => {\n const groupLabel = $translate.instant(`ttyg.agent.create_agent_modal.form.similarity_instance_type_label.${provider}`);\n Object.keys(types || {}).forEach((typeName) => {\n $scope.similarityOptionsGrouped.push({\n provider,\n label: typeName,\n value: typeName,\n group: groupLabel,\n });\n });\n });\n };\n\n const handleSimilaritySearchExtractionMethodPanelToggle = (extractionMethod, clearSelectedVectorField = false) => {\n if (!extractionMethod.selected) {\n // clear the validation status if the method is deselected.\n $scope.agentSettingsForm.$setValidity('missingIndex', true);\n return;\n }\n // Check if the connector instances select is pristine (unchanged). Treat the field as pristine until it exists.\n // Because it's loaded with ng-if, on first pass through here, it won't exist yet, so we treat it as pristine.\n const connectorField = $scope.agentSettingsForm && $scope.agentSettingsForm.connectorInstances;\n const isConnectorPristine = connectorField ? connectorField.$pristine : true;\n // Don't reload the indexes and override the user selection if the connector instances field is pristine\n if ($scope.connectorMap && !isConnectorPristine) {\n return;\n }\n if (!$scope.agentFormModel.repositoryId) {\n return;\n }\n $scope.extractionMethodLoaderFlags[extractionMethod.method] = true;\n const selectedRepositoryInfo = getSelectedRepositoryInfo();\n SimilarityService.getSimilarityIndexesWithVectorFields(selectedRepositoryInfo.repositoryId)\n .then((connectorMap) => {\n $scope.connectorMap = connectorMap;\n const indexes = buildSelectMenuOptions(connectorMap);\n // if no indexes are found, selection (connectorsMap) will be cleaned and the info message will be\n // shown to the user again\n buildSimilarityIndexSelectOptions(connectorMap);\n updateSelectedSimilarityIndex(indexes, extractionMethod);\n updateVectorFields(extractionMethod);\n\n $scope.agentSettingsForm.$setValidity('missingIndex', !extractionMethod.selected || $scope.hasConnectorData());\n // Initially, when there is no selection, the first index is selected, and we need to trigger the\n // onSimilarityIndexChange to set the connector fields.\n if (clearSelectedVectorField || (extractionMethod.connectorFields && extractionMethod.connectorFields.length === 0)) {\n $scope.onSimilarityIndexChange(extractionMethod);\n }\n })\n .catch((error) => {\n $scope.connectorMap = null;\n $scope.agentSettingsForm.$setValidity('missingIndex', false);\n logAndShowError(error, 'ttyg.agent.messages.error_similarity_indexes_loading');\n })\n .finally(() => {\n $scope.extractionMethodLoaderFlags[extractionMethod.method] = false;\n });\n };\n\n /**\n * Updates the selected similarity index for the extraction method.\n *\n * @param {SelectMenuOptionsModel[]} indexes - The list of all available similarity indexes.\n * @param {Object} extractionMethod - The extraction method object containing the currently selected similarity index.\n */\n const updateSelectedSimilarityIndex = (indexes, extractionMethod) => {\n if (!indexes.length) {\n extractionMethod.connectorType = '';\n extractionMethod.similarityIndex = '';\n extractionMethod.similarityIndexOption = undefined;\n return;\n }\n\n const currentType = extractionMethod.connectorType;\n const currentName = extractionMethod.similarityIndex;\n\n // Find previously selected index or default to the first one\n const matchedIndex = indexes.find((index) =>\n index.data.connectorType === currentType &&\n index.value === currentName,\n );\n const selectedIndex = matchedIndex || indexes[0];\n\n extractionMethod.connectorType = selectedIndex.data.connectorType;\n extractionMethod.similarityIndex = selectedIndex.value;\n\n const options = $scope.similarityOptionsGrouped || [];\n const opt = options.find((option) =>\n option.provider === extractionMethod.connectorType &&\n option.value === extractionMethod.similarityIndex,\n );\n\n extractionMethod.similarityIndexOption = opt || undefined;\n };\n\n const buildSelectMenuOptions = (data) => {\n const result = [];\n\n Object.entries(data).forEach(([connectorType, indexes]) => {\n Object.entries(indexes).forEach(([indexName, fields]) => {\n result.push(\n new SelectMenuOptionsModel({\n label: indexName,\n value: indexName,\n data: {connectorType, connectorFields: fields},\n }),\n );\n });\n });\n\n return result;\n };\n\n const handleRetrievalConnectorExtractionMethodPanelToggle = (extractionMethod) => {\n if (!$scope.agentFormModel.repositoryId) {\n return;\n }\n if (!extractionMethod.selected) {\n // clear the validation status if method is deselected.\n $scope.agentSettingsForm.$setValidity('missingConnector', true);\n return;\n }\n\n $scope.extractionMethodLoaderFlags[extractionMethod.method] = true;\n const selectedRepositoryInfo = getSelectedRepositoryInfo();\n ConnectorsService.getConnectorPrefixByName(CHAT_GPT_RETRIEVAL_CONNECTOR_NAME, selectedRepositoryInfo.repositoryId, selectedRepositoryInfo.repositoryLocation)\n .then((prefix) => ConnectorsService.getConnectorsByTypeAsSelectMenuOptions(prefix, selectedRepositoryInfo.repositoryId, selectedRepositoryInfo.repositoryLocation))\n .then((connectors) => {\n $scope.retrievalConnectors = connectors;\n $scope.agentSettingsForm.$setValidity('missingConnector', !extractionMethod.selected || !!(connectors && connectors.length));\n updateSelectedRetrievalConnector($scope.retrievalConnectors, extractionMethod);\n })\n .catch((error) => {\n $scope.agentSettingsForm.$setValidity('missingConnector', false);\n logAndShowError(error, 'ttyg.agent.messages.error_retrieval_connectors_loading');\n })\n .finally(() => {\n $scope.extractionMethodLoaderFlags[extractionMethod.method] = false;\n });\n };\n\n /**\n * Updates the selected retrieval connector for the extraction method.\n *\n * @param {SelectMenuOptionsModel[]} retrievalConnectors - The list of all available connectors.\n * @param {Object} extractionMethod - The extraction method object containing the currently selected retrieval connector.\n */\n const updateSelectedRetrievalConnector = (retrievalConnectors, extractionMethod) => {\n if (retrievalConnectors.length === 0) {\n // If no connector are available, clear the similarity index.\n extractionMethod.retrievalConnectorInstance = null;\n return;\n }\n const selectedConnector = retrievalConnectors.find((connector) => connector.value === extractionMethod.retrievalConnectorInstance);\n\n // If the selected connector is not found in the current list, default to the first index.\n extractionMethod.retrievalConnectorInstance = selectedConnector\n ? selectedConnector.value\n : retrievalConnectors[0].value;\n };\n\n const extractionPanelToggleHandlers = {\n [ExtractionMethod.FTS_SEARCH]: (extractionMethod) => handleFTSExtractionMethodPanelToggle(extractionMethod),\n [ExtractionMethod.SPARQL]: (extractionMethod) => {\n },\n [ExtractionMethod.SIMILARITY]: (extractionMethod) => handleSimilaritySearchExtractionMethodPanelToggle(extractionMethod),\n [ExtractionMethod.RETRIEVAL]: (extractionMethod) => handleRetrievalConnectorExtractionMethodPanelToggle(extractionMethod),\n };\n\n const additionalExtractionPanelToggleHandlers = {\n [AdditionalExtractionMethod.AUTOCOMPLETE_IRI_DISCOVERY_SEARCH]: (extractionMethod) => handleAutocompleteExtractionMethodPanelToggle(extractionMethod),\n [AdditionalExtractionMethod.IRI_DISCOVERY_SEARCH]: () => {\n },\n };\n\n const handleAutocompleteExtractionMethodPanelToggle = (extractionMethod) => {\n if (!extractionMethod.selected) {\n // clear the validation status if method is deselected.\n $scope.agentSettingsForm.$setValidity('autocompleteDisabled', true);\n }\n $scope.checkAutocompleteIndexEnabled(extractionMethod);\n };\n\n const refreshValidations = (clearIndexSelection = false, clearRetrievalConnectorSelection = false) => {\n $scope.checkIfFTSEnabled();\n $scope.updateSimilaritySearchPanel(clearIndexSelection);\n $scope.updateRetrievalConnectorPanel(clearRetrievalConnectorSelection);\n $scope.checkAutocompleteIndexEnabled();\n };\n\n const onTabVisibilityChanged = () => {\n if (!document.hidden) {\n refreshValidations();\n }\n };\n\n const refreshSliderById = (elementId, value) => {\n const slider = document.getElementById(elementId);\n if (slider) {\n slider.value = value;\n }\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n const removeAllSubscribers = () => {\n document.removeEventListener(\"visibilitychange\", onTabVisibilityChanged);\n };\n\n document.addEventListener(\"visibilitychange\", onTabVisibilityChanged);\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n\n\n // =========================\n // Initialization\n // =========================\n\n const init = () => {\n // Set repository id to null if it is missing from the list of active repositories\n const selectedRepositoryInfo = getSelectedRepositoryInfo();\n if (!selectedRepositoryInfo.repositoryId) {\n $scope.agentFormModel.repositoryId = null;\n }\n // Delay the validation status setting because angular form ngmodel is not present immediately\n setTimeout(setExtractionMethodValidityStatus, 0);\n $uibModalInstance.rendered.then(() => {\n refreshSliderById('temperatureSlider', $scope.agentFormModel.temperature.value);\n refreshSliderById('topPSlider', $scope.agentFormModel.topP.value);\n if ($scope.operation !== AGENT_OPERATION.CREATE) {\n refreshValidations();\n }\n });\n };\n init();\n}\n"],"names":["angular","module","directive","restrict","scope","items","placeholder","onChange","labelKeys","templateUrl","controller","$scope","$document","$element","$filter","$timeout","open","search","query","visibleItems","subscriptions","normalize","v","toLowerCase","rebuildFiltered","list","Array","isArray","normalizedQuery","filter","i","label","includes","onDocClick","e","contains","target","$applyAsync","toggleOpen","stopPropagation","input","querySelector","focus","onKeydownMenu","key","preventDefault","btn","selectedCount","selected","length","allFilteredSelected","every","someFilteredSelected","any","some","all","toggleSelectAll","makeSelected","item","emitChange","on","push","$watch","$watchCollection","$on","onDestroyCallback","off","unsubscribe","SimilarityInstanceType","ExternalIntegrationConfigurationModalController","$uibModalInstance","ModalService","$translate","dialogModel","externalIntegrationConfiguration","difyExtension","difyExtensionUrl","queryMethods","queryMethodsUrl","agentId","agentName","close","dismiss","onCloseExternalIntegrationConfigurationModal","$inject","ExternalIntegrationModalService","$uibModal","LocationsRestService","toastr","agent","getExternalUrl","then","response","baseUrl","name","id","buildDialogModel","data","windowClass","backdrop","resolve","result","catch","error","getError","TTYG_ERROR_MSG_LENGTH","factory","logger","LoggerProvider","AgentSettingsModalController","SimilarityService","ConnectorsService","RepositoriesRestService","$sce","UriUtils","TTYGContextService","TTYGService","ExtractionMethodTemplates","AutocompleteService","AutocompleteRestService","productInfo","AGENT_OPERATION","operation","savingAgent","agentFormModel","activeRepositoryInfo","extractionMethodLoaderFlags","ExtractionMethod","SIMILARITY","activeRepositoryList","extractionMethods","additionalExtractionMethods","AdditionalExtractionMethod","showAdvancedSettings","showHighTemperatureWarning","showSystemInstructionWarning","retrievalConnectors","ftsEnabled","autocompleteSuggestions","showContextSize","contextSize","vectorFields","documentationUrlForSimilarity","DocumentationUrlResolver","getDocumentationUrl","productShortVersion","similarityOptionsGrouped","toggleExtractionMethod","extractionMethod","expanded","agentSettingsForm","$setTouched","setExtractionMethodValidityStatus","extractionPanelToggleHandlers","method","onExtractionMethodPanelToggle","toggleCollapse","toggleAdditionalExtractionMethod","checkAutocompleteIndexEnabled","additionalExtractionPanelToggleHandlers","onAdditionalExtractionMethodPanelToggle","helpInfoForModel","ttygHelpInfo","message","decodeHTML","instant","trustAsHtml","getModelHelpMessage","linkText","documentationUrl","getFTSDisabledHelpMessage","repositoryEditPage","repositoryId","goToAutocompleteView","event","emit","TTYGEventName","GO_TO_AUTOCOMPLETE_INDEX_VIEW","goToCreateSimilarityView","GO_TO_CREATE_SIMILARITY_VIEW","goToConnectorsView","GO_TO_CONNECTORS_VIEW","ok","agentPayload","toPayload","agentOperationHandlers","cancel","updateSimilaritySearchPanel","clearIndexSelection","similaritySearchExtractionMethod","assistantExtractionMethods","getSimilarityExtractionMethod","similarityIndex","handleSimilaritySearchExtractionMethodPanelToggle","$setValidity","updateRetrievalConnectorPanel","clearSelection","retrievalExtractionExtractionMethod","getRetrievalExtractionMethod","retrievalConnectorInstance","handleRetrievalConnectorExtractionMethodPanelToggle","checkIfFTSEnabled","getFTSSearchExtractionMethod","FTS_SEARCH","getRepositoryModel","repositoryModel","getParamValue","REPOSITORY_PARAMS","enableFtsIndex","logAndShowError","finally","openExternalIntegrationConfig","onRepositoryChange","refreshValidations","find","AUTOCOMPLETE_IRI_DISCOVERY_SEARCH","selectedRepositoryInfo","getSelectedRepositoryInfo","checkAutocompleteStatus","repositoryLocation","autocompleteEnabled","onRestoreDefaultContextSize","contextSizeCopy","onRestoreDefaultSystemInstructions","instructions","systemInstruction","systemInstructionCopy","onRestoreDefaultUserInstructions","userInstruction","userInstructionCopy","onTemperatureChange","temperature","value","onSystemInstructionChange","openModalAlert","title","onExplainAgentSettings","explainAgentSettings","agentInstructionsExplain","options","size","getSuggestions","inputText","getAutocompleteSuggestions","mapUriAsNtripleAutocompleteResponse","suggestions","map","text","onVectorFieldsChange","connectorFields","selectedConnectorField","hasConnectorData","connectorMap","Object","keys","shouldShowVectorFields","provider","connectorType","indexName","isVectorProvider","fields","getVectorFieldsFromMap","onSimilarityIndexChange","option","similarityIndexOption","undefined","CREATE","payload","createAgent","EDIT","editAgent","CLONE","cloneAgent","newAgentPayload","agentModel","success","updatedAgent","errorMessageKey","hasExtractionMethodSelected","selectRepositoryInfo","repository","location","p","OPENSEARCH","ELASTICSEARCH","clearSelectedVectorField","connectorField","connectorInstances","isConnectorPristine","$pristine","getSimilarityIndexesWithVectorFields","indexes","buildSelectMenuOptions","entries","forEach","types","groupLabel","typeName","group","buildSimilarityIndexSelectOptions","updateSelectedSimilarityIndex","updateVectorFields","currentType","currentName","selectedIndex","index","opt","SelectMenuOptionsModel","getConnectorPrefixByName","prefix","getConnectorsByTypeAsSelectMenuOptions","connectors","updateSelectedRetrievalConnector","selectedConnector","connector","SPARQL","RETRIEVAL","handleAutocompleteExtractionMethodPanelToggle","IRI_DISCOVERY_SEARCH","clearRetrievalConnectorSelection","onTabVisibilityChanged","document","hidden","refreshSliderById","elementId","slider","getElementById","addEventListener","removeAllSubscribers","removeEventListener","setTimeout","rendered","topP","constant","arr","o"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=98268;export const __webpack_esm_ids__=[98268];export const __webpack_esm_modules__={98268(e,t,n){var o=n(60529);function r(e,t,n,r,i){return{template:'\n <style>\n .open-in-sparql-editor-btn {\n line-height: 0.75;\n }\n .open-in-sparql-editor-btn .fa:nth-child(2) {\n margin-left: -0.2em;\n margin-right: -0.2em;\n font-size: 0.9em;\n }\n </style>\n <button class="btn btn-link btn-sm open-in-sparql-editor-btn"\n data-test="open-in-sparql-editor-btn"\n gdb-tooltip="{{\'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip\' | translate}}" ng-click="onGoToSparqlEditorView()" guide-selector="open-in-sparql-editor-btn">\n <i class="ri-braces-line"></i>\n </button>\n ',restrict:"E",scope:{query:"@",repositoryId:"@",executeQuery:"@",addPrefixes:"@"},link:function(a,s){a.tooltipText="ttyg.chat_panel.btn.open_in_sparql_editor.tooltip";const p="true"===a.executeQuery,l="true"===a.addPrefixes;a.onGoToSparqlEditorView=()=>{const r=e.getActiveRepository();r&&r===a.repositoryId?c(a.query):n.openConfirmationModal({title:t.instant("common.confirm"),message:(0,o.Gz)(t.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:a.repositoryId})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},()=>{e.setRepository(e.getRepository(a.repositoryId)),c(a.query)})};const c=e=>{if(l){const t=r.open("about:blank","_blank");i.addKnownPrefixes(JSON.stringify(e)).then(e=>{const n=e.data;d(n,t)}).catch(()=>{d(e,t)})}else d(e)},d=(e,t)=>{const n=`sparql?query=${encodeURIComponent(e)}&execute=${p}`;t?t.location.href=n:r.open(n,"_blank")}}}}angular.module("graphdb.framework.core.directives.open-in-sparql-editor",[]).directive("openInSparqlEditor",r),r.$inject=["$repositories","$translate","ModalService","$window","SparqlRestService"]}};
|
|
2
|
+
//# sourceMappingURL=98268.a1bd17e40ede031a0a00.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"98268.a1bd17e40ede031a0a00.bundle.js","mappings":"iJA0CA,SAASA,EAA4BC,EAAeC,EAAYC,EAAcC,EAASC,GACnF,MAAO,CAGHC,SAAU,mvBAiBVC,SAAU,IACVC,MAAO,CACHC,MAAO,IACPC,aAAc,IACdC,aAAc,IACdC,YAAa,KAEjBC,KAAM,SAASC,EAAQC,GAKnBD,EAAOE,YAAc,oDAIrB,MAAMC,EAAkC,SAAxBH,EAAOH,aACjBO,EAAyC,SAAvBJ,EAAOF,YAS/BE,EAAOK,uBAAyB,KAC5B,MAAMC,EAAqBnB,EAAcoB,sBACpCD,GAAsBA,IAAuBN,EAAOJ,aAerDY,EAAoBR,EAAOL,OAb3BN,EAAaoB,sBACT,CACIC,MAAOtB,EAAWuB,QAAQ,kBAC1BC,SAASC,EAAAA,EAAAA,IAAWzB,EAAWuB,QAAQ,wDAAyD,CAACf,aAAcI,EAAOJ,gBACtHkB,iBAAkB,qCAEtB,KACI3B,EAAc4B,cAAc5B,EAAc6B,cAAchB,EAAOJ,eAC/DY,EAAoBR,EAAOL,UAgB3C,MAAMa,EAAuBb,IACzB,GAAIS,EAAiB,CAEjB,MAAMa,EAAS3B,EAAQ4B,KAAK,cAAe,UAC3C3B,EAAkB4B,iBAAiBC,KAAKC,UAAU1B,IAC7C2B,KAAMC,IACH,MAAMC,EAAoBD,EAASE,KACnCC,EAA2BF,EAAmBP,KAEjDU,MAAM,KAEHD,EAA2B/B,EAAOsB,IAE9C,MACIS,EAA2B/B,IAI7B+B,EAA6BA,CAAC/B,EAAOiC,KACvC,MAAMC,EAAM,gBAAgBC,mBAAmBnC,cAAkBQ,IAC7DyB,EAEAA,EAAYG,SAASC,KAAOH,EAE5BvC,EAAQ4B,KAAKW,EAAK,UAG9B,EAER,CA9GAI,QACKC,OAAO,0DAA2D,IAClEC,UAAU,qBAAsBjD,GAErCA,EAA4BkD,QAAU,CAAC,gBAAiB,aAAc,eAAgB,UAAW,oB","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/open-in-sparql-editor/open-in-sparql-editor.directive.js"],"sourcesContent":["import {decodeHTML} from \"../../../../../app\";\n\n/**\n * @ngdoc directive\n * @name graphdb.framework.core.directives.open-in-sparql-editor.directive:openInSparqlEditor\n * @restrict E\n *\n * @description\n * This directive provides a button that allows users to open the SPARQL editor with a pre-defined query.\n * Optionally, it can handle repository switching before opening the editor and executing the query.\n * The directive can also trigger the query execution automatically if specified.\n *\n * @scope\n *\n * @param {string} query The SPARQL query to be opened and optionally executed in the SPARQL editor.\n * @param {string} repositoryId The ID of the repository to be selected before opening the SPARQL editor.\n * @param {string} executeQuery Flag that determines whether the query should be executed upon opening the editor.\n * It accepts 'true' or 'false'. If 'true', the query will be automatically executed.\n * @param {string} addPrefixes Flag that determines whether known prefixes should be added to the query before opening\n * the editor.\n *\n * @example\n * <open-in-sparql-editor\n * query=\"SELECT * WHERE {?s ?p ?o}\"\n * repository-id=\"myRepository\"\n * execute-query=\"true\">\n * </open-in-sparql-editor>\n *\n * @requires $repositories\n * @requires $translate\n * @requires ModalService\n * @requires $window\n *\n * @param {string} query The SPARQL query to be executed in the new tab.\n */\n\nangular\n .module('graphdb.framework.core.directives.open-in-sparql-editor', [])\n .directive('openInSparqlEditor', openInSparqlEditorDirective);\n\nopenInSparqlEditorDirective.$inject = ['$repositories', '$translate', 'ModalService', '$window', 'SparqlRestService'];\n\nfunction openInSparqlEditorDirective($repositories, $translate, ModalService, $window, SparqlRestService) {\n return {\n // Note: the line-height of the element must match the line-height of the icon.\n // This defines a composite FontAwesome icon to match the style of the surrounding icons.\n template: `\n <style>\n .open-in-sparql-editor-btn {\n line-height: 0.75;\n }\n .open-in-sparql-editor-btn .fa:nth-child(2) {\n margin-left: -0.2em;\n margin-right: -0.2em;\n font-size: 0.9em;\n }\n </style>\n <button class=\"btn btn-link btn-sm open-in-sparql-editor-btn\"\n data-test=\"open-in-sparql-editor-btn\"\n gdb-tooltip=\"{{'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip' | translate}}\" ng-click=\"onGoToSparqlEditorView()\" guide-selector=\"open-in-sparql-editor-btn\">\n <i class=\"ri-braces-line\"></i>\n </button>\n `,\n restrict: 'E',\n scope: {\n query: '@',\n repositoryId: '@',\n executeQuery: '@',\n addPrefixes: '@',\n },\n link: function($scope, element) {\n // =========================\n // Public variables\n // =========================\n\n $scope.tooltipText = 'ttyg.chat_panel.btn.open_in_sparql_editor.tooltip';\n // =========================\n // Private functions\n // =========================\n const execute = $scope.executeQuery === 'true';\n const autoAddPrefixes = $scope.addPrefixes === 'true';\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Opens the SPARQL editor in a new browser tab with the specified query and optional execution.\n */\n $scope.onGoToSparqlEditorView = () => {\n const activeRepositoryId = $repositories.getActiveRepository();\n if (!activeRepositoryId || activeRepositoryId !== $scope.repositoryId) {\n // Open a confirmation modal before switching the repository\n ModalService.openConfirmationModal(\n {\n title: $translate.instant('common.confirm'),\n message: decodeHTML($translate.instant('ttyg.chat_panel.dialog.confirm_repository_change.body', {repositoryId: $scope.repositoryId})),\n confirmButtonKey: 'ttyg.chat_panel.btn.proceed.label',\n },\n () => {\n $repositories.setRepository($repositories.getRepository($scope.repositoryId));\n prepareAndOpenQuery($scope.query);\n },\n );\n } else {\n // No repository switch needed, just open the SPARQL editor\n prepareAndOpenQuery($scope.query);\n }\n };\n // =========================\n // Private functions\n // =========================\n\n /**\n * Opens SPARQL editor view with passed query and handles repository switch if necessary.\n * @param {string} query\n */\n const prepareAndOpenQuery = (query) => {\n if (autoAddPrefixes) {\n // Open the tab NOW while the user-gesture is still active\n const newTab = $window.open('about:blank', '_blank');\n SparqlRestService.addKnownPrefixes(JSON.stringify(query))\n .then((response) => {\n const queryWithPrefixes = response.data;\n openInSparqlEditorInNewTab(queryWithPrefixes, newTab);\n })\n .catch(() => {\n // If there's an error adding prefixes, open the editor with the original query\n openInSparqlEditorInNewTab(query, newTab);\n });\n } else {\n openInSparqlEditorInNewTab(query);\n }\n };\n\n const openInSparqlEditorInNewTab = (query, existingTab) => {\n const url = `sparql?query=${encodeURIComponent(query)}&execute=${execute}`;\n if (existingTab) {\n // navigate the already-opened blank tab to the SPARQL editor with the query\n existingTab.location.href = url;\n } else {\n $window.open(url, '_blank');\n }\n };\n },\n };\n}\n"],"names":["openInSparqlEditorDirective","$repositories","$translate","ModalService","$window","SparqlRestService","template","restrict","scope","query","repositoryId","executeQuery","addPrefixes","link","$scope","element","tooltipText","execute","autoAddPrefixes","onGoToSparqlEditorView","activeRepositoryId","getActiveRepository","prepareAndOpenQuery","openConfirmationModal","title","instant","message","decodeHTML","confirmButtonKey","setRepository","getRepository","newTab","open","addKnownPrefixes","JSON","stringify","then","response","queryWithPrefixes","data","openInSparqlEditorInNewTab","catch","existingTab","url","encodeURIComponent","location","href","angular","module","directive","$inject"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=99448;export const __webpack_esm_ids__=[99448];export const __webpack_esm_modules__={64088(e,t,n){n.d(t,{A:()=>r});var a=a||{};a.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var a=0;a<t.children.length;a++)e(t.children[a]);if(1===t.children.length){var r=1.2*t.size;n&&(r=.1*t.children[0].size),t.children.push({name:"placeholder",size:r})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var a=t[n];"placeholder"===a.data.name?t.splice(n,1):a.children&&e(a.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var a=n.x-n.children[0].x;n.children[0].x+=a,r(n.children[0],a)}}function r(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,r(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,a=0;a<e.length;a++){var r=e[a];r.x-=t,r.y-=n}}};const r=a},88141(e,t,n){n.d(t,{A:()=>i}),n(62979);const a={selectAll:n(93462).selectAll};var r=r||{};r.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let n="";return _.each(t,function(e){n+=e.cssText}),n},generateBase64ImageSource:function(e){e||(e="svg");const t=a.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}};const i=r},99448(e,t,n){var a=n(75468),r=n(64088),i=n(19935),s=n(93462),c=n(88141),o=(n(32150),n(57154));function l(e,t,n,l,d,h,u,f,p,g,x,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(y,A,v){!function(y){let A=!1;let v,S;const C=s.pack().size([780,780]),R=s.scaleLinear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(s.interpolateHcl),E=s.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function P(){return E.append("svg:g").attrs({id:"main-group",transform:"translate(400,400)"})}function w(){return"true"===g.get(x.CLASS_HIERARCHY_HIDE_PREFIXES)}function H(){const e=c.A.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=3.3.3-RC1");s.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),s.selectAll("g").style("opacity",1);const t=c.A.Export.generateBase64ImageSource("#classChart svg");s.select(this).attrs({href:t,download:"class-hierarchy-"+h.getActiveRepository()+".svg"})}y.hidePrefixes=w();let I=P();const T=!!y.classHierarchyData?.classCount,L=h.getActiveRepository()&&!h.isSystemRepository();let D,k,N,b,F;(0,o.service)(o.LicenseContextService).onLicenseChanged(t=>{t?.valid&&!T&&L&&function(){e.loader=!0,e.hierarchyError=!1;const t=g.get(`classHierarchy-selectedGraph-${h.getActiveRepository()}`);n.getClassHierarchyData(null!==t?t.contextID.uri:"").success(function(t,n){e.loader=!1,207===n&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),y.classHierarchyData=t,s.select("#download-svg").on("mouseover",H)}).error(function(t){e.loader=!1,e.hierarchyError=getError(t),u.error(m.instant("graphexplore.error.request.failed",{name:p,error:getError(t)}))})}()});const z={};function O(n,c,o,h){b&&b(),F&&F(),s.selectAll("#main-group").remove(),I=P(),r.A.SingleChild.addPlaceholders(n,!0),S=s.hierarchy(n),S.sum(function(e){return e.size}),N=o||S,C(S);const u=S.descendants();let g;N.isInFocusTransitive=!0,r.A.SingleChild.removePlaceholders(u),r.A.SingleChild.centerNodes(u),r.A.SingleChild.makePositionsRelativeToZero(u),v||(v=(0,a.A)().attr("class","d3-tip").customPosition(function(e,t){return{top:"inherit",bottom:l.innerHeight-t.clientY+"px",right:l.innerWidth-t.clientX+"px"}}).html(function(e){return e.data.name}),E.call(v));const x=I.selectAll("circle").data(u).enter().append("g");c.doFade&&x.each(function(e){i.A.Transition.fadeIn(s.select(this),550)});let m=[];const w=x.append("circle").attr("class",function(e){return e.data.role}).attr("data-test",function(e){return"class-"+e.data.name}).attr("guide-selector",function(e){return"class-"+e.data.name}).style("fill",function(e){return e.children?R(e.depth):"#E0D0D0"}).each(function(e){if(e.circle=s.select(this),e.data.name!==p){const t=e.data.name;m.push({name:t}),z[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",function(t){c.noPrefixes||e.textHidden?v.show(e,t):v.hide(e)}),e.circle.on("mouseout",v.hide)}}).on("gdb-focus",(e,t)=>k(t)).on("gdb-zoom",(e,t)=>Z(t));let H;function T(e){s.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),H=e}function L(){y.showClassInfoPanel=!1}m&&(m=_.uniqBy(m,"name"),y.flattenedClassNames=m);const $=i.A.Click.delayDblClick();s.selectAll(".parent, .topLevelParent, .child, .root").call($),k=function(e){Z(e),e.data.name===p?(L(),s.selectAll(".selected").classed("selected",!1)):(T(e),A||(y.selectedClass=H,y.showClassInfoPanel=!0),y.$on("sidePanelClosed",function(t){s.selectAll(".selected").classed("selected",e.selected=!1)}))},$.on("click",function(e,t){t.data.id&&l.history.pushState({id:t.data.id},"classHierarchyPage"+t.data.id,"hierarchy#"+t.data.id),v.hide(),k(t)}),$.on("dblclick",function(t,a){a!==n&&(v.hide(),T(a),e.$broadcast("goToDomainRangeGraphView",H,N),t.stopPropagation())});let O=0;E.on("wheel",function(e){v.hide(),e.preventDefault(),e.stopPropagation();const t=Date.now();if(!(t-O>100))return;O=t;let n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");let a=e.target.__data__;if(a||(a=N),"in"===n){if(a!==N){for(;a.parent&&!a.parent.isInFocusTransitive;)a=a.parent;a.depth<N.depth&&(a=N)}if(a===N&&a.children){let e=a.children[0];for(let t=1;t<a.children.length;t++)a.children[t].sortingRank>e.sortingRank&&(e=a.children[t]);e.children&&(a=e)}else a.children||(a=a.parent);Z(a,!0)}else"out"===n&&(a=N.parent,a&&Z(a,!0));N.data.name===p&&l.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),U()});const Y=I.selectAll("text").data(u).enter().append("text").attr("class",function(e){return e.children&&e.children.length?"label":"label child-label"}).each(function(e){e.textSel=s.select(this)});c.noPrefixes?(Y.each(function(e){const t=e.data.name.indexOf(":");e.data.name.indexOf("http://")>-1?e.noPrefixName=e.data.name:t>-1&&(e.noPrefixName=e.data.name.substring(t+1))}),Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.noPrefixName,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)})):Y.style("font-size",function(e){return i.A.Text.calcFontSize(e.data.name,e.r)}).text(function(e){return i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r/3)}),Y.style("display",function(e){return e.parent&&e.parent.data===N.data?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")}),c.doFade&&!c.keepPrevState&&Y.each(function(e){i.A.Transition.fadeIn(s.select(this),550)}),D=function(){function e(e){e&&w.each(function(t){+e===t.data.id&&k(t)})}const n=t.hash();l.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};const B=I.selectAll("circle, text");function V(e,t){const n=800/e[2];g=e,B.attr("transform",function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"}),w.attr("r",function(e){return e.r*n}),t&&Y.each(function(e){e.data.fullName!==N.data.topLevelParentUri&&N.data.topLevelParentUri!==p||(e.textSel.style("display","none"),N.children&&N.children.length?_.each(N.children,function(e){e.textSel.style("display","inline")}):N.textSel.style("display","inline"),N.parent&&_.each(N.parent.children,function(e){e.data.name!==N.data.name&&e.textSel.style("display","inline")}))}),Y.style("font-size",function(e){return c.noPrefixes?i.A.Text.calcFontSize(e.noPrefixName,e.r*n):i.A.Text.calcFontSize(e.data.name,e.r*n)}).text(function(e){return c.noPrefixes?i.A.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):i.A.Text.getTextWithElipsisIfNeeded(e.data.name,e.r*n/3)})}function M(e){let t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function W(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display=""):(e.textHidden=!0,this.style.display="none")}function Z(e,t){if(d(function(){y.showExternalElements=e.data.name===p}),N===e)return;if(e.data.id&&l.history.replaceState({id:e.data.id},"classHierarchyPage"+e.data.id,"hierarchy#"+e.data.id),!e.children&&(e=e.parent,N===e))return;if(t&&(L(),s.selectAll(".selected").classed("selected",!1)),N.parent){let e=N;for(;e;)e.isInFocusTransitive=!1,e=e.parent}let n=e;for(;n;)n.isInFocusTransitive=!!n.children,n=n.parent;N=e,2*N.r/(2*N.r+20)<.3||y.currentSliderValue>y.currentBrowserLimit?(V([N.x,N.y,M(N.r)]),Y.each(function(e){W.call(this,e)})):s.transition().duration(f).tween("zoom",function(e){const t=s.interpolateZoom(g,[N.x,N.y,M(N.r)]);return function(e){V(t(e))}}).selectAll("text").each(W)}V([N.x,N.y,M(N.r)],h),b=y.$on("rootFocus",function(){l.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),k(S)}),F=y.$on("classSearch",function(e){k(e)})}function U(){const t=y.classHierarchyData.classCount;let n=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}let Y,B,V,M;window.addEventListener("resize",U),window.addEventListener("beforeunload",function e(){window.removeEventListener("resize",U),window.removeEventListener("beforeunload",e)}),y.$watch("classHierarchyData",function(){Y&&Y(),B&&B(),V&&V(),M&&M();let e=w();if(y.classHierarchyData.classCount){U();const t=structuredClone(y.classHierarchyData);const n=s.hierarchy(t).descendants().sort(function(e,t){return e.data.sortingRank>t.data.sortingRank?-1:e.data.sortingRank<t.data.sortingRank||e.data.depth>t.data.depth?1:e.data.depth<t.data.depth?-1:0});let a,r;function i(e,t){const n={keepPrevState:!0,noPrefixes:w()};r=n.noPrefixes,O(a||e,n,N,!0),d(()=>{g.set(x.CLASS_HIERARCHY_SWITCH_PREFIXES,t),D(),A=!1},70)}function c(e,n,s){if(!e)return;g.set(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),a={name:p,children:[]};const c=new Set;for(let t=1;t<=e;t++)c.add(n[t].data.id),n[t].parent===n[0]&&a.children.push(n[t].data);(function e(t){if(!t.children)return;const n=[];for(const e of t.children)c.has(e.id)&&n.push($.extend({},e));t.children=n;for(const n of t.children)e(n)})(a),s?(r=angular.isUndefined(r)?w():r,O(a,{noPrefixes:r})):i(t)}const o=g.get(x.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(o)c(o,n);else{const h={doFade:!0,keepPrevState:!0,noPrefixes:w()};O(t,h),D()}let l;Y=y.$watch("hidePrefixes",function(n){angular.isUndefined(n)||e?e=void 0:d(function(){A=!0,function(e){angular.isUndefined(e)||g.set(x.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),i(t,!0)},50)},!0),B=y.$watch("currentSliderValue",function(e){c(e,n,!0)},!0),M=y.$on("onEnterKeypressSearchAction",function(e){l&&k(l)}),V=y.$on("searchedClass",function(e,t){l=z[t.name],l&&k(l)})}},!0)}(y)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]}};
|
|
2
|
+
//# sourceMappingURL=99448.147164e93b1ab3a87d36.bundle.js.map
|