@c8y/ng1-modules 1018.37.0 → 1018.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";!function(){function n(c,n,t,e,i,o,a,r,l,s,u,d,f,g){var p,m,b,y,v=g("humanizeAppName"),h=this,w=s("Apply branding"),I=s("Save branding configuration first"),B={html_title:R,favicon:function(n){h.favicon=n?n.fileSrc:"",p&&p.document.querySelector("link[rel=icon]")&&(p.document.querySelector("link[rel=icon]").href=n?n.fileSrc:"")},"navigator-font-family":function(n){P("navigator-font-family",a.getFontFamilyCssVar(n))},appLogo:function(n){return P("navigator-platform-logo",n?"url(".concat(n.fileSrc,")"):"")},"brand-logo-img":function(n){return P("brand-logo-img",n?"url(".concat(n.fileSrc,")"):"")},"__import-font":function(n){var e=document.createElement("style");e.innerText="@import url('".concat(n,"')"),N().contentDocument.head.appendChild(e),p&&p.document.head.appendChild(e)}},C=!!window.MSInputMethodContext&&!!document.documentMode;function N(){return document.querySelector("#previewBrowser")}function A(){return h.isLoading=!0,n.all({schema:i.getSchema(),form:i.getForm(),options:i.getSchemaFormOptions(),branding:i.getBranding(),app:d.getCurrent()}).then(function(n){var e=n.schema,t=n.form,o=n.options,i=n.branding,a=n.app;_.defaults(i,{c8y_less_variables:{}}),b=_.cloneDeep(i),_.assign(h,{schema:e,form:t,options:o,branding:i}),y=a;var r=N();r.src="".concat(d.getHref(y),"/index.html"),r.onload=function(){r.appTitle=r.contentDocument.title,_.set(r.contentWindow,"C8Y_PREVIEW.preview",!0),_.set(r.contentWindow,"C8Y_PREVIEW.previewCookieBanner",k()),R(),E()},c.$watchCollection("vm.branding.c8y_less_variables",E)}).finally(function(){h.isLoading=!1})}function R(n){var e=n||T();h.title="".concat(e," - ").concat(N().appTitle),p&&(p.document.title="".concat(e," - ").concat(p.appTitle),p.C8Y_PREVIEW.globalTitle=e)}function T(){return _.get(h,"branding.c8y_less_variables.html_title")||u.appOption("globalTitle")}function k(){return _.pick(h.branding.c8y_less_variables,["cookieBannerDisabled","cookieBannerTitle","cookieBannerText","policyUrl"])}function E(){h.isLoading||_.forOwn(h.branding.c8y_less_variables,function(n,e){B[e]?B[e](n):P(e,n)})}function P(n,e){S(n,e,N().contentDocument.documentElement),p&&S(n,e,p.document.documentElement)}function S(n,e,t){var o=a.keyToCssVar(n);"navigator-platform-logo-height"===o?null==e||""===e?t.style.removeProperty("--".concat(o)):t.style.setProperty("--".concat(o),"".concat(e,"%")):t.style.setProperty("--".concat(o),_.isNumber(e)?"".concat(e,"px"):e)}function G(){return o.state().then($)}function $(n){var e=h.state;h.state=n,e&&e.RUNNING&&!n.RUNNING&&l.success(s("Branded applications created.")),e&&e.WAITING&&n.RUNNING&&l.success(s("Branded applications will be created.")),(n.RUNNING||n.WAITING)&&t(G,2e3)}_.assign(h,{$onInit:function(){r&&G();return A()},applyTitle:w,dirtyFormApplyTitle:I,canSave:function(){return!(_.get(c,"platformConfigurationForm1.$invalid")||_.get(c,"platformConfigurationForm2.$invalid"))},save:function(){var t=[],o=i.BINARY_VARS;return h.branding.binary_ref={},_.each(o,function(e){if(h.branding.c8y_less_variables[e]){var n=i.saveBinary(e,h.branding.c8y_less_variables[e],b.binary_ref,b.c8y_less_variables[e]).then(function(n){h.branding.binary_ref[e]=_.pick(n,["id","name"])});t.push(n)}}),n.all(t).then(function(){return h.branding.c8y_less_variables=_.omitBy(h.branding.c8y_less_variables,function(n,e){return""===_.trim(n)||_.includes(o,e)}),i.saveConfiguration(h.branding,b.id).then(function(){return l.success(s("Branding saved."))})}).then(e.reload)},generate:o.wizardGenerate,preview:function(){p=window.open("".concat(d.getHref(y),"/index.html"),"_blank"),function e(){clearInterval(m);m=setInterval(function(){if(p&&(p.C8Y_PREVIEW={preview:!0,globalTitle:T(),previewCookieBanner:k()},p.C8Y_APP)){var n=p.C8Y_APP.name;p.appTitle=v(n),clearInterval(m),E(),p.onunload=function(){return e()}}})}()},blocked:function(){var n=h.state;return!_.get(h,"branding.id")||_.get(n,"RUNNING")||_.get(n,"WAITING")},title:window.document.title,favicon:"favicon.ico",useMicroservice:r,applyConfiguration:function(){a.removeLegacyBrandedApplications().then(function(){return f({status:"info",title:s("Apply branding configuration"),body:s("You are about to apply the branding configuration, making it visible to all subtenants. Do you want to proceed?"),labels:{ok:s("Apply")}})}).then(function(){a.deploy(h.branding.c8y_less_variables).then(function(){return l.success(s("Branding configuration is being applied. It usually takes less than a minute."))},function(n){l.danger(u.getResErrorMessage(n))})})},showPreview:!C,removeAppliedBranding:function(){f({status:"info",title:s("Remove branding"),body:s("You are about to remove applied branding.\n If you have any extra customization options set, they will be reset.\n The default branding will be shown to all subtenants. Do you want to proceed?"),labels:{ok:s("Remove")}}).then(function(){a.reset().then(function(){return l.success(s("Branding has been removed."))})})},resetForm:function(n){f({status:"info",title:s("Reset branding configuration"),body:s("You are about to reset the branding configuration to the previously saved settings.\n Do you want to proceed?"),labels:{ok:s("Reset")}}).then(function(){A().then(function(){n&&n.$setPristine(),l.success(s("Branding configuration has been reset."))},function(n){return l.danger(n)})})}})}n.$inject=["$scope","$q","$timeout","$route","c8yBrandingConfigurationUi","c8yBrandingConfiguration","c8yBrandingDeploy","USE_BRANDING_MICROSERVICE","c8yAlert","gettext","c8yBase","c8yApplication","c8yModal","$filter"],angular.module("c8y.custom-branding").component("c8yBrandingConfigurationForm",{templateUrl:":::PLUGIN_PATH:::/customBranding/brandingConfigurationForm.html",controller:n,controllerAs:"vm"})}();
1
+ "use strict";!function(){function n(c,n,t,e,i,o,a,r,l,s,u,d,f,g){var p,m,b,y,v=g("humanizeAppName"),h=this,w=s("Apply branding"),I=s("Save branding configuration first"),B={html_title:R,favicon:function(n){h.favicon=n?n.fileSrc:"",p&&p.document.querySelector("link[rel=icon]")&&(p.document.querySelector("link[rel=icon]").href=n?n.fileSrc:"")},"navigator-font-family":function(n){P("navigator-font-family",a.getFontFamilyCssVar(n))},appLogo:function(n){return P("navigator-platform-logo",n?"url(".concat(n.fileSrc,")"):"")},"brand-logo-img":function(n){return P("brand-logo-img",n?"url(".concat(n.fileSrc,")"):"")},"__import-font":function(n){var e=document.createElement("style");e.innerText="@import url('".concat(n,"')"),N().contentDocument.head.appendChild(e),p&&p.document.head.appendChild(e)}},C=!!window.MSInputMethodContext&&!!document.documentMode;function N(){return document.querySelector("#previewBrowser")}function A(){return h.isLoading=!0,n.all({schema:i.getSchema(),form:i.getForm(),options:i.getSchemaFormOptions(),branding:i.getBranding(),app:d.getCurrent()}).then(function(n){var e=n.schema,t=n.form,o=n.options,i=n.branding,a=n.app;_.defaults(i,{c8y_less_variables:{}}),b=_.cloneDeep(i),_.assign(h,{schema:e,form:t,options:o,branding:i}),y=a;var r=N();r.src="".concat(d.getHref(y),"/index.html"),r.onload=function(){r.appTitle=r.contentDocument.title,_.set(r.contentWindow,"C8Y_PREVIEW.preview",!0),_.set(r.contentWindow,"C8Y_PREVIEW.previewCookieBanner",k()),R(),E()},c.$watchCollection("vm.branding.c8y_less_variables",E)}).finally(function(){h.isLoading=!1})}function R(n){var e=n||T();h.title="".concat(e," - ").concat(N().appTitle),p&&(p.document.title="".concat(e," - ").concat(p.appTitle),p.C8Y_PREVIEW.globalTitle=e)}function T(){return _.get(h,"branding.c8y_less_variables.html_title")||u.appOption("globalTitle")}function k(){return _.pick(h.branding.c8y_less_variables,["cookieBannerDisabled","cookieBannerTitle","cookieBannerText","policyUrl"])}function E(){h.isLoading||_.forOwn(h.branding.c8y_less_variables,function(n,e){B[e]?B[e](n):P(e,n)})}function P(n,e){S(n,e,N().contentDocument.documentElement),p&&S(n,e,p.document.documentElement)}function S(n,e,t){var o=a.keyToCssVar(n);"navigator-platform-logo-height"===o?null==e||""===e?t.style.removeProperty("--".concat(o)):t.style.setProperty("--".concat(o),"".concat(e,"%")):t.style.setProperty("--".concat(o),_.isNumber(e)?"".concat(e,"px"):e)}function G(){return o.state().then($)}function $(n){var e=h.state;h.state=n,e&&e.RUNNING&&!n.RUNNING&&l.success(s("Branded applications created.")),e&&e.WAITING&&n.RUNNING&&l.success(s("Branded applications will be created.")),(n.RUNNING||n.WAITING)&&t(G,2e3)}_.assign(h,{$onInit:function(){r&&G();return A()},applyTitle:w,dirtyFormApplyTitle:I,canSave:function(){return!(_.get(c,"platformConfigurationForm1.$invalid")||_.get(c,"platformConfigurationForm2.$invalid"))},save:function(){var t=[],o=i.BINARY_VARS;return h.branding.binary_ref={},_.each(o,function(e){if(h.branding.c8y_less_variables[e]){var n=i.saveBinary(e,h.branding.c8y_less_variables[e],b.binary_ref,b.c8y_less_variables[e]).then(function(n){h.branding.binary_ref[e]=_.pick(n,["id","name"])});t.push(n)}}),n.all(t).then(function(){return h.branding.c8y_less_variables=_.omitBy(h.branding.c8y_less_variables,function(n,e){return""===_.trim(n)||_.includes(o,e)}),i.saveConfiguration(h.branding,b.id).then(function(){return l.success(s("Branding saved."))})}).then(e.reload)},generate:o.wizardGenerate,preview:function(){p=window.open("".concat(d.getHref(y),"/index.html"),"_blank","noopener,noreferrer"),function e(){clearInterval(m);m=setInterval(function(){if(p&&(p.C8Y_PREVIEW={preview:!0,globalTitle:T(),previewCookieBanner:k()},p.C8Y_APP)){var n=p.C8Y_APP.name;p.appTitle=v(n),clearInterval(m),E(),p.onunload=function(){return e()}}})}()},blocked:function(){var n=h.state;return!_.get(h,"branding.id")||_.get(n,"RUNNING")||_.get(n,"WAITING")},title:window.document.title,favicon:"favicon.ico",useMicroservice:r,applyConfiguration:function(){a.removeLegacyBrandedApplications().then(function(){return f({status:"info",title:s("Apply branding configuration"),body:s("You are about to apply the branding configuration, making it visible to all subtenants. Do you want to proceed?"),labels:{ok:s("Apply")}})}).then(function(){a.deploy(h.branding.c8y_less_variables).then(function(){return l.success(s("Branding configuration is being applied. It usually takes less than a minute."))},function(n){l.danger(u.getResErrorMessage(n))})})},showPreview:!C,removeAppliedBranding:function(){f({status:"info",title:s("Remove branding"),body:s("You are about to remove applied branding.\n If you have any extra customization options set, they will be reset.\n The default branding will be shown to all subtenants. Do you want to proceed?"),labels:{ok:s("Remove")}}).then(function(){a.reset().then(function(){return l.success(s("Branding has been removed."))})})},resetForm:function(n){f({status:"info",title:s("Reset branding configuration"),body:s("You are about to reset the branding configuration to the previously saved settings.\n Do you want to proceed?"),labels:{ok:s("Reset")}}).then(function(){A().then(function(){n&&n.$setPristine(),l.success(s("Branding configuration has been reset."))},function(n){return l.danger(n)})})}})}n.$inject=["$scope","$q","$timeout","$route","c8yBrandingConfigurationUi","c8yBrandingConfiguration","c8yBrandingDeploy","USE_BRANDING_MICROSERVICE","c8yAlert","gettext","c8yBase","c8yApplication","c8yModal","$filter"],angular.module("c8y.custom-branding").component("c8yBrandingConfigurationForm",{templateUrl:":::PLUGIN_PATH:::/customBranding/brandingConfigurationForm.html",controller:n,controllerAs:"vm"})}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1018.37.0",
3
+ "version": "1018.38.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",
@@ -332,6 +332,7 @@
332
332
  </div>
333
333
  <a
334
334
  target="_blank"
335
+ rel="noopener noreferrer"
335
336
  class="btn btn-default btn-xs"
336
337
  ng-if="tenant.supportUser.enabled && supportUser && isTopTenant"
337
338
  ng-href="//{{ tenant.domain }}/apps/administration/?user={{ supportUser }}"