graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 10.6 kB
JavaScript
export const __webpack_id__=82896;export const __webpack_ids__=[868,3632,16014,28379,29646,45149,82896];export const __webpack_modules__={868:(e,t,s)=>{s.r(t),s.d(t,{DynamicFormField:()=>i});class i{_key="";_label="";_type="";_collection=!1;_value;_values;_regex;_required=!1;_group;hidden=!1;constructor(e){this._key=e.key,this._label=e.label,this._type=e.type,this._collection=e.collection,this._value=e.value,this._values=e.values,this._regex="string"==typeof e.regex?new RegExp(e.regex):e.regex,this._required=e.required,this._group=e.group,this.hidden=e.hidden}get key(){return this._key}set key(e){this._key=e}get label(){return this._label}set label(e){this._label=e}get type(){return this._type}set type(e){this._type=e}get collection(){return this._collection}set collection(e){this._collection=e}get value(){return this._value}set value(e){this._value=e}get values(){return this._values}set values(e){this._values=e}get regex(){return this._regex}set regex(e){this._regex="string"==typeof e?new RegExp(e):e}get required(){return this._required}set required(e){this._required=e}get group(){return this._group}set group(e){this._group=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}}},3632:(e,t,s)=>{s.r(t);var i=s(98980);function a(){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),s()},e.selectAll=()=>{e.selectedOptions=e.selectedOptions.concat(e.availableOptions),e.availableOptions=[],s()},e.deselectOption=t=>{e.availableOptions.push(t),e.selectedOptions=e.selectedOptions.filter(e=>e!==t),s()},e.deselectAll=()=>{e.availableOptions=e.availableOptions.concat(e.selectedOptions),e.selectedOptions=[],s()};const s=()=>{e.selected=[...e.selectedOptions]};e.$on("$destroy",()=>{t.forEach(e=>e())}),e.selectedOptions=(0,i.cloneDeep)(e.selected),e.selectedOptions.length?e.availableOptions=e.options.filter(t=>!e.selectedOptions.find(e=>e.id===t.id)):e.availableOptions=(0,i.cloneDeep)(e.options)}}}angular.module("graphdb.framework.core.directives.shuttle-multiselect",[]).directive("shuttleMultiselect",a),a.$inject=[]},16014:(e,t,s)=>{s.r(t),s.d(t,{ENDPOINT_GENERATION_STATUS:()=>i,GraphqlEndpointOverview:()=>l,GraphqlEndpointOverviewList:()=>a});const i={NONE:"NONE",SUCCESS:"SUCCESS",ERROR:"ERROR"};class a{_endpointList=[];constructor(e){this._endpointList=e||[]}get endpointList(){return this._endpointList}set endpointList(e){this._endpointList=e}}class l{_label;_uri;_status;constructor(e){this._label=e.label||"",this._uri=e.uri||"",this._status=e.status||i.NONE}get label(){return this._label}set label(e){this._label=e}get uri(){return this._uri}set uri(e){this._uri=e}get status(){return this._status}set status(e){this._status=e}}},28379:(e,t,s)=>{s.r(t),s.d(t,{CONFIG_TYPE:()=>a,GraphqlEndpointConfigurationSettings:()=>l});var i=s(868);const a={STRING:"string",TEXT:"text",BOOLEAN:"boolean",JSON:"json"};class l{_settings;_hasSettings;constructor(e){this._settings=e,this._hasSettings=!!this._settings&&this._settings.models.length>0}toFlatJSON(){const e={},t=t=>{t.collection?e[t.key]=t.value:"select"===t.type?e[t.key]=t.value.value:e[t.key]=t.value};return this._settings.models.forEach(e=>{e instanceof i.DynamicFormField?t(e):[...e.fields,...e.hiddenFields].forEach(t)}),e}get hasSettings(){return this._hasSettings}get settings(){return this._settings}set settings(e){this._settings=e,this._hasSettings=this._settings.models.length>0}}},29646:(e,t,s)=>{s.r(t),s.d(t,{GraphqlSchemaShape:()=>a,GraphqlSchemaShapes:()=>i});class i{_shapes;_size;_isEmpty;constructor(e){this._shapes=e||[],this._size=this.shapes.length,this._isEmpty=0===this.shapes.length}processShapes(e){return this.shapes.map(e)}getShapeIds(){return this.shapes.map(e=>e.id)}get isEmpty(){return this._isEmpty}get size(){return this._size}get shapes(){return this._shapes}set shapes(e){this._shapes=e,this._size=this.shapes.length,this._isEmpty=0===this.shapes.length}toJSON(){return this.shapes.map(e=>e.id)}}class a{_id;_name;_label;_description;constructor(e){this._id=e.id,this._name=e.name,this._label=e.label,this._description=e.description}get id(){return this._id}set id(e){this._id=e}get name(){return this._name}set name(e){this._name=e}get label(){return this._label}set label(e){this._label=e}get description(){return this._description}set description(e){this._description=e}}},32606:(e,t,s)=>{s.r(t),s(3632);var i=s(82854),a=s(32534),l=s(21388);const o=s(304).LoggerProvider.logger;function r(e,t,s,r,n,p,c,h){return{restrict:"E",templateUrl:"js/angular/graphql/templates/step-select-schema-sources.html",scope:{stepDefinition:"="},link:(n,d)=>{const _=[];n.schemaSourceType=l.SchemaSourceType,n.ontologyShaclShapeSource=l.OntologyShaclShapeSource,n.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"},n.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"},n.endpointConfiguration=void 0,n.prefixList=[],n.loadingPrefixes=!1,n.graphs=void 0,n.shaclShapeGraphs=void 0,n.graphqlSchemaShapes=void 0,n.allGraphs=void 0,n.loadingGraphs=!1,n.cancel=()=>{const e=s.instant("graphql.create_endpoint.wizard_steps.actions.cancel.confirmation.title"),i=s.instant("graphql.create_endpoint.wizard_steps.actions.cancel.confirmation.body");t.openConfirmation(e,i,()=>{p.cancelEndpointCreation()})},n.next=()=>{p.nextEndpointCreationStep()},n.onSchemaSourceTypeChange=()=>{n.endpointConfiguration.schemaSourceType=n.stepDefinition.schemaSourceType,n.endpointConfiguration.generateFromShaclShapes()&&(n.stepDefinition.ontotlogyShaclShapeSource===l.OntologyShaclShapeSource.USE_ALL_GRAPHS?n.endpointConfiguration.selectedGraphs=n.allGraphs:n.stepDefinition.ontotlogyShaclShapeSource===l.OntologyShaclShapeSource.USE_SHACL_SHAPE_GRAPH?n.endpointConfiguration.selectedGraphs=n.shaclShapeGraphs:n.stepDefinition.ontotlogyShaclShapeSource===l.OntologyShaclShapeSource.PICK_GRAPHS&&(n.endpointConfiguration.selectedGraphs=new i.GraphListOptions))},n.onOntologyShaclShapeSourceChange=()=>{n.endpointConfiguration.owlOrShaclSourceType=n.stepDefinition.ontotlogyShaclShapeSource,n.stepDefinition.ontotlogyShaclShapeSource===l.OntologyShaclShapeSource.USE_ALL_GRAPHS?n.endpointConfiguration.selectedGraphs=n.allGraphs:n.stepDefinition.ontotlogyShaclShapeSource===l.OntologyShaclShapeSource.USE_SHACL_SHAPE_GRAPH?n.endpointConfiguration.selectedGraphs=n.shaclShapeGraphs:n.stepDefinition.ontotlogyShaclShapeSource===l.OntologyShaclShapeSource.PICK_GRAPHS&&(n.endpointConfiguration.selectedGraphs=new i.GraphListOptions)},n.canProceed=()=>{let e=!1;if(n.endpointConfiguration){const t=n.endpointConfiguration.hasSelectedGraphqlSchemaShapes(),s=n.endpointParamsForm.$valid;n.stepDefinition.schemaSourceType===l.SchemaSourceType.GRAPHQL_SCHEMA_SHAPES&&t?e=!0:n.stepDefinition.schemaSourceType===l.SchemaSourceType.SHACL_SHAPES&&s&&(e=n.endpointConfiguration.owlOrShaclSourceType===l.OntologyShaclShapeSource.USE_ALL_GRAPHS||n.endpointConfiguration.hasSelectedGraphs())}return e};const g=t=>{n.loadingData=!0,e.all([(n.loadingPrefixes=!0,c.getPrefixListAsSelectOptions(p.getSourceRepository()).catch(e=>{o.error("Error loading prefixes",e),r.error(getError(e))}).finally(()=>{n.loadingPrefixes=!1})),(n.loadingGraphs=!0,h.getGraphs(p.getSourceRepository()).catch(e=>{o.error("Error loading graphs",e),r.error(getError(e))}).finally(()=>{n.loadingGraphs=!1})),c.getGraphqlSchemaShapes(p.getSourceRepository()).catch(e=>{o.error("Error loading GraphQL schema shapes",e),r.error(getError(e))}),c.getShaclShapeGraphs(p.getSourceRepository()).catch(e=>{o.error("Error loading SHACL shape graphs",e),r.error(getError(e))})]).then(([e,s,a,l])=>{n.graphqlSchemaShapes=a,n.graphs=s,n.shaclShapeGraphs=l,n.allGraphs=new i.GraphListOptions([...s.graphList,...l.graphList]),n.prefixList=e,n.endpointConfiguration=t}).finally(()=>{n.loadingData=!1})},u=()=>{g(p.getNewEndpoint())},S=()=>{_.forEach(e=>e())};(()=>{n.$on("$destroy",S),_.push(p.subscribe(a.GraphqlEventName.SOURCE_REPOSITORY_UPDATED,u));const e=p.getNewEndpoint();e?g(e):_.push(p.onEndpointConfigCreated(g))})()}}}angular.module("graphdb.framework.graphql.directives.select-schema-sources",["graphdb.framework.core.directives.shuttle-multiselect"]).directive("selectSchemaSources",r),r.$inject=["$q","ModalService","$translate","toastr","$repositories","GraphqlContextService","GraphqlService","RDF4JRepositoriesService"]}};
//# sourceMappingURL=82896.4787d205b19befaf263a.bundle.js.map