PanelTestProvider.jsm 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const MESSAGES = () => ([
  6. {
  7. "id": "SIMPLE_FXA_BOOKMARK_TEST_FLUENT",
  8. "template": "fxa_bookmark_panel",
  9. "content": {
  10. "title": {"string_id": "cfr-doorhanger-bookmark-fxa-header"},
  11. "text": {"string_id": "cfr-doorhanger-bookmark-fxa-body"},
  12. "cta": {"string_id": "cfr-doorhanger-bookmark-fxa-link-text"},
  13. "color": "white",
  14. "background_color_1": "#7d31ae",
  15. "background_color_2": "#5033be",
  16. "info_icon": {
  17. "tooltiptext": {"string_id": "cfr-doorhanger-bookmark-fxa-info-icon-tooltip"},
  18. },
  19. "close_button": {
  20. "tooltiptext": {"string_id": "cfr-doorhanger-bookmark-fxa-close-btn-tooltip"},
  21. },
  22. },
  23. "trigger": {"id": "bookmark-panel"},
  24. },
  25. {
  26. "id": "SIMPLE_FXA_BOOKMARK_TEST_NON_FLUENT",
  27. "template": "fxa_bookmark_panel",
  28. "content": {
  29. "title": "Bookmark Message Title",
  30. "text": "Bookmark Message Body",
  31. "cta": "Sync bookmarks now",
  32. "color": "white",
  33. "background_color_1": "#7d31ae",
  34. "background_color_2": "#5033be",
  35. "info_icon": {
  36. "tooltiptext": "Toggle tooltip",
  37. },
  38. "close_button": {
  39. "tooltiptext": "Close tooltip",
  40. },
  41. },
  42. "trigger": {"id": "bookmark-panel"},
  43. },
  44. ]);
  45. const PanelTestProvider = {
  46. getMessages() {
  47. return MESSAGES()
  48. .map(message => ({...message, targeting: `providerCohorts.panel_local_testing == "SHOW_TEST"`}));
  49. },
  50. };
  51. this.PanelTestProvider = PanelTestProvider;
  52. const EXPORTED_SYMBOLS = ["PanelTestProvider"];