123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Cognos Analytics
- * Copyright IBM Corp. 2018, 2018
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['react', 'react-dom', 'ba-react-admin/ba-react-admin.min', 'underscore', 'bi/glass/app/ContentView', 'bi/admin/nls/StringResource', 'bacontentnav/lib/@waca/core-client/js/core-client/utils/DateTimeUtils', 'bacontentnav/utils/GlassContextHelper'], function (React, ReactDOM, AdminReact, _, ContentView, StringResource, DateTimeUtils, GlassContextHelper) {
- 'use strict'; //NOSONAR: meant to be strict
- var ContactListPane = ContentView.extend({
- init: function init(options) {
- ContactListPane.inherited('init', this, arguments);
- _.extend(this, options);
- },
- formatDate: function formatDate(dateTime) {
- var date = DateTimeUtils.formatDate(dateTime, 'short', GlassContextHelper.getLocaleTime(this.glassContext)).toString();
- var time = DateTimeUtils.formatTime(dateTime, 'short', GlassContextHelper.getLocaleTime(this.glassContext)).toString();
- return {
- date: date,
- time: time
- };
- },
- render: function render() {
- ReactDOM.unmountComponentAtNode(this.$el[0]);
- var contactListPane = React.createElement(AdminReact.ContactListPanel, {
- glassContext: this.glassContext,
- StringResource: StringResource,
- parent: this,
- title: this.title
- });
- ReactDOM.render(contactListPane, this.$el[0]);
- return Promise.resolve();
- },
- remove: function remove() {
- if (this.$el) {
- ReactDOM.unmountComponentAtNode(this.$el[0]);
- }
- this.viewState = null;
- return ContactListPane.inherited('remove', this, arguments);
- }
- });
- return ContactListPane;
- });
|