UNPKG

graphdb-workbench

Version:
1 lines 3.13 kB
import{Host,h}from"@stencil/core";import{ServiceProvider,SubscriptionList,ProductInfoContextService,LicenseService,SecurityContextService,CookieConsent,CookieService,LicenseContextService,WindowService}from"../../../../../api/dist/ontotext-workbench-api";export class OntoFooter{constructor(){this.subscriptions=new SubscriptionList,this.currentYear=(new Date).getFullYear(),this.securityContextService=ServiceProvider.get(SecurityContextService),this.licenseContextService=ServiceProvider.get(LicenseContextService),this.cookieService=ServiceProvider.get(CookieService)}handleConsentGiven(){this.cookieService.acceptCookiePolicy().then(()=>this.shouldShowCookieConsent=!1)}render(){var e,t,o,i;return h(Host,{key:"c5bbe0151e3eb14932bacecaad88b7e529e3a1f1"},h("div",{key:"5d4e0501b872ccbaa2e48f99361a948e83191b65",class:"footer-component"},h("a",{key:"80ed7acc465b754ed295d2931d3c38549e2fa4f8",href:"http://graphdb.ontotext.com",target:"_blank",rel:"noopener noreferrer"},"GraphDB")," ",null===(e=this.productInfo)||void 0===e?void 0:e.productVersion," • ",h("a",{key:"df2a6a80c117d91be1a45f4021987b24d0eaaa06",href:"http://rdf4j.org",target:"_blank",rel:"noopener noreferrer"},"RDF4J "),null===(t=this.productInfo)||void 0===t?void 0:t.sesame," • Connectors ",null===(o=this.productInfo)||void 0===o?void 0:o.connectors," • Workbench ",null===(i=this.productInfo)||void 0===i?void 0:i.workbench," • © 2002–",this.currentYear," ",h("a",{key:"2477c4b7e24a304904b1a9e113e562a3e2a68193",href:"http://ontotext.com",target:"_blank",rel:"noopener noreferrer"},"Ontotext AD"),". ",h("translate-label",{key:"e5f700a69d2f129d883af745a415027532b52531",labelKey:"footer.label.all_rights_reserved"})),this.shouldShowCookieConsent&&h("onto-cookie-consent",{key:"42138884db38d3813072b574d8c4b84f2acb2c9d"}))}connectedCallback(){this.subscribeToProductInfoChange(),this.subscribeToUserChange(),this.subscribeToLicenseChange()}disconnectedCallback(){this.subscriptions.unsubscribeAll()}subscribeToProductInfoChange(){this.subscriptions.add(ServiceProvider.get(ProductInfoContextService).onProductInfoChanged(e=>{this.productInfo=e}))}isTrackingAllowed(){return ServiceProvider.get(LicenseService).isTrackableLicense()&&!WindowService.getWindow().wbDevMode}subscribeToUserChange(){this.subscriptions.add(this.securityContextService.onAuthenticatedUserChanged(()=>{this.setCookieConsentVisibility()}))}setCookieConsentVisibility(){var e;const t=this.securityContextService.getAuthenticatedUser();this.shouldShowCookieConsent=this.isTrackingAllowed()&&!new CookieConsent(null===(e=null==t?void 0:t.appSettings)||void 0===e?void 0:e.COOKIE_CONSENT).policyAccepted}subscribeToLicenseChange(){this.subscriptions.add(this.licenseContextService.onLicenseChanged(()=>{this.setCookieConsentVisibility()}))}static get is(){return"onto-footer"}static get originalStyleUrls(){return{$:["onto-footer.scss"]}}static get styleUrls(){return{$:["onto-footer.css"]}}static get states(){return{productInfo:{},shouldShowCookieConsent:{}}}static get listeners(){return[{name:"consentGiven",method:"handleConsentGiven",target:void 0,capture:!1,passive:!1}]}}