"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; });