CadencePickerView.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Licensed Materials - Property of IBM
  3. *
  4. * IBM Cognos Products: SHARE
  5. *
  6. * (C) Copyright IBM Corp. 2015
  7. *
  8. * US Government Users Restricted Rights - Use, duplication or disclosure
  9. * restricted by GSA ADP Schedule Contract with IBM Corp.
  10. */
  11. define([
  12. 'bi/commons/ui/View',
  13. 'bi/schedule/app/appControler',
  14. 'jquery',
  15. 'bi/sharecommon/utils/translator',
  16. 'q',
  17. 'bi/sharecommon/utils/simpledoT',
  18. 'bi/schedule/utils/htmlIds',
  19. 'underscore'
  20. ],
  21. function (View, controler, $, t, Q, dot, ids, template, _) {
  22. 'use strict';
  23. var cadencePicker = View.extend({
  24. everyNperiods: 1,
  25. /**
  26. * @constructor
  27. */
  28. init: function(options) {
  29. $.extend(this, options);
  30. View.inherited('init', this, [ options ]);
  31. },
  32. /**
  33. * Render is the main function of the Conten View. Content Views should implement (override) the render
  34. * method to populate this.el with the appropriate HTML. Render should always return this as a promise
  35. * to allow chaining of calls.
  36. * @returns (Promise)
  37. */
  38. render: function() {
  39. var dfd = $.Deferred();
  40. dfd.resolve(this);
  41. return dfd.promise();
  42. },
  43. /** All views should overwrite this function.
  44. * It takes a partially populated json schedule descriptor and adds to it
  45. * based on the properties of this view.
  46. * @param desc the partial JSON schedule descriptor
  47. * @returns the descriptor passed in, with added attributes.
  48. */
  49. toDescriptor: function(desc) {
  50. return desc;
  51. },
  52. /** All views should overwrite this function.
  53. * It takes an empty json message array and adds to it
  54. * based on the properties of this view.
  55. * @param msgs the messages
  56. * @returns the warning messages from the cadence view.
  57. */
  58. validate: function(msgs) {
  59. return msgs;
  60. }
  61. });
  62. return cadencePicker;
  63. });