graphdb-workbench 3.3.2-TR1 → 3.3.3-RC1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{10759.b2e1d643d681ebd9c124.bundle.js → 10759.57059f90014058a86952.bundle.js} +2 -2
- package/dist/10759.57059f90014058a86952.bundle.js.map +1 -0
- package/dist/13231.8bbbe30c10e6c0dfdba3.bundle.js +2 -0
- package/dist/13231.8bbbe30c10e6c0dfdba3.bundle.js.map +1 -0
- package/dist/{18961.01ff5fcc0f4b9f99236e.bundle.js → 18961.732c0c355509452ac6da.bundle.js} +2 -2
- package/dist/18961.732c0c355509452ac6da.bundle.js.map +1 -0
- package/dist/{20694.a738f5634ec09369dc85.bundle.js → 20694.03b5abf23347ae0bad65.bundle.js} +2 -2
- package/dist/20694.03b5abf23347ae0bad65.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.37a8cd71112da94401d9.bundle.js → 38644.8585127c40697ea58e00.bundle.js} +2 -2
- package/dist/{38644.37a8cd71112da94401d9.bundle.js.map → 38644.8585127c40697ea58e00.bundle.js.map} +1 -1
- package/dist/{39518.2871b32c37b20075dba3.bundle.js → 39518.0acc5eb68f38cc6b62a5.bundle.js} +2 -2
- package/dist/{39518.2871b32c37b20075dba3.bundle.js.map → 39518.0acc5eb68f38cc6b62a5.bundle.js.map} +1 -1
- package/dist/39874.17dde6245fc4cc91bb58.bundle.js +2 -0
- package/dist/39874.17dde6245fc4cc91bb58.bundle.js.map +1 -0
- package/dist/{45758.1212136a37dd4f7528f8.bundle.js → 45758.b9ce5fe0ed6c8c4fc141.bundle.js} +2 -2
- package/dist/45758.b9ce5fe0ed6c8c4fc141.bundle.js.map +1 -0
- package/dist/60560.62ed0cb0b3d07fecbf28.bundle.js +2 -0
- package/dist/60560.62ed0cb0b3d07fecbf28.bundle.js.map +1 -0
- package/dist/{60730.35493812d428872eddb6.bundle.js → 60730.a9fc5342637039776562.bundle.js} +2 -2
- package/dist/60730.a9fc5342637039776562.bundle.js.map +1 -0
- package/dist/{64118.b06aebc9f8d7e822244f.bundle.js → 64118.177457589341de779668.bundle.js} +2 -2
- package/dist/64118.177457589341de779668.bundle.js.map +1 -0
- package/dist/{67888.b75d9678cf65cd82f065.bundle.js → 67888.0f7d008c6f62683e2c62.bundle.js} +2 -2
- package/dist/{67888.b75d9678cf65cd82f065.bundle.js.map → 67888.0f7d008c6f62683e2c62.bundle.js.map} +1 -1
- package/dist/71099.ba1073458b96d9789756.bundle.js +2 -0
- package/dist/71099.ba1073458b96d9789756.bundle.js.map +1 -0
- package/dist/75881.148ce498d06784abfd6c.bundle.js +2 -0
- package/dist/75881.148ce498d06784abfd6c.bundle.js.map +1 -0
- package/dist/78070.d54ede951a08e1c8689d.bundle.js +2 -0
- package/dist/78070.d54ede951a08e1c8689d.bundle.js.map +1 -0
- package/dist/7815.89cc59b6625e84913351.bundle.js +2 -0
- package/dist/7815.89cc59b6625e84913351.bundle.js.map +1 -0
- package/dist/78681.6c8614aad7e5465be505.bundle.js +2 -0
- package/dist/78681.6c8614aad7e5465be505.bundle.js.map +1 -0
- package/dist/{82206.229877d7931849236456.bundle.js → 82206.473f6d4f79e12f6a9da6.bundle.js} +2 -2
- package/dist/82206.473f6d4f79e12f6a9da6.bundle.js.map +1 -0
- package/dist/{82926.99231caacc379c66487a.bundle.js → 82926.7d300bdaae879f385185.bundle.js} +2 -2
- package/dist/{82926.99231caacc379c66487a.bundle.js.map → 82926.7d300bdaae879f385185.bundle.js.map} +1 -1
- package/dist/{94229.47dbdba202106c61dff1.bundle.js → 94229.5a853fae006f6ef633af.bundle.js} +2 -2
- package/dist/94229.5a853fae006f6ef633af.bundle.js.map +1 -0
- package/dist/95953.1350a9dc14b22372b4e2.bundle.js +2 -0
- package/dist/95953.1350a9dc14b22372b4e2.bundle.js.map +1 -0
- package/dist/98268.a1bd17e40ede031a0a00.bundle.js +2 -0
- package/dist/98268.a1bd17e40ede031a0a00.bundle.js.map +1 -0
- package/dist/{99448.272a4ba1ce8032167bea.bundle.js → 99448.147164e93b1ab3a87d36.bundle.js} +2 -2
- package/dist/{99448.272a4ba1ce8032167bea.bundle.js.map → 99448.147164e93b1ab3a87d36.bundle.js.map} +1 -1
- package/dist/api/models/cookie/cookie-options.d.ts +17 -0
- package/dist/api/models/cookie/index.d.ts +1 -1
- package/dist/api/models/security/authenticated-user.d.ts +2 -0
- package/dist/api/models/tracking/cookie-consent.d.ts +39 -0
- package/dist/api/models/tracking/index.d.ts +1 -0
- package/dist/api/models/users/app-settings.d.ts +2 -2
- package/dist/api/ontotext-workbench-api.d.ts +3 -1
- package/dist/api/ontotext-workbench-api.js +1 -1
- package/dist/api/ontotext-workbench-api.js.map +1 -1
- package/dist/api/services/cookie/browser-cookie-store.d.ts +19 -0
- package/dist/api/services/cookie/cookie-builder.d.ts +77 -0
- package/dist/api/services/cookie/cookie-store.d.ts +16 -0
- package/dist/api/services/cookie/cookie.service.d.ts +34 -7
- package/dist/api/services/cookie/error/invalid-cookie-expiration.d.ts +8 -0
- package/dist/api/services/cookie/index.d.ts +3 -0
- package/dist/api/services/cookie/test/cookie-builder.spec.d.ts +1 -0
- package/dist/api/services/cookie/test/in-memory-cookie-store.d.ts +11 -0
- package/dist/api/services/security/auth-strategies/tests/provider-response-mocks.d.ts +2 -2
- package/dist/api/services/security/security-context.service.d.ts +6 -0
- package/dist/api/services/tracking/google-analytics-cookie.service.d.ts +50 -0
- package/dist/api/services/tracking/index.d.ts +4 -0
- package/dist/api/services/tracking/installation-cookie.service.d.ts +37 -0
- package/dist/api/services/tracking/test/tracking-storage.service.spec.d.ts +1 -0
- package/dist/api/services/tracking/test/tracking.service.spec.d.ts +1 -0
- package/dist/api/services/tracking/tracking-storage.service.d.ts +27 -0
- package/dist/api/services/tracking/tracking.service.d.ts +56 -0
- package/dist/api/services/users/response/user-response.d.ts +1 -1
- package/dist/api/services/utils/date-util.d.ts +11 -0
- package/dist/api/services/utils/index.d.ts +1 -0
- package/dist/api/services/window/window.service.d.ts +6 -0
- package/dist/assets/i18n/fr.json +1 -1
- package/dist/index.html +9 -9
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
- package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
- package/dist/js/angular/core/templates/search-resource-input.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +5 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +3 -2
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
- package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/legacyWorkbench.f1ed8e359786e8adeab2.js +3 -0
- package/dist/{legacyWorkbench.88e1d4d209e51c6f9b65.js.map → legacyWorkbench.f1ed8e359786e8adeab2.js.map} +1 -1
- package/dist/license-checker-static.json +0 -7
- package/dist/main.a67c284710a8b9a98ca2.js +3 -0
- package/dist/main.a67c284710a8b9a98ca2.js.map +1 -0
- package/dist/pages/aclmanagement.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/home.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/jdbc.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/sparql-templates.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +4 -3
- package/dist/res/swagger5/index.html +11 -11
- package/dist/res/swagger5/swagger-initializer.js +1 -1
- package/dist/shared-components/cjs/function-utils-WB47AWpR.js +1 -0
- package/dist/shared-components/cjs/index-CTK5NoJt.js +2 -0
- package/dist/shared-components/cjs/loader.cjs.js +1 -1
- package/dist/shared-components/cjs/onto-cookie-consent_2.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-dialog_2.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-dropdown.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-footer_5.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-language-selector_9.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-layout.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-permission-banner.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-test-context.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-toastr.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/shared-components.cjs.js +1 -1
- package/dist/shared-components/cjs/translate-label.cjs.entry.js +1 -1
- package/dist/shared-components/collection/collection-manifest.json +2 -2
- package/dist/shared-components/collection/components/dialogs/onto-cookie-policy-dialog/onto-cookie-policy-dialog.js +1 -1
- package/dist/shared-components/collection/components/dialogs/onto-dialog.js +1 -1
- package/dist/shared-components/collection/components/onto-cookie-consent/onto-cookie-consent.css +1 -1
- package/dist/shared-components/collection/components/onto-cookie-consent/onto-cookie-consent.js +1 -1
- package/dist/shared-components/collection/components/onto-dropdown/onto-dropdown.js +1 -1
- package/dist/shared-components/collection/components/onto-footer/onto-footer.js +1 -1
- package/dist/shared-components/collection/components/onto-language-selector/onto-language-selector.js +1 -1
- package/dist/shared-components/collection/components/onto-license-alert/onto-license-alert.js +1 -1
- package/dist/shared-components/collection/components/onto-loader/onto-loader.js +1 -1
- package/dist/shared-components/collection/components/onto-navbar/onto-navbar.js +1 -1
- package/dist/shared-components/collection/components/onto-operations-notification/onto-operations-notification.js +1 -1
- package/dist/shared-components/collection/components/onto-repository-selector/onto-repository-selector.js +1 -1
- package/dist/shared-components/collection/components/onto-search-resource-input/onto-search-resource-input.js +1 -1
- package/dist/shared-components/collection/components/onto-test-context/onto-test-context.js +1 -1
- package/dist/shared-components/collection/components/onto-toggle-switch/onto-toggle-switch.js +1 -1
- package/dist/shared-components/collection/components/onto-user-menu/onto-user-menu.js +1 -1
- package/dist/shared-components/collection/components/translate-label/translate-label.js +1 -1
- package/dist/shared-components/esm/function-utils-D1ZpXQQS.js +1 -0
- package/dist/shared-components/esm/index-EiAqSNMq.js +2 -0
- package/dist/shared-components/esm/loader.js +1 -1
- package/dist/shared-components/esm/onto-cookie-consent_2.entry.js +1 -1
- package/dist/shared-components/esm/onto-dialog_2.entry.js +1 -1
- package/dist/shared-components/esm/onto-dropdown.entry.js +1 -1
- package/dist/shared-components/esm/onto-footer_5.entry.js +1 -1
- package/dist/shared-components/esm/onto-language-selector_9.entry.js +1 -1
- package/dist/shared-components/esm/onto-layout.entry.js +1 -1
- package/dist/shared-components/esm/onto-permission-banner.entry.js +1 -1
- package/dist/shared-components/esm/onto-test-context.entry.js +1 -1
- package/dist/shared-components/esm/onto-toastr.entry.js +1 -1
- package/dist/shared-components/esm/shared-components.js +1 -1
- package/dist/shared-components/esm/translate-label.entry.js +1 -1
- package/dist/shared-components/shared-components/p-1103d100.entry.js +1 -0
- package/dist/shared-components/shared-components/{p-9b2c6e80.entry.js → p-2e2bb175.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-b754971e.entry.js → p-50735428.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-7e47d850.entry.js → p-59707503.entry.js} +1 -1
- package/dist/shared-components/shared-components/p-6a37f808.entry.js +1 -0
- package/dist/shared-components/shared-components/{p-9214bb16.entry.js → p-6fb5eec5.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-c27fe716.entry.js → p-97930684.entry.js} +1 -1
- package/dist/shared-components/shared-components/p-D1ZpXQQS.js +1 -0
- package/dist/shared-components/shared-components/p-EiAqSNMq.js +2 -0
- package/dist/shared-components/shared-components/p-a5a49d87.entry.js +1 -0
- package/dist/shared-components/shared-components/p-d134e207.entry.js +1 -0
- package/dist/shared-components/shared-components/{p-279a026b.entry.js → p-ec2f4ea5.entry.js} +1 -1
- package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
- package/dist/shared-components/types/components/dialogs/onto-cookie-policy-dialog/onto-cookie-policy-dialog.d.ts +31 -7
- package/dist/shared-components/types/components/onto-cookie-consent/onto-cookie-consent.d.ts +2 -2
- package/dist/shared-components/types/components/onto-footer/onto-footer.d.ts +9 -2
- package/dist/shared-components/types/components.d.ts +17 -8
- package/dist/shared-components/types/models/dialog/dialog-handler.d.ts +4 -0
- package/dist/shared-components/types/stencil-public-runtime.d.ts +10 -147
- package/package.json +1 -1
- package/dist/10759.b2e1d643d681ebd9c124.bundle.js.map +0 -1
- package/dist/13231.9b625e487e6385faa36f.bundle.js +0 -2
- package/dist/13231.9b625e487e6385faa36f.bundle.js.map +0 -1
- package/dist/18961.01ff5fcc0f4b9f99236e.bundle.js.map +0 -1
- package/dist/20694.a738f5634ec09369dc85.bundle.js.map +0 -1
- package/dist/21015.68c7c667ef64ad8e8e0d.bundle.js +0 -2
- package/dist/21015.68c7c667ef64ad8e8e0d.bundle.js.map +0 -1
- package/dist/2975.8be1a79816fd811be223.bundle.js +0 -2
- package/dist/2975.8be1a79816fd811be223.bundle.js.map +0 -1
- package/dist/39874.47a6948df3520a7bf37a.bundle.js +0 -2
- package/dist/39874.47a6948df3520a7bf37a.bundle.js.map +0 -1
- package/dist/45758.1212136a37dd4f7528f8.bundle.js.map +0 -1
- package/dist/60560.275a89ab1375e91de0aa.bundle.js +0 -2
- package/dist/60560.275a89ab1375e91de0aa.bundle.js.map +0 -1
- package/dist/60730.35493812d428872eddb6.bundle.js.map +0 -1
- package/dist/64118.b06aebc9f8d7e822244f.bundle.js.map +0 -1
- package/dist/71099.ca7720893604e9d908d6.bundle.js +0 -2
- package/dist/71099.ca7720893604e9d908d6.bundle.js.map +0 -1
- package/dist/75881.54dc716f79b6fe29232a.bundle.js +0 -2
- package/dist/75881.54dc716f79b6fe29232a.bundle.js.map +0 -1
- package/dist/78070.13538271878de6a98862.bundle.js +0 -2
- package/dist/78070.13538271878de6a98862.bundle.js.map +0 -1
- package/dist/7815.f09f8d6953d2c964e04d.bundle.js +0 -2
- package/dist/7815.f09f8d6953d2c964e04d.bundle.js.map +0 -1
- package/dist/78681.0cfa1e86d4dac1b7e7e8.bundle.js +0 -2
- package/dist/78681.0cfa1e86d4dac1b7e7e8.bundle.js.map +0 -1
- package/dist/82206.229877d7931849236456.bundle.js.map +0 -1
- package/dist/94229.47dbdba202106c61dff1.bundle.js.map +0 -1
- package/dist/95953.ec1b9d5e568d43ec3dcf.bundle.js +0 -2
- package/dist/95953.ec1b9d5e568d43ec3dcf.bundle.js.map +0 -1
- package/dist/98268.86ff371dde616b4e2a76.bundle.js +0 -2
- package/dist/98268.86ff371dde616b4e2a76.bundle.js.map +0 -1
- package/dist/api/models/cookie/cookie-consent.d.ts +0 -14
- package/dist/legacyWorkbench.88e1d4d209e51c6f9b65.js +0 -3
- package/dist/main.1be0fc11ab24b99f8800.js +0 -3
- package/dist/main.1be0fc11ab24b99f8800.js.map +0 -1
- package/dist/shared-components/cjs/app-globals-V2Kpy_OQ.js +0 -1
- package/dist/shared-components/cjs/index-L_ZmIeD5.js +0 -2
- package/dist/shared-components/collection/models/dialog/onto-dialog.js +0 -1
- package/dist/shared-components/esm/app-globals-DQuL1Twl.js +0 -1
- package/dist/shared-components/esm/index-CGqARDX4.js +0 -2
- package/dist/shared-components/shared-components/p-2075209c.entry.js +0 -1
- package/dist/shared-components/shared-components/p-30e4880f.entry.js +0 -1
- package/dist/shared-components/shared-components/p-413b3789.entry.js +0 -1
- package/dist/shared-components/shared-components/p-67199a46.entry.js +0 -1
- package/dist/shared-components/shared-components/p-CGqARDX4.js +0 -2
- package/dist/shared-components/shared-components/p-DQuL1Twl.js +0 -1
- package/dist/shared-components/types/models/dialog/onto-dialog.d.ts +0 -4
- /package/dist/{legacyWorkbench.88e1d4d209e51c6f9b65.js.LICENSE.txt → legacyWorkbench.f1ed8e359786e8adeab2.js.LICENSE.txt} +0 -0
- /package/dist/{main.1be0fc11ab24b99f8800.js.LICENSE.txt → main.a67c284710a8b9a98ca2.js.LICENSE.txt} +0 -0
- /package/dist/shared-components/cjs/{index-L_ZmIeD5.js.LICENSE.txt → index-CTK5NoJt.js.LICENSE.txt} +0 -0
- /package/dist/shared-components/esm/{index-CGqARDX4.js.LICENSE.txt → index-EiAqSNMq.js.LICENSE.txt} +0 -0
- /package/dist/shared-components/shared-components/{p-CGqARDX4.js.LICENSE.txt → p-EiAqSNMq.js.LICENSE.txt} +0 -0
package/dist/{67888.b75d9678cf65cd82f065.bundle.js.map → 67888.0f7d008c6f62683e2c62.bundle.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"67888.b75d9678cf65cd82f065.bundle.js","mappings":"mJAQA,SAASA,EAAkCC,EAAYC,GACnD,MAAO,CACHC,SAAU,IACVC,YAAa,+DACbC,MAAO,CACHC,SAAU,KAEdC,KAAOC,IACH,MAAMC,EAAc,GAKpBD,EAAOE,gBAAkB,kCACzBF,EAAOG,eAAgB,EACvBH,EAAOI,QAAUJ,EAAOF,SAASO,eAAeD,QAChDJ,EAAOM,cAAgBN,EAAOF,SAASO,eAAeC,cACtDN,EAAOO,QAAUC,mBAAmBR,EAAOF,SAASO,eAAeI,SACnET,EAAOU,YAAcV,EAAOF,SAASO,eAAeK,YACpDV,EAAOW,WAAaX,EAAOF,SAASO,eAAeM,WACnDX,EAAOY,eAAiBZ,EAA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4BvC,QAAU,CAAC,WAAY,uB,4BC/BnDH,QACKC,OAAO,4EAA6E,IACpFW,WAAW,wCAAyCwK,GAEzDA,EAAsCjL,QAAU,CAAC,SAAU,oBAAqB,aAAc,SAAU,WAExG,MAAMkL,EAASC,EAAAA,EAAeD,OAE9B,SAASD,EAAsC/M,EAAQkN,EAAmBC,EAAYC,EAAQxK,GAC1F5C,EAAO4C,QAAUA,EAGjB5C,EAAOgB,MAAQ,KACXkM,EAAkBG,WAGtBrN,EAAOsN,gBAAkB,KACrBC,UAAUC,UAAUC,UAAUzN,EAAO4C,SAChC8K,KAAK,KACFN,EAAOO,QAAQR,EAAWS,QAAQ,6CAClC5N,EAAOgB,SACP6M,IACAb,EAAOc,MAAM,wBAAyBD,KAGtD,C","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js"],"sourcesContent":["const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=3.3.2-TR1\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {\n ByteUtils,\n} from \"@ontotext/workbench-api\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL',\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED',\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info',\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = ByteUtils.convertToBytes(r1.importResource.size);\n const r2Size = ByteUtils.convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n },\n };\n}\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n"],"names":["importResourceStatusInfoDirective","$rootScope","$document","restrict","templateUrl","scope","resource","link","$scope","subscribers","popoverTemplate","popoverIsOpen","context","importResource","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","open","closeAllDialogs","$broadcast","close","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","angular","module","directive","$inject","importResourceMessageDirective","$uibModal","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","controller","size","windowClass","backdrop","resolve","message","validateUri","UriUtils","require","element","attr","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString","ImportProgressIndicator","$watch","file","status","$","has","length","append","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","ByteUtils","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","ImportResourceMessageDialogController","logger","LoggerProvider","$uibModalInstance","$translate","toastr","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error"],"ignoreList":[],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"67888.0f7d008c6f62683e2c62.bundle.js","mappings":"mJAQA,SAASA,EAAkCC,EAAYC,GACnD,MAAO,CACHC,SAAU,IACVC,YAAa,+DACbC,MAAO,CACHC,SAAU,KAEdC,KAAOC,IACH,MAAMC,EAAc,GAKpBD,EAAOE,gBAAkB,kCACzBF,EAAOG,eAAgB,EACvBH,EAAOI,QAAUJ,EAAOF,SAASO,eAAeD,QAChDJ,EAAOM,cAAgBN,EAAOF,SAASO,eAAeC,cACtDN,EAAOO,QAAUC,mBAAmBR,EAAOF,SAASO,eAAeI,SACnET,EAAOU,YAAcV,EAAOF,SAASO,eAAeK,YACpDV,EAAOW,WAAaX,EAAOF,SAASO,eAAeM,WACnDX,EAAOY,eAAiBZ,EAAOF,SAASO,eAAeO,eAKvDZ,EAAOa,KAAO,KACVb,EAAOc,kBACPd,EAAOG,eAAgB,GAG3BH,EAAOc,gBAAkB,KACrBrB,EAAWsB,WAAW,kBAG1Bf,EAAOgB,MAAQ,KACXhB,EAAOG,eAAgB,GAG3B,MAAMc,EAAwBC,IACR,WAAdA,EAAMC,KACNnB,EAAOoB,OAAO,KACVpB,EAAOgB,WAanBf,EAAYoB,KAAKrB,EAAOsB,IAAI,gBAAiBtB,EAAOgB,QACpDtB,EAAU6B,GAAG,UAAWN,GAExBjB,EAAOsB,IAAI,WAAY,KACnB5B,EAAU8B,IAAI,UAAWP,GAXzBhB,EAAYwB,QAASC,GAAeA,QAgBpD,CArEAC,QACKC,OAAO,kEAHI,IAIXC,UAAU,2BAA4BrC,GAE3CA,EAAkCsC,QAAU,CAAC,aA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-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js"],"sourcesContent":["const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=3.3.3-RC1\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {\n ByteUtils,\n} from \"@ontotext/workbench-api\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL',\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED',\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info',\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = ByteUtils.convertToBytes(r1.importResource.size);\n const r2Size = ByteUtils.convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n },\n };\n}\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n"],"names":["importResourceStatusInfoDirective","$rootScope","$document","restrict","templateUrl","scope","resource","link","$scope","subscribers","popoverTemplate","popoverIsOpen","context","importResource","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","open","closeAllDialogs","$broadcast","close","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","angular","module","directive","$inject","importResourceMessageDirective","$uibModal","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","controller","size","windowClass","backdrop","resolve","message","validateUri","UriUtils","require","element","attr","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString","ImportProgressIndicator","$watch","file","status","$","has","length","append","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","ByteUtils","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","ImportResourceMessageDialogController","logger","LoggerProvider","$uibModalInstance","$translate","toastr","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=71099;export const __webpack_esm_ids__=[71099];export const __webpack_esm_modules__={71099(e,a,s){s(82493),s(98599),s(76933),s(98977);const n=angular.module("graphdb.framework.namespaces.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.core.services.jwtauth","graphdb.framework.rest.repositories.service","graphdb.framework.rest.rdf4j.repositories.service","toastr"]),t=function(){const e="[A-Z]|[a-z]|[À-Ö]|[Ø-ö]|[ø-˿]|[Ͱ-ͽ]|[Ϳ-]|[-]|[⁰-]|[Ⰰ-]|[、-]|[豈-﷏]|[ﷰ-�]",a=e+"|_|-|[0-9]|·|[̀-ͯ]|[‿-⁀]";return new RegExp("^(?:"+e+")(?:(?:"+a+"|\\.)*(?:"+a+"))?$")}();n.controller("NamespacesCtrl",["$scope","$http","$repositories","toastr","$uibModal","ModalService","RepositoriesRestService","RDF4JRepositoriesRestService","$translate",function(e,a,s,n,c,r,i,o,p){e.namespaces=[],e.namespace={},e.loader=!1,e.haveSelected=!1,e.pageSizeOptions=[10,20,50,100],e.page=1,e.pageSize=e.pageSizeOptions[0],e.displayedNamespaces=[],e.getNamespaces=function(){s.getActiveRepository()&&(e.loader=!0,e.namespaces=[],e.displayedNamespaces=[],e.matchedElements=[],o.getNamespaces(s.getActiveRepository()).success(function(a){e.namespaces=a.results.bindings.map(function(e){return{prefix:e.prefix.value,namespace:e.namespace.value}}),e.namespaces.length>0&&(e.namespaces.sort(function(e,a){const s=e.prefix.toUpperCase(),n=a.prefix.toUpperCase();return s<n?-1:s>n?1:0}),e.matchedElements=e.namespaces,e.changePagination()),0===e.namespaces.length&&(e.loader=!1)}).error(function(a){const s=getError(a);n.error(s),e.loader=!1}))},e.changePagination=function(){angular.isDefined(e.namespaces)&&(e.displayedNamespaces=e.namespaces.slice(e.pageSize*(e.page-1),e.pageSize*e.page))},e.changePageSize=function(a){$(".ot-graph-page-size").removeClass("active"),e.page=1,e.searchNamespaces="",a&&(e.getNamespaces(),e.pageSize=a)},e.$watch("matchedElements",function(){angular.isDefined(e.matchedElements)&&(e.displayedNamespaces=e.matchedElements.slice(e.pageSize*(e.page-1),e.pageSize*e.page))}),e.$watch(function(){return s.getActiveRepository()},function(){e.searchNamespaces="",e.getNamespaces(),e.selectedAll=!1}),e.onNamespaceSearch=function(){e.haveSelected=!1,e.selectedAll=!1,e.matchedElements=[],g(),l()};const l=function(){angular.forEach(e.namespaces,function(a){-1===a.namespace.indexOf(e.searchNamespaces)&&-1===a.prefix.indexOf(e.searchNamespaces)||e.matchedElements.push(a)})};e.saveNamespace=function(a,t){return e.loader=!0,o.updateNamespacePrefix(s.getActiveRepository(),t,a).then(function(){e.getNamespaces(),n.success(p.instant("namespace.saved")),e.loader=!1}).catch(function(a){const s=getError(a);return n.error(s,p.instant("common.error")),e.loader=!1,Promise.reject(a)})},e.editPrefix=function(a,t){e.loader=!0,i.getPrefix(s.getActiveRepository(),{from:a,to:t,location:s.getActiveRepositoryObject().location}).success(function(){e.getNamespaces(),e.loader=!1}).error(function(a){const s=getError(a);n.error(s,p.instant("common.error")),e.loader=!1})},e.editPrefixAndNamespace=async(e,a,s)=>{try{const n=a;let t=e;if(e||(t=""),!h(t,n))return"Prefix or namespace is invalid";const c=s.prefix;return m(t,c)&&await r.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result,d(t,c,n)}catch(e){return"Prefix overwrite cancelled"}};const m=(a,s)=>!!e.namespaces.find(e=>e.prefix===a&&s!==a),d=(a,s,n)=>e.saveNamespace(s,n).then(function(){s!==a&&e.editPrefix(s,a)});e.addNamespace=function(){if(e.namespace.prefix||(e.namespace.prefix=""),!h(e.namespace.prefix,e.namespace.namespace))return;e.selectedAll=!1;let a=!1;for(let s=0;s<e.namespaces.length;s++)e.namespaces[s].prefix===e.namespace.prefix&&(a=!0);a?r.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result.then(f):f()};const f=()=>{e.saveNamespace(e.namespace.prefix,e.namespace.namespace).then(()=>{e.namespace.namespace="",e.namespace.prefix="",setTimeout(()=>{e.form.$setUntouched(),e.form.$setPristine()})}).catch(()=>{})};e.removeNamespace=function(e){r.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.msg",{prefix:e.prefix}),warning:!0}).result.then(function(){u(e)})},e.checkAll=function(){angular.forEach(e.displayedNamespaces,function(a){a.selected=e.selectedAll})},e.deleteSelected=function(){let a=!1;angular.forEach(e.displayedNamespaces,function(s){a||s.selected&&(a=!0,r.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.selected"),warning:!0}).result.then(function(){e.loader=!0;const a=[];angular.forEach(e.displayedNamespaces,function(e){e.selected&&a.push(e)}),u(a.shift(),a),e.selectedAll=!1},function(){e.getNamespaces(),e.selectedAll=!1,e.searchNamespaces=""}))})};const u=(a,t)=>{let c;c="object"==typeof a?a.prefix:a,o.deleteNamespacePrefix(s.getActiveRepository(),c).success(function(){t&&t.length>0?(a=t.shift(),u(a,t)):(e.selectedAll=!1,e.namespace={},e.getNamespaces(),e.searchNamespaces="",e.haveSelected=!1,e.loader=!1,e.displayedNamespaces=[],void 0===t?n.success(p.instant("namespace.prefix.deleted.successfully",{prefix:c}),""):n.success(p.instant("namespace.selected.namespaces.deleted.successfully"),""))}).error(function(a){const s=getError(a);n.error(s,p.instant("common.error")),e.loader=!1})};e.checkIfSelectedNamespace=function(){e.haveSelected=!1,angular.forEach(e.namespaces,function(a){a.selected&&(e.haveSelected=!0)})};const g=function(){angular.forEach(e.namespaces,function(e){e.selected=!1})},h=(e,a)=>function(e){return""===e||e.match(t)}(e)?!angular.isUndefined(a)&&""!==a||(n.error(p.instant("namespace.warning.provide.namespace"),p.instant("common.error")),!1):(n.error(p.instant("namespace.invalid.prefix",{prefix:e},p.instant("common.error"))),!1)}]),n.controller("StandartModalCtrl",["$scope","$uibModalInstance",function(e,a){e.ok=function(){a.close(!0)},e.cancel=function(){a.dismiss("cancel")}}])}};
|
|
2
|
+
//# sourceMappingURL=71099.ba1073458b96d9789756.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"71099.ba1073458b96d9789756.bundle.js","mappings":"sKAKA,MASMA,EAAaC,QAAQC,OAAO,2CATlB,CACZ,eACA,+CACA,0CACA,8CACA,oDACA,WAOEC,EAAa,WACf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AAO8E,MAAM7G,EACzC,CAoWiB8G,CAAe/E,IAKhBjC,QAAQiH,YAAYhG,IAA4B,KAAdA,IAClCN,EAAOgC,MAAM3B,EAAWiD,QAAQ,uCAAwCjD,EAAWiD,QAAQ,kBACpF,IANPtD,EAAOgC,MAAM3B,EAAWiD,QAAQ,2BAA4B,CAAChC,OAAQA,GAASjB,EAAWiD,QAAQ,mBAC1F,EAUnB,IAEJlE,EAAWQ,WAAW,oBAAqB,CAAC,SAAU,oBAAqB,SAASC,EAAQ0G,GACxF1G,EAAO2G,GAAK,WAERD,EAAkBE,OADH,EAEnB,EAEA5G,EAAO6G,OAAS,WACZH,EAAkBI,QAAQ,SAC9B,CACJ,G","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/namespaces/controllers.js"],"sourcesContent":["import 'angular/core/services';\nimport 'angular/core/services/jwt-auth.service';\nimport 'angular/core/services/repositories.service';\nimport 'angular/rest/rdf4j.repositories.rest.service';\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.core.services.jwtauth',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.rest.rdf4j.repositories.service',\n 'toastr',\n];\n\nconst namespaces = angular.module('graphdb.framework.namespaces.controllers', modules);\n\n// A regular expression that validates a prefix according to the SPARQL 1.1 specification.\n// XXX: Technically this should include Unicode chars > 0xFFFF but those aren't fully supported in JavaScript\nconst pnPrefixRe = function() {\n const pnCharsBase = '[A-Z]|[a-z]|[\\u00C0-\\u00D6]|[\\u00D8-\\u00F6]|[\\u00F8-\\u02FF]|[\\u0370-\\u037D]'\n + '|[\\u037F-\\u1FFF]|[\\u200C-\\u200D]|[\\u2070-\\u218F]|[\\u2C00-\\u2FEF]|[\\u3001-\\uD7FF]'\n + '|[\\uF900-\\uFDCF]|[\\uFDF0-\\uFFFD]';\n const pnCharsU = pnCharsBase + '|_';\n const pnChars = pnCharsU + '|-|[0-9]|\\u00B7|[\\u0300-\\u036F]|[\\u203F-\\u2040]';\n\n return new RegExp('^(?:' + pnCharsBase + ')(?:(?:' + pnChars + '|\\\\.)*(?:' + pnChars + '))?$');\n}();\n\nfunction validatePrefix(prefix) {\n return prefix === '' || prefix.match(pnPrefixRe);\n}\n\nnamespaces.controller('NamespacesCtrl', ['$scope', '$http', '$repositories', 'toastr', '$uibModal', 'ModalService', 'RepositoriesRestService', 'RDF4JRepositoriesRestService', '$translate',\n function($scope, $http, $repositories, toastr, $uibModal, ModalService, RepositoriesRestService, RDF4JRepositoriesRestService, $translate) {\n $scope.namespaces = [];\n $scope.namespace = {};\n $scope.loader = false;\n $scope.haveSelected = false;\n $scope.pageSizeOptions = [10, 20, 50, 100];\n $scope.page = 1;\n $scope.pageSize = $scope.pageSizeOptions[0];\n $scope.displayedNamespaces = [];\n\n $scope.getNamespaces = function() {\n if (!$repositories.getActiveRepository()) {\n return;\n }\n\n $scope.loader = true;\n $scope.namespaces = [];\n $scope.displayedNamespaces = [];\n $scope.matchedElements = [];\n RDF4JRepositoriesRestService.getNamespaces($repositories.getActiveRepository())\n .success(function(data) {\n $scope.namespaces = data.results.bindings.map(function(e) {\n return {\n prefix: e.prefix.value,\n namespace: e.namespace.value,\n };\n });\n if ($scope.namespaces.length > 0) {\n $scope.namespaces.sort(function(a, b) {\n const prefixA = a.prefix.toUpperCase(); // ignore upper and lowercase\n const prefixB = b.prefix.toUpperCase(); // ignore upper and lowercase\n if (prefixA < prefixB) {\n return -1;\n }\n if (prefixA > prefixB) {\n return 1;\n }\n return 0;\n });\n $scope.matchedElements = $scope.namespaces;\n $scope.changePagination();\n }\n if ($scope.namespaces.length === 0) {\n // Remove the loader ourselves\n $scope.loader = false;\n } // else let the loaderPostRepeatDirective do it\n }).error(function(data) {\n const msg = getError(data);\n toastr.error(msg);\n $scope.loader = false;\n });\n };\n\n $scope.changePagination = function() {\n if (angular.isDefined($scope.namespaces)) {\n $scope.displayedNamespaces = $scope.namespaces.slice($scope.pageSize * ($scope.page - 1), $scope.pageSize * $scope.page);\n }\n };\n\n $scope.changePageSize = function(size) {\n $('.ot-graph-page-size').removeClass('active');\n $scope.page = 1;\n $scope.searchNamespaces = '';\n if (size) {\n $scope.getNamespaces();\n $scope.pageSize = size;\n }\n };\n\n $scope.$watch('matchedElements', function() {\n if (angular.isDefined($scope.matchedElements)) {\n $scope.displayedNamespaces = $scope.matchedElements.slice($scope.pageSize * ($scope.page - 1), $scope.pageSize * $scope.page);\n }\n });\n\n $scope.$watch(function() {\n return $repositories.getActiveRepository();\n }, function() {\n $scope.searchNamespaces = '';\n $scope.getNamespaces();\n $scope.selectedAll = false;\n });\n\n $scope.onNamespaceSearch = function() {\n $scope.haveSelected = false;\n $scope.selectedAll = false;\n $scope.matchedElements = [];\n deselectAll();\n filterResults();\n };\n\n const filterResults = function() {\n angular.forEach($scope.namespaces, function(item) {\n if (item.namespace.indexOf($scope.searchNamespaces) !== -1 || item.prefix.indexOf($scope.searchNamespaces) !== -1) {\n $scope.matchedElements.push(item);\n }\n });\n };\n\n $scope.saveNamespace = function(prefix, namespace) {\n $scope.loader = true;\n return RDF4JRepositoriesRestService.updateNamespacePrefix($repositories.getActiveRepository(), namespace, prefix)\n .then(function() {\n $scope.getNamespaces();\n toastr.success($translate.instant('namespace.saved'));\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 // Reject the promise so that the caller can handle the error as well. Some callers don't care about\n // the error and just want to know if the operation was successful or not. But there are also callers\n // that want to know the error details.\n return Promise.reject(data);\n });\n };\n\n $scope.editPrefix = function(oldPrefix, newPrefix) {\n $scope.loader = true;\n RepositoriesRestService.getPrefix($repositories.getActiveRepository(), {\n from: oldPrefix, to: newPrefix, location: $repositories.getActiveRepositoryObject().location})\n .success(function() {\n $scope.getNamespaces();\n $scope.loader = false;\n }).error(function(data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n const confirmReplace = function(okCallback, cancelCallback) {\n return ModalService.openSimpleModal({\n title: $translate.instant('namespace.confirm.replace'),\n message: $translate.instant('namespace.already.exists.msg'),\n warning: true,\n }).result;\n };\n\n /**\n * Validates the prefix and namespace and checks if the prefix already exists. If the prefix already exists,\n * a confirmation dialog is shown to the user. If the user confirms the dialog, the flow continues and the\n * namespace is updated. If the user rejects the dialog, the flow continues in the catch block.\n *\n * <strong>Using async/await in order to be able to control the flow of the function and to be able to return a value\n * which is expected by the xeditable component. Otherwise, it won't behave as expected.</strong>\n *\n * @param {string} prefixValue The new prefix value.\n * @param {string} namespaceValue The new namespace value.\n * @param {*} namespaceObject The namespace object holding the old values.\n * @return {Promise<boolean|string>}\n */\n $scope.editPrefixAndNamespace = async (prefixValue, namespaceValue, namespaceObject) => {\n try {\n const namespace = namespaceValue;\n let prefix = prefixValue;\n if (!prefixValue) {\n prefix = '';\n }\n\n if (!validatePrefixAndNamespace(prefix, namespace)) {\n // The string returned here is only meaningful for the xeditable component which handles it as an\n // error which we don't show to the user. In this case the form remains open and the user can cancel\n // or correct the input.\n return 'Prefix or namespace is invalid';\n }\n\n const oldPrefix = namespaceObject.prefix;\n if (isPrefixExist(prefix, oldPrefix)) {\n // If the user rejects the confirmation dialog, the flow continues in the catch block.\n await ModalService.openSimpleModal({\n title: $translate.instant('namespace.confirm.replace'),\n message: $translate.instant('namespace.already.exists.msg'),\n warning: true,\n }).result;\n }\n return updateNamespace(prefix, oldPrefix, namespace);\n } catch (err) {\n // The string returned here is only meaningful for the xeditable component which handles it as an\n // error which we don't show to the user. In this case the form remains open and the user can cancel\n // or correct the input.\n return 'Prefix overwrite cancelled';\n }\n };\n\n /**\n * Checks if the prefix already exists in the list of namespaces.\n * @param {string} prefix The prefix to check.\n * @param {string} oldPrefix The old prefix value.\n * @return {boolean} True if the prefix already exists, false otherwise.\n */\n const isPrefixExist = (prefix, oldPrefix) => {\n return !!$scope.namespaces.find((elem) => elem.prefix === prefix && oldPrefix !== prefix);\n };\n\n /**\n * Updates the namespace and if the operation is successful, updates the prefix as well.\n * @param {string} newPrefix The new prefix value.\n * @param {string} oldPrefix The old prefix value.\n * @param {*} namespace The namespace object holding the old values.\n * @return {Promise<void>}\n */\n const updateNamespace = (newPrefix, oldPrefix, namespace) => {\n return $scope.saveNamespace(oldPrefix, namespace)\n .then(function() {\n if (oldPrefix !== newPrefix) {\n $scope.editPrefix(oldPrefix, newPrefix);\n }\n });\n };\n\n $scope.addNamespace = function() {\n if (!$scope.namespace.prefix) {\n $scope.namespace.prefix = '';\n }\n\n if (!validatePrefixAndNamespace($scope.namespace.prefix, $scope.namespace.namespace)) {\n return;\n }\n\n $scope.selectedAll = false;\n let prefixExist = false;\n for (let i = 0; i < $scope.namespaces.length; i++) {\n if ($scope.namespaces[i].prefix === $scope.namespace.prefix) {\n prefixExist = true;\n }\n }\n if (prefixExist) {\n confirmReplace().then(saveNamespaceAndUpdateTheUI);\n } else {\n saveNamespaceAndUpdateTheUI();\n }\n };\n\n /**\n * Saves the namespace and if operation is successful, resets the form state.\n */\n const saveNamespaceAndUpdateTheUI = () => {\n $scope.saveNamespace($scope.namespace.prefix, $scope.namespace.namespace)\n .then(() => {\n $scope.namespace.namespace = '';\n $scope.namespace.prefix = '';\n // Not sure why the timeout is needed here. Probably resetting the values above needs to be\n // reflected first in the form state and then the form validation model needs to be reset.\n setTimeout(() => {\n $scope.form.$setUntouched();\n $scope.form.$setPristine();\n });\n })\n .catch(() => {\n // Do nothing, the error is already handled in the saveNamespace function\n });\n };\n\n $scope.removeNamespace = function(namespace) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: $translate.instant('namespace.warning.delete.msg', {prefix: namespace.prefix}),\n warning: true,\n }).result.then(function() {\n deleteNamespace(namespace);\n });\n };\n\n $scope.checkAll = function() {\n angular.forEach($scope.displayedNamespaces, function(item) {\n item.selected = $scope.selectedAll;\n });\n };\n\n $scope.deleteSelected = function() {\n const openModalInstance = function() {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: $translate.instant('namespace.warning.delete.selected'),\n warning: true,\n }).result.then(function() {\n $scope.loader = true;\n const namespaces = [];\n angular.forEach($scope.displayedNamespaces, function(namespace) {\n if (namespace.selected) {\n namespaces.push(namespace);\n }\n });\n deleteNamespace(namespaces.shift(), namespaces);\n $scope.selectedAll = false;\n }, function() {\n $scope.getNamespaces();\n $scope.selectedAll = false;\n $scope.searchNamespaces = '';\n });\n };\n\n let modalInstanceOpened = false;\n angular.forEach($scope.displayedNamespaces, function(namespace) {\n if (!modalInstanceOpened) {\n if (namespace.selected) {\n modalInstanceOpened = true;\n openModalInstance();\n }\n }\n });\n };\n\n const deleteNamespace = (namespace, namespaces)=> {\n let prefix;\n if (typeof namespace === 'object') {\n prefix = namespace.prefix;\n } else {\n prefix = namespace;\n }\n RDF4JRepositoriesRestService.deleteNamespacePrefix($repositories.getActiveRepository(), prefix)\n .success(function() {\n if (namespaces && namespaces.length > 0) {\n namespace = namespaces.shift();\n deleteNamespace(namespace, namespaces);\n } else {\n $scope.selectedAll = false;\n $scope.namespace = {};\n $scope.getNamespaces();\n $scope.searchNamespaces = '';\n $scope.haveSelected = false;\n $scope.loader = false;\n $scope.displayedNamespaces = [];\n if (namespaces === undefined) {\n toastr.success($translate.instant('namespace.prefix.deleted.successfully', {prefix: prefix}), '');\n } else {\n toastr.success($translate.instant('namespace.selected.namespaces.deleted.successfully'), '');\n }\n }\n }).error(function(data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n $scope.checkIfSelectedNamespace = function() {\n $scope.haveSelected = false;\n angular.forEach($scope.namespaces, function(item) {\n if (item.selected) {\n $scope.haveSelected = true;\n }\n });\n };\n\n const deselectAll = function() {\n angular.forEach($scope.namespaces, function(item) {\n item.selected = false;\n });\n };\n\n const validatePrefixAndNamespace = (prefix, namespace) => {\n if (!validatePrefix(prefix)) {\n toastr.error($translate.instant('namespace.invalid.prefix', {prefix: prefix}, $translate.instant('common.error')));\n return false;\n }\n\n if (angular.isUndefined(namespace) || namespace === '') {\n toastr.error($translate.instant('namespace.warning.provide.namespace'), $translate.instant('common.error'));\n return false;\n }\n\n return true;\n };\n }]);\n\nnamespaces.controller('StandartModalCtrl', ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {\n $scope.ok = function() {\n const result = true;\n $uibModalInstance.close(result);\n };\n\n $scope.cancel = function() {\n $uibModalInstance.dismiss('cancel');\n };\n}]);\n"],"names":["namespaces","angular","module","pnPrefixRe","pnCharsBase","pnChars","pnCharsU","RegExp","controller","$scope","$http","$repositories","toastr","$uibModal","ModalService","RepositoriesRestService","RDF4JRepositoriesRestService","$translate","namespace","loader","haveSelected","pageSizeOptions","page","pageSize","displayedNamespaces","getNamespaces","getActiveRepository","matchedElements","success","data","results","bindings","map","e","prefix","value","length","sort","a","b","prefixA","toUpperCase","prefixB","changePagination","error","msg","getError","isDefined","slice","changePageSize","size","$","removeClass","searchNamespaces","$watch","selectedAll","onNamespaceSearch","deselectAll","filterResults","forEach","item","indexOf","push","saveNamespace","updateNamespacePrefix","then","instant","catch","Promise","reject","editPrefix","oldPrefix","newPrefix","getPrefix","from","to","location","getActiveRepositoryObject","editPrefixAndNamespace","async","prefixValue","namespaceValue","namespaceObject","validatePrefixAndNamespace","isPrefixExist","openSimpleModal","title","message","warning","result","updateNamespace","err","find","elem","addNamespace","prefixExist","i","saveNamespaceAndUpdateTheUI","setTimeout","form","$setUntouched","$setPristine","removeNamespace","deleteNamespace","checkAll","selected","deleteSelected","modalInstanceOpened","shift","deleteNamespacePrefix","undefined","checkIfSelectedNamespace","match","validatePrefix","isUndefined","$uibModalInstance","ok","close","cancel","dismiss"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=75881;export const __webpack_esm_ids__=[41482,54745,71099,75881];export const __webpack_esm_modules__={41482(){angular.module("graphdb.framework.namespaces.directives",["ngRoute"]).directive("loaderPostRepeatDirective",["$timeout",function(e){return function(a){a.$last&&e(function(){a.$parent.loader=!1},0)}}])},54745(){angular.module("graphdb.framework.core.directives.paginations",[]).directive("paginations",["$translate","$rootScope","$compile",function(e,a,t){return{link:function(e,s){const n=()=>{const a=t('<uib-pagination class="nav navbar-right" total-items="matchedElements.length" items-per-page="pageSize" ng-model="page" ng-change="changePagination()" direction-links="false" boundary-links="true" max-size="5" rotate="true" first-text="{{\'paginator.first.page.label\' | translate}}" last-text="{{\'paginator.last.page.label\' | translate}}"></uib-pagination>')(e);s.html(a)};n();const r=a.$on("$translateChangeSuccess",n);e.$on("$destroy",r)}}}])},71099(e,a,t){t(82493),t(98599),t(76933),t(98977);const s=angular.module("graphdb.framework.namespaces.controllers",["ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.core.services.jwtauth","graphdb.framework.rest.repositories.service","graphdb.framework.rest.rdf4j.repositories.service","toastr"]),n=function(){const e="[A-Z]|[a-z]|[À-Ö]|[Ø-ö]|[ø-˿]|[Ͱ-ͽ]|[Ϳ-]|[-]|[⁰-]|[Ⰰ-]|[、-]|[豈-﷏]|[ﷰ-�]",a=e+"|_|-|[0-9]|·|[̀-ͯ]|[‿-⁀]";return new RegExp("^(?:"+e+")(?:(?:"+a+"|\\.)*(?:"+a+"))?$")}();s.controller("NamespacesCtrl",["$scope","$http","$repositories","toastr","$uibModal","ModalService","RepositoriesRestService","RDF4JRepositoriesRestService","$translate",function(e,a,t,s,r,c,i,o,p){e.namespaces=[],e.namespace={},e.loader=!1,e.haveSelected=!1,e.pageSizeOptions=[10,20,50,100],e.page=1,e.pageSize=e.pageSizeOptions[0],e.displayedNamespaces=[],e.getNamespaces=function(){t.getActiveRepository()&&(e.loader=!0,e.namespaces=[],e.displayedNamespaces=[],e.matchedElements=[],o.getNamespaces(t.getActiveRepository()).success(function(a){e.namespaces=a.results.bindings.map(function(e){return{prefix:e.prefix.value,namespace:e.namespace.value}}),e.namespaces.length>0&&(e.namespaces.sort(function(e,a){const t=e.prefix.toUpperCase(),s=a.prefix.toUpperCase();return t<s?-1:t>s?1:0}),e.matchedElements=e.namespaces,e.changePagination()),0===e.namespaces.length&&(e.loader=!1)}).error(function(a){const t=getError(a);s.error(t),e.loader=!1}))},e.changePagination=function(){angular.isDefined(e.namespaces)&&(e.displayedNamespaces=e.namespaces.slice(e.pageSize*(e.page-1),e.pageSize*e.page))},e.changePageSize=function(a){$(".ot-graph-page-size").removeClass("active"),e.page=1,e.searchNamespaces="",a&&(e.getNamespaces(),e.pageSize=a)},e.$watch("matchedElements",function(){angular.isDefined(e.matchedElements)&&(e.displayedNamespaces=e.matchedElements.slice(e.pageSize*(e.page-1),e.pageSize*e.page))}),e.$watch(function(){return t.getActiveRepository()},function(){e.searchNamespaces="",e.getNamespaces(),e.selectedAll=!1}),e.onNamespaceSearch=function(){e.haveSelected=!1,e.selectedAll=!1,e.matchedElements=[],g(),l()};const l=function(){angular.forEach(e.namespaces,function(a){-1===a.namespace.indexOf(e.searchNamespaces)&&-1===a.prefix.indexOf(e.searchNamespaces)||e.matchedElements.push(a)})};e.saveNamespace=function(a,n){return e.loader=!0,o.updateNamespacePrefix(t.getActiveRepository(),n,a).then(function(){e.getNamespaces(),s.success(p.instant("namespace.saved")),e.loader=!1}).catch(function(a){const t=getError(a);return s.error(t,p.instant("common.error")),e.loader=!1,Promise.reject(a)})},e.editPrefix=function(a,n){e.loader=!0,i.getPrefix(t.getActiveRepository(),{from:a,to:n,location:t.getActiveRepositoryObject().location}).success(function(){e.getNamespaces(),e.loader=!1}).error(function(a){const t=getError(a);s.error(t,p.instant("common.error")),e.loader=!1})},e.editPrefixAndNamespace=async(e,a,t)=>{try{const s=a;let n=e;if(e||(n=""),!h(n,s))return"Prefix or namespace is invalid";const r=t.prefix;return m(n,r)&&await c.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result,d(n,r,s)}catch(e){return"Prefix overwrite cancelled"}};const m=(a,t)=>!!e.namespaces.find(e=>e.prefix===a&&t!==a),d=(a,t,s)=>e.saveNamespace(t,s).then(function(){t!==a&&e.editPrefix(t,a)});e.addNamespace=function(){if(e.namespace.prefix||(e.namespace.prefix=""),!h(e.namespace.prefix,e.namespace.namespace))return;e.selectedAll=!1;let a=!1;for(let t=0;t<e.namespaces.length;t++)e.namespaces[t].prefix===e.namespace.prefix&&(a=!0);a?c.openSimpleModal({title:p.instant("namespace.confirm.replace"),message:p.instant("namespace.already.exists.msg"),warning:!0}).result.then(f):f()};const f=()=>{e.saveNamespace(e.namespace.prefix,e.namespace.namespace).then(()=>{e.namespace.namespace="",e.namespace.prefix="",setTimeout(()=>{e.form.$setUntouched(),e.form.$setPristine()})}).catch(()=>{})};e.removeNamespace=function(e){c.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.msg",{prefix:e.prefix}),warning:!0}).result.then(function(){u(e)})},e.checkAll=function(){angular.forEach(e.displayedNamespaces,function(a){a.selected=e.selectedAll})},e.deleteSelected=function(){let a=!1;angular.forEach(e.displayedNamespaces,function(t){a||t.selected&&(a=!0,c.openSimpleModal({title:p.instant("common.confirm.delete"),message:p.instant("namespace.warning.delete.selected"),warning:!0}).result.then(function(){e.loader=!0;const a=[];angular.forEach(e.displayedNamespaces,function(e){e.selected&&a.push(e)}),u(a.shift(),a),e.selectedAll=!1},function(){e.getNamespaces(),e.selectedAll=!1,e.searchNamespaces=""}))})};const u=(a,n)=>{let r;r="object"==typeof a?a.prefix:a,o.deleteNamespacePrefix(t.getActiveRepository(),r).success(function(){n&&n.length>0?(a=n.shift(),u(a,n)):(e.selectedAll=!1,e.namespace={},e.getNamespaces(),e.searchNamespaces="",e.haveSelected=!1,e.loader=!1,e.displayedNamespaces=[],void 0===n?s.success(p.instant("namespace.prefix.deleted.successfully",{prefix:r}),""):s.success(p.instant("namespace.selected.namespaces.deleted.successfully"),""))}).error(function(a){const t=getError(a);s.error(t,p.instant("common.error")),e.loader=!1})};e.checkIfSelectedNamespace=function(){e.haveSelected=!1,angular.forEach(e.namespaces,function(a){a.selected&&(e.haveSelected=!0)})};const g=function(){angular.forEach(e.namespaces,function(e){e.selected=!1})},h=(e,a)=>function(e){return""===e||e.match(n)}(e)?!angular.isUndefined(a)&&""!==a||(s.error(p.instant("namespace.warning.provide.namespace"),p.instant("common.error")),!1):(s.error(p.instant("namespace.invalid.prefix",{prefix:e},p.instant("common.error"))),!1)}]),s.controller("StandartModalCtrl",["$scope","$uibModalInstance",function(e,a){e.ok=function(){a.close(!0)},e.cancel=function(){a.dismiss("cancel")}}])},75881(e,a,t){t(82493),t(5687),t(76933),t(71099),t(41482),t(54745),t(35596),angular.module("graphdb.framework.namespaces",["LocalStorageModule","xeditable","ngAnimate","ngRoute","toastr","graphdb.framework.namespaces.controllers","graphdb.framework.namespaces.directives","graphdb.framework.core.services.repositories","graphdb.framework.core.directives","graphdb.framework.core.directives.paginations"]).run(["editableOptions",function(e){e.theme="bs3"}])}};
|
|
2
|
+
//# sourceMappingURL=75881.148ce498d06784abfd6c.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"75881.148ce498d06784abfd6c.bundle.js","mappings":"+IAA6BA,QAAQC,OAAO,0CAA2C,CAAC,YAGnEC,UAAU,4BAA6B,CAAC,WAAY,SAAUC,GAC/E,OAAO,SAAUC,GACTA,EAAMC,OAKNF,EAAS,WACLC,EAAME,QAAQC,QAAS,CAC3B,EAAG,EAEX,CACJ,G,UCdAP,QAAQC,OAAO,gDAAiD,IAC3DC,UAAU,cAAe,CAAC,aAAc,aAAc,WAAY,SAAUM,EAAYC,EAAYC,GACjG,MAAO,CACHC,KAAM,SAAUC,EAAQC,GACpB,MAYMC,EAAqBA,KACvB,MAAMC,EAAmBL,EAbZ,0WAaYA,CAAmBE,GAC5CC,EAAQG,KAAKD,IAGlBD,IACA,MAAMG,EAA8BR,EAAWS,IAAI,0BAA2BJ,GAC9EF,EAAOM,IAAI,WAAYD,EAC1B,EAER,G,mDCtBJ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,QAAQ7D,EAAOO,WAAY,SAASuD,GACxCA,EAAK6C,UAAW,CACpB,EACJ,EAEMtB,EAA6BA,CAACjD,EAAQf,IArWpD,SAAwBe,GACpB,MAAkB,KAAXA,GAAiBA,EAAO8E,MAAM1G,EACzC,CAoWiB2G,CAAe/E,IAKhBhD,QAAQgI,YAAY/F,IAA4B,KAAdA,IAClCL,EAAO8B,MAAMlD,EAAWwE,QAAQ,uCAAwCxE,EAAWwE,QAAQ,kBACpF,IANPpD,EAAO8B,MAAMlD,EAAWwE,QAAQ,2BAA4B,CAAChC,OAAQA,GAASxC,EAAWwE,QAAQ,mBAC1F,EAUnB,IAEJ7D,EAAWM,WAAW,oBAAqB,CAAC,SAAU,oBAAqB,SAASb,EAAQqH,GACxFrH,EAAOsH,GAAK,WAERD,EAAkBE,OADH,EAEnB,EAEAvH,EAAOwH,OAAS,WACZH,EAAkBI,QAAQ,SAC9B,CACJ,G,6ECpYsBrI,QAAQC,OAAO,+BAbrB,CACZ,qBACA,YACA,YACA,UACA,SACA,2CACA,0CACA,+CACA,oCACA,kDAKUqI,IAAI,CAAC,kBAAmB,SAAUC,GAC5CA,EAAgBC,MAAQ,KAC5B,G","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/namespaces/directives.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/core/directives/paginations.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/namespaces/controllers.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/namespaces/app.js"],"sourcesContent":["const namespacesDirectives = angular.module('graphdb.framework.namespaces.directives', ['ngRoute']);\n\n// This directive will set the loader to false once the respective ngRepeat is done loading\nnamespacesDirectives.directive('loaderPostRepeatDirective', ['$timeout', function ($timeout) {\n return function (scope) {\n if (scope.$last) {\n // It's important to do this with timeout:\n // \"...since the setTimeout function gets pushed to the end of the queue of the browser,\n // its always right after everything is done in angular, usually ngRepeat which continues\n // after its parents postLinking function\"\n $timeout(function () {\n scope.$parent.loader = false;\n }, 0);\n }\n };\n}]);\n","// Due to a problem in the uib-pagination library, the template needs to be recompiled, in order to set the first and last text in a new language\nangular.module('graphdb.framework.core.directives.paginations', [])\n .directive('paginations', [\"$translate\", \"$rootScope\", \"$compile\", function ($translate, $rootScope, $compile) {\n return {\n link: function ($scope, element) {\n const template = '<uib-pagination class=\"nav navbar-right\" ' +\n 'total-items=\"matchedElements.length\" ' +\n 'items-per-page=\"pageSize\" ' +\n 'ng-model=\"page\" ' +\n 'ng-change=\"changePagination()\" ' +\n 'direction-links=\"false\" ' +\n 'boundary-links=\"true\" ' +\n 'max-size=\"5\" ' +\n 'rotate=\"true\" ' +\n 'first-text=\"{{\\'paginator.first.page.label\\' | translate}}\" ' +\n 'last-text=\"{{\\'paginator.last.page.label\\' | translate}}\"></uib-pagination>';\n\n const recompileDirective = () => {\n const compiledTemplate = $compile(template)($scope);\n element.html(compiledTemplate);\n };\n\n recompileDirective();\n const languageChangedSubscription = $rootScope.$on('$translateChangeSuccess', recompileDirective);\n $scope.$on('$destroy', languageChangedSubscription);\n }\n };\n }]);\n","import 'angular/core/services';\nimport 'angular/core/services/jwt-auth.service';\nimport 'angular/core/services/repositories.service';\nimport 'angular/rest/rdf4j.repositories.rest.service';\n\nconst modules = [\n 'ui.bootstrap',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.core.services.jwtauth',\n 'graphdb.framework.rest.repositories.service',\n 'graphdb.framework.rest.rdf4j.repositories.service',\n 'toastr',\n];\n\nconst namespaces = angular.module('graphdb.framework.namespaces.controllers', modules);\n\n// A regular expression that validates a prefix according to the SPARQL 1.1 specification.\n// XXX: Technically this should include Unicode chars > 0xFFFF but those aren't fully supported in JavaScript\nconst pnPrefixRe = function() {\n const pnCharsBase = '[A-Z]|[a-z]|[\\u00C0-\\u00D6]|[\\u00D8-\\u00F6]|[\\u00F8-\\u02FF]|[\\u0370-\\u037D]'\n + '|[\\u037F-\\u1FFF]|[\\u200C-\\u200D]|[\\u2070-\\u218F]|[\\u2C00-\\u2FEF]|[\\u3001-\\uD7FF]'\n + '|[\\uF900-\\uFDCF]|[\\uFDF0-\\uFFFD]';\n const pnCharsU = pnCharsBase + '|_';\n const pnChars = pnCharsU + '|-|[0-9]|\\u00B7|[\\u0300-\\u036F]|[\\u203F-\\u2040]';\n\n return new RegExp('^(?:' + pnCharsBase + ')(?:(?:' + pnChars + '|\\\\.)*(?:' + pnChars + '))?$');\n}();\n\nfunction validatePrefix(prefix) {\n return prefix === '' || prefix.match(pnPrefixRe);\n}\n\nnamespaces.controller('NamespacesCtrl', ['$scope', '$http', '$repositories', 'toastr', '$uibModal', 'ModalService', 'RepositoriesRestService', 'RDF4JRepositoriesRestService', '$translate',\n function($scope, $http, $repositories, toastr, $uibModal, ModalService, RepositoriesRestService, RDF4JRepositoriesRestService, $translate) {\n $scope.namespaces = [];\n $scope.namespace = {};\n $scope.loader = false;\n $scope.haveSelected = false;\n $scope.pageSizeOptions = [10, 20, 50, 100];\n $scope.page = 1;\n $scope.pageSize = $scope.pageSizeOptions[0];\n $scope.displayedNamespaces = [];\n\n $scope.getNamespaces = function() {\n if (!$repositories.getActiveRepository()) {\n return;\n }\n\n $scope.loader = true;\n $scope.namespaces = [];\n $scope.displayedNamespaces = [];\n $scope.matchedElements = [];\n RDF4JRepositoriesRestService.getNamespaces($repositories.getActiveRepository())\n .success(function(data) {\n $scope.namespaces = data.results.bindings.map(function(e) {\n return {\n prefix: e.prefix.value,\n namespace: e.namespace.value,\n };\n });\n if ($scope.namespaces.length > 0) {\n $scope.namespaces.sort(function(a, b) {\n const prefixA = a.prefix.toUpperCase(); // ignore upper and lowercase\n const prefixB = b.prefix.toUpperCase(); // ignore upper and lowercase\n if (prefixA < prefixB) {\n return -1;\n }\n if (prefixA > prefixB) {\n return 1;\n }\n return 0;\n });\n $scope.matchedElements = $scope.namespaces;\n $scope.changePagination();\n }\n if ($scope.namespaces.length === 0) {\n // Remove the loader ourselves\n $scope.loader = false;\n } // else let the loaderPostRepeatDirective do it\n }).error(function(data) {\n const msg = getError(data);\n toastr.error(msg);\n $scope.loader = false;\n });\n };\n\n $scope.changePagination = function() {\n if (angular.isDefined($scope.namespaces)) {\n $scope.displayedNamespaces = $scope.namespaces.slice($scope.pageSize * ($scope.page - 1), $scope.pageSize * $scope.page);\n }\n };\n\n $scope.changePageSize = function(size) {\n $('.ot-graph-page-size').removeClass('active');\n $scope.page = 1;\n $scope.searchNamespaces = '';\n if (size) {\n $scope.getNamespaces();\n $scope.pageSize = size;\n }\n };\n\n $scope.$watch('matchedElements', function() {\n if (angular.isDefined($scope.matchedElements)) {\n $scope.displayedNamespaces = $scope.matchedElements.slice($scope.pageSize * ($scope.page - 1), $scope.pageSize * $scope.page);\n }\n });\n\n $scope.$watch(function() {\n return $repositories.getActiveRepository();\n }, function() {\n $scope.searchNamespaces = '';\n $scope.getNamespaces();\n $scope.selectedAll = false;\n });\n\n $scope.onNamespaceSearch = function() {\n $scope.haveSelected = false;\n $scope.selectedAll = false;\n $scope.matchedElements = [];\n deselectAll();\n filterResults();\n };\n\n const filterResults = function() {\n angular.forEach($scope.namespaces, function(item) {\n if (item.namespace.indexOf($scope.searchNamespaces) !== -1 || item.prefix.indexOf($scope.searchNamespaces) !== -1) {\n $scope.matchedElements.push(item);\n }\n });\n };\n\n $scope.saveNamespace = function(prefix, namespace) {\n $scope.loader = true;\n return RDF4JRepositoriesRestService.updateNamespacePrefix($repositories.getActiveRepository(), namespace, prefix)\n .then(function() {\n $scope.getNamespaces();\n toastr.success($translate.instant('namespace.saved'));\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 // Reject the promise so that the caller can handle the error as well. Some callers don't care about\n // the error and just want to know if the operation was successful or not. But there are also callers\n // that want to know the error details.\n return Promise.reject(data);\n });\n };\n\n $scope.editPrefix = function(oldPrefix, newPrefix) {\n $scope.loader = true;\n RepositoriesRestService.getPrefix($repositories.getActiveRepository(), {\n from: oldPrefix, to: newPrefix, location: $repositories.getActiveRepositoryObject().location})\n .success(function() {\n $scope.getNamespaces();\n $scope.loader = false;\n }).error(function(data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n const confirmReplace = function(okCallback, cancelCallback) {\n return ModalService.openSimpleModal({\n title: $translate.instant('namespace.confirm.replace'),\n message: $translate.instant('namespace.already.exists.msg'),\n warning: true,\n }).result;\n };\n\n /**\n * Validates the prefix and namespace and checks if the prefix already exists. If the prefix already exists,\n * a confirmation dialog is shown to the user. If the user confirms the dialog, the flow continues and the\n * namespace is updated. If the user rejects the dialog, the flow continues in the catch block.\n *\n * <strong>Using async/await in order to be able to control the flow of the function and to be able to return a value\n * which is expected by the xeditable component. Otherwise, it won't behave as expected.</strong>\n *\n * @param {string} prefixValue The new prefix value.\n * @param {string} namespaceValue The new namespace value.\n * @param {*} namespaceObject The namespace object holding the old values.\n * @return {Promise<boolean|string>}\n */\n $scope.editPrefixAndNamespace = async (prefixValue, namespaceValue, namespaceObject) => {\n try {\n const namespace = namespaceValue;\n let prefix = prefixValue;\n if (!prefixValue) {\n prefix = '';\n }\n\n if (!validatePrefixAndNamespace(prefix, namespace)) {\n // The string returned here is only meaningful for the xeditable component which handles it as an\n // error which we don't show to the user. In this case the form remains open and the user can cancel\n // or correct the input.\n return 'Prefix or namespace is invalid';\n }\n\n const oldPrefix = namespaceObject.prefix;\n if (isPrefixExist(prefix, oldPrefix)) {\n // If the user rejects the confirmation dialog, the flow continues in the catch block.\n await ModalService.openSimpleModal({\n title: $translate.instant('namespace.confirm.replace'),\n message: $translate.instant('namespace.already.exists.msg'),\n warning: true,\n }).result;\n }\n return updateNamespace(prefix, oldPrefix, namespace);\n } catch (err) {\n // The string returned here is only meaningful for the xeditable component which handles it as an\n // error which we don't show to the user. In this case the form remains open and the user can cancel\n // or correct the input.\n return 'Prefix overwrite cancelled';\n }\n };\n\n /**\n * Checks if the prefix already exists in the list of namespaces.\n * @param {string} prefix The prefix to check.\n * @param {string} oldPrefix The old prefix value.\n * @return {boolean} True if the prefix already exists, false otherwise.\n */\n const isPrefixExist = (prefix, oldPrefix) => {\n return !!$scope.namespaces.find((elem) => elem.prefix === prefix && oldPrefix !== prefix);\n };\n\n /**\n * Updates the namespace and if the operation is successful, updates the prefix as well.\n * @param {string} newPrefix The new prefix value.\n * @param {string} oldPrefix The old prefix value.\n * @param {*} namespace The namespace object holding the old values.\n * @return {Promise<void>}\n */\n const updateNamespace = (newPrefix, oldPrefix, namespace) => {\n return $scope.saveNamespace(oldPrefix, namespace)\n .then(function() {\n if (oldPrefix !== newPrefix) {\n $scope.editPrefix(oldPrefix, newPrefix);\n }\n });\n };\n\n $scope.addNamespace = function() {\n if (!$scope.namespace.prefix) {\n $scope.namespace.prefix = '';\n }\n\n if (!validatePrefixAndNamespace($scope.namespace.prefix, $scope.namespace.namespace)) {\n return;\n }\n\n $scope.selectedAll = false;\n let prefixExist = false;\n for (let i = 0; i < $scope.namespaces.length; i++) {\n if ($scope.namespaces[i].prefix === $scope.namespace.prefix) {\n prefixExist = true;\n }\n }\n if (prefixExist) {\n confirmReplace().then(saveNamespaceAndUpdateTheUI);\n } else {\n saveNamespaceAndUpdateTheUI();\n }\n };\n\n /**\n * Saves the namespace and if operation is successful, resets the form state.\n */\n const saveNamespaceAndUpdateTheUI = () => {\n $scope.saveNamespace($scope.namespace.prefix, $scope.namespace.namespace)\n .then(() => {\n $scope.namespace.namespace = '';\n $scope.namespace.prefix = '';\n // Not sure why the timeout is needed here. Probably resetting the values above needs to be\n // reflected first in the form state and then the form validation model needs to be reset.\n setTimeout(() => {\n $scope.form.$setUntouched();\n $scope.form.$setPristine();\n });\n })\n .catch(() => {\n // Do nothing, the error is already handled in the saveNamespace function\n });\n };\n\n $scope.removeNamespace = function(namespace) {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: $translate.instant('namespace.warning.delete.msg', {prefix: namespace.prefix}),\n warning: true,\n }).result.then(function() {\n deleteNamespace(namespace);\n });\n };\n\n $scope.checkAll = function() {\n angular.forEach($scope.displayedNamespaces, function(item) {\n item.selected = $scope.selectedAll;\n });\n };\n\n $scope.deleteSelected = function() {\n const openModalInstance = function() {\n ModalService.openSimpleModal({\n title: $translate.instant('common.confirm.delete'),\n message: $translate.instant('namespace.warning.delete.selected'),\n warning: true,\n }).result.then(function() {\n $scope.loader = true;\n const namespaces = [];\n angular.forEach($scope.displayedNamespaces, function(namespace) {\n if (namespace.selected) {\n namespaces.push(namespace);\n }\n });\n deleteNamespace(namespaces.shift(), namespaces);\n $scope.selectedAll = false;\n }, function() {\n $scope.getNamespaces();\n $scope.selectedAll = false;\n $scope.searchNamespaces = '';\n });\n };\n\n let modalInstanceOpened = false;\n angular.forEach($scope.displayedNamespaces, function(namespace) {\n if (!modalInstanceOpened) {\n if (namespace.selected) {\n modalInstanceOpened = true;\n openModalInstance();\n }\n }\n });\n };\n\n const deleteNamespace = (namespace, namespaces)=> {\n let prefix;\n if (typeof namespace === 'object') {\n prefix = namespace.prefix;\n } else {\n prefix = namespace;\n }\n RDF4JRepositoriesRestService.deleteNamespacePrefix($repositories.getActiveRepository(), prefix)\n .success(function() {\n if (namespaces && namespaces.length > 0) {\n namespace = namespaces.shift();\n deleteNamespace(namespace, namespaces);\n } else {\n $scope.selectedAll = false;\n $scope.namespace = {};\n $scope.getNamespaces();\n $scope.searchNamespaces = '';\n $scope.haveSelected = false;\n $scope.loader = false;\n $scope.displayedNamespaces = [];\n if (namespaces === undefined) {\n toastr.success($translate.instant('namespace.prefix.deleted.successfully', {prefix: prefix}), '');\n } else {\n toastr.success($translate.instant('namespace.selected.namespaces.deleted.successfully'), '');\n }\n }\n }).error(function(data) {\n const msg = getError(data);\n toastr.error(msg, $translate.instant('common.error'));\n $scope.loader = false;\n });\n };\n\n $scope.checkIfSelectedNamespace = function() {\n $scope.haveSelected = false;\n angular.forEach($scope.namespaces, function(item) {\n if (item.selected) {\n $scope.haveSelected = true;\n }\n });\n };\n\n const deselectAll = function() {\n angular.forEach($scope.namespaces, function(item) {\n item.selected = false;\n });\n };\n\n const validatePrefixAndNamespace = (prefix, namespace) => {\n if (!validatePrefix(prefix)) {\n toastr.error($translate.instant('namespace.invalid.prefix', {prefix: prefix}, $translate.instant('common.error')));\n return false;\n }\n\n if (angular.isUndefined(namespace) || namespace === '') {\n toastr.error($translate.instant('namespace.warning.provide.namespace'), $translate.instant('common.error'));\n return false;\n }\n\n return true;\n };\n }]);\n\nnamespaces.controller('StandartModalCtrl', ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {\n $scope.ok = function() {\n const result = true;\n $uibModalInstance.close(result);\n };\n\n $scope.cancel = function() {\n $uibModalInstance.dismiss('cancel');\n };\n}]);\n","import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/core/services/repositories.service';\nimport 'angular/namespaces/controllers';\nimport 'angular/namespaces/directives';\nimport 'angular/core/directives/paginations';\nimport 'angular-xeditable/dist/js/xeditable.min';\n\nconst modules = [\n 'LocalStorageModule',\n 'xeditable',\n 'ngAnimate',\n 'ngRoute',\n 'toastr',\n 'graphdb.framework.namespaces.controllers',\n 'graphdb.framework.namespaces.directives',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.core.directives',\n 'graphdb.framework.core.directives.paginations'\n];\n\nconst namespacesApp = angular.module('graphdb.framework.namespaces', modules);\n\nnamespacesApp.run(['editableOptions', function (editableOptions) {\n editableOptions.theme = 'bs3';\n}]);\n"],"names":["angular","module","directive","$timeout","scope","$last","$parent","loader","$translate","$rootScope","$compile","link","$scope","element","recompileDirective","compiledTemplate","html","languageChangedSubscription","$on","namespaces","pnPrefixRe","pnCharsBase","pnChars","pnCharsU","RegExp","controller","$http","$repositories","toastr","$uibModal","ModalService","RepositoriesRestService","RDF4JRepositoriesRestService","namespace","haveSelected","pageSizeOptions","page","pageSize","displayedNamespaces","getNamespaces","getActiveRepository","matchedElements","success","data","results","bindings","map","e","prefix","value","length","sort","a","b","prefixA","toUpperCase","prefixB","changePagination","error","msg","getError","isDefined","slice","changePageSize","size","$","removeClass","searchNamespaces","$watch","selectedAll","onNamespaceSearch","deselectAll","filterResults","forEach","item","indexOf","push","saveNamespace","updateNamespacePrefix","then","instant","catch","Promise","reject","editPrefix","oldPrefix","newPrefix","getPrefix","from","to","location","getActiveRepositoryObject","editPrefixAndNamespace","async","prefixValue","namespaceValue","namespaceObject","validatePrefixAndNamespace","isPrefixExist","openSimpleModal","title","message","warning","result","updateNamespace","err","find","elem","addNamespace","prefixExist","i","saveNamespaceAndUpdateTheUI","setTimeout","form","$setUntouched","$setPristine","removeNamespace","deleteNamespace","checkAll","selected","deleteSelected","modalInstanceOpened","shift","deleteNamespacePrefix","undefined","checkIfSelectedNamespace","match","validatePrefix","isUndefined","$uibModalInstance","ok","close","cancel","dismiss","run","editableOptions","theme"],"ignoreList":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=78070;export const __webpack_esm_ids__=[2134,27899,43006,78070,78618];export const __webpack_esm_modules__={2134(e,t,n){n.d(t,{x:()=>r});class r extends Error{}},27899(e,t,n){n.d(t,{Q:()=>a,y:()=>r});class r{constructor(e,t,n,r){this.status=e,this.mesage=r,this.messageLabelKey=t,this.parameters=n}}const a={ERROR:"error",SUCCESS:"success"}},43006(e,t,n){n.d(t,{H:()=>r});const r={CREATE:"create",REPAIR:"repair",DROP:"drop"}},78070(e,t,n){var r=n(98857),a=n(85694),o=(n(61105),n(20227),n(85727)),s=n(14604),i=n(43006),c=n(27899),u=n(97421),d=n(60529),l=n(78618),p=n(22201),g=n(2134),m=n(10799),y=(n(81655),n(304)),h=n(57154);const S=y.I.logger;function v(e,t,n,y,v,E,f,C,R,w,q,A,_,b,x,L,T){const P=(0,h.service)(h.SecurityContextService);this.repository="";const O="#query-editor";let U=E.getActiveRepository(),Q=E.isActiveRepoOntopType();t.yasguiConfig=void 0,t.savedQueryConfig=void 0,t.prefixes={},t.inferUserSetting=!0,t.sameAsUserSetting=!0;const $=new Map;let N=!1;t.updateConfig=e=>{t.yasguiConfig={endpoint:k,componentId:p.y,prefixes:t.prefixes,infer:Q||t.inferUserSetting,sameAs:Q||t.sameAsUserSetting,yasrToolbarPlugins:[z],beforeUpdateQuery:V(),outputHandlers:new Map([[u.r.QUERY_EXECUTED,I],[u.r.REQUEST_ABORTED,M]]),clearState:void 0!==e&&e}},t.getActiveRepositoryNoError=()=>U;const k=e=>{const t=(e=>{const t=e.getTab();if(t)return t.getYasqe()})(e);if(t)return E.resolveSparqlEndpoint(t.getQueryMode())},I=e=>{const t=$.get(e.tabId);t&&(t.dismiss(),$.delete(e.tabId))},M=e=>{if(e&&m.g.UPDATE!==e.queryMode){const t=e.getRepository(),n=e.getQueryTrackAlias();t&&n&&b.deleteQuery(n,t)}},D=e=>o.p3.getOntotextYasguiElementAsync(O).then(t=>t.openTab(e)).then(e=>o.p3.highlightTabName(e)),Y=()=>{N=!0;const e=y.search()[h.REPOSITORY_ID_PARAM];y.search(e?{repositoryId:e}:{}),y.replace()},G=e=>e?o.p3.getOntotextYasguiElementAsync(O).then(H).then(j):Promise.resolve(),H=e=>e.getQueryMode().then(t=>({yasguiComponent:e,queryMode:t})),j=({yasguiComponent:e,queryMode:t})=>"update"!==t?e.query():new Promise(t=>{const n=R.instant("confirm.execute"),r=(0,d.Gz)(R.instant("query.editor.automatically.execute.update.warning"));_.openConfirmation(n,r,()=>t(e.query()),()=>t())}),z={createElement:n=>{const r=document.createElement("span");r.classList.add("explore-visual-graph-button-name");const a=document.createElement("button");return a.classList.add("explore-visual-graph-button"),a.classList.add("icon-data"),a.onclick=function(){const r={query:n.yasqe.getValue(),sameAs:n.yasqe.getSameAs(),inference:n.yasqe.getInfer()},a=function(){y.path("graphs-visualizations").search(r)};t.$$phase||e.$$phase?a():t.$apply(a)},a.appendChild(r),a},updateElement:(e,t)=>{if(e.classList.add("hidden"),!t.hasResults())return;const n=t.yasqe.getQueryType();s.b.CONSTRUCT!==n&&s.b.DESCRIBE!==n||e.classList.remove("hidden"),e.querySelector(".explore-visual-graph-button-name").innerText=R.instant("query.editor.visual.btn")},getOrder:()=>2},B=(e,t)=>({key:e,value:t}),F=e=>[B("name",e.data.name)],K=(e,n,r)=>{const a=t.$new(!0);a.beingBuiltConnector={percentDone:0,status:{processedEntities:0,estimatedEntities:0,indexedEntities:0,entitiesPerSecond:0},actionName:e,eta:"-",inline:!1,iri:n,name:r,doneCallback:function(){o.dismiss("cancel")}},a.getHumanReadableSeconds=t.getHumanReadableSeconds;const o=f.open({templateUrl:"pages/connectorProgress.html",controller:"CreateProgressCtrl",size:"lg",backdrop:"static",scope:a});return o},V=()=>(e,t)=>q.checkConnector(e).then(e=>e.data.command?e.data.hasSupport?i.H.CREATE===e.data.command?((e,t)=>{const n=K(R.instant("externalsync.creating"),e.data.iri,e.data.name);return $.set(t,n),new c.y(c.Q.SUCCESS,"created.connector",F(e))})(e,t):i.H.REPAIR===e.data.command?((e,t)=>{const n=K(R.instant("externalsync.repairing"),e.data.iri,e.data.name);return $.set(t,n),new c.y(c.Q.SUCCESS,"query.editor.repaired.connector",F(e))})(e,t):i.H.DROP===e.data.command?(e=>new c.y(c.Q.SUCCESS,"externalsync.delete.success.msg",F(e)))(e):void 0:(e=>{const t=[B("connectorName",e.data.connectorName),B("pluginName",e.data.pluginName)];return new c.y(c.Q.ERROR,"query.editor.inactive.plugin.warning.msg",t)})(e):new c.y(c.Q.SUCCESS)).catch(e=>{S.error("Checking connector error: ",e)}),X=e=>{const o=document.querySelectorAll('script[src*="https://www.gstatic.com/"]');if(o.length>0){const e=v.getLanguage();let t="module.js";if("en"!==e&&(t=`module__${e}.js`),!Array.prototype.some.call(o,e=>e.src.includes(t)))return void location.reload()}const s=P.getAuthenticatedUser();n.when(E.getPrefixes(U)).then(n=>{t.prefixes=n,(e=>{t.inferUserSetting=e?.appSettings.DEFAULT_INFERENCE,t.sameAsUserSetting=e?.appSettings.DEFAULT_SAMEAS})(s),((e=!1)=>{t.updateConfig(e);const n=y.search();n.hasOwnProperty(a.L.savedQueryName)?(e=>{const t=e[a.L.savedQueryName],n=e[a.L.savedQueryOwner],o=(0,l.G4)(e.execute);w.getSavedQuery(t,n).then(e=>{const t=(0,r.YS)(e);D(t).then(Y).then(()=>G(o))}).catch(e=>{C.error(R.instant("query.editor.missing.saved.query.data.error",{savedQueryName:t,error:getError(e)}))})})(n):n.hasOwnProperty(a.L.query)?(e=>{const t=e[a.L.name],n=e[a.L.query],o=e[a.L.owner],s=(0,l.G4)(e.execute),i=(0,r.mX)(n,t,o,!0);D(i).then(Y).then(()=>G(s))})(n):A.isActive()&&D()})(e)})},J=[],W=e=>{const t=o.p3.getOntotextYasguiElement(O);t&&t.abortAllRequests().then(()=>{})};window.addEventListener("beforeunload",W);let Z;J.push(h.ServiceProvider.get(h.EventService).subscribe(h.EventName.NAVIGATION_START,e=>(e=>{if(N)return void(N=!1);const t=o.p3.getOntotextYasguiElement(O);if(!t||Z)return;const n=new URL(e.newUrl),r=n.pathname+n.search+n.hash;e.cancelNavigation(),t.getOngoingRequestsInfo().then(e=>{return t=e,new Promise((e,n)=>{if(!t||t.queriesCount<1&&t.updatesCount<1)return void e();const r=R.instant("common.confirm"),a=(0,d.Gz)((e=>{let t="view.sparql-editor.leave_page.run_queries.confirmation.";!e||e.queriesCount<1?t+="none_queries_":1===e.queriesCount?t+="one_query_":t+="queries_",e.updatesCount&&0!==e.updatesCount?1===e.updatesCount?t+="one_update":t+="updates":t+="non_updates",t+=".message";const n={queriesCount:e.queriesCount,updatesCount:e.updatesCount};return R.instant(t,n)})(t));_.openSimpleModal({title:r,message:a,warning:!0}).result.then(function(){e()},function(){n(new g.x)})});var t}).then(()=>t.abortAllRequests()).then(()=>{Z=!0,(0,h.navigateTo)(r)()}).catch(e=>{e instanceof g.x||(S.error(e),Z=!0,(0,h.navigateTo)(r)())})})(e)));const ee=()=>{L.set(T.SPARQL_LAST_REPO,U)};J.push(t.$on("language-changed",function(){location.reload()}));const te=h.ServiceProvider.get(h.LanguageContextService).onSelectedLanguageChanged(()=>{},()=>new Promise(e=>{_.openSimpleModal({title:R.instant("query.editor.language.change.warning.title"),message:R.instant("query.editor.reload.page.warning"),warning:!0}).result.then(function(){e(!0)},function(){e(!1)})}));J.push(te),J.push(t.$on("$destroy",()=>{ee(),J.forEach(e=>e()),window.removeEventListener("beforeunload",W)})),J.push(t.$watch(t.getActiveRepositoryObject,e=>{e&&(U=E.getActiveRepository(),Q=E.isActiveRepoOntopType(e),L.get(T.SPARQL_LAST_REPO)!==U?(X(!0),ee()):X(!1))}))}angular.module("graphdb.framework.sparql-editor.controllers",["ui.bootstrap","graphdb.framework.rest.connectors.service","graphdb.framework.externalsync.controllers","graphdb.framework.utils.event-emitter-service","graphdb.framework.utils.localstorageadapter"]).controller("SparqlEditorCtrl",v),v.$inject=["$rootScope","$scope","$q","$location","$languageService","$repositories","$uibModal","toastr","$translate","SparqlRestService","ConnectorsRestService","GuidesService","ModalService","MonitoringRestService","EventEmitterService","LocalStorageAdapter","LSKeys"]},78618(e,t,n){n.d(t,{G4:()=>o,Sn:()=>s,hK:()=>a});var r=n(98980);const a=e=>e.replace(/[()']/g,""),o=e=>"string"==typeof e?"true"===e:Boolean(e),s=e=>e?(0,r.upperFirst)(e.toLowerCase()):e}};
|
|
2
|
+
//# sourceMappingURL=78070.d54ede951a08e1c8689d.bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"78070.d54ede951a08e1c8689d.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,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E,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 const navigate = function() {\n $location.path('graphs-visualizations').search(paramsToParse);\n };\n // This button is embedded in the Yasr toolbar, which is outside the Angular context, so we need to\n // manually trigger the navigation inside the Angular context. Otherwise, the navigation will be\n // triggered on the next digest cycle that might never happen. In our case there is a constant server\n // polling that triggers the digest cycle, so the navigation will be triggered, but it can lead to a\n // noticeable delay. By manually triggering the navigation inside the Angular context, we ensure that\n // the navigation is triggered immediately.\n if ($scope.$$phase || $rootScope.$$phase) {\n navigate();\n } else {\n $scope.$apply(navigate);\n }\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","navigate","path","$$phase","$apply","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":""}
|