graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 9.33 kB
JavaScript
export const __webpack_id__=32606;export const __webpack_ids__=[3632,10153,32534,32606];export const __webpack_modules__={3632:(e,t,o)=>{o.r(t);var a=o(98980);function i(){return{restrict:"E",scope:{options:"=",selected:"=",labels:"="},templateUrl:"js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html",link:function(e){const t=[];e.searchLeft="",e.availableOptions=[],e.selectedOptions=[],e.selectOption=t=>{e.selectedOptions.push(t),e.availableOptions=e.availableOptions.filter(e=>e!==t),o()},e.selectAll=()=>{e.selectedOptions=e.selectedOptions.concat(e.availableOptions),e.availableOptions=[],o()},e.deselectOption=t=>{e.availableOptions.push(t),e.selectedOptions=e.selectedOptions.filter(e=>e!==t),o()},e.deselectAll=()=>{e.availableOptions=e.availableOptions.concat(e.selectedOptions),e.selectedOptions=[],o()};const o=()=>{e.selected=[...e.selectedOptions]};e.$on("$destroy",()=>{t.forEach(e=>e())}),e.selectedOptions=(0,a.cloneDeep)(e.selected),e.selectedOptions.length?e.availableOptions=e.options.filter(t=>!e.selectedOptions.find(e=>e.id===t.id)):e.availableOptions=(0,a.cloneDeep)(e.options)}}}angular.module("graphdb.framework.core.directives.shuttle-multiselect",[]).directive("shuttleMultiselect",i),i.$inject=[]},32534:(e,t,o)=>{o.r(t),o.d(t,{GraphqlEventName:()=>l});var a=o(98980),i=o(10406);function n(e){let t,o,n;const r=()=>t,s=()=>n,p=(t,o)=>{e.emitSync(t,(0,a.cloneDeep)(o))},c=(t,o)=>e.subscribeSync(t,e=>o(e));return{resetContext:()=>{o=void 0,n=void 0},updateSourceRepository:e=>{t=e,p(l.SOURCE_REPOSITORY_UPDATED,r())},getSourceRepository:r,setSelectedEndpoint:e=>{o=e},getSelectedEndpoint:()=>(0,a.cloneDeep)(o),getNewEndpoint:s,createEndpointConfig:()=>{n=new i.GraphqlEndpointConfiguration,e.emitSync(l.ENDPOINT_CONFIG_CREATED,n)},onEndpointConfigCreated:e=>(n&&angular.isFunction(e)&&e(n),c(l.ENDPOINT_CONFIG_CREATED,t=>e(t))),startCreateEndpointWizard:()=>{p(l.START_CREATE_ENDPOINT_WIZARD,null)},generateEndpoint:()=>{p(l.GENERATE_ENDPOINT,s())},endpointGenerated:e=>{p(l.ENDPOINT_GENERATED,e)},exploreEndpointInPlayground:e=>{p(l.EXPLORE_ENDPOINT_IN_PLAYGROUND,e)},openEndpointGenerationReport:e=>{p(l.OPEN_ENDPOINT_GENERATION_REPORT,e)},deleteEndpointGenerationReport:e=>{p(l.DELETE_ENDPOINT_REPORT,e)},cancelEndpointCreation:()=>{p(l.CANCEL_ENDPOINT_CREATION,{})},finishGenerationWorkflow:()=>{p(l.FINISH_GENERATION_WORKFLOW,{})},nextEndpointCreationStep:()=>{p(l.NEXT_ENDPOINT_CREATION_STEP,{})},previousEndpointCreationStep:()=>{p(l.PREVIOUS_ENDPOINT_CREATION_STEP,{})},subscribe:c}}angular.module("graphdb.framework.graphql.services.graphql-context",[]).factory("GraphqlContextService",n),n.$inject=["EventEmitterService","GraphqlService"];const l={SOURCE_REPOSITORY_UPDATED:"sourceRepositoryUpdated",START_CREATE_ENDPOINT_WIZARD:"startCreateEndpointWizard",ENDPOINT_CONFIG_CREATED:"updateConfigCreated",GENERATE_ENDPOINT:"generateEndpoint",ENDPOINT_GENERATED:"endpointGenerated",CANCEL_ENDPOINT_CREATION:"cancelEndpointCreation",FINISH_GENERATION_WORKFLOW:"finishGenerationWorkflow",EXPLORE_ENDPOINT_IN_PLAYGROUND:"exploreEndpointInPlayground",OPEN_ENDPOINT_GENERATION_REPORT:"openEndpointGenerationReport",DELETE_ENDPOINT_REPORT:"deleteEndpointReport",NEXT_ENDPOINT_CREATION_STEP:"nextEndpointCreationStep",PREVIOUS_ENDPOINT_CREATION_STEP:"previousEndpointCreationStep"}},32606:(e,t,o)=>{o.r(t),o(3632);var a=o(82854),i=o(32534),n=o(21388);function l(e,t,o,l,r,s,p,c){return{restrict:"E",templateUrl:"js/angular/graphql/templates/step-select-schema-sources.html",scope:{stepDefinition:"="},link:(r,d)=>{const h=[];r.schemaSourceType=n.SchemaSourceType,r.ontologyShaclShapeSource=n.OntologyShaclShapeSource,r.shapesMultiselectLabels={availableOptionsTitle:"graphql.create_endpoint.wizard_steps.shapes_multiselect.available_options.title",availableOptionsFilter:"graphql.create_endpoint.wizard_steps.shapes_multiselect.available_options.filter_placeholder",selectedOptionsTitle:"graphql.create_endpoint.wizard_steps.shapes_multiselect.selected_options.title",selectedOptionsCount:"graphql.create_endpoint.wizard_steps.shapes_multiselect.selected_options.count",selectTooltip:"graphql.create_endpoint.wizard_steps.shapes_multiselect.actions.add.tooltip",selectAllLabel:"graphql.create_endpoint.wizard_steps.shapes_multiselect.actions.add_all.label",selectAllTooltip:"graphql.create_endpoint.wizard_steps.shapes_multiselect.actions.add_all.tooltip",deselectTooltip:"graphql.create_endpoint.wizard_steps.shapes_multiselect.actions.remove.tooltip",deselectAllLabel:"graphql.create_endpoint.wizard_steps.shapes_multiselect.actions.remove_all.label",deselectAllTooltip:"graphql.create_endpoint.wizard_steps.shapes_multiselect.actions.remove_all.tooltip"},r.graphsMultiselectLabels={availableOptionsTitle:"graphql.create_endpoint.wizard_steps.graphs_multiselect.available_options.title",availableOptionsFilter:"graphql.create_endpoint.wizard_steps.graphs_multiselect.available_options.filter_placeholder",selectedOptionsTitle:"graphql.create_endpoint.wizard_steps.graphs_multiselect.selected_options.title",selectedOptionsCount:"graphql.create_endpoint.wizard_steps.graphs_multiselect.selected_options.count",selectTooltip:"graphql.create_endpoint.wizard_steps.graphs_multiselect.actions.add.tooltip",selectAllLabel:"graphql.create_endpoint.wizard_steps.graphs_multiselect.actions.add_all.label",selectAllTooltip:"graphql.create_endpoint.wizard_steps.graphs_multiselect.actions.add_all.tooltip",deselectTooltip:"graphql.create_endpoint.wizard_steps.graphs_multiselect.actions.remove.tooltip",deselectAllLabel:"graphql.create_endpoint.wizard_steps.graphs_multiselect.actions.remove_all.label",deselectAllTooltip:"graphql.create_endpoint.wizard_steps.graphs_multiselect.actions.remove_all.tooltip"},r.endpointConfiguration=void 0,r.prefixList=[],r.loadingPrefixes=!1,r.graphs=void 0,r.shaclShapeGraphs=void 0,r.graphqlSchemaShapes=void 0,r.allGraphs=void 0,r.loadingGraphs=!1,r.cancel=()=>{const e=o.instant("graphql.create_endpoint.wizard_steps.actions.cancel.confirmation.title"),a=o.instant("graphql.create_endpoint.wizard_steps.actions.cancel.confirmation.body");t.openConfirmation(e,a,()=>{s.cancelEndpointCreation()})},r.next=()=>{s.nextEndpointCreationStep()},r.onSchemaSourceTypeChange=()=>{r.endpointConfiguration.schemaSourceType=r.stepDefinition.schemaSourceType,r.endpointConfiguration.generateFromShaclShapes()&&(r.stepDefinition.ontotlogyShaclShapeSource===n.OntologyShaclShapeSource.USE_ALL_GRAPHS?r.endpointConfiguration.selectedGraphs=r.allGraphs:r.stepDefinition.ontotlogyShaclShapeSource===n.OntologyShaclShapeSource.USE_SHACL_SHAPE_GRAPH?r.endpointConfiguration.selectedGraphs=r.shaclShapeGraphs:r.stepDefinition.ontotlogyShaclShapeSource===n.OntologyShaclShapeSource.PICK_GRAPHS&&(r.endpointConfiguration.selectedGraphs=new a.GraphListOptions))},r.onOntologyShaclShapeSourceChange=()=>{r.endpointConfiguration.owlOrShaclSourceType=r.stepDefinition.ontotlogyShaclShapeSource,r.stepDefinition.ontotlogyShaclShapeSource===n.OntologyShaclShapeSource.USE_ALL_GRAPHS?r.endpointConfiguration.selectedGraphs=r.allGraphs:r.stepDefinition.ontotlogyShaclShapeSource===n.OntologyShaclShapeSource.USE_SHACL_SHAPE_GRAPH?r.endpointConfiguration.selectedGraphs=r.shaclShapeGraphs:r.stepDefinition.ontotlogyShaclShapeSource===n.OntologyShaclShapeSource.PICK_GRAPHS&&(r.endpointConfiguration.selectedGraphs=new a.GraphListOptions)},r.canProceed=()=>{let e=!1;if(r.endpointConfiguration){const t=r.endpointConfiguration.hasSelectedGraphqlSchemaShapes(),o=r.endpointParamsForm.$valid;r.stepDefinition.schemaSourceType===n.SchemaSourceType.GRAPHQL_SCHEMA_SHAPES&&t?e=!0:r.stepDefinition.schemaSourceType===n.SchemaSourceType.SHACL_SHAPES&&o&&(e=r.endpointConfiguration.owlOrShaclSourceType===n.OntologyShaclShapeSource.USE_ALL_GRAPHS||r.endpointConfiguration.hasSelectedGraphs())}return e};const _=t=>{r.loadingData=!0,e.all([(r.loadingPrefixes=!0,p.getPrefixListAsSelectOptions(s.getSourceRepository()).catch(e=>{console.error("Error loading prefixes",e),l.error(getError(e))}).finally(()=>{r.loadingPrefixes=!1})),(r.loadingGraphs=!0,c.getGraphs(s.getSourceRepository()).catch(e=>{console.error("Error loading graphs",e),l.error(getError(e))}).finally(()=>{r.loadingGraphs=!1})),p.getGraphqlSchemaShapes(s.getSourceRepository()).catch(e=>{console.error("Error loading GraphQL schema shapes",e),l.error(getError(e))}),p.getShaclShapeGraphs(s.getSourceRepository()).catch(e=>{console.error("Error loading SHACL shape graphs",e),l.error(getError(e))})]).then(([e,o,i,n])=>{r.graphqlSchemaShapes=i,r.graphs=o,r.shaclShapeGraphs=n,r.allGraphs=new a.GraphListOptions([...o.graphList,...n.graphList]),r.prefixList=e,r.endpointConfiguration=t}).finally(()=>{r.loadingData=!1})},S=()=>{_(s.getNewEndpoint())},E=()=>{h.forEach(e=>e())};(()=>{r.$on("$destroy",E),h.push(s.subscribe(i.GraphqlEventName.SOURCE_REPOSITORY_UPDATED,S));const e=s.getNewEndpoint();e?_(e):h.push(s.onEndpointConfigCreated(_))})()}}}angular.module("graphdb.framework.graphql.directives.select-schema-sources",["graphdb.framework.core.directives.shuttle-multiselect"]).directive("selectSchemaSources",l),l.$inject=["$q","ModalService","$translate","toastr","$repositories","GraphqlContextService","GraphqlService","RDF4JRepositoriesService"]}};
//# sourceMappingURL=32606.376e14770ba6e81b7159.bundle.js.map