CobrandingDataService.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* eslint-disable
  2. camelcase,
  3. max-len,
  4. no-return-assign,
  5. no-undef,
  6. */
  7. // TODO: This file was created by bulk-decaffeinate.
  8. // Fix any style issues and re-enable lint.
  9. /*
  10. * decaffeinate suggestions:
  11. * DS102: Remove unnecessary code created because of implicit returns
  12. * DS207: Consider shorter variations of null checks
  13. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  14. */
  15. define(['base'], function(App) {
  16. const _cobrandingData = window.brandVariation
  17. return App.factory('CobrandingDataService', function() {
  18. const isProjectCobranded = () => _cobrandingData != null
  19. const getLogoImgUrl = () =>
  20. _cobrandingData != null ? _cobrandingData.logo_url : undefined
  21. const getSubmitBtnHtml = () =>
  22. _cobrandingData != null ? _cobrandingData.submit_button_html : undefined
  23. const getBrandVariationName = () =>
  24. _cobrandingData != null ? _cobrandingData.name : undefined
  25. const getBrandVariationHomeUrl = () =>
  26. _cobrandingData != null ? _cobrandingData.home_url : undefined
  27. const getPublishGuideHtml = () =>
  28. _cobrandingData != null ? _cobrandingData.publish_guide_html : undefined
  29. const getPartner = () =>
  30. _cobrandingData != null ? _cobrandingData.partner : undefined
  31. const hasBrandedMenu = () =>
  32. _cobrandingData != null ? _cobrandingData.branded_menu : undefined
  33. const getBrandId = () =>
  34. _cobrandingData != null ? _cobrandingData.brand_id : undefined
  35. const getBrandVariationId = () =>
  36. _cobrandingData != null ? _cobrandingData.id : undefined
  37. return {
  38. isProjectCobranded,
  39. getLogoImgUrl,
  40. getSubmitBtnHtml,
  41. getBrandVariationName,
  42. getBrandVariationHomeUrl,
  43. getPublishGuideHtml,
  44. getPartner,
  45. hasBrandedMenu,
  46. getBrandId,
  47. getBrandVariationId
  48. }
  49. })
  50. })