"use strict"; /** * Licensed Materials - Property of IBM * * IBM Cognos Products: ADMIN * * Copyright IBM Corp. 2018 * * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */ define(['react', 'react-dom', 'jquery', 'underscore', 'bi/glass/app/ContentView', 'bi/admin/status/slideout/ActivitiesPane', 'bi/admin/nls/StringResource', 'ba-react-admin/ba-react-admin.min', 'bi/admin/routingrules/services/RoutingRulesService', 'bi/admin/common/utils/AJAXUtils', 'require-css!bi/content_apps/lib/@waca/bacontentnav/public/css/bacontentnav/bacontentnav'], function (React, ReactDOM, $, _, ContentView, ActivitiesPane, StringResource, AdminReact, RoutingRulesService, AJAXUtils) { var view = ContentView.extend({ init: function init(options) { view.inherited('init', this, arguments); _.extend(this, options); this.routingRulesService = new RoutingRulesService(options); }, getTitle: function getTitle() { return StringResource.get("routingRulesTitle"); }, getIcon: function getIcon() { return 'child-relationship_32'; }, /* Add this this temporarily * Current API is to return the routing rules table and the routing hints in the same server call. * We may need to make to server calls to get the routing table separately from the routing hints * to better manage client load time if it becomes a problem. * delete this code if this does not turn out to be needed. */ setFocus: function setFocus() {}, render: function render() { return this.routingRulesService.getRouting('routingRules').then(function (response) { this.routingRulesTable = response.data[0].routingTable; this.routingHints = response.data[1].routingHints; ReactDOM.unmountComponentAtNode(this.$el[0]); ReactDOM.render(React.createElement(AdminReact.RoutingRulesView, { StringResource: StringResource, routingRules: this.routingRulesTable, routingHints: this.routingHints, glassContext: this.glassContext, AJAXUtils: AJAXUtils //routingRulesService: this.routingRulesService }), this.$el[0]); return Promise.resolve(); }.bind(this)); }, remove: function remove() { view.inherited('remove', this, arguments); ReactDOM.unmountComponentAtNode(this.$el[0]); } }); return view; });