DrillThroughManageDialog.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Watson Analytics (C) Copyright IBM Corp. 2018
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. *
  7. */
  8. define(['../../../lib/@waca/core-client/js/core-client/ui/dialogs/GenericViewDialog', '../views/DrillThroughManageView', '../../../widgets/livewidget/nls/StringResources'], function (GenericViewDialog, DrillThroughManageView, StringResources) {
  9. /**
  10. * Creates a drill through manage dialog.
  11. * @param - options
  12. */
  13. var DrillThroughManageDialog = GenericViewDialog.extend({
  14. init: function init(options) {
  15. options = options || {};
  16. if (!options.handlers) {
  17. throw new Error('Handlers must be provided to manage drill through definitions');
  18. }
  19. var dialogOptions = {
  20. buttons: [{
  21. text: StringResources.get('dlg_apply'),
  22. handler: this.ok.bind(this),
  23. type: 'primary',
  24. defaultId: 'open_button'
  25. }, {
  26. handler: this.cancel.bind(this),
  27. defaultId: 'cancel'
  28. }],
  29. viewClass: DrillThroughManageView,
  30. id: 'manageJumpPathsDialogTitle',
  31. title: StringResources.get('drillthrough_manageJumpPaths'),
  32. okCallback: options.handlers.okCallback,
  33. cancelCallback: options.handlers.cancelCallback,
  34. viewOptions: {
  35. content: options.content,
  36. dashboard: options.dashboard,
  37. drillThroughModelApi: options.drillThroughModelApi,
  38. handlers: {
  39. onEdit: options.handlers.onEdit,
  40. onCreate: options.handlers.onCreate,
  41. onDelete: options.handlers.onDelete,
  42. enableOk: this.enableOk.bind(this)
  43. }
  44. }
  45. };
  46. DrillThroughManageDialog.inherited('init', this, [dialogOptions]);
  47. }
  48. });
  49. return DrillThroughManageDialog;
  50. });
  51. //# sourceMappingURL=DrillThroughManageDialog.js.map