1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Cognos Analytics
- * Copyright IBM Corp. 2017
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['bi/admin/common/slideout/BasePane', 'bi/admin/nls/StringResource', 'bi/commons/ui/properties/PropertyUIControl'], function (BasePane, StringResource, PropertyUIControl) {
- /**
- * Sample content view that extends the glass View class
- */
- var ConnectionStringEditorPane = BasePane.extend({
- init: function init(options) {
- ConnectionStringEditorPane.inherited('init', this, arguments);
- $.extend(this, options);
- this.connectionType = options.connectionType;
- var sText = StringResource.get('connectionInformationTitle', {
- 'connType': this.parseInfo.metadata.title
- });
- this.title = sText;
- this.slideout.$el.addClass('connection-string-editor-pane');
- },
- isEditable: function isEditable() {
- return this.objectInfo.permissions && this.objectInfo.permissions.indexOf("write") !== -1;
- },
- _getNewPropertyUIControl: function _getNewPropertyUIControl(options) {
- return new PropertyUIControl(options);
- },
- _renderBody: function _renderBody(propOptions) {
- this.addFooterItems(propOptions);
- this._propertyUIControl = this._getNewPropertyUIControl(propOptions);
- return this._propertyUIControl.render().then(this._postRender.bind(this));
- },
- _postRender: function _postRender() {},
- closeClick: function closeClick() {
- this.slideout.hide({
- force: true
- });
- },
- addFooterItems: function addFooterItems(propOptions) {
- propOptions.items.push({
- 'type': 'Footer',
- 'items': [{
- 'type': 'Button',
- 'id': 'editConnectionCloseButton',
- 'label': StringResource.get('close'),
- 'onSelect': this.closeClick.bind(this),
- 'primary': true
- }]
- });
- },
- getPropertyUIControl: function getPropertyUIControl() {
- return this._propertyUIControl;
- }
- });
- return ConnectionStringEditorPane;
- });
|