CustomSaveLocationPane.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. "use strict";
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: Cognos Analytics
  5. * Copyright IBM Corp. 2016, 2017
  6. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. */
  8. define(['underscore', 'bi/admin/nls/StringResource', 'bi/admin/account/slideout/teamfolders/TeamFoldersPane', 'bi/commons/ui/ButtonBar', 'bi/admin/account/slideout/contentFilePicker/ContentFilePickerBody', 'bi/admin/account/slideout/contentFilePicker/CustomSaveLocationController'], function (_, StringResource, TeamFoldersPane, ButtonBar, ContentFilePickerBody, CustomSaveLocationController) {
  9. var CustomSaveLocationPane = TeamFoldersPane.extend({
  10. init: function init(options) {
  11. CustomSaveLocationPane.inherited('init', this, arguments);
  12. this.headerView = this._createHeader();
  13. this.bodyView = this._createBody();
  14. this.footerView = this._createFooter();
  15. },
  16. _createBody: function _createBody() {
  17. return new ContentFilePickerBody({
  18. 'glassContext': this.glassContext,
  19. 'className': 'setTeamFoldersView',
  20. 'slideout': this.slideout,
  21. 'onChange': this._onChange.bind(this),
  22. 'teamContentOnly': this.teamContentOnly,
  23. 'controller': new CustomSaveLocationController({
  24. 'currentValue': this.currentValue
  25. })
  26. });
  27. },
  28. _createFooter: function _createFooter() {
  29. return new ButtonBar({
  30. buttons: [{
  31. 'id': this.APPLY_BUTTON_ID,
  32. 'label': StringResource.get('apply'),
  33. 'onSelect': this._onApply.bind(this),
  34. 'disabled': true
  35. }, {
  36. 'id': this.RESET_BUTTON_ID,
  37. 'label': StringResource.get('clear'),
  38. 'onSelect': this._onReset.bind(this),
  39. 'disabled': _.isEmpty(this.currentValue) || this.currentValue == null || this.currentValue == '.my_folders'
  40. }]
  41. });
  42. }
  43. });
  44. return CustomSaveLocationPane;
  45. });