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:"e81e156b6b691a0a05275ee399ccf26438ba5729",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:"018b1772807248dfd83e0c2ca57fde6bd848e9c9",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:"20e70771852b0c504e86e36a1b9fdb9b61d5963c",href:"http://ontotext.com",target:"_blank",rel:"noopener noreferrer"},"Ontotext AD"),". ",h("translate-label",{key:"8df55b8d224ae50ca9de3fd038c0285ee01b4ff3",labelKey:"footer.label.all_rights_reserved"})),this.shouldShowCookieConsent&&h("onto-cookie-consent",{key:"80f9c1af70db76ef4c6680dacf7022eb1262f049"}))}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}]}}