12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- "use strict";
- /*
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: ADMIN
- *
- * (C) Copyright IBM Corp. 2017
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['bi/glass/app/plugins/MenuActionInterface', 'bi/glass/utils/ClassFactory', 'ba-react-admin/ba-react-admin.min'], function (view, ClassFactory, AdminReact) {
- 'use strict';
- var JOB_PANE_MODULE = 'bi/admin/job/JobPane';
- var JobCreateButtonView = view.extend({
- SUBSCRIPTION_SLIDEOUT_PANE_WIDTH: '400px',
- onSelectItem: function onSelectItem(context) {
- var id = context.target.itemId;
- var idTokens = id.split('.');
- var key = idTokens[idTokens.length - 1];
- if (key === "new_job") {
- AdminReact.JobUIStore.setCreateButtonPressed(true);
- return this._showNewJobPane(context.glassContext).catch(function (err) {
- context.glassContext.getCoreSvc('.Logger').error(err);
- });
- }
- },
- _showNewJobPane: function _showNewJobPane(glassContext) {
- return ClassFactory.loadModule(JOB_PANE_MODULE).then(function (JobPane) {
- return JobPane.openJobPane(glassContext, {});
- });
- },
- isItemVisible: function isItemVisible(context) {
- var id = context.target.itemId;
- var idTokens = id.split('.');
- var key = idTokens[idTokens.length - 1];
- if (key === "new_job") {
- return true;
- } else {
- return false;
- }
- }
- });
- return JobCreateButtonView;
- });
|