123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- "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', 'react', 'react-dom', 'ba-react-admin/ba-react-admin.min'], function (BasePane, StringResource, React, ReactDom, AdminReact) {
- var SAPBWConnectionPane = BasePane.extend({
- init: function init(options) {
- SAPBWConnectionPane.inherited('init', this, arguments);
- $.extend(this, options);
- this._connectionEditor = null;
- },
- renderBody: function renderBody() {
- var codePageArray = [{
- value: 1100,
- label: StringResource.get("sapbw_cp_1100")
- }, {
- value: 1160,
- label: StringResource.get("sapbw_cp_1160")
- }, {
- value: 1401,
- label: StringResource.get("sapbw_cp_1401")
- }, {
- value: 1404,
- label: StringResource.get("sapbw_cp_1404")
- }, {
- value: 1610,
- label: StringResource.get("sapbw_cp_1610")
- }, {
- value: 1614,
- label: StringResource.get("sapbw_cp_1614")
- }, {
- value: 1700,
- label: StringResource.get("sapbw_cp_1700")
- }, {
- value: 1704,
- label: StringResource.get("sapbw_cp_1704")
- }, {
- value: 1800,
- label: StringResource.get("sapbw_cp_1800")
- }, {
- value: 4102,
- label: StringResource.get("sapbw_cp_4102")
- }, {
- value: 4103,
- label: StringResource.get("sapbw_cp_4103")
- }, {
- value: 4110,
- label: StringResource.get("sapbw_cp_4110")
- }, {
- value: 8000,
- label: StringResource.get("sapbw_cp_8000")
- }, {
- value: 8300,
- label: StringResource.get("sapbw_cp_8300")
- }, {
- value: 8400,
- label: StringResource.get("sapbw_cp_8400")
- }, {
- value: 8500,
- label: StringResource.get("sapbw_cp_8500")
- }, {
- value: 8600,
- label: StringResource.get("sapbw_cp_8600")
- }];
- var codePageMap = {};
- _.each(codePageArray, function (cp) {
- codePageMap[cp.value] = cp.label;
- });
- var sapBwEditor = React.createElement(AdminReact.SAPBWConnectionEditor, {
- clickFunc: this.closeClick.bind(this),
- localizedStrings: {
- 'appServer': StringResource.get("sapbw_appServer"),
- 'sysNumber': StringResource.get("sapbw_sysNumber"),
- 'clientNumber': StringResource.get("sapbw_clientNumber"),
- 'codePage': StringResource.get("sapbw_codePage"),
- 'routerString': StringResource.get("sapbw_routerString"),
- 'destination': StringResource.get("sapbw_destination"),
- 'messageServer': StringResource.get("sapbw_messageServer"),
- 'logonType': StringResource.get("sapbw_logonType"),
- 'systemId': StringResource.get("sapbw_systemId"),
- 'logonGroup': StringResource.get("sapbw_logonGroup"),
- 'buttonLabel': StringResource.get("close")
- },
- logonTypes: [{
- label: StringResource.get("sapbw_appServer"),
- value: 'applicationServer'
- }, {
- label: StringResource.get("sapbw_destination"),
- value: 'destination'
- }, {
- label: StringResource.get("sapbw_messageServer"),
- value: 'messageServer'
- }],
- codePages: codePageArray,
- codePageMap: codePageMap,
- rtl: false,
- disabled: false,
- title: StringResource.get("sapbw_title")
- });
- this.title = StringResource.get("sapbw_title");
- this.connectionEditor = ReactDom.render(sapBwEditor, this.$el.find('.bi-admin-pane-body')[0]);
- this.connectionEditor.setState(this.parseInfo.sapbwParams);
- return Promise.resolve();
- },
- closeClick: function closeClick() {
- this.parseInfo.sapbwParams = this.connectionEditor.state;
- this.slideout.hide({
- force: true
- });
- }
- });
- return SAPBWConnectionPane;
- });
|