graphdb-workbench 3.3.2 → 3.3.3-TR1
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/{13231.d7107e7549453805e13a.bundle.js → 13231.8bbbe30c10e6c0dfdba3.bundle.js} +2 -2
- package/dist/13231.8bbbe30c10e6c0dfdba3.bundle.js.map +1 -0
- 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.cc471c67239fa24901cc.bundle.js +2 -0
- package/dist/38644.cc471c67239fa24901cc.bundle.js.map +1 -0
- package/dist/39518.1c641a7dc1c50a526845.bundle.js +2 -0
- package/dist/{39518.4d72b74fffba395c6b2a.bundle.js.map → 39518.1c641a7dc1c50a526845.bundle.js.map} +1 -1
- package/dist/{64118.b06aebc9f8d7e822244f.bundle.js → 64118.177457589341de779668.bundle.js} +2 -2
- package/dist/64118.177457589341de779668.bundle.js.map +1 -0
- package/dist/67888.7224e1b2689d73c4d468.bundle.js +2 -0
- package/dist/67888.7224e1b2689d73c4d468.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/{82926.ce1d6bf65b09288a2b10.bundle.js → 82926.bbdac6a7e9eb883ae97b.bundle.js} +2 -2
- package/dist/{82926.ce1d6bf65b09288a2b10.bundle.js.map → 82926.bbdac6a7e9eb883ae97b.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.b9922814bd15808a9d1c.bundle.js +2 -0
- package/dist/99448.b9922814bd15808a9d1c.bundle.js.map +1 -0
- package/dist/index.html +8 -8
- 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.4d8a4e8dde83fc9ac427.js +3 -0
- package/dist/{legacyWorkbench.40eba9e09196e1483221.js.map → legacyWorkbench.4d8a4e8dde83fc9ac427.js.map} +1 -1
- 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/package.json +1 -1
- package/dist/13231.d7107e7549453805e13a.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/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/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/{legacyWorkbench.40eba9e09196e1483221.js.LICENSE.txt → legacyWorkbench.4d8a4e8dde83fc9ac427.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"78070.13538271878de6a98862.bundle.js","mappings":"yKAAO,MAAMA,UAA4BC,O,wCCAlC,MAAMC,EACTC,WAAAA,CAAYC,EAAQC,EAAiBC,EAAYC,GAC7CC,KAAKJ,OAASA,EACdI,KAAKD,OAASA,EACdC,KAAKH,gBAAkBA,EACvBG,KAAKF,WAAaA,CACtB,EAGG,MAAMG,EAAgC,CACzCC,MAAO,QACPC,QAAS,U,gCCXN,MAAMC,EAAmB,CAC5B,OAAU,SACV,OAAU,SACV,KAAQ,O,yMC0BZ,MAQMC,EAASC,EAAAA,EAAeD,OAyB9B,SAASE,EAAiBC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GACtB,MAAMC,GAAyBC,EAAAA,EAAAA,SAAQC,EAAAA,wBAEvC3B,KAAK4B,WAAa,GAElB,MAAMC,EAAkB,gBACxB,IAAIC,EAAmBjB,EAAckB,sBACjCC,EAAcnB,EAAcoB,wBAKhCxB,EAAOyB,kBAAeC,EACtB1B,EAAO2B,sBAAmBD,EAC1B1B,EAAO4B,SAAW,CAAC,EACnB5B,EAAO6B,kBAAmB,EAC1B7B,EAAO8B,mBAAoB,EAE3B,MAAMC,EAAuC,IAAIC,IACjD,IAAIC,GAAqB,EASzBjC,EAAOkC,aAAgBC,IACnBnC,EAAOyB,aAAe,CAClBW,SAAUC,EACVC,YAAaC,EAAAA,EACbX,SAAU5B,EAAO4B,SACjBY,MAAOjB,GAAevB,EAAO6B,iBAC7BY,OAAQlB,GAAevB,EAAO8B,kBAC9BY,mBAAoB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AKlO,EAAO0Q,OAAO1Q,EAAO2Q,0BA9INC,IACzBA,IAGLvP,EAAmBjB,EAAckB,sBACjCC,EAAcnB,EAAcoB,sBAAsBoP,GAC9C9P,EAAoBiD,IAAIhD,EAAOgP,oBAAsB1O,GACrDoJ,GAAK,GACLqF,MAEArF,GAAK,MAqIjB,CAzkBAoG,QACKC,OAAO,8CAXI,CACZ,eACA,4CACA,6CACA,gDACA,gDAOCvH,WAAW,mBAAoBzJ,GAEpCA,EAAiBiR,QAAU,CACvB,aACA,SACA,KACA,YACA,mBACA,gBACA,YACA,SACA,aACA,oBACA,wBACA,gBACA,eACA,wBACA,sBACA,sBACA,S,kECjDJ,MAAMC,EAAsBC,GACjBA,EAAO1L,QAAQ,SAAU,IAG9BkH,EAAazE,GACM,iBAAVA,EACU,SAAVA,EAEJkJ,QAAQlJ,GAGbmJ,EAAeC,GACZA,GAGEC,EAAAA,EAAAA,YAAWD,EAAKE,eAFZF,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/models/sparql/cancel-aborting-query.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/ontotext-yasgui/before-update-query-result.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/models/connectors/connector-command.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/sparql-editor/controllers.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/utils/string-utils.js"],"sourcesContent":["export class CancelAbortingQuery extends Error {}\n","export class BeforeUpdateQueryResult {\n constructor(status, messageLabelKey, parameters, mesage) {\n this.status = status;\n this.mesage = mesage;\n this.messageLabelKey = messageLabelKey;\n this.parameters = parameters;\n }\n}\n\nexport const BeforeUpdateQueryResultStatus = {\n ERROR: 'error',\n SUCCESS: 'success'\n};\n","export const ConnectorCommand = {\n 'CREATE': 'create',\n 'REPAIR': 'repair',\n 'DROP': 'drop'\n};\n","import {\n savedQueryResponseMapper, buildQueryModel,\n} from \"../rest/mappers/saved-query-mapper\";\nimport {RouteConstants} from \"../utils/route-constants\";\nimport 'angular/rest/connectors.rest.service';\nimport 'angular/externalsync/controllers';\nimport {YasguiComponentDirectiveUtil} from \"../core/directives/yasgui-component/yasgui-component-directive.util\";\nimport {QueryType} from \"../models/ontotext-yasgui/query-type\";\nimport {ConnectorCommand} from \"../models/connectors/connector-command\";\nimport {BeforeUpdateQueryResult, BeforeUpdateQueryResultStatus} from \"../models/ontotext-yasgui/before-update-query-result\";\nimport {EventDataType} from \"../models/ontotext-yasgui/event-data-type\";\nimport {decodeHTML} from \"../../../app\";\nimport {toBoolean} from \"../utils/string-utils\";\nimport {VIEW_SPARQL_EDITOR} from \"../models/sparql/constants\";\nimport {CancelAbortingQuery} from \"../models/sparql/cancel-aborting-query\";\nimport {QueryMode} from \"../models/ontotext-yasgui/query-mode\";\nimport 'angular/core/services/event-emitter-service';\nimport {LoggerProvider} from \"../core/services/logger-provider\";\nimport {\n navigateTo,\n LanguageContextService,\n ServiceProvider,\n EventService,\n EventName,\n SecurityContextService,\n service,\n REPOSITORY_ID_PARAM,\n} from \"@ontotext/workbench-api\";\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.rest.connectors.service',\n 'graphdb.framework.externalsync.controllers',\n 'graphdb.framework.utils.event-emitter-service',\n 'graphdb.framework.utils.localstorageadapter',\n];\n\nconst logger = LoggerProvider.logger;\n\nangular\n .module('graphdb.framework.sparql-editor.controllers', modules)\n .controller('SparqlEditorCtrl', SparqlEditorCtrl);\n\nSparqlEditorCtrl.$inject = [\n '$rootScope',\n '$scope',\n '$q',\n '$location',\n '$languageService',\n '$repositories',\n '$uibModal',\n 'toastr',\n '$translate',\n 'SparqlRestService',\n 'ConnectorsRestService',\n 'GuidesService',\n 'ModalService',\n 'MonitoringRestService',\n 'EventEmitterService',\n 'LocalStorageAdapter',\n 'LSKeys'];\n\nfunction SparqlEditorCtrl($rootScope,\n $scope,\n $q,\n $location,\n $languageService,\n $repositories,\n $uibModal,\n toastr,\n $translate,\n SparqlRestService,\n ConnectorsRestService,\n GuidesService,\n ModalService,\n MonitoringRestService,\n EventEmitterService,\n LocalStorageAdapter,\n LSKeys) {\n const securityContextService = service(SecurityContextService);\n\n this.repository = '';\n\n const QUERY_EDITOR_ID = '#query-editor';\n let activeRepository = $repositories.getActiveRepository();\n let isOntopRepo = $repositories.isActiveRepoOntopType();\n\n /**\n * @type {OntotextYasguiConfig}\n */\n $scope.yasguiConfig = undefined;\n $scope.savedQueryConfig = undefined;\n $scope.prefixes = {};\n $scope.inferUserSetting = true;\n $scope.sameAsUserSetting = true;\n\n const tabIdToConnectorProgressModalMapping = new Map();\n let internallyReloaded = false;\n\n // =========================\n // Public functions\n // =========================\n /**\n * Updates the Yasgui configuration\n * @param {boolean} clearYasguiState if set to true, the Yasgui will reinitialize and clear all tab results. Queries will remain.\n */\n $scope.updateConfig = (clearYasguiState) => {\n $scope.yasguiConfig = {\n endpoint: getEndpoint,\n componentId: VIEW_SPARQL_EDITOR,\n prefixes: $scope.prefixes,\n infer: isOntopRepo || $scope.inferUserSetting,\n sameAs: isOntopRepo || $scope.sameAsUserSetting,\n yasrToolbarPlugins: [exploreVisualGraphYasrToolbarElementBuilder],\n beforeUpdateQuery: getBeforeUpdateQueryHandler(),\n outputHandlers: new Map([\n [EventDataType.QUERY_EXECUTED, queryExecutedHandler],\n [EventDataType.REQUEST_ABORTED, requestAbortedHandler],\n ]),\n clearState: clearYasguiState !== undefined ? clearYasguiState : false,\n };\n };\n\n $scope.getActiveRepositoryNoError = () => {\n return activeRepository;\n };\n\n // =========================\n // Private functions\n // =========================\n const getYasqe = (yasgui) => {\n const tab = yasgui.getTab();\n if (!tab) {\n return;\n }\n return tab.getYasqe();\n };\n\n const getEndpoint = (yasgui) => {\n const yasqe = getYasqe(yasgui);\n if (!yasqe) {\n // this can happen if open saprql view for first time (browser local store is clear);\n return;\n }\n return $repositories.resolveSparqlEndpoint(yasqe.getQueryMode());\n };\n\n /**\n * Initializes the editor from the URL parameters.\n * @param {boolean} clearYasguiState if set to true, the Yasgui will reinitialize and clear all tab results. Queries will remain.\n * The default is false.\n */\n const initViewFromUrlParams = (clearYasguiState = false) => {\n $scope.updateConfig(clearYasguiState);\n const queryParams = $location.search();\n if (queryParams.hasOwnProperty(RouteConstants.savedQueryName)) {\n // init new tab from shared saved query link\n initTabFromSavedQuery(queryParams);\n } else if (queryParams.hasOwnProperty(RouteConstants.query)) {\n // init new tab from shared query link\n initTabFromSharedQuery(queryParams);\n } else if (GuidesService.isActive()) {\n openNewTab();\n }\n };\n\n // ================================\n // = Setup output handlers\n // ================================\n /**\n * Handles the \"queryExecuted\" event emitted by ontotext-yasgui. The event is fired immediately after the request is executed, whether it succeeds or fails.\n * @param {QueryExecutedEvent} queryExecutedRequest - the event payload.\n */\n const queryExecutedHandler = (queryExecutedRequest) => {\n const connectorProgressModal = tabIdToConnectorProgressModalMapping.get(queryExecutedRequest.tabId);\n if (connectorProgressModal) {\n connectorProgressModal.dismiss();\n tabIdToConnectorProgressModalMapping.delete(queryExecutedRequest.tabId);\n }\n };\n\n /**\n * Handles the \"requestAborted\" event emitted by the ontotext-yasgui. The event is fired when a request is aborted.\n *\n * @param {RequestAbortedEvent} requestAbortedEvent the event payload containing the request object and the query mode.\n */\n const requestAbortedHandler = (requestAbortedEvent) => {\n if (requestAbortedEvent && QueryMode.UPDATE !== requestAbortedEvent.queryMode) {\n const repository = requestAbortedEvent.getRepository();\n const currentTrackAlias = requestAbortedEvent.getQueryTrackAlias();\n if (repository && currentTrackAlias) {\n MonitoringRestService.deleteQuery(currentTrackAlias, repository);\n }\n }\n };\n\n // =========================\n // Private function\n // =========================\n\n const initTabFromSavedQuery = (queryParams) => {\n const savedQueryName = queryParams[RouteConstants.savedQueryName];\n const savedQueryOwner = queryParams[RouteConstants.savedQueryOwner];\n const isExecuteRequested = toBoolean(queryParams.execute);\n\n SparqlRestService.getSavedQuery(savedQueryName, savedQueryOwner).then((res) => {\n const savedQuery = savedQueryResponseMapper(res);\n openNewTab(savedQuery)\n .then(clearUrlParameters)\n .then(() => autoExecuteQueryIfRequested(isExecuteRequested));\n }).catch((err) => {\n toastr.error($translate.instant('query.editor.missing.saved.query.data.error', {\n savedQueryName: savedQueryName,\n error: getError(err),\n }));\n });\n };\n\n const initTabFromSharedQuery = (queryParams) => {\n const queryName = queryParams[RouteConstants.name];\n const query = queryParams[RouteConstants.query];\n const queryOwner = queryParams[RouteConstants.owner];\n const isExecuteRequested = toBoolean(queryParams.execute);\n const sharedQueryModel = buildQueryModel(query, queryName, queryOwner, true);\n openNewTab(sharedQueryModel)\n .then(clearUrlParameters)\n .then(() => autoExecuteQueryIfRequested(isExecuteRequested));\n };\n\n /**\n * Open a new tab with query described in <code>sparqlQuery</code>.\n *\n * @param {TabQueryModel} sparqlQuery\n *\n * @return {Promise<void>}\n */\n const openNewTab = (sparqlQuery) => {\n return YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync(QUERY_EDITOR_ID)\n .then((yasguiComponent) => yasguiComponent.openTab(sparqlQuery))\n .then((tab) => YasguiComponentDirectiveUtil.highlightTabName(tab));\n };\n\n const clearUrlParameters = () => {\n internallyReloaded = true;\n const currentParams = $location.search();\n // Keep only the repositoryId parameter (if any). This will prevent router event from being triggered again and\n // reinitializing the repositoryId param thus adding a new history entry.\n const repositoryId = currentParams[REPOSITORY_ID_PARAM];\n $location.search(repositoryId ? {repositoryId} : {});\n // Replace current URL without adding a new history entry\n $location.replace();\n };\n\n const autoExecuteQueryIfRequested = (isRequested) => {\n if (isRequested) {\n return YasguiComponentDirectiveUtil.getOntotextYasguiElementAsync(QUERY_EDITOR_ID)\n .then(getQueryMode)\n .then(confirmAndExecuteQuery);\n }\n return Promise.resolve();\n };\n\n const getQueryMode = (yasguiComponent) => {\n return yasguiComponent.getQueryMode()\n .then((queryMode) => {\n return {yasguiComponent, queryMode};\n });\n };\n\n const confirmAndExecuteQuery = ({yasguiComponent, queryMode}) => {\n if (queryMode !== 'update') {\n return yasguiComponent.query();\n }\n\n return new Promise((resolve) => {\n const title = $translate.instant('confirm.execute');\n const message = decodeHTML($translate.instant('query.editor.automatically.execute.update.warning'));\n ModalService.openConfirmation(title, message, () => resolve(yasguiComponent.query()), () => resolve());\n });\n };\n\n const setInferAndSameAs = (principal) => {\n $scope.inferUserSetting = principal?.appSettings.DEFAULT_INFERENCE;\n $scope.sameAsUserSetting = principal?.appSettings.DEFAULT_SAMEAS;\n };\n\n const exploreVisualGraphYasrToolbarElementBuilder = {\n createElement: (yasr) => {\n const buttonName = document.createElement('span');\n buttonName.classList.add(\"explore-visual-graph-button-name\");\n const exploreVisualButtonWrapperElement = document.createElement('button');\n exploreVisualButtonWrapperElement.classList.add(\"explore-visual-graph-button\");\n exploreVisualButtonWrapperElement.classList.add(\"icon-data\");\n exploreVisualButtonWrapperElement.onclick = function() {\n const paramsToParse = {\n query: yasr.yasqe.getValue(),\n sameAs: yasr.yasqe.getSameAs(),\n inference: yasr.yasqe.getInfer(),\n };\n $location.path('graphs-visualizations').search(paramsToParse);\n };\n exploreVisualButtonWrapperElement.appendChild(buttonName);\n return exploreVisualButtonWrapperElement;\n },\n updateElement: (element, yasr) => {\n element.classList.add('hidden');\n if (!yasr.hasResults()) {\n return;\n }\n const queryType = yasr.yasqe.getQueryType();\n\n if (QueryType.CONSTRUCT === queryType || QueryType.DESCRIBE === queryType) {\n element.classList.remove('hidden');\n }\n element.querySelector('.explore-visual-graph-button-name').innerText = $translate.instant(\"query.editor.visual.btn\");\n },\n getOrder: () => {\n return 2;\n },\n };\n\n const createParameter = (key, value) => {\n return {key, value};\n };\n\n const getCommandParameters = (response) => {\n return [createParameter('name', response.data.name)];\n };\n\n const toNoCommandResponse = () => {\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS);\n };\n\n const toHasNotSupport = (response) => {\n const parameters = [\n createParameter('connectorName', response.data.connectorName),\n createParameter('pluginName', response.data.pluginName),\n ];\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.ERROR, 'query.editor.inactive.plugin.warning.msg', parameters);\n };\n\n const createConnectorProgressDialog = (actionName, iri, connectorName) => {\n const progressScope = $scope.$new(true);\n progressScope.beingBuiltConnector = {\n percentDone: 0,\n status: {\n processedEntities: 0,\n estimatedEntities: 0,\n indexedEntities: 0,\n entitiesPerSecond: 0,\n },\n actionName,\n eta: \"-\",\n inline: false,\n iri,\n name: connectorName,\n doneCallback: function() {\n connectorProgressModal.dismiss('cancel');\n },\n };\n progressScope.getHumanReadableSeconds = $scope.getHumanReadableSeconds;\n\n const connectorProgressModal = $uibModal.open({\n templateUrl: 'pages/connectorProgress.html',\n controller: 'CreateProgressCtrl',\n size: 'lg',\n backdrop: 'static',\n scope: progressScope,\n });\n return connectorProgressModal;\n };\n\n const toCreateCommandResponse = (response, tabId) => {\n const connectorProgressModal = createConnectorProgressDialog($translate.instant('externalsync.creating'), response.data.iri, response.data.name);\n tabIdToConnectorProgressModalMapping.set(tabId, connectorProgressModal);\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'created.connector', getCommandParameters(response));\n };\n\n const toRepairCommandResponse = (response, tabId) => {\n const connectorProgressModal = createConnectorProgressDialog($translate.instant('externalsync.repairing'), response.data.iri, response.data.name);\n tabIdToConnectorProgressModalMapping.set(tabId, connectorProgressModal);\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'query.editor.repaired.connector', getCommandParameters(response));\n };\n\n const toDropCommandResponse = (response) => {\n return new BeforeUpdateQueryResult(BeforeUpdateQueryResultStatus.SUCCESS, 'externalsync.delete.success.msg', getCommandParameters(response));\n };\n\n const getBeforeUpdateQueryHandler = () => (query, tabId) => {\n return ConnectorsRestService.checkConnector(query)\n .then((response) => {\n if (!response.data.command) {\n return toNoCommandResponse();\n }\n if (!response.data.hasSupport) {\n return toHasNotSupport(response);\n }\n\n if (ConnectorCommand.CREATE === response.data.command) {\n return toCreateCommandResponse(response, tabId);\n }\n\n if (ConnectorCommand.REPAIR === response.data.command) {\n return toRepairCommandResponse(response, tabId);\n }\n\n if (ConnectorCommand.DROP === response.data.command) {\n return toDropCommandResponse(response);\n }\n }).catch((error) => {\n // For some reason we couldn't check if this is a connector update, so just catch the exception,\n // to not stop the execution of query.\n logger.error('Checking connector error: ', error);\n });\n };\n\n const getExitPageConfirmMessage = (ongoingRequestsInfo) => {\n let exitPageConfirmMessage = \"view.sparql-editor.leave_page.run_queries.confirmation.\";\n if (!ongoingRequestsInfo || ongoingRequestsInfo.queriesCount < 1) {\n exitPageConfirmMessage += \"none_queries_\";\n } else if (ongoingRequestsInfo.queriesCount === 1) {\n exitPageConfirmMessage += \"one_query_\";\n } else {\n exitPageConfirmMessage += \"queries_\";\n }\n\n if (!ongoingRequestsInfo.updatesCount || ongoingRequestsInfo.updatesCount === 0) {\n exitPageConfirmMessage += \"non_updates\";\n } else if (ongoingRequestsInfo.updatesCount === 1) {\n exitPageConfirmMessage += \"one_update\";\n } else {\n exitPageConfirmMessage += \"updates\";\n }\n\n exitPageConfirmMessage += \".message\";\n const params = {\n queriesCount: ongoingRequestsInfo.queriesCount,\n updatesCount: ongoingRequestsInfo.updatesCount,\n };\n return $translate.instant(exitPageConfirmMessage, params);\n };\n\n // Initialization and bootstrap\n const init = (clearYasguiState) => {\n // This script check is required, because of the following scenario:\n // I am in the SPARQL view;\n // Then I go to a different view and change the language;\n // Then I return to the SPARQL view. I will see that the Google chart and Pivot table will have their\n // original scripts loaded still.\n // THE FIX: Get all the scripts (if there are none, the correct language will be loaded). If there are\n // scripts, and they don't match those, which are loaded already, the page needs to reload when opening\n // the SPARQL view, otherwise the Google chart and Pivot table configs will be in the old language.\n const googleScripts = document.querySelectorAll(`script[src*=\"https://www.gstatic.com/\"]`);\n if (googleScripts.length > 0) {\n const currentLang = $languageService.getLanguage();\n let searchTerm = 'module.js';\n if ('en' !== currentLang) {\n searchTerm = `module__${currentLang}.js`;\n }\n if (!Array.prototype.some.call(googleScripts, (script) => script.src.includes(searchTerm))) {\n location.reload();\n return;\n }\n }\n const principal = securityContextService.getAuthenticatedUser();\n $q.when($repositories.getPrefixes(activeRepository))\n .then((usedPrefixes) => {\n $scope.prefixes = usedPrefixes;\n setInferAndSameAs(principal);\n // check is there is a saved query or query url parameter and init the editor\n initViewFromUrlParams(clearYasguiState);\n });\n // TODO: we should also watch for changes in namespaces\n // scope.$watch('namespaces', function () {});\n };\n\n // =========================\n // Event handlers\n // =========================\n const subscriptions = [];\n\n const repositoryChangedHandler = (object) => {\n if (!object) {\n return;\n }\n activeRepository = $repositories.getActiveRepository();\n isOntopRepo = $repositories.isActiveRepoOntopType(object);\n if (LocalStorageAdapter.get(LSKeys.SPARQL_LAST_REPO) !== activeRepository) {\n init(true);\n persistLasstUsedRepository();\n } else {\n init(false);\n }\n };\n\n const beforeunloadHandler = (event) => {\n const ontotextYasguiElement = YasguiComponentDirectiveUtil.getOntotextYasguiElement(QUERY_EDITOR_ID);\n if (!ontotextYasguiElement) {\n return;\n }\n // If we set event.returnValue, the browser will prompt the user for confirmation to leave the page,\n // but we don't have a way to handle the user's choice.\n // Therefore, we can't take any action, so we simply proceed to abort all requests.\n ontotextYasguiElement.abortAllRequests().then(() => {});\n };\n\n window.addEventListener('beforeunload', beforeunloadHandler);\n\n const confirmIfHaveRunQuery = (ongoingRequestsInfo) => new Promise((resolve, reject) => {\n if (!ongoingRequestsInfo || ongoingRequestsInfo.queriesCount < 1 && ongoingRequestsInfo.updatesCount < 1) {\n resolve();\n return;\n }\n\n const title = $translate.instant('common.confirm');\n const message = decodeHTML(getExitPageConfirmMessage(ongoingRequestsInfo));\n ModalService.openSimpleModal({\n title,\n message,\n warning: true,\n }).result.then(function() {\n resolve();\n }, function() {\n reject(new CancelAbortingQuery());\n });\n });\n let queriesAreCanceled = undefined;\n const locationChangeHandler = (eventPayload) => {\n if (internallyReloaded) {\n internallyReloaded = false;\n return;\n }\n const ontotextYasguiElement = YasguiComponentDirectiveUtil.getOntotextYasguiElement(QUERY_EDITOR_ID);\n if (!ontotextYasguiElement || queriesAreCanceled) {\n return;\n }\n\n const url = new URL(eventPayload.newUrl);\n const newUrl = url.pathname + url.search + url.hash;\n eventPayload.cancelNavigation();\n // First, we check if there are any ongoing requests initiated by the user.\n // If the user has ongoing requests, we request confirmation to abort them.\n // If the user confirms or there are no ongoing requests, we call the \"abortAllRequests\" method. This method will abort all requests.\n ontotextYasguiElement\n .getOngoingRequestsInfo()\n .then((hasRunQuery) => confirmIfHaveRunQuery(hasRunQuery))\n .then(() => ontotextYasguiElement.abortAllRequests())\n .then(() => {\n queriesAreCanceled = true;\n navigateTo(newUrl)();\n })\n .catch((error) => {\n if (!(error instanceof CancelAbortingQuery)) {\n logger.error(error);\n queriesAreCanceled = true;\n navigateTo(newUrl)();\n }\n });\n };\n\n subscriptions.push(\n ServiceProvider.get(EventService).subscribe(EventName.NAVIGATION_START, (eventPayload) => locationChangeHandler(eventPayload)),\n );\n\n const removeAllListeners = () => {\n subscriptions.forEach((subscription) => subscription());\n window.removeEventListener('beforeunload', beforeunloadHandler);\n };\n\n const finalizeAndDestroy = () => {\n persistLasstUsedRepository();\n removeAllListeners();\n };\n\n const persistLasstUsedRepository = () => {\n // The active repository is set when the controller is initialized and when the repository is changed.\n // It holds the actual repository when the YASGUI is initialized. DON'T use runtime fetching of the actual repository here, because there is a scenario:\n // 1. Open a tab with the SPARQL view open;\n // 2. Open the SPARQL view in another tab and execute a query;\n // 3. Switch to the repositories view and change the repository;\n // 4. Switch back to the SPARQL view, and the YASR is not cleared.\n // The problem occurs because of the second tab. When the repository is changed, its ID is persisted to local storage, which triggers the \"storage\" event to be fired.\n // In the main controller, a listener has been registered to listen to that event and refresh the page outside of the Angular scope.\n // Reloading the page triggers the destruction of the component and persistence of the active repository. The reloading of the page is out of the Angular scope, so the \"activeRepository\"\n // holds the real repository when the YASGUI is created. If we use $$repositories.getActiveRepository(), the new value will be fetched, which in this case will be incorrect.\n LocalStorageAdapter.set(LSKeys.SPARQL_LAST_REPO, activeRepository);\n };\n\n subscriptions.push(\n $scope.$on('language-changed', function() {\n location.reload();\n }),\n );\n\n const onLanguageChange = () => {\n // Do nothing on language change\n };\n\n const showLanguageChangeConfirmation = () => {\n return new Promise((resolve) => {\n ModalService.openSimpleModal({\n title: $translate.instant('query.editor.language.change.warning.title'),\n message: $translate.instant('query.editor.reload.page.warning'),\n warning: true,\n }).result.then(function() {\n resolve(true);\n }, function() {\n resolve(false);\n });\n });\n };\n\n const languageContextService = ServiceProvider.get(LanguageContextService);\n const onLanguageChangeSubscription = languageContextService.onSelectedLanguageChanged(onLanguageChange, showLanguageChangeConfirmation);\n\n // Subscribe to language change and ask to reload the page\n subscriptions.push(onLanguageChangeSubscription);\n\n // Deregister the watcher when the scope/directive is destroyed\n subscriptions.push($scope.$on('$destroy', finalizeAndDestroy));\n\n // Wait until the active repository object is set, otherwise \"canWriteActiveRepo()\" may return a wrong result and the \"ontotext-yasgui\"\n // readOnly configuration may be incorrect.\n subscriptions.push($scope.$watch($scope.getActiveRepositoryObject, repositoryChangedHandler));\n}\n","import {upperFirst} from \"lodash\";\n\n/**\n * Removes brackets and serial commas from IRIs\n * when used to create ids for links and markers,\n * because elements with ids that contain such\n * are not valid XHTML and cause a host problems\n * when trying to style individual elements\n * @param {string} string The string to be processed.\n * @return {string} A string where the special characters are removed.\n */\nconst removeSpecialChars = (string) => {\n return string.replace(/[()']/g, \"\");\n};\n\nconst toBoolean = (value) => {\n if (typeof value === 'string') {\n return value === 'true';\n }\n return Boolean(value);\n};\n\nconst toTitleCase = (text) => {\n if (!text) {\n return text;\n }\n return upperFirst(text.toLowerCase());\n};\n\nexport {\n removeSpecialChars,\n toBoolean,\n toTitleCase\n};\n\n"],"names":["CancelAbortingQuery","Error","BeforeUpdateQueryResult","constructor","status","messageLabelKey","parameters","mesage","this","BeforeUpdateQueryResultStatus","ERROR","SUCCESS","ConnectorCommand","logger","LoggerProvider","SparqlEditorCtrl","$rootScope","$scope","$q","$location","$languageService","$repositories","$uibModal","toastr","$translate","SparqlRestService","ConnectorsRestService","GuidesService","ModalService","MonitoringRestService","EventEmitterService","LocalStorageAdapter","LSKeys","securityContextService","service","SecurityContextService","repository","QUERY_EDITOR_ID","activeRepository","getActiveRepository","isOntopRepo","isActiveRepoOntopType","yasguiConfig","undefined","savedQueryConfig","prefixes","inferUserSetting","sameAsUserSetting","tabIdToConnectorProgressModalMapping","Map","internallyReloaded","updateConfig","clearYasguiState","endpoint","getEndpoint","componentId","VIEW_SPARQL_EDITOR","infer","sameAs","yasrToolbarPlugins","exploreVisualGraphYasrToolbarElementBuilder","beforeUpdateQuery","getBeforeUpdateQueryHandler","outputHandlers","EventDataType","QUERY_EXECUTED","queryExecutedHandler","REQUEST_ABORTED","requestAbortedHandler","clearState","getActiveRepositoryNoError","yasgui","yasqe","tab","getTab","getYasqe","resolveSparqlEndpoint","getQueryMode","queryExecutedRequest","connectorProgressModal","get","tabId","dismiss","delete","requestAbortedEvent","QueryMode","UPDATE","queryMode","getRepository","currentTrackAlias","getQueryTrackAlias","deleteQuery","openNewTab","sparqlQuery","YasguiComponentDirectiveUtil","getOntotextYasguiElementAsync","then","yasguiComponent","openTab","highlightTabName","clearUrlParameters","repositoryId","search","REPOSITORY_ID_PARAM","replace","autoExecuteQueryIfRequested","isRequested","confirmAndExecuteQuery","Promise","resolve","query","title","instant","message","decodeHTML","openConfirmation","createElement","yasr","buttonName","document","classList","add","exploreVisualButtonWrapperElement","onclick","paramsToParse","getValue","getSameAs","inference","getInfer","path","appendChild","updateElement","element","hasResults","queryType","getQueryType","QueryType","CONSTRUCT","DESCRIBE","remove","querySelector","innerText","getOrder","createParameter","key","value","getCommandParameters","response","data","name","createConnectorProgressDialog","actionName","iri","connectorName","progressScope","$new","beingBuiltConnector","percentDone","processedEntities","estimatedEntities","indexedEntities","entitiesPerSecond","eta","inline","doneCallback","getHumanReadableSeconds","open","templateUrl","controller","size","backdrop","scope","checkConnector","command","hasSupport","CREATE","toCreateCommandResponse","set","REPAIR","toRepairCommandResponse","DROP","toDropCommandResponse","pluginName","toHasNotSupport","catch","error","init","googleScripts","querySelectorAll","length","currentLang","getLanguage","searchTerm","Array","prototype","some","call","script","src","includes","location","reload","principal","getAuthenticatedUser","when","getPrefixes","usedPrefixes","appSettings","DEFAULT_INFERENCE","DEFAULT_SAMEAS","setInferAndSameAs","initViewFromUrlParams","queryParams","hasOwnProperty","RouteConstants","savedQueryName","savedQueryOwner","isExecuteRequested","toBoolean","execute","getSavedQuery","res","savedQuery","savedQueryResponseMapper","err","getError","initTabFromSavedQuery","queryName","queryOwner","owner","sharedQueryModel","buildQueryModel","initTabFromSharedQuery","isActive","subscriptions","beforeunloadHandler","event","ontotextYasguiElement","getOntotextYasguiElement","abortAllRequests","window","addEventListener","queriesAreCanceled","push","ServiceProvider","EventService","subscribe","EventName","NAVIGATION_START","eventPayload","url","URL","newUrl","pathname","hash","cancelNavigation","getOngoingRequestsInfo","hasRunQuery","confirmIfHaveRunQuery","ongoingRequestsInfo","reject","queriesCount","updatesCount","exitPageConfirmMessage","params","getExitPageConfirmMessage","openSimpleModal","warning","result","navigateTo","locationChangeHandler","persistLasstUsedRepository","SPARQL_LAST_REPO","$on","onLanguageChangeSubscription","LanguageContextService","onSelectedLanguageChanged","onLanguageChange","showLanguageChangeConfirmation","finalizeAndDestroy","forEach","subscription","removeEventListener","$watch","getActiveRepositoryObject","object","angular","module","$inject","removeSpecialChars","string","Boolean","toTitleCase","text","upperFirst","toLowerCase"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"94229.47dbdba202106c61dff1.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,EA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AC5BjF,KAAMA,EACN+E,OAAQA,EAAO,GACfD,QAASC,EAAO,IAExB,EAwBApN,EAAOL,IAAI,kBAAmB,WArB1BY,EAAgBgN,WACXnJ,QAAQ,SAASpC,GACdhC,EAAOwN,aAAexL,EACtBhC,EAAOyN,MAAQ7I,EAAE8I,KAAK1N,EAAOwN,cAC7BxN,EAAO2N,SAAW/I,EAAE8I,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 const timer = $timeout(function() {\n $window.history.back();\n }, 100);\n $scope.$on('$destroy', function() {\n $timeout.cancel(timer);\n });\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 const timer = $timeout(function() {\n $window.history.back();\n }, 100);\n $scope.$on('$destroy', function() {\n $timeout.cancel(timer);\n });\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","timer","history","back","pageTitle","submit","createUser","createUserHttp","User","AppSettings","AuthorityList","path","async","usernameError","$routeParams","securityContextService","SecurityContextService","params","userId","defaultUserSettings","url","getUserData","getUser","external","toUIModel","undefined","principal","getAuthenticatedUser","setAppSettings","debugMapping","mapping","method","split","getRolesMapping","getRoles","roleMappings","roles","keys","mappings","permissionsCount","filter","reverse","orderBy","p"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
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,x,F,_,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=F,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.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();x.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,x.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,x.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,x.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||e.agentSettingsForm.$setValidity("missingIndex",!0),t.selected){const t=e.agentSettingsForm&&e.agentSettingsForm.connectorInstances,o=!t||t.$pristine;if(e.connectorMap&&!o)return}if(e.agentFormModel.repositoryId&&t.expanded){e.extractionMethodLoaderFlags[t.method]=!0;const n=V();p.getSimilarityIndexesWithVectorFields(n.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&&(t.selected||e.agentSettingsForm.$setValidity("missingConnector",!0),t.expanded)){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)})}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.ec1b9d5e568d43ec3dcf.bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"95953.ec1b9d5e568d43ec3dcf.bundle.js","mappings":"+IACIA,QAAQC,OAAO,gDAAiD,IAC3DC,UAAU,sBAAuB,WAC9B,MAAO,CACHC,SAAU,IACVC,MAAO,CACHC,MAAO,IACPC,YAAa,KACbC,SAAU,KAYVC,UAAW,MAEfC,YAAa,kFACbC,WAAY,CAAC,SAAU,YAAa,WAAY,UAAW,WAAY,SAASC,EAAQC,EAAWC,EAAUC,EAASC,GAKlHJ,EAAOK,MAAO,EACdL,EAAOM,OAAS,CAACC,MAAO,IACxBP,EAAOQ,aAAe,GAMtB,MAAMC,EAAgB,GAWhBC,EAAaC,GACF,OAANA,EAAa,IAAM,GAAKA,GAAGC,cAMhCC,EAAkBA,KACpB,MAAMC,EAAOC,MAAMC,QAAQhB,EAAON,OAASM,EAAON,MAAQ,GACpDuB,EAAkBP,EAAUV,EAAOM,OAAOC,OAE5CP,EAAOQ,aADPS,EACsBH,EAAKI,OAAQC,GAAMT,EAAUS,EAAEC,OAAOC,SAASJ,IAE/CH,GAcxBQ,EAAcC,IACXvB,EAAOK,OAGPH,EAAS,GAAGsB,SAASD,EAAEE,SAb5BzB,EAAO0B,YAAY,WACf1B,EAAOK,MAAO,CAClB,KA4CJL,EAAO2B,WAAa,SAASJ,GACzBA,GAAKA,EAAEK,kBACP5B,EAAOK,MAAQL,EAAOK,K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BAAwB,GAElEvM,EAAOmJ,8BAA8BV,IAGnCiE,EAAqBA,CAACzB,GAAsB,EAAOmI,GAAmC,KACxFpT,EAAO6L,oBACP7L,EAAOgL,4BAA4BC,GACnCjL,EAAOuL,8BAA8B6H,GACrCpT,EAAOmJ,iCAGLkK,EAAyBA,KACtBC,SAASC,QACV7G,KAIF8G,EAAoBA,CAACC,EAAW5F,KAClC,MAAM6F,EAASJ,SAASK,eAAeF,GACnCC,IACAA,EAAO7F,MAAQA,IAYvByF,SAASM,iBAAiB,mBAAoBP,GAG9CrT,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,QAIvE,CA38BAxO,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 return;\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 method is deselected.\n $scope.agentSettingsForm.$setValidity('missingIndex', true);\n }\n if (extractionMethod.selected) {\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 }\n if (!$scope.agentFormModel.repositoryId) {\n return;\n }\n if (extractionMethod.expanded) {\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 /**\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 }\n\n if (extractionMethod.expanded) {\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 /**\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 });\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","updateRetrievalConnectorPanel","clearSelection","retrievalExtractionExtractionMethod","getRetrievalExtractionMethod","retrievalConnectorInstance","handleRetrievalConnectorExtractionMethodPanelToggle","checkIfFTSEnabled","getFTSSearchExtractionMethod","FTS_SEARCH","getRepositoryModel","repositoryModel","getParamValue","REPOSITORY_PARAMS","enableFtsIndex","logAndShowError","finally","$setValidity","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":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
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){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:"@"},link:function(i,p){i.tooltipText="ttyg.chat_panel.btn.open_in_sparql_editor.tooltip";const s="true"===i.executeQuery;i.onGoToSparqlEditorView=()=>{const r=e.getActiveRepository();r&&r===i.repositoryId?a(i.query):n.openConfirmationModal({title:t.instant("common.confirm"),message:(0,o.Gz)(t.instant("ttyg.chat_panel.dialog.confirm_repository_change.body",{repositoryId:i.repositoryId})),confirmButtonKey:"ttyg.chat_panel.btn.proceed.label"},()=>{e.setRepository(e.getRepository(i.repositoryId)),a(i.query)})};const a=e=>{r.open(`sparql?query=${encodeURIComponent(e)}&execute=${s}`,"_blank")}}}}angular.module("graphdb.framework.core.directives.open-in-sparql-editor",[]).directive("openInSparqlEditor",r),r.$inject=["$repositories","$translate","ModalService","$window"]}};
|
|
2
|
-
//# sourceMappingURL=98268.86ff371dde616b4e2a76.bundle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"98268.86ff371dde616b4e2a76.bundle.js","mappings":"iJAwCA,SAASA,EAA4BC,EAAeC,EAAYC,EAAcC,GAC1E,MAAO,CAGHC,SAAU,mvBAiBVC,SAAU,IACVC,MAAO,CACHC,MAAO,IACPC,aAAc,IACdC,aAAc,KAElBC,KAAM,SAASC,EAAQC,GAKnBD,EAAOE,YAAc,oDAIrB,MAAMC,EAAkC,SAAxBH,EAAOF,aASvBE,EAAOI,uBAAyB,KAC5B,MAAMC,EAAqBhB,EAAciB,sBACpCD,GAAsBA,IAAuBL,EAAOH,aAerDU,EAA2BP,EAAOJ,OAblCL,EAAaiB,sBACT,CACIC,MAAOnB,EAAWoB,QAAQ,kBAC1BC,SAASC,EAAAA,EAAAA,IAAWtB,EAAWoB,QAAQ,wDAAyD,CAACb,aAAcG,EAAOH,gBACtHgB,iBAAkB,qCAEtB,KACIxB,EAAcyB,cAAczB,EAAc0B,cAAcf,EAAOH,eAC/DU,EAA2BP,EAAOJ,UAgBlD,MAAMW,EAA8BX,IAEhCJ,EAAQwB,KAAK,gBAAgBC,mBAAmBrB,cAAkBO,IAAW,UAErF,EAER,CArFAe,QACKC,OAAO,0DAA2D,IAClEC,UAAU,qBAAsBhC,GAErCA,EAA4BiC,QAAU,CAAC,gBAAiB,aAAc,eAAgB,U","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 *\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'];\n\nfunction openInSparqlEditorDirective($repositories, $translate, ModalService, $window) {\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 },\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\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 openInSparqlEditorInNewTab($scope.query);\n },\n );\n } else {\n // No repository switch needed, just open the SPARQL editor\n openInSparqlEditorInNewTab($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 openInSparqlEditorInNewTab = (query) => {\n // Open the SPARQL editor in a new tab and execute the query\n $window.open(`sparql?query=${encodeURIComponent(query)}&execute=${execute}`, '_blank');\n };\n },\n };\n}\n"],"names":["openInSparqlEditorDirective","$repositories","$translate","ModalService","$window","template","restrict","scope","query","repositoryId","executeQuery","link","$scope","element","tooltipText","execute","onGoToSparqlEditorView","activeRepositoryId","getActiveRepository","openInSparqlEditorInNewTab","openConfirmationModal","title","instant","message","decodeHTML","confirmButtonKey","setRepository","getRepository","open","encodeURIComponent","angular","module","directive","$inject"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
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.2");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.2a87f387a8062617d893.bundle.js.map
|