UNPKG

graphdb-workbench

Version:
1 lines 5.78 kB
import{h}from"@stencil/core";import{TranslationService}from"../../../services/translation.service";import{SecurityContextService,ServiceProvider,CookieConsent,SecurityService}from"../../../../../../api/dist/ontotext-workbench-api";var CookieType;!function(e){e.THIRD_PARTY="thirdParty",e.STATISTIC="statistic"}(CookieType||(CookieType={}));export class OntoCookiePolicyDialog{constructor(){this.user=ServiceProvider.get(SecurityContextService).getAuthenticatedUser(),this.securityService=ServiceProvider.get(SecurityService)}toggleChanged(e){this.setUserCookieConsent(this.updateCookieConsent(e.detail)),this.securityService.updateUserData(this.user).catch(console.error)}render(){var e,a;const t={dialogTitle:TranslationService.translate("cookie.policy.title"),onClose:()=>this.dialogHandler.onDialogClose(),modalClass:"cookie-policy-modal"},o=new CookieConsent(null===(a=null===(e=this.user)||void 0===e?void 0:e.appSettings)||void 0===a?void 0:a.COOKIE_CONSENT);return h("onto-dialog",{key:"5c9716eebf02b30a51d90af98775d7e183618290",config:t},h("div",{key:"afdaebff817f24cfda4bafbcc386a741f7907674",slot:"body"},h("section",{key:"5387b27738aaba232f3646a1a71fbe1bc7b5332f"},h("h4",{key:"ab64a92c9e72bfa48868b5e8e8055eb674e40eda"},h("translate-label",{key:"b7f62e750e65a6d354e2f3bc9bfaf6d5eca304d4",labelKey:"cookie.policy.purpose_heading"})),h("p",{key:"0354cbaf054caa4680d548f33434bbee4527c40e"},h("translate-label",{key:"69c60946be613dea36d2690d287e645edb71483a",labelKey:"cookie.policy.purpose_text"})),h("p",{key:"055e50c6a516413f46a35c7b85952e4aa1a9f9df"},h("translate-label",{key:"70857b357e74bb7dfb8c384883668c8b2482ca4a",labelKey:"cookie.policy.purpose_enterprise_text"}))),h("section",{key:"6e71eb5aae17c6da27bf257cae2a0760860df5d1"},h("h4",{key:"83b3b663f46498e43c7ab30410de8f074243c3ae"},h("translate-label",{key:"2f6b5c9c10ace40140ecafbcd7d10709df14b1ab",labelKey:"cookie.policy.privacy_commitment_heading"})),h("p",{key:"09f6d19d59629866fa3b21842831d392b9e555ec"},h("translate-label",{key:"4c8f23a3c88299a4fd5d390eaa4a7afa5862d9ad",labelKey:"cookie.policy.privacy_commitment_text"})),h("ul",{key:"09b90acc150cf43a9e59297b34657d9c0d6f58cf"},h("li",{key:"703ef7e25fb39d5d42980653b1fcf86d8a94557c"},h("translate-label",{key:"df7d2a7233e3c18a068fa9058c3c193d3cd29aa9",labelKey:"cookie.policy.privacy_commitment_1"})),h("li",{key:"8d31ea369caab98410d1ca4d10ca56acbf712b4d"},h("translate-label",{key:"4cf9f87d207ae4a56f5ef25ad5e61ae49229a66d",labelKey:"cookie.policy.privacy_commitment_2"})))),h("section",{key:"11a8ff13f5ccf5ce1ee72a6ddd14f7a15aaf28a8"},h("h4",{key:"05c721ac41e0ce384336f36efbed649cdf3c8521"},h("translate-label",{key:"0311734172a238e9a34d5b646ce7226146ca4fb4",labelKey:"cookie.policy.cookies_heading"})),h("p",{key:"9b6348c8749b252e1308c2217753333d7f34510d"},h("translate-label",{key:"ec1a61b4d8c13ade4a3596818916bd4fb0ea9250",labelKey:"cookie.policy.cookies_text"}))),h("section",{key:"0a56afdf911e56f1e857bd9c8141214b841cfab6"},h("h4",{key:"1aab64214b9a77114cd6a57ad32386dcc7361f92"},h("translate-label",{key:"124cd6d94ab003ee056b8f57a1550604500d2af8",labelKey:"cookie.policy.manage_cookies_heading"})),h("onto-toggle-switch",{key:"d5e9c3008e8286bc6223fe46d955b8f40e229401",checked:null==o?void 0:o.statistic,labelKey:"cookie.policy.statistic_cookies",tooltipTranslationKey:"cookie.policy.statistic_tooltip",context:CookieType.STATISTIC}),h("p",{key:"950ed4231c70d11951d75d5c7e2f4baa3b037a29"},h("translate-label",{key:"89d34f7bdedcb706c873f14d7cab5cc3d7c02f24",labelKey:"cookie.policy.statistic_text"})),h("onto-toggle-switch",{key:"ec5ad346c46f236b53738df40661b39581441c76",checked:null==o?void 0:o.thirdParty,labelKey:"cookie.policy.third_party_cookies",tooltipTranslationKey:"cookie.policy.third_party_tooltip",context:CookieType.THIRD_PARTY}),h("p",{key:"dcb9444ad459d3ae88200c4d6aabb60ac32ac0b2"},h("translate-label",{key:"7f8f517ed2b9eb396cda52247f93e2269e081169",labelKey:"cookie.policy.third_party_cookies_text"}))),h("p",{key:"bd784e85cfbd3189e52ce75159a7c2727c8b71bc"},h("span",{key:"5cd30d116bf907e58ee72b5b9d87c46895287085"},h("translate-label",{key:"bc7ef9a8f755ec932c93eb6f37f47646c3d9d4db",labelKey:"cookie.policy.change_cookies"}),h("i",{key:"f77778f441780569f9519112b54827f64ef45c4b"}," ",h("translate-label",{key:"327b6accb62caf5075e2d7d5191b55a375cbd7e8",labelKey:"menu.setup.label"})," > ",h("translate-label",{key:"f4d1aa6a0ff386f5dcc91644c444c0cbdb31de93",labelKey:"menu.my.settings.label"})," > ",h("translate-label",{key:"6addb466067cca060041f13085d1bad6d8dada18",labelKey:"security.user.settings"})," > ",h("translate-label",{key:"40348ad073e5b407aa077a64ac19c4a4fcd5deec",labelKey:"cookie.policy.change_cookies_location4"})," ")))))}updateCookieConsent(e){var a,t;const o=new CookieConsent(null===(t=null===(a=this.user)||void 0===a?void 0:a.appSettings)||void 0===t?void 0:t.COOKIE_CONSENT);return o[e.context]=e.checked,o.updatedAt=(new Date).getTime(),o}setUserCookieConsent(e){this.user.appSettings||(this.user.appSettings={}),this.user.appSettings.COOKIE_CONSENT=e}static get is(){return"onto-cookie-policy-dialog"}static get originalStyleUrls(){return{$:["onto-cookie-policy-dialog.scss"]}}static get styleUrls(){return{$:["onto-cookie-policy-dialog.css"]}}static get properties(){return{dialogHandler:{type:"unknown",attribute:"dialog-handler",mutable:!1,complexType:{original:"DialogHandler",resolved:"DialogHandler",references:{DialogHandler:{location:"import",path:"../../../models/dialog/dialog-handler",id:"src/models/dialog/dialog-handler.ts::DialogHandler"}}},required:!0,optional:!1,docs:{tags:[],text:"The dialog handler for managing the dialog's behavior."},getter:!1,setter:!1}}}static get listeners(){return[{name:"toggleChanged",method:"toggleChanged",target:void 0,capture:!1,passive:!1}]}}