diff --git a/CA和CR的Tab上加入文档预览按钮/AegApiTool_mxJPO.java b/CA和CR的Tab上加入文档预览按钮/AegApiTool_mxJPO.java new file mode 100644 index 0000000..7804e8e --- /dev/null +++ b/CA和CR的Tab上加入文档预览按钮/AegApiTool_mxJPO.java @@ -0,0 +1,92 @@ +import com.matrixone.apps.domain.DomainObject; +import com.matrixone.apps.domain.util.MqlUtil; +import matrix.db.Context; +import matrix.db.File; +import matrix.db.FileItr; +import matrix.db.FileList; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Logger; + +public class AegApiTool_mxJPO { + + private static final String basePath = "/kkFileView2/kkFileView-4.4.0"; + private static final String targetDir = basePath + "/file/demo/"; + private static final Logger LOGGER = Logger.getLogger(AegCADemote_mxJPO.class.getName()); + private static final String tempFilePath = "/kkFileView2/kkFileView-4.4.0/file/demo/"; + + public Map downloadFile(Context context1, String[] args) throws Exception { + String physicalId = args[0]; + String documentName = args[1]; + LOGGER.info("physicalId ==> " + physicalId); + LOGGER.info("documentName ==> " + documentName); + LOGGER.info("context.name ==> " + context1.getUser()); + + Context context=new Context(""); + context.setUser("admin_platform"); + context.setPassword("Aeg12345678"); + context.connect(); + + String getItemIdInfo = "temp query bus * * * where 'physicalId == " + physicalId + "' select id dump |"; + String itemIdInfo = MqlUtil.mqlCommand(context, getItemIdInfo); + + String itemId = itemIdInfo.split("\\|")[3]; + DomainObject domainObject = DomainObject.newInstance(context, itemId); + + String getFileFormat = "print bus " + itemId + " select format[].file.format dump |" ; + String fileFormat = MqlUtil.mqlCommand(context, getFileFormat); + String[] formatArray=fileFormat.split("\\|"); + + boolean isFlag = false; + String displayName = ""; + + for(String format : formatArray) + { + FileList fileList = domainObject.getFiles(context, format); + FileItr fileItr = new FileItr(fileList); + + while (fileItr.next()) + { + File file = fileItr.obj(); + String fileName = file.getName(); + + LOGGER.info("fileName ==> " + fileName); + LOGGER.info("documentName ==> " + documentName); + +// if(documentName.equals(fileName.substring(0, fileName.lastIndexOf('.')))) { +// domainObject.checkoutFile(context, false, format, fileName, tempFilePath); +// displayName = fileName; +// isFlag = true; +// } + + Path path = Paths.get(targetDir); + + if(!Files.exists(path)){ + Files.createDirectories(path); + System.out.println("目录创建成功:" + targetDir); + } else { + System.out.println("目录已存在,跳过创建:" + targetDir); + } + + domainObject.checkoutFile(context, false, format, fileName, tempFilePath); + displayName = fileName; + isFlag = true; + } + } + + Map map = new HashMap<>(); + map.put("displayName", displayName); + + if(isFlag) { + map.put("isFlag","true"); + return map; + } else { + map.put("isFlag","false"); + return map; + } + } +} diff --git a/CA和CR的Tab上加入文档预览按钮/AegDownloadFile.jar b/CA和CR的Tab上加入文档预览按钮/AegDownloadFile.jar new file mode 100644 index 0000000..19a6b1d Binary files /dev/null and b/CA和CR的Tab上加入文档预览按钮/AegDownloadFile.jar differ diff --git a/CA和CR的Tab上加入文档预览按钮/CA和CR配置详情.docx b/CA和CR的Tab上加入文档预览按钮/CA和CR配置详情.docx new file mode 100644 index 0000000..ca01520 --- /dev/null +++ b/CA和CR的Tab上加入文档预览按钮/CA和CR配置详情.docx @@ -0,0 +1,21 @@ +第一步: + :下载并安装LibreOffice + wget https://downloadarchive.documentfoundation.org/libreoffice/old/7.5.3.2/rpm/x86_64/LibreOffice_7.5.3.2_Linux_x86-64_rpm.tar.gz + tar -zxvf LibreOffice_7.5.3.2_Linux_x86-64_rpm.tar.gz + cd LibreOffice_7.5.3.2_Linux_x86-64_rpm/RPMS/ + sudo rpm -ivh *.rpm --nodeps - force + :下载并安装kkFileView + tar -zxvf kkFileView-4.4.0.tar.gz + cd /kkFileView2/kkFileView-4.4.0/bin/ + ./startup.sh + :添加JPO + : 添加Jar包 + :修改ENOChgGovernanceUX_zh.js 添加中文名字; + + :修改 ENOChgGovernanceUX.js 文件; + 在CA的Tab上添加按钮 + 搜索createCusTab + 然后一路配置下去 + 在CR 的Tab上添加按钮 + 搜索createCrCusTab + 然后一路配置下去 diff --git a/CA和CR的Tab上加入文档预览按钮/CommonTools_mxJPO.java b/CA和CR的Tab上加入文档预览按钮/CommonTools_mxJPO.java new file mode 100644 index 0000000..ff44f62 --- /dev/null +++ b/CA和CR的Tab上加入文档预览按钮/CommonTools_mxJPO.java @@ -0,0 +1,272 @@ + +import com.dassault_systemes.enovia.changeorder.factory.ChangeOrderFactory; +import com.dassault_systemes.enovia.changeorder.interfaces.IChangeOrderServices; +import com.dassault_systemes.enovia.changerequest.factory.ChangeRequestFactory; +import com.dassault_systemes.enovia.changerequest.interfaces.IAffectedItem; +import com.dassault_systemes.enovia.changerequest.interfaces.IChangeRequest; +import com.dassault_systemes.enovia.changerequest.interfaces.IChangeRequestServices; +import com.dassault_systemes.enovia.enterprisechangemgt.common.ChangeAction; +import com.dassault_systemes.enovia.enterprisechangemgtapp.common.ChangeRequest; +import com.dassault_systemes.platform.ven.jackson.databind.ObjectMapper; +import com.matrixone.apps.cpd.json.JSONObject; +import com.matrixone.apps.domain.DomainObject; +import com.matrixone.apps.domain.util.FrameworkException; +import com.matrixone.apps.domain.util.MapList; +import com.matrixone.apps.domain.util.MqlUtil; +import matrix.db.Context; + +import java.util.*; +import java.util.logging.Logger; + +public class CommonTools_mxJPO { + + private static final Logger LOGGER = Logger.getLogger(CommonTools_mxJPO.class.getName()); + + public String getInfoByObjId(Context context, String[] args) { + + String objId = args[0]; + String selectVal = args[1]; + + StringBuilder stringBuilder = new StringBuilder(); + + List list = new ArrayList<>(); + + if(selectVal.contains("|")){ + String[] selectValInfo = selectVal.split("\\|"); + for (String value : selectValInfo){ + list.add(value); + stringBuilder.append(value); + stringBuilder.append(" "); + } + } else { + list.add(selectVal); + stringBuilder.append(selectVal); + } + + String queryInfo = "print bus " + objId + " select " + stringBuilder + " dump |"; + JSONObject jsonObject = new JSONObject(); + + try { + String selInfo = MqlUtil.mqlCommand(context, queryInfo); + + if(selInfo.isEmpty()){ + return "fail"; + } + + if(selInfo.contains("|")){ + String[] queryInfoSplit = selInfo.split("\\|"); + for (int i = 0; i < queryInfoSplit.length; i++) { + jsonObject.put(list.get(i),queryInfoSplit[i]); + } + } else{ + jsonObject.put(list.get(0),selInfo); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + return jsonObject.toString(); + } + + public String getInfoByPhyId(Context context, String[] args){ + + String physicalId = args[0]; + String selectVal = args[1]; + + StringBuilder stringBuilder = new StringBuilder(); + List list = new ArrayList<>(); + + if(selectVal.contains("|")){ + String[] selectValInfo = selectVal.split("\\|"); + for (String value : selectValInfo){ + list.add(value); + stringBuilder.append(value); + stringBuilder.append(" "); + } + } else { + list.add(selectVal); + stringBuilder.append(selectVal); + } + + String queryInfo = "temp query bus * * * where 'physicalid==" + physicalId + "' select " + stringBuilder + " dump |"; + JSONObject jsonObject = new JSONObject(); + + try { + String selInfo = MqlUtil.mqlCommand(context, queryInfo); + + if(selInfo.isEmpty()){ + return "fail"; + } + + if(selInfo.contains("|")){ + String[] queryInfoSplit = selInfo.split("\\|"); + for (int i = 3; i < queryInfoSplit.length; i++) { + jsonObject.put(list.get(i-3),queryInfoSplit[i]); + } + } else{ + jsonObject.put(list.get(0),selInfo); + } + + } catch (Exception e) { + throw new RuntimeException(e); + } + return jsonObject.toString(); + } + + public String getInfoByObjIdAndVersion(Context context, String[] args){ + String name = args[0]; + String version = args[1]; + String selectList = args[2]; + + StringBuilder stringBuilder = new StringBuilder(); + List list = new ArrayList<>(); + + if(selectList.contains("|")){ + String[] selectValInfo = selectList.split("\\|"); + for (String value : selectValInfo){ + list.add(value); + stringBuilder.append(value); + stringBuilder.append(" "); + } + } else { + list.add(selectList); + stringBuilder.append(selectList); + } + + String queryInfo = "temp query bus * " + name + " " + version + " select " + stringBuilder + " dump |"; + JSONObject jsonObject = new JSONObject(); + + try { + String selInfo = MqlUtil.mqlCommand(context, queryInfo); + + if(selInfo.isEmpty()){ + return "fail"; + } + + if(selInfo.contains("|")){ + String[] queryInfoSplit = selInfo.split("\\|"); + for (int i = 3; i < queryInfoSplit.length; i++) { + jsonObject.put(list.get(i-3),queryInfoSplit[i]); + } + } else{ + jsonObject.put(list.get(0),selInfo); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + return jsonObject.toString(); + } + + public String getProposedChangeInfoByName(Context context, String[] args) throws Exception { + String Name = args[0]; + LOGGER.info("Name ==> " + Name); + + String getObjId = "temp query bus * " + Name + " * select id dump |"; + LOGGER.info("getObjId ==> " + getObjId); + String objId = MqlUtil.mqlCommand(context, getObjId); + System.out.println(objId); + + if(!objId.isEmpty()){ + ChangeAction changeAction = new ChangeAction(objId.split("\\|")[3]); + MapList mapList = changeAction.getAffectedItems(context); + MapList realizedChangesList = changeAction.getRealizedChanges(context); + + Map response = new HashMap<>(); + + response.put("proposedChanges", processItems(context, mapList)); + response.put("realizedChanges", processItems(context, realizedChangesList)); + ObjectMapper mapper = new ObjectMapper(); + return mapper.writeValueAsString(response); + } + return ""; + } + + public List processItems(Context context, MapList items) throws FrameworkException { + if(items.isEmpty()) { + return null; + } + + List list = new ArrayList<>(); + + for (int i = 0; i < items.size(); i++) { + Map map = new HashMap<>(); + Map itemMap = (Map) items.get(i); + + if(!"Document".equals((String) itemMap.get("type"))) { + continue; + } + + String type = (String) itemMap.get("type"); + String name = (String) itemMap.get("name"); + String id = (String) itemMap.get("id"); + String current = (String) itemMap.get("current"); + + String getObjInfo = "print bus " + id + " select attribute[Title] physicalid dump |"; + String objInfo = MqlUtil.mqlCommand(context, getObjInfo); + + String physicalId = objInfo.split("\\|")[1]; + String title = objInfo.split("\\|")[0]; + + map.put("title", title); + map.put("physicalid", physicalId); + map.put("name", name); + map.put("current", current); + map.put("type",type); + list.add(map); + } + + return list; + } + + public String getCRAffectInfo(Context context, String[] args) throws Exception { + String itemName = args[0]; + System.out.println(123); + System.out.println(itemName); + + String getItemIdInfo = "temp query bus * " + itemName + " * select id dump |"; + String itemIdInfo = MqlUtil.mqlCommand(context, getItemIdInfo); + + MapList mapList = new MapList(); + + if(!itemIdInfo.isEmpty()){ + DomainObject domChange = DomainObject.newInstance(context, itemIdInfo.split("\\|")[3]); + IChangeRequestServices changeRequestFactory = ChangeRequestFactory.createChangeRequestFactory(); + IChangeRequest iChangeRequest = changeRequestFactory.retrieveChangeRequestFromDatabase(context, domChange); + List affectedItems = iChangeRequest.getAffectedItems(context); + + for (int i = 0; i < affectedItems.size(); i++) { + System.out.println(affectedItems.get(i).getPhysicalId()); + Map itemMap = getCRAffectItemInfo(context, affectedItems.get(i).getPhysicalId()); + + if(itemMap.size() == 0){ + continue; + } + mapList.add(itemMap); + } + } + + System.out.println(mapList); + return mapList.toString(); + } + + public Map getCRAffectItemInfo(Context context, String physicalId) throws FrameworkException { + String getItemInfo = "temp query bus * * * where ' physicalid == " + physicalId + "' select attribute[Title] type name current dump |"; + System.out.println(getItemInfo); + String itemInfo = MqlUtil.mqlCommand(context, getItemInfo); + System.out.println(itemInfo); + + Map map = new HashMap(); + + System.out.println(itemInfo.split("\\|")[1]); + + if(!itemInfo.isEmpty() && "Document".equals(itemInfo.split("\\|")[0])){ + String[] itemSplit = itemInfo.split("\\|"); + map.put("title", itemSplit[3]); + map.put("physicalid", physicalId); + map.put("type", itemSplit[0]); + map.put("name", itemSplit[1]); + map.put("current",itemSplit[6]); + } + + return map; + } +} diff --git a/CA和CR的Tab上加入文档预览按钮/ENOChgGovernanceUX.js b/CA和CR的Tab上加入文档预览按钮/ENOChgGovernanceUX.js new file mode 100644 index 0000000..89c6291 --- /dev/null +++ b/CA和CR的Tab上加入文档预览按钮/ENOChgGovernanceUX.js @@ -0,0 +1,26738 @@ +define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/util/ChgCAMemberFilterView', + [ + 'UWA/Class/View', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'UWA/Core', + 'DS/Handlebars/Handlebars4', + ], + function (e, t, i, n) { + return e.extend({ + name: 'teamfilter', + tagName: 'div', + className: 'chg-member-view', + setup: function () { + (this.template = + '
' + + t.CHG_Member_Filter_ByName + + '
' + + t.CHG_Member_Filter_ByResponsibilities + + '
'), + (this.renderer = this.getTemplate(this.template)); + }, + init: function (e) { + (e = i.clone(e || {}, !1)), this._parent.call(this, e); + }, + render: function () { + this.name, this.cid; + this.container.empty(), (containerReference = this.container); + var e = UWA.createElement('div', { + class: 'chg-member-view-role-filter', + styles: { + height: '10%', + }, + }), + t = this.renderer(); + return e.addContent(t), e.inject(containerReference), this; + }, + injectSubView: function (e, t) { + var i = this.container.getElement(t); + e && i && i.grab(e.render().getContent()); + }, + getTemplate: function (e) { + var t = n.compile(e), + i = this; + return ( + (i.data = { + placeholder: i.options.placeholder, + }), + function () { + return t(i.data); + } + ); + }, + domEvents: { + 'keyup .filtertext': function (e) { + var t = e.target.value, + i = this.container.getElement('.clear-filter'); + t.length > 0 + ? i.setStyle('visibility', 'visible') + : i.setStyle('visibility', 'hidden'), + this.dispatchEvent('memberRoleFilter', arguments); + }, + 'click .clear-filter': function (e) { + this.container + .getElement('.clear-filter') + .setStyle('visibility', 'hidden'); + var t = this.container.getElement('.filtertext'); + if (t) { + t.value = ''; + } + this.dispatchEvent('memberRoleFilter', arguments); + }, + 'focus .filtertext': function () { + var e = document.getElementsByClassName( + 'searchfiler-input-container', + ); + e.addClassName('highlighted-border'), + e.removeClassName('border-without-focus'); + }, + 'click .roleFilter': function () { + this.dispatchEvent('memberRoleFilter', arguments); + }, + }, + }); + }, +), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCreateChangeRequest', + [ + 'DS/ENONewWidget/ENONewLauncher', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/UIKIT/Mask', + 'require', + ], + function (e, t, i, n, o) { + return { + launchCreateChangeRequestDialog: function (a) { + console.log( + 'launchCreateChangeRequestDialog ............................', + ); + let r = { + context: { + service: '3DSpace', + tenant: t.getGlobalVariable().tenant, + header: { + SecurityContext: t.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: i.CHG_NEW_CHANGE_REQUEST_FORM, + type: 'Change Request', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Request', + preferedType: 'Change Request', + select: [], + }, + events: { + onSuccess: function (e) { + a && (a.isClickProcessing = !1); + var t = document.getElementsByClassName('moduleWrapper')[0]; + (null == t && 'undefined' == t) || n.mask(t); + let i = e.result[0].identifier, + r = {}; + (r.context = i), (r.type = 'ChangeRequest'); + let s = o( + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ), + l = o( + 'DS/ENOChgGovernanceUX/scripts/util/changeRequest/ChgChangeRequestUtil', + ); + s.launchPropertyPanelContext(r), + l.displayObjectInfoInsideIDcard(i, !0); + }, + onFailure: function (e) { + console.log('onFailure...............' + e), + a && (a.isClickProcessing = !1); + }, + onCancel: function (e) { + a && (a.isClickProcessing = !1); + }, + }, + }; + var s = { + commandInfo: { + type: 'Change Request', + facet: 'Start a New Activity', + action: 'CR>Start a New Activity>New Change Request', + }, + }; + o( + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ).cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: s, + }), + new e().CreateNew(r); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/ChgRelatedScopeViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + let t = Object.create(null); + return ( + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + className: 'info-active', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/ChgRelatedScopeDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/ChgRelatedScopeTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function () { + return { + entries: [ + { + id: 'addExisting', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_Toolbar_AddRelatedScope, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/ChgRelatedScopeDataGridLayout', + func: 'addExistingHandler', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_Toolbar_RemoveRelatedScope, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/ChgRelatedScopeDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTagNavigatorProxy', + [ + 'DS/TagNavigatorProxy/TagNavigatorProxy', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t) { + 'use strict'; + var i = null, + n = null, + o = [], + a = { + init: function (o) { + var r = { + widgetId: widget.id, + filteringMode: 'FilteringOnServer', + colorize: !0, + }; + i && i.die(), + (n = o.DataContext), + (i = e.createProxy(r)).addOpenTaggerListener(function () { + require([ + 'DS/Notifications/NotificationsManagerUXMessages', + 'DS/Notifications/NotificationsManagerViewOnScreen', + 'i18n!DS/ENOChgActionGridUX/assets/nls/ENOChgActionDataGridNLS', + ], function (e, t, i) { + var n = { + level: 'info', + title: i.WARNING_TAGGER_INFO, + subtitle: i.WARNING_TAGGER, + sticky: !1, + }; + (window.notif = e), + t.removeLastNotificationDisplayed(), + t.setNotificationManager(window.notif), + t.setFadeOutPolicy(2), + t.setStackingPolicy(1), + t.setRemoveStackOnFirstTimeoutFlag(!0), + null != t._notifScreen && + t._notifScreen.addClassName('ca-align-center'), + e.addNotif(n); + }); + }), + i.addEvent('onFilterChange', function (e) { + var o = i.getCurrentFilter(); + n.ChgCOlayoutModel.empty(), + Object.keys(o.allfilters).length > 0 + ? ((t.getGlobalVariable().indexMode = 'true'), + n.refreshGrid(e, o)) + : ((t.getGlobalVariable().indexMode = 'true'), + n.refreshGrid(e, o), + (t.getGlobalVariable().indexMode = 'false'), + n.refreshGrid(e, o)); + }), + i.addEvent('colorize', function (e) { + var t = e.tagColors; + a._colorize(t); + }), + i.addEvent('unColorize', function (e) { + a._uncolorize(); + }); + }, + setTags: function (e, t) { + if (i && t) { + var n = a.getTagsList(t); + t.forEach(function (e) { + if (-1 != n.indexOf(e.sixw)) { + for (var t = !1, i = 0; i < o.length; i++) + if (o[i].sixw == e.sixw && o[i].object == e.object) { + (o[i] = e), (t = !0); + break; + } + t || o.push(e); + } + }); + } + i.setTags(e, o); + }, + deactivate: function () { + i && i.deactivate(); + }, + activate: function () { + i && i.activate(); + }, + clearLocalFilter: function () { + i && i.clearLocalFilter(); + }, + getTaglistData: function () { + return [ + { + sixw: 'ds6w:what/ds6w:status', + modelField: 'maturity', + compareType: 'AcontainsB', + }, + { + sixw: 'ds6w:why/ds6w:fulfills/ds6w:severity', + modelField: 'severity', + compareType: 'String', + }, + { + sixw: 'ds6w:who/ds6w:responsible', + modelField: 'responsible', + compareType: 'String', + }, + { + sixw: 'ds6w:when/ds6w:ends/ds6w:dueDate', + modelField: 'dueDate', + compareType: 'date', + }, + ]; + }, + getTagsList: function (e) { + var t = []; + return ( + e && + e.forEach(function (e) { + t.push(e.sixw); + }), + a.getTaglistData().forEach(function (e) { + t.push(e.sixw); + }), + t + ); + }, + tagCompare: function (e, t, i) { + if (t && e) + if ('String' == i) { + if (e == t) return !0; + } else if ('AcontainsB' == i) { + if (e.contains(t)) return !0; + } else if ('BcontainsA' == i) { + if (t.contains(e)) return !0; + } else if ('Array' == i) { + if (t.indexOf(e) > -1) return !0; + } else if ('date' == i) + return ( + (o = t), + (a = n = e), + n.length > 7 + ? (a = new UWA.Date(n).strftime('%Y-%m-%d')) + : n.length > 4 && (a = new UWA.Date(n).strftime('%Y-%m')), + !!o.contains(a) + ); + var n, o, a; + return !1; + }, + _uncolorize: function () { + 'tree' == n.coGridView.options.columns[0].dataIndex && + ((n.coGridView.options.columns[0].getCellKPIColor = null), + n.coGridView.coDatagrid.prepareUpdateView(), + n.coGridView.coDatagrid.pushUpdateView( + { + updateCellContent: !0, + updateCellLayout: !1, + updateCellAttributes: !1, + }, + !0, + )), + n.coGridView.tilesView && + ((n.coGridView.tilesView.getColor = function () {}), + n.coGridView.tilesView.prepareUpdateView(), + n.coGridView.tilesView.pushUpdateView( + { + updateCellContent: !0, + updateCellLayout: !1, + updateCellAttributes: !1, + }, + !0, + )); + }, + _colorize: function (e) { + var t = a.getTagsList().indexOf(e[0].predicate); + if (t >= 0) { + var i = a.getTaglistData()[t]; + 'tree' == n.coGridView.options.columns[0].dataIndex && + ((n.coGridView.options.columns[0].getCellKPIColor = function ( + t, + ) { + for (var n = 0; n < e.length; n++) + if ( + a.tagCompare( + e[n].object, + t.nodeModel.options.grid[i.modelField], + i.compareType, + ) + ) + return e[n].color; + return null; + }), + n.coGridView.caDatagrid.prepareUpdateView(), + n.coGridView.caDatagrid.pushUpdateView( + { + updateCellContent: !0, + updateCellLayout: !1, + updateCellAttributes: !1, + }, + !0, + )), + n.coGridView.tilesView && + ((n.coGridView.tilesView.getColor = function (t) { + t.options.grid; + for (var n = 0; n < e.length; n++) + if ( + a.tagCompare( + e[n].object, + t.options.grid[i.modelField], + i.compareType, + ) + ) + return e[n].color; + }), + n.coGridView.tilesView.prepareUpdateView(), + n.coGridView.tilesView.pushUpdateView( + { + updateCellContent: !0, + updateCellLayout: !1, + updateCellAttributes: !1, + }, + !0, + )); + } + }, + }; + return a; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/util/ChgCRMembersFeaturesUtil', + [ + 'UWA/Core', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'require', + ], + function (e, t, i) { + 'use strict'; + var n = { + showRMBMenuOnGrid: function (e, t) { + return new Promise(function (o, a) { + var r = 'false', + s = {}, + l = i( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/util/ChgCRMembersGridUtil', + ), + c = t.cellInfos.nodeModel.getTreeDocument().getSelectedNodes(), + d = c[0].options.grid.roles; + s.currentObjType = c[0].options.grid.type; + var u = 0; + c.length > 1 && (r = 'true'), + d.indexOf('Approver') >= 0 + ? ((s.Approver = 'DISCONNECT'), u++) + : (s.Approver = 'CONNECT'), + d.indexOf('Coordinator') >= 0 + ? ((s.Coordinator = 'DISCONNECT'), u++) + : (s.Coordinator = 'CONNECT'), + d.indexOf('Follower') >= 0 + ? ((s.Follower = 'DISCONNECT'), u++) + : (s.Follower = 'CONNECT'), + d.indexOf('Assignee') >= 0 + ? ((s.Assignee = 'DISCONNECT'), u++) + : (s.Assignee = 'CONNECT'); + var g = d.indexOf('Owner') >= 0 || d.indexOf('Originator') >= 0; + if ((0 == g && 1 == u && (s.showConfirmation = !0), 'false' == r)) + i( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersDataGridLayout', + ); + var p = [], + h = t.cellInfos.nodeModel.options.grid.id, + m = t.cellInfos.nodeModel.options.grid.type, + C = t.cellInfos.nodeModel.options.grid.name, + v = t.cellInfos.nodeModel.options.grid.displayType; + 'Group' == m && + ((m = 'foaf:Group'), + (C = t.cellInfos.nodeModel.options.grid.fullName), + (v = t.cellInfos.nodeModel.options.grid.type)); + var f = { + objectId: h, + objectType: m, + displayName: C, + displayType: v, + facetName: 'dependency', + }; + [].push(f); + var b = i( + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ).openWith(f), + w = []; + w.push(b), + Promise.all(w).then(function (i) { + 'Person' == s.currentObjType && + ((1 != l.isChangeCoordinatorConnected || + (1 == l.isChangeCoordinatorConnected && + 'DISCONNECT' == s.Coordinator)) && + p.push(n.getChangeCoordinatorMenu(e, t, s)), + p.push(n.getFollowerMenu(e, t, s)), + p.push(n.getAssigneeMenu(e, t, s))), + 'Group' == s.currentObjType && + (p.push(n.getFollowerMenu(e, t, s)), + p.push(n.getAssigneeMenu(e, t, s))), + 0 == g && p.push(n.getDeleteMenu(e, t, s)), + i[0] && p.push(i[0]), + o(p); + }); + }); + }, + getChangeCoordinatorMenu: function (e, i, n) { + var o = { + type: 'CheckItem', + title: t.CHG_Member_Menu_Change_Coordinator, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersDataGridLayout', + ], function (e) { + console.log('Coordinator : ' + n.Coordinator), + (n.role = 'Coordinator'), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + return 'DISCONNECT' == n.Coordinator && (o.state = 'selected'), o; + }, + getFollowerMenu: function (e, i, n) { + var o = { + type: 'CheckItem', + title: t.CHG_Member_Menu_Follower, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersDataGridLayout', + ], function (e) { + console.log('Follower : ' + n.Follower), + (n.role = 'Follower'), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + return 'DISCONNECT' == n.Follower && (o.state = 'selected'), o; + }, + getAssigneeMenu: function (e, i, n) { + var o = { + type: 'CheckItem', + title: t.CHG_Member_Menu_Assignee, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersDataGridLayout', + ], function (e) { + console.log('Assignee : ' + n.Assignee), + (n.role = 'Assignee'), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + return 'DISCONNECT' == n.Assignee && (o.state = 'selected'), o; + }, + getDeleteMenu: function (e, i, n) { + return { + type: 'PushItem', + title: t.CHG_Member_Menu_Remove, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-remove', + }, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersDataGridLayout', + ], function (e) { + console.log('remove '), + (n.role = []), + 'DISCONNECT' == n.Follower && n.role.push('Follower'), + 'DISCONNECT' == n.Approver && n.role.push('Approver'), + 'DISCONNECT' == n.Coordinator && n.role.push('Coordinator'), + 'DISCONNECT' == n.Assignee && n.role.push('Assignee'), + (n.showConfirmation = !0), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + }, + }; + return n; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/facets/issue/ChgIssueDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/UIKIT/Mask', + 'DS/TreeModel/BaseFilter', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u) { + 'use strict'; + let g = u.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + let t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }), + p = e.extend({ + init: function (e) { + this.parentCRId = e; + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new t({ + id: 'CO_Issue', + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + let t = e.getChildren(); + for (let e = 0; e < t.length; e++) + if (this.options.grid.id == t[e].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument + .getFilterManager() + .registerFilter('stringRole', g); + }, + loadIssueData: function (e, t) { + e.prepareUpdate(); + let i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + let n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = this.createCustomOwnerField(e); + e.chgObjOwner = t; + let n = e.name + ' | ' + e.ownerFullName; + '' == e.maturityNLS && (e.maturityNLS = e.stateNLS); + let o = e.maturityNLS; + var a = this.getCustomTooltip(e); + return new i({ + label: e.title, + subLabel: n, + description: o, + grid: e, + customTooltip: a, + icons: [e.icon], + thumbnail: e.thumbnail, + useAsyncPreExpand: !0, + }); + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + addExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCRId; + e.forEach((e) => { + var a = e.id, + r = { + resolvedBy: [], + }; + (r.physicalId = a), + r.resolvedBy.push({ + physicalId: o, + }); + let c = document.getElementById('outer-CO-issue-grid-div'); + 'undefined' != c && null != c && d.mask(c), + s.updateExistingIssue(a, r).then( + function (e) { + s.getIssueDetails(a).then(function (n) { + let o = n.body; + l + .processedChangeRequestNewIssueList(o) + .then(function (n) { + p.prototype.addNodesInLayoutModel( + t.treeDocument, + n, + ), + i(e); + }), + d.unmask(c); + }); + }, + function (e) { + d.unmask(c), n(e); + }, + ); + }); + }); + }, + removeExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCRId; + e.forEach((e) => { + var r = e.id, + l = { + resolvedBy: [], + }; + (l.physicalId = r), + l.resolvedBy.push({ + physicalId: o, + }); + let u = document.getElementById('outer-issue-grid-div'); + 'undefined' != u && null != u && d.mask(u), + s.removeExistingIssue(r, l).then( + function (e) { + let n = t.treeDocument.getSelectedNodes(); + i(n); + for (let e = 0; e < n.length; e++) + t.treeDocument.removeRoot(n[e]); + c.success(a.CHG_GOV_Issue_Remove_Success), d.unmask(u); + }, + function (e) { + d.unmask(u), n(); + }, + ); + }); + }); + }, + addNodesInLayoutModel: function (e, t) { + let i = p.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else for (let t = i.length - 1; t >= 0; t--) e.addRoot(i[t], 0); + e.pushUpdate(); + }, + filterView: function (e, t) { + let i = t, + n = e.matchingIDs; + i.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: n, + }, + }, + }); + }, + enableColorizeView: function (e, t) { + let i = t.getAllDescendants(); + var n, o; + (n = e), + (o = function (e, t) { + i.map((i) => { + if (i.options.grid.id === t) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + i.updateOptions(n); + } + }); + }), + UWA.is(n, 'array') && + n.forEach(function (e) { + var t = e.color, + i = e.id; + o(t, i); + }); + }, + disableColorizeView: function (e, t) { + t.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return p; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeAction/group/ChgChangeGroupModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + ], + function (e, t, i, n) { + 'use strict'; + return e.extend({ + init: function () {}, + createTreeDocument: function () { + return new t({}); + }, + loadData: function (e, t, i) { + e.prepareUpdate(); + for (var n = t.groups, o = 0; o < n.length; o++) { + var a = this.createNode(n[o].title, n[o].id); + (i && n[o].id == i.id) || e.addRoot(a); + } + e.pushUpdate(); + }, + createNode: function (e, t) { + return new i({ + label: e, + value: t, + }); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/ChgCODataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/TreeModel/BaseFilter', + 'require', + ], + function (e, t, i, n, o, a, r, s, l) { + 'use strict'; + var c = s.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }); + return e.extend({ + init: function () {}, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + var e = new n(), + i = new t({ + id: 'coSummary', + dataModelSet: e, + }); + return this.setTreeDocument(i), i; + }, + registerCustomFilter: function () { + this.treeDocument.getFilterManager().registerFilter('stringRole', c); + }, + loadIndexedChangeOrders: function (e, t) { + var o = e, + a = new n(); + e.prepareUpdate(); + for (var r = 0; r < t.length; r++) { + var s = this.createCustomNameField(t[r]); + t[r].co_name = s; + var l = this.createCustomSeverity(t[r]); + t[r].sev = l; + var c = this.createCustomChangeCoordinatorField(t[r]); + t[r].co_Coordinator = c; + var d = this.createCustomOwnerField(t[r]); + t[r].co_Owner = d; + for ( + var u = this.getStatusBarIcons(t[r]), + g = this.statusbarIconsTooltips(t[r]), + p = this.getSubLevel(t[r]), + h = this.getDescription(t[r]), + m = this.createCustomTooltip(t[r]), + C = !1, + v = o.getChildren(), + f = 0; + f < v.length; + f++ + ) { + v[f].options.grid.id == t[r].id && (C = !0); + } + if (!C) { + var b = i.createTreeNodeDataModel(a, { + label: t[r].title, + subLabel: p, + description: h, + grid: t[r], + icons: [t[r].iconURL], + thumbnail: t[r].thumbnail, + statusbarIcons: u, + statusbarIconsTooltips: g, + customTooltip: m, + contextualMenu: ['Copy1', 'Move1'], + }); + e.addChild(b); + } + } + e.pushUpdate(); + }, + loadChangeOrderData: function (e, t) { + var a = e, + r = new n(); + e.prepareUpdate(); + for (var s = 0; s < t.length; s++) { + var l = this.createCustomNameField(t[s], 'NonIndex'); + t[s].co_name = l; + var c = this.createCustomSeverity(t[s]); + t[s].sev = c; + var d = this.createCustomChangeCoordinatorField(t[s]); + t[s].co_Coordinator = d; + var u = this.createCustomOwnerField(t[s]); + t[s].co_Owner = u; + for ( + var g = this.getStatusBarIcons(t[s], 'NonIndex'), + p = this.statusbarIconsTooltips(t[s], 'NonIndex'), + h = this.getSubLevel(t[s]), + m = this.getDescription(t[s]), + C = this.createCustomTooltip(t[s]), + v = !1, + f = + (o.getGlobalVariable().existingCOIds, + (v = !1), + a.getChildren()), + b = 0; + b < f.length; + b++ + ) { + f[b].options.grid.id == t[s].id && (v = !0); + } + if (!v) { + var w = i.createTreeNodeDataModel(r, { + label: t[s].title, + subLabel: h, + description: m, + grid: t[s], + icons: [t[s].iconURL], + thumbnail: t[s].thumbnail, + statusbarIcons: g, + statusbarIconsTooltips: p, + customTooltip: C, + contextualMenu: ['Copy1', 'Move1'], + }); + e.addChild(w, 0); + } + } + e.pushUpdate(); + }, + updateNodeIndexed: function (e, t) { + 0 == e.getChildren().length && + e._modelEvents.publish({ + event: 'coSummaryNotEmpty', + }), + e.unselectAll(); + var o = new n(), + a = this.createCustomNameField(t[0]); + t[0].co_name = a; + var r = this.createCustomSeverity(t[0]); + t[0].sev = r; + var s = this.createCustomChangeCoordinatorField(t[0]); + t[0].co_Coordinator = s; + var l = this.createCustomOwnerField(t[0]); + t[0].co_Owner = l; + var c = this.getStatusBarIcons(t[0]), + d = this.statusbarIconsTooltips(t[0]), + u = this.getSubLevel(t[0]), + g = this.getDescription(t[0]), + p = this.createCustomTooltip(t[0]), + h = i.createTreeNodeDataModel(o, { + label: t[0].title, + subLabel: u, + description: g, + grid: t[0], + icons: [t[0].iconURL], + thumbnail: t[0].thumbnail, + statusbarIcons: c, + statusbarIconsTooltips: d, + customTooltip: p, + }); + e.addChild(h, 0), e.getXSO().add(h); + }, + createCustomNameField: function (e, t) { + var i = new UWA.Element('div', {}); + UWA.createElement('span', { + html: e.name, + }).inject(i); + var n = new UWA.Element('div', { + class: 'iconsDiv', + }); + if ('true' == e.onHold) { + var o = new UWA.Element('div', { + class: 'gridIconContainer', + title: a.CHG_GOV_TOOLTIP_HOLD, + }); + UWA.createElement('div', { + class: 'fonticon fonticon-pause', + }).inject(o), + o.inject(n); + } + if ('NonIndex' == t) { + let e = new UWA.Element('div', { + class: 'gridIconContainer', + title: a.CHG_TOOLTIP_NEW_ORDER, + }); + UWA.createElement('div', { + class: + 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-database-add recentCA', + }).inject(e), + e.inject(n); + } + return n.inject(i), i.outerHTML; + }, + createCustomOwnerField: function (e) { + var t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + var l = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: l.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', l.avatarColor); + } + s.inject(a); + var c = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), c.inject(n), n.outerHTML; + }, + createCustomChangeCoordinatorField: function (e) { + var t = new UWA.Element('div', { + class: 'members', + }); + if ('' != e.changeCoordinatorFullName) { + var i = new UWA.Element('div', { + class: 'assignee', + }), + n = + '/api/user/getpicture/login/' + + e.changeCoordinator + + '/format/normal', + a = o.getGlobalVariable().computeSwymUrl(n), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: a, + }); + else { + var l = r.getAvatarDetails(e.changeCoordinatorFullName); + (s = UWA.createElement('div', { + html: l.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', l.avatarColor); + } + s.inject(i); + var c = UWA.createElement('span', { + class: 'userName', + html: e.changeCoordinatorFullName, + }); + i.inject(t), c.inject(t); + } + return t.outerHTML; + }, + createCustomSeverity: function (e) { + var t = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e.severity + ? (t = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e.severity && + (t = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + var i = new UWA.Element('div', {}), + n = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: t, + }).inject(n); + var o = UWA.createElement('span', { + html: e.severityNLS, + }); + return n.inject(i), o.inject(i), i.outerHTML; + }, + createCustomMaturity: function (e) { + var t = 'co-state co-draft'; + 'InWork' == e.maturity + ? (t = 'co-inwork co-state') + : 'InApproval' == e.maturity + ? (t = 'co-Inapproval co-state') + : 'Approved' == e.maturity + ? (t = 'co-approved co-state') + : 'Completed' == e.maturity && (t = 'co-completed co-state'); + var i = new UWA.Element('div', {}); + return ( + UWA.createElement('span', { + html: e.maturityNLS, + class: t, + }).inject(i), + i.outerHTML + ); + }, + getStatusBarIcons: function (e, t) { + var i = []; + return ( + 'Low' == e.severity + ? i.push('level-low') + : 'Medium' == e.severity + ? i.push('level-medium') + : 'High' == e.severity && i.push('level-high'), + 'true' == e.onHold && i.push('pause'), + 'NonIndex' == t && i.push('database-add'), + i + ); + }, + statusbarIconsTooltips: function (e, t) { + var i = []; + return ( + i.push(e.severityNLS), + 'true' == e.onHold && i.push(a.CHG_GOV_TOOLTIP_HOLD), + 'NonIndex' == t && i.push(a.CHG_TOOLTIP_NEW_ORDER), + i + ); + }, + createCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Severity + + ': ' + + e.severityNLS + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + getSubLevel: function (e) { + return e.name + ' | ' + e.ownerFullName; + }, + getDescription: function (e) { + return e.maturityNLS; + }, + filterView: function (e) { + let t = this.treeDocument, + i = e.matchingIDs; + t.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: i, + }, + }, + }); + }, + enableColorizeView: function (e) { + let t = this.treeDocument.getAllDescendants(); + var i, n; + (i = e), + (n = function (e, i) { + t.map((t) => { + if (t.options.grid.id === i) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + t.updateOptions(n); + } + }); + }), + UWA.is(i, 'array') && + i.forEach(function (e) { + var t = e.color, + i = e.id; + n(t, i); + }); + }, + disableColorizeView: function () { + this.treeDocument.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealiedChangesToolbarHandler', + [ + 'UWA/Core', + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ], + function (e, t, i, n, o) { + return { + findRealizedChanges: function (e) { + var i = { + commandInfo: { + type: 'Change Action', + facet: 'Realized Changes', + action: 'CA>Realized Changes>DGV>Search Realized Changes', + }, + }; + o.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }), + t.publish('ECM_GOV_RealizedDGV_FIND:' + (widget ? widget.id : '')); + }, + ignoreRealizedChange: function (e) {}, + moveRealizedChange: function (e) {}, + downloadRealizedChange: function (e) { + var i = { + commandInfo: { + type: 'Change Action', + facet: 'Realized Changes', + action: 'CA>Realized Changes>DGV>Download', + }, + }; + o.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }), + t.publish('ECM_GOV_Realized_Download:' + (widget ? widget.id : '')); + }, + launchCustomColumnManager: function (e) {}, + refreshRealizedDGV: function (e) { + t.publish( + 'ECM_GOV_RealizedDGV_REFRESH:' + (widget ? widget.id : ''), + { + filter: + 'selected' === e.menu[0].state + ? 'TRACKED' + : 'selected' === e.menu[1].state + ? 'MOVED' + : 'IGNORED', + }, + ); + }, + filterViewHandler: function (e) { + if ('TRACKED' === e.filter) { + var i = { + commandInfo: { + type: 'Change Action', + facet: 'Realized Changes', + action: 'CA>Realized Changes>DGV>Tracked View', + }, + }; + o.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }), + e.context.nodeModel.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'change-action-realized', + }, + }, + }, + tooltip: n.CHG_GOV_Realized_Tracked, + }), + (e.context.nodeModel.options.grid.data.menu[0].state = + 'selected'), + (e.context.nodeModel.options.grid.data.menu[1].state = + 'unselected'), + (e.context.nodeModel.options.grid.data.menu[2].state = + 'unselected'); + } else if ('MOVED' === e.filter) { + i = { + commandInfo: { + type: 'Change Action', + facet: 'Realized Changes', + action: 'CA>Realized Changes>DGV>Moved View', + }, + }; + o.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }), + e.context.nodeModel.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'move-to', + }, + }, + }, + tooltip: n.CHG_GOV_Realized_Moved, + }), + (e.context.nodeModel.options.grid.data.menu[0].state = + 'unselected'), + (e.context.nodeModel.options.grid.data.menu[1].state = + 'selected'), + (e.context.nodeModel.options.grid.data.menu[2].state = + 'unselected'); + } else if ('IGNORED' === e.filter) { + i = { + commandInfo: { + type: 'Change Action', + facet: 'Realized Changes', + action: 'CA>Realized Changes>DGV>Ignored View', + }, + }; + o.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }), + e.context.nodeModel.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'ignore', + }, + }, + }, + tooltip: n.CHG_GOV_Realized_Ignored, + }), + (e.context.nodeModel.options.grid.data.menu[0].state = + 'unselected'), + (e.context.nodeModel.options.grid.data.menu[1].state = + 'unselected'), + (e.context.nodeModel.options.grid.data.menu[2].state = + 'selected'); + } + t.publish('ECM_GOV_RealizedDGV_FILTER:' + (widget ? widget.id : ''), { + filter: e.filter, + }); + }, + expandCollapseHandler: function (e) { + if ('EXPAND' === e.action) { + var i = { + commandInfo: { + type: 'Change Action', + facet: 'Realized Changes', + action: 'CA>Realized Changes>DGV>Expand All', + }, + }; + o.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }), + e.context.nodeModel.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'flow-tree-expand-down', + }, + }, + }, + tooltip: n.CHG_GOV_Expanded_All, + }), + (e.context.nodeModel.options.grid.data.menu[0].state = + 'selected'), + (e.context.nodeModel.options.grid.data.menu[1].state = + 'unselected'); + } else if ('COLLAPSE' === e.action) { + i = { + commandInfo: { + type: 'Change Action', + facet: 'Realized Changes', + action: 'CA>Realized Changes>DGV>Collapse All', + }, + }; + o.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }), + e.context.nodeModel.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'flow-tree-expand-up', + }, + }, + }, + tooltip: n.CHG_GOV_Collapsed_All, + }), + (e.context.nodeModel.options.grid.data.menu[0].state = + 'unselected'), + (e.context.nodeModel.options.grid.data.menu[1].state = + 'selected'); + } + t.publish( + 'ECM_GOV_RealizedDGV_EXPAND_COLLAPSE:' + (widget ? widget.id : ''), + { + action: e.action, + }, + ); + }, + switchViewHandler: function (e) { + 'DGV' === e.type + ? (e.context.nodeModel.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: n.CHG_TOOLTIP_GRID_VIEW, + }), + (e.context.nodeModel.options.grid.data.menu[0].state = + 'selected'), + (e.context.nodeModel.options.grid.data.menu[1].state = + 'unselected'), + t.publish( + 'ECM_GOV_RealizedDGV_I_ON:' + (widget ? widget.id : ''), + )) + : 'LTLV' === e.type && + (e.context.nodeModel.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-big-tile', + }, + }, + }, + tooltip: n.CHG_TOOLTIP_LARGE_TILE_VIEW, + }), + (e.context.nodeModel.options.grid.data.menu[0].state = + 'unselected'), + (e.context.nodeModel.options.grid.data.menu[1].state = + 'selected'), + !0 === i.getGlobalVariable().is3DSpace + ? t.publish('ECM_GOV_Realized_LTV_ON_3DSpace') + : t.publish( + 'ECM_GOV_RealizedDGV_OFF:' + (widget ? widget.id : ''), + )); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/util/ChgMemberFilterView', + [ + 'UWA/Class/View', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'UWA/Core', + 'DS/Handlebars/Handlebars4', + ], + function (e, t, i, n) { + return e.extend({ + name: 'teamfilter', + tagName: 'div', + className: 'chg-member-view', + setup: function () { + (this.template = + '
' + + t.CHG_Member_Filter_ByName + + '
' + + t.CHG_Member_Filter_ByResponsibilities + + '
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
'), + (this.renderer = this.getTemplate(this.template)); + }, + init: function (e) { + (e = i.clone(e || {}, !1)), this._parent.call(this, e); + }, + render: function () { + this.name, this.cid; + this.container.empty(), (containerReference = this.container); + var e = UWA.createElement('div', { + class: 'chg-member-view-role-filter', + styles: { + height: '10%', + }, + }), + t = this.renderer(); + return e.addContent(t), e.inject(containerReference), this; + }, + injectSubView: function (e, t) { + var i = this.container.getElement(t); + e && i && i.grab(e.render().getContent()); + }, + getTemplate: function (e) { + var t = n.compile(e), + i = this; + return ( + (i.data = { + placeholder: i.options.placeholder, + }), + function () { + return t(i.data); + } + ); + }, + domEvents: { + 'keyup .filtertext': function (e) { + var t = e.target.value, + i = this.container.getElement('.clear-filter'); + t.length > 0 + ? i.setStyle('visibility', 'visible') + : i.setStyle('visibility', 'hidden'), + this.dispatchEvent('memberRoleFilter', arguments); + }, + 'click .clear-filter': function (e) { + this.container + .getElement('.clear-filter') + .setStyle('visibility', 'hidden'); + var t = this.container.getElement('.filtertext'); + if (t) { + t.value = ''; + } + this.dispatchEvent('memberFilterKeyUp', { + target: { + value: '', + }, + }); + }, + 'focus .filtertext': function () { + var e = document.getElementsByClassName( + 'searchfiler-input-container', + ); + e.addClassName('highlighted-border'), + e.removeClassName('border-without-focus'); + }, + 'click .roleFilter': function () { + this.dispatchEvent('memberRoleFilter', arguments); + }, + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/UIKIT/Mask', + 'DS/TreeModel/BaseFilter', + 'require', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p) { + 'use strict'; + var h = g.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }), + m = e.extend({ + init: function (e, t) { + (this.contextID = e), (this.contextDetails = t); + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + var e = new t({ + id: 'crOrchestration', + useAsyncPreExpand: !0, + }); + return ( + e.onPreExpand(function (e) { + var t = e.target.options.grid.id; + if ((console.log('call for children' + e.target), t)) { + let n = !0; + 'ChangeOrder' == e.target.options.grid.isKindOfType + ? s.getChangeOrchestration(t, n).then( + function (e) { + i(e); + }, + function (e) { + return Promise.reject(e); + }, + ) + : 'ChangeRequest' == e.target.options.grid.isKindOfType && + s.getCRChangeOrchestration(t, n).then( + function (e) { + i(e); + }, + function (e) { + return Promise.reject(e); + }, + ); + } + + function i(t) { + l.processCRChangeOrchestration(t).then(function (t) { + var i = m.prototype.createTreeDocumentNodeModel(t); + if (e.target.hasChildren()) + for ( + var n = !1, o = e.target.getChildren(), a = 0; + a < i.length; + a++ + ) { + n = !1; + for (var r = 0; r < o.length; r++) + if (o[r].options.grid.id == i[a].options.grid.id) { + n = !0; + break; + } + n || e.target.addChild(i[r]); + } + else e.target.addChild(i); + e.target.preExpandDone(); + }); + } + }), + (e.isChildOf = function (e) { + for (var t = e.getChildren(), i = 0; i < t.length; i++) + if (this.options.grid.id == t[i].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument + .getFilterManager() + .registerFilter('stringRole', h); + }, + loadChangeOrchestrationData: function (e, t) { + e.prepareUpdate(); + var i = this.createTreeDocumentNodeModel(t); + if ( + (e.addRoot(i), e.pushUpdate(), o.getGlobalVariable().is3DSpace) + ) { + console.log('unmasking orchestratiom item 3dspace'); + let e = document.getElementById( + 'crOrchestrationFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('crChangeOrchestration'); + e && u.isMasked(e) && u.unmask(e); + } + }, + createTreeDocumentNodeModel: function (e) { + for (var t = [], i = 0; i < e.length; i++) { + var n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + var t = this.createCustomNameField(e); + e.chgObjName = t; + var n = this.createCustomSeverity(e); + e.sev = n; + var a = this.createCustomChangeCoordinatorField(e); + e.chgObjCoordinator = a; + var r = this.createCustomOwnerField(e); + e.chgObjOwner = r; + var s, + l = e.name + ' | ' + e.ownerFullName, + c = e.maturityNLS, + d = this.getStatusBarIcons(e), + u = this.statusbarIconsTooltips(e), + g = this.getCustomTooltip(e); + return ( + (s = o.getGlobalVariable().is3DSpace + ? '' + + UWA.String.escapeHTML(e.title) + + '' + : e.title), + new i({ + label: s, + subLabel: l, + description: c, + children: e.isKindOfChangeAction ? null : [], + grid: e, + icons: [e.iconURL], + thumbnail: e.thumbnail, + contextualMenu: ['Copy1', 'Move1'], + statusbarIcons: d, + statusbarIconsTooltips: u, + customTooltip: g, + useAsyncPreExpand: !0, + }) + ); + }, + createCustomNameField: function (e) { + var t = new UWA.Element('div', { + class: + 'wux-tweakers wux-tweakers-string wux-tweakers-string-label wux-tweakers-labelonly', + }), + i = UWA.createElement('span', { + html: e.name, + }); + i.style.setProperty('text-overflow', 'ellipsis'), i.inject(t); + var n = new UWA.Element('div', { + class: 'iconsDiv', + }); + if ( + e.ecm_change_on_hold && + 'true' == e.ecm_change_on_hold.toLowerCase() + ) { + var o = new UWA.Element('div', { + class: 'gridIconContainer', + title: a.CHG_GOV_TOOLTIP_HOLD, + }); + UWA.createElement('div', { + class: 'fonticon fonticon-pause', + }).inject(o), + o.inject(n); + } + return n.inject(t), t.outerHTML; + }, + createCustomSeverity: function (e) { + var t = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e.severity + ? (t = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e.severity && + (t = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + var i = new UWA.Element('div', {}), + n = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: t, + }).inject(n); + var o = UWA.createElement('span', { + html: e.severityNLS, + }); + return n.inject(i), o.inject(i), i.outerHTML; + }, + createCustomChangeCoordinatorField: function (e) { + var t = new UWA.Element('div', { + class: 'members', + }); + if ('' != e.changeCoordinatorFullName) { + var i = new UWA.Element('div', { + class: 'assignee', + }), + n = + '/api/user/getpicture/login/' + + e.changeCoordinator + + '/format/normal', + a = o.getGlobalVariable().computeSwymUrl(n), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: a, + }); + else { + var l = r.getAvatarDetails(e.changeCoordinatorFullName); + (s = UWA.createElement('div', { + html: l.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', l.avatarColor); + } + s.inject(i); + var c = UWA.createElement('span', { + class: 'userName', + html: e.changeCoordinatorFullName, + }); + i.inject(t), c.inject(t); + } + return t.outerHTML; + }, + createCustomOwnerField: function (e) { + var t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + var l = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: l.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', l.avatarColor); + } + s.inject(a); + var c = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), c.inject(n), n.outerHTML; + }, + getStatusBarIcons: function (e) { + var t = []; + return ( + 'Low' == e.severity + ? t.push('level-low') + : 'Medium' == e.severity + ? t.push('level-medium') + : 'High' == e.severity && t.push('level-high'), + e.ecm_change_on_hold && + 'true' == e.ecm_change_on_hold.toLowerCase() && + t.push('pause'), + t + ); + }, + statusbarIconsTooltips: function (e) { + var t = []; + return ( + t.push(e.severityNLS), + e.ecm_change_on_hold && + 'true' == e.ecm_change_on_hold.toLowerCase() && + t.push(a.CHG_GOV_TOOLTIP_HOLD), + t + ); + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Severity + + ': ' + + e.severityNLS + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + updateNodeIndexed: function (e, t) { + console.log(t); + }, + addNewChildren: function (e) { + var t = this; + let i = 'Change Request'; + if (this.treeDocument.getSelectedNodes().length > 1) + d.error( + a.CHG_GOV_ChangeOrchestration_AddExisting_Single_Selection, + ); + else { + this.treeDocument.getSelectedNodes().length + ? (this.treeDocument.getSelectedNodes()[0].options.grid.id, + (i = 'Change Order')) + : this.contextID; + var n = document.getElementById('outer-orchestration-grid-div'); + 'undefined' != n && null != n && u.mask(n), + 'Change Order' == e.type + ? s.getChangeOrderInfo(e.objectID).then( + function (e) { + l.processedChangeOrchestrationSummaryList(e).then( + function (e) { + m.prototype.addNodesInLayoutModel( + t.treeDocument, + e, + !0, + ), + u.unmask(n); + }, + ); + }, + function (e) { + u.unmask(n); + }, + ) + : 'Change Action' == e.type + ? s.getNewCADetails(e.objectID).then( + function (e) { + var t = l.processChangeActionInContext(e).processData; + console.log(t), + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + ], function (e) { + e.addNodesInLayout(t), u.unmask(n); + }); + }, + function (e) { + u.unmask(n); + }, + ) + : 'Change Request' == e.type && + s.getChangeRequestInfo(e.objectID).then( + function (e) { + l.processedChangeOrchestrationSummaryList(e).then( + function (e) { + m.prototype.addNodesInLayoutModel( + t.treeDocument, + e, + ), + u.unmask(n); + }, + ); + }, + function (e) { + u.unmask(n); + }, + ); + } + }, + addExistingChildren: function (e) { + var t, + i = this; + let n = 'Change Request'; + if (this.treeDocument.getSelectedNodes().length > 1) + d.error( + a.CHG_GOV_ChangeOrchestration_AddExisting_Single_Selection, + ); + else { + this.treeDocument.getSelectedNodes().length + ? ((t = + this.treeDocument.getSelectedNodes()[0].options.grid.id), + (n = 'Change Order')) + : (t = this.contextID); + var o = document.getElementById('outer-orchestration-grid-div'); + 'undefined' != o && null != o && u.mask(o), + s.addExistingInCRChangeOrchestration(t, n, e).then( + function (e) { + l.processCRChangeOrchestration(e).then(function (e) { + m.prototype.addNodesInLayoutModel(i.treeDocument, e), + u.unmask(o); + }); + }, + function (e) { + u.unmask(o); + }, + ); + } + }, + addNodesInLayoutModel: function (e, t, i = !1) { + 0 == e.getChildren().length && + e._modelEvents.publish({ + event: 'treeNotEmpty', + }); + var n, + o, + a = m.prototype.createTreeDocumentNodeModel(t); + if ( + (e.getSelectedNodes().length + ? ((n = !1), (o = e.getSelectedNodes()[0])) + : (n = !0), + n) + ) { + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(a); + else for (var r = a.length - 1; r >= 0; r--) e.addRoot(a[r], 0); + if ((e.pushUpdate(), i)) + try { + let e = p('DS/ENOChgProbes/scripts/ChgCloudProbeUtils'); + var s = t[0]; + e.cloudProbeUtils.sendChgObjectCreateTrackerEvent({ + createData: s, + View: 'Change Orchestration', + }); + } catch (e) { + console.log(e); + } + } else if (null == o.getChildren()) e.addRoot(a, 0); + else { + if ((o.prepareUpdate(), 0 == o.getChildren().length)) + o.addChild(a); + else for (r = a.length - 1; r >= 0; r--) o.addChild(a[r], 0); + o.pushUpdate(), o.isExpanded() || o.expand(); + } + }, + removeChildren: function () { + var e = this, + t = e.treeDocument.getSelectedNodes(); + if (t.length) { + let g = 'Change Order'; + var i, + n, + r = t[0].getParent().options.grid.id; + void 0 === r + ? ((i = e.contextID), (g = 'Change Request'), (n = !0)) + : ((i = r), (n = !1)); + var l = []; + l.push({ + id: t[0].options.grid.id, + type: t[0].options.grid.type, + }); + for (var c = 0; c < t.length; c++) + if ('ChangeAction' === t[c].options.grid.isKindOfType) { + if ( + (d.error(a.CHG_GOV_ChangeOrchestration_CA_Not_Removed), + o.getGlobalVariable().is3DSpace) + ) { + console.log('unmasking orchestratiom item 3dspace'); + let e = document.getElementById( + 'crOrchestrationFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('crChangeOrchestration'); + e && u.isMasked(e) && u.unmask(e); + } + return; + } + for (c = 1; c < t.length; c++) { + if (r !== t[c].getParent().options.grid.id) { + if ( + (d.error( + a.CHG_GOV_ChangeOrchestration_Toolbar_Invalid_Selection, + ), + o.getGlobalVariable().is3DSpace) + ) { + console.log('unmasking orchestratiom item 3dspace'); + let e = document.getElementById( + 'crOrchestrationFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('crChangeOrchestration'); + e && u.isMasked(e) && u.unmask(e); + } + return; + } + l.push({ + id: t[c].options.grid.id, + type: t[c].options.grid.type, + }); + } + s.removeInCRChangeOrchestration(i, g, l).then( + function (i) { + if (n) { + for (var r = 0; r < t.length; r++) + e.treeDocument.removeRoot(t[r]); + 0 == e.treeDocument.getChildren().length && + e.treeDocument._modelEvents.publish({ + event: 'treeEmpty', + }); + } else { + var s = t[0].getParent(); + s.prepareUpdate(); + for (r = 0; r < t.length; r++) s.removeChild(t[r]); + s.pushUpdate(); + } + if (o.getGlobalVariable().is3DSpace) { + console.log('unmasking orchestratiom item 3dspace'); + let e = document.getElementById( + 'crOrchestrationFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('crChangeOrchestration'); + e && u.isMasked(e) && u.unmask(e); + } + d.success( + a.CHG_GOV_ChangeOrchestration_Toolbar_Remove_Success, + ); + }, + function (e) { + if (o.getGlobalVariable().is3DSpace) { + console.log('unmasking orchestration item 3dspace'); + let e = document.getElementById( + 'crOrchestrationFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('crChangeOrchestration'); + e && u.isMasked(e) && u.unmask(e); + } + }, + ); + } else d.error(a.CHG_GOV_ChangeOrchestration_Remove_No_Objects); + }, + filterView: function (e, t) { + let i = t, + n = e.matchingIDs; + i.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: n, + }, + }, + }); + }, + enableColorizeView: function (e, t) { + let i = t.getAllDescendants(); + var n, o; + (n = e), + (o = function (e, t) { + i.map((i) => { + if (i.options.grid.id === t) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + i.updateOptions(n); + } + }); + }), + UWA.is(n, 'array') && + n.forEach(function (e) { + var t = e.color, + i = e.id; + o(t, i); + }); + }, + disableColorizeView: function (e, t) { + t.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return m; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/util/ChgCAAddMemberView', + [ + 'UWA/Class/View', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'UWA/Core', + 'DS/Handlebars/Handlebars4', + ], + function (e, t, i, n) { + return e.extend({ + name: 'chg-add-member', + tagName: 'div', + className: 'chg-add-member', + setup: function () { + (this.template = + '
\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
' + + t.CHG_Add_Member_Assignee + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
' + + t.CHG_Add_Member_Approver + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
' + + t.CHG_Add_Member_Follower + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t
'), + (this.renderer = this.getTemplate(this.template)); + }, + init: function (e) { + (e = i.clone(e || {}, !1)), this._parent.call(this, e); + }, + render: function () { + this.name, this.cid; + this.container.empty(), (containerReference = this.container); + var e = UWA.createElement('div', { + class: 'chg-member-view', + styles: { + height: '10%', + }, + }), + t = this.renderer(); + return e.addContent(t), e.inject(containerReference), this; + }, + injectSubView: function (e, t) { + var i = this.container.getElement(t); + e && i && i.grab(e.render().getContent()); + }, + getTemplate: function (e) { + var t = n.compile(e), + i = this; + return ( + (i.data = { + placeholder: i.options.placeholder, + }), + function () { + return t(i.data); + } + ); + }, + domEvents: { + 'click .assignee-field-search': function () { + this.dispatchEvent('searchAssignee', arguments); + }, + 'click .approver-field-search': function () { + this.dispatchEvent('searchApprover', arguments); + }, + 'click .informed-user-field-search': function () { + this.dispatchEvent('searchInformedUser', arguments); + }, + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/contributor/ChgCRContributorsDataGridViewToolbar', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + ], + function (e, t) { + var i = Object.create(null); + return ( + (i.toolbar = null), + (i.viewData = { + menu: [ + { + type: 'PushItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'PushItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (i.writetoolbarDefinition = function (i) { + var n = i.accessBits; + const o = 'true' == (n = t.processAccessBitIA(n)).AddAssignee, + a = 'true' == n.RemoveAssignee; + return { + entries: [ + { + id: 'addExisting', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'user-add', + fontIconFamily: 1, + }, + tooltip: e.CHG_Contributors_Toolbar_AddContributor, + position: 'far', + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/contributor/ChgCRContributorsDataGridLayout', + func: 'addExistingHandler', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_Contributors_Toolbar_RemoveContributor, + position: 'far', + visibleFlag: a, + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/contributor/ChgCRContributorsDataGridLayout', + func: 'removeHandler', + }, + }, + }, + ], + }; + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealizedChangesView', + [ + 'DS/ENOChangeActionUX/scripts/Views/CARealizedView', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/PlatformAPI/PlatformAPI', + ], + function (e, t, i, n, o) { + 'use strict'; + return { + createRealizedChangesView: function (n) { + var a = {}; + (a = UWA.merge(a, n)), + (this._modelEvents = a.contextDetails._modelEvents), + (this.id = a.id); + var r = 'pid:' + a.id; + let s = a.contextDetails.title; + var l = ''; + a.targetclassName = a.target.className; + let c = { + caModel: { + id: r, + name: a.contextDetails.name, + title: s, + description: a.contextDetails.description, + severity: a.contextDetails.severity, + maturity: a.contextDetails.maturity, + invokedFrom: 'gov', + isSelected: a.isSelected, + }, + init_options: a, + }, + d = a.target, + u = new (new e(c).buildRealizedView())(); + (u.container = d), + t.getChangeActionUserAccess(a.id).then(function (e) { + (l = e.data[0]), + (l = i.processAccessBitCA(l)), + (u.model = { + id: r, + name: a.contextDetails.name, + title: s, + description: a.contextDetails.description, + severity: a.contextDetails.severity, + maturity: a.contextDetails.maturity, + invokedFrom: 'gov', + isSelected: a.isSelected, + get: function (e) { + return 'userAccess' == e + ? l + : 'id' == e + ? r + : 'synopsis' === e + ? s + : void 0; + }, + fetch: function (e) { + console.log('dummy fetch called...!'), + e.onComplete(), + o.publish('load-dependency' + widget.id, r); + }, + }), + d.addContent(u.render()); + }); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/facets/changeAction/ChgChangeActionDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/UIKIT/Mask', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u) { + 'use strict'; + let g = e.extend({ + init: function (e) { + this.parentCRId = e; + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new t({ + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + let t = e.getChildren(); + for (let e = 0; e < t.length; e++) + if (this.options.grid.id == t[e].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + loadCAData: function (e, t) { + e.prepareUpdate(); + let i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + let n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = this.createCustomOwnerField(e); + e.chgObjOwner = t; + let n = e.name + ' | ' + e.ownerFullName; + '' == e.maturityNLS && (e.maturityNLS = e.stateNLS); + let o = e.maturityNLS; + var a = this.getCustomTooltip(e); + return new i({ + label: e.title, + subLabel: n, + description: o, + grid: e, + customTooltip: a, + icons: [e.iconURL], + thumbnail: e.thumbnail, + contextualMenu: ['Copy1', 'Move1'], + useAsyncPreExpand: !0, + }); + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + addNewChildren: function (e) { + if ('Change Action' == e.type) { + var t = document.getElementById('outer-CA-grid-div'); + 'undefined' != t && null != t && u.mask(t), + s.getNewCADetails(e.objectID).then( + function (e) { + var i = l.processChangeActionInContext(e).processData; + console.log(i), + c.getUserFullName(i[0].owner).then(function (e) { + (i[0].ownerFullName = + e.userDisplayName.userInfo[i[0].owner].userDisplayName), + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgChangeActionDataGridLayout', + ], function (e) { + e.addNodesInLayout(i), u.unmask(t); + }); + }); + }, + function (e) { + u.unmask(t); + }, + ); + } + }, + removeExistingChildren: function (e) {}, + addNodesInLayoutModel: function (e, t) { + let i = g.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else for (let t = i.length - 1; t >= 0; t--) e.addRoot(i[t], 0); + e.pushUpdate(); + }, + }); + return g; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/propertiesView/ChgPropertiesPanelTab', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/EditPropWidget/constants/EditPropConstants', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/PlatformAPI/PlatformAPI', + ], + function (e, t, i, n, o, a) { + 'use strict'; + return { + hideFacet: function (e) { + for (var i = 0; i < e.elements.container._lFacets.length; i++) { + var n = e.elements.container._lFacets[i]; + n.facet.name != t.FACET_PROPERTIES && (n.alwaysVisible = !1); + } + }, + addAllFacet: function (i, n) { + var o = []; + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/facets/applicability/ChgApplicabilityfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'Applicability', + icon: 'evolution-effectivity', + text: e.CHG_GOV_Header_Applicability, + }, + options: {}, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/facets/dependency/ChgDependencyfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'Dependency', + icon: 'dependencies', + text: e.CHG_GOV_Header_Dependency, + }, + options: {}, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/ChgRelatedScopefacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'CO_RelatedScope', + icon: 'object-related-cog', + text: e.CHG_GOV_Header_RelatedScope, + }, + options: { + data: n, + }, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/facets/issue/ChgIssuefacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'Issue', + icon: 'issue', + text: e.CHG_GOV_Header_Issue, + }, + options: { + data: n, + }, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/relatedScope/ChgCRRelatedScopefacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'CR_RelatedScope', + icon: 'object-related-cog', + text: e.CHG_GOV_Header_RelatedScope, + }, + options: { + data: n, + }, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/facets/decision/ChgDecisionfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'Decision', + icon: 'text-quote', + text: e.CHG_GOV_Header_Decision, + }, + options: {}, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgImpactBasisfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'IA_ImpactBasis', + icon: 'change-request-alert', + text: e.CHG_GOV_DataGrid_Column_ImpactBasis, + }, + options: { + data: n, + }, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgImpactedItemfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'IA_ImpactItem', + icon: 'change-request-impacted-items', + text: e.CHG_GOV_DataGrid_Column_ImpactedItem, + }, + options: { + data: n, + }, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgChangeActionfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'IA_ChangeAction', + icon: 'change-action', + text: e.CHG_GOV_DataGrid_Column_IA_CA, + }, + options: { + data: n, + }, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/contributor/ChgContributorfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'IA_Assignee', + icon: 'users', + text: e.CHG_GOV_DataGrid_Column_Contributors, + }, + options: { + data: n, + }, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/context/ChgCAcontextfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'CA_Context', + icon: '3d-object', + text: e.CHG_GOV_Header_Contexts, + }, + options: {}, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/facets/attachment/ChgAttachmentfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'Attachment', + icon: 'attach', + text: e.CHG_GOV_Header_Attachments, + }, + options: {}, + }), + o.push({ + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/flowdown/ChgCAFlowdownfacet', + alwaysVisible: !1, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'CA_Flowdown', + icon: 'flow-down', + text: e.CHG_GOV_Header_Flowdown, + }, + options: {}, + }), + i.addFacets(o); + require(['DS/ENORIPE_Relations/RelationsTabSettings'], function (e) { + o.push(t.FACET_RELATIONS), + o.push(t.FACET_SWYMCOMMENTS), + i.addFacets(o), + n && + n[0] && + n[0].isViaHeader && + e.setProfile('Change_Traceability'); + }, function (e) { + console.warn('Cannot load ' + e.requireModules), + o.push(t.FACET_SWYMCOMMENTS), + i.addFacets(o); + }); + }, + getUpdateIMpactAnalysisFacet: function (e) { + var t = this; + return new Promise(function (r, s) { + 1 == e.length + ? n + .getImpactAnalysisUserAccess(e[0].physicalId) + .then(function (t) { + var n = t.data[0].dataelements; + (n = o.processAccessBitIA(n)), (e[0].accessBits = n); + var s = { + id: t.data[0].id, + type: t.data[0].type, + accessBits: n, + }; + (i.getGlobalVariable().IAAccessBitsData = { + widgetID: widget.id, + iaID: t.data[0].id, + type: t.data[0].type, + accessBits: n, + }), + a.publish( + 'CR-ImpactAnalysis-AccessBit-Update-On-Properties-Load', + s, + ), + r(s); + }) + : r(t.getImpactAnalysisFacets(e)); + }); + }, + getImpactAnalysisFacets: function (t) { + return [ + { + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgImpactBasisfacet', + alwaysVisible: !0, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'IA_ImpactBasis', + icon: 'change-request-alert', + text: e.CHG_GOV_DataGrid_Column_ImpactBasis, + }, + options: { + data: t, + }, + actions: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgImpactBasisfacet', + func: 'onTabClickAction', + }, + }, + { + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgImpactedItemfacet', + alwaysVisible: !0, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'IA_ImpactItem', + icon: 'change-request-impacted-items', + text: e.CHG_GOV_DataGrid_Column_ImpactedItem, + }, + options: { + data: t, + }, + }, + { + require: + 'DS/ENOChgGovernanceUX/scripts/view/facets/attachment/ChgAttachmentfacet', + alwaysVisible: !0, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'Attachment', + icon: 'attach', + text: e.CHG_GOV_Header_Attachments, + }, + options: {}, + }, + { + require: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/contributor/ChgContributorfacet', + alwaysVisible: !0, + visible: !0, + services: ['3DSpace'], + inheritance: !0, + content: null, + facet: { + name: 'IA_Assignee', + icon: 'users', + text: e.CHG_GOV_DataGrid_Column_Contributors, + }, + options: { + data: t, + }, + }, + ]; + }, + updateFacetOnSelection: function (e, t, i) { + 'ChangeOrder' == e && this.getChangeOrderTab(t, i), + 'ChangeAction' == e && this.getChangeActionTab(t, i), + 'ChangeRequest' == e && this.getChangeRequestTab(t, i), + 'ChangeAnalysis' == e && this.getImpactAnalysisTab(t, i), + null == e && this.hideFacet(i); + }, + getChangeRequestTab: function (e, t) { + if (e.length > 1) this.hideFacet(t); + else + for (var i = 0; i < t.elements.container._lFacets.length; i++) { + var n = t.elements.container._lFacets[i]; + 'Attachment' == n.facet.name && (n.alwaysVisible = !0), + 'CR_RelatedScope' == n.facet.name && (n.alwaysVisible = !0), + 'Issue' == n.facet.name && (n.alwaysVisible = !0), + 'Decision' == n.facet.name && (n.alwaysVisible = !0), + 'Applicability' == n.facet.name && (n.alwaysVisible = !0); + } + }, + getChangeOrderTab: function (e, t) { + if (e.length > 1) this.hideFacet(t); + else + for (var i = 0; i < t.elements.container._lFacets.length; i++) { + var n = t.elements.container._lFacets[i]; + 'Dependency' == n.facet.name && (n.alwaysVisible = !0), + 'Applicability' == n.facet.name && (n.alwaysVisible = !0), + 'Attachment' == n.facet.name && (n.alwaysVisible = !0), + 'CO_RelatedScope' == n.facet.name && (n.alwaysVisible = !0), + 'Issue' == n.facet.name && (n.alwaysVisible = !0), + 'Decision' == n.facet.name && (n.alwaysVisible = !0); + } + }, + getChangeActionTab: function (e, t) { + if (e.length > 1) this.hideFacet(t); + else + for (var i = 0; i < t.elements.container._lFacets.length; i++) { + var n = t.elements.container._lFacets[i]; + 'Dependency' == n.facet.name && (n.alwaysVisible = !0), + 'Applicability' == n.facet.name && (n.alwaysVisible = !0), + 'Attachment' == n.facet.name && (n.alwaysVisible = !0), + 'CA_Context' == n.facet.name && (n.alwaysVisible = !0), + 'CA_Flowdown' == n.facet.name && (n.alwaysVisible = !0), + 'Issue' == n.facet.name && (n.alwaysVisible = !0), + 'Decision' == n.facet.name && (n.alwaysVisible = !0); + } + }, + getImpactAnalysisTab: function (e, t) { + if (e.length > 1) this.hideFacet(t); + else + for (var i = 0; i < t.elements.container._lFacets.length; i++) { + var n = t.elements.container._lFacets[i]; + 'IA_ImpactBasis' == n.facet.name && (n.alwaysVisible = !0), + 'IA_ImpactItem' == n.facet.name && (n.alwaysVisible = !0), + 'IA_Assignee' == n.facet.name && (n.alwaysVisible = !0), + 'IA_ChangeAction' == n.facet.name && (n.alwaysVisible = !0), + 'Attachment' == n.facet.name && (n.alwaysVisible = !0); + } + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceSlideIn', + ['UWA/Class/View', 'UWA/Core'], + function (e, t) { + 'use strict'; + return e.extend({ + init: function (e, t, i) { + (this.slideinContainer = e), + (this.parentContainer = t), + (this.content = i), + this._parent.call(this); + }, + setup: function () { + this.layoutResizer = new UWA.createElement('div', { + id: 'layout-resizer-div', + class: 'layout-resizer', + }); + }, + render: function () { + return this; + }, + buildSlideIn: function () { + const e = UWA.createElement('div', { + id: 'slideInContent', + }); + this.getHeaderCommand().inject(e), + this.getBody().inject(e), + e.inject(this.slideinContainer), + e.set({ + events: { + touchmove: function (e) { + e.stopPropagation(); + }, + }, + }), + (this._handlerKeyUp = function (e) { + 27 == e.which && that.hideSlideIn(); + }), + UWA.extendElement(document).addEvent('keyup', this._handlerKeyUp); + }, + getHeaderCommand: function () { + const e = UWA.createElement('div', { + id: 'slideInHeaderCommand', + styles: { + padding: '2px 14px', + position: 'absolute', + 'z-index': '1', + right: '0px', + }, + }); + return ( + UWA.createElement('span', { + class: 'close fonticon fonticon-cancel cursorPointer', + title: 'Close', + }) + .inject(e) + .addEvent('click', this.onCloseButtonClick.bind(this)), + e + ); + }, + onCloseButtonClick: function () { + this.hideSlideIn(); + }, + getBody: function () { + const e = UWA.createElement('div', { + id: 'slideInBody', + }); + return ( + 'string' == typeof this.content + ? (e.innerHTML = this.content) + : this.content instanceof HTMLElement + ? e.appendChild(this.content) + : void 0 !== this.content.render && + this.content.render().inject(e), + e + ); + }, + showSlideIn: function () { + if (UWA.is(this.slideinContainer)) { + this.resizerContainer && + (this.resizerContainer.style.display = 'block'), + window.matchMedia('(max-width: 768px)').matches + ? ((this.slideinContainer.style.width = '100%'), + this.resizerContainer && + (this.resizerContainer.style.right = '100%')) + : ((this.slideinContainer.style.width = '600px'), + this.resizerContainer && + (this.resizerContainer.style.right = '600px'), + (this.slideinContainer.style.minWidth = '250px'), + (this.slideinContainer.style.borderLeftWidth = '1px')); + } + }, + hideSlideIn: function () { + if (UWA.is(this.slideinContainer)) { + (this.slideinContainer.style.width = '0'), + (this.slideinContainer.style.minWidth = '0'), + this.resizerContainer && + ((this.resizerContainer.style.right = '0px'), + (this.resizerContainer.style.display = 'none')), + (this.slideinContainer.style.borderLeftWidth = '0'); + this.parentContainer.setStyle('width', 'calc( 100% - 0px )'), + this.destroy(); + } + }, + destroy: function () {}, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/context/ChgCAcontextViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + let t = Object.create(null); + return ( + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + className: 'info-active', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/context/ChgCAcontextDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/context/ChgCAcontextTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function () { + return { + entries: [ + { + id: 'add', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_Toolbar_AddContexts, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/context/ChgCAcontextDataGridLayout', + func: 'addExistingHandler', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_Toolbar_RemoveContexts, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/context/ChgCAcontextDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridViewToolbar', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t) { + let i = Object.create(null); + return ( + (i.toolbar = null), + (i.sortingData = { + menu: [ + { + type: 'PushItem', + title: e.CHG_GOV_DataGrid_Column_Severity, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-alpha-sorting-a-z', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridLayout', + func: 'sortBySeverity', + }, + }, + { + type: 'PushItem', + title: e.CHG_GOV_DataGrid_Column_Maturity, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-alpha-sorting-a-z', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridLayout', + func: 'sortByMaturity', + }, + }, + ], + }), + (i.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCATileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (i.filterData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_Filter_ActiveCA, + state: 'selected', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridLayout', + func: 'filterView', + argument: { + filter: 'activeCA', + }, + }, + tooltip: e.CHG_Filter_ActiveCA_Def, + }, + { + type: 'CheckItem', + title: e.CHG_Filter_InactiveCA, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridLayout', + func: 'filterView', + argument: { + filter: 'inactiveCA', + }, + }, + tooltip: e.CHG_Filter_InactiveCA_Def, + }, + ], + }), + (i.writetoolbarDefination = function () { + let i = { + entries: [ + { + id: 'filter', + className: 'menuCA', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'list-filter', + fontIconFamily: 1, + }, + value: this.filterData, + }, + position: 'far', + tooltip: e.CHG_Toolbar_FilterBy, + category: 'View', + }, + { + id: 'view', + className: 'menuCA', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + { + id: 'sorting', + className: 'menuCA', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'sorting', + fontIconFamily: 1, + }, + value: this.sortingData, + }, + position: 'far', + tooltip: e.CHG_TOOLTIP_SORT, + category: 'View', + }, + ], + }; + var n = { + id: 'creategroup', + className: 'menuCA', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'group-add', + fontIconFamily: 1, + }, + position: 'far', + tooltip: e.CHG_TOOLTIP_CREATE_GROUP, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridLayout', + func: 'assignGroupToCAs', + }, + }, + category: 'View', + }; + let o = 'true'; + return ( + 'false' == t.getGlobalVariable().isFullLicence && (o = 'false'), + 'true' === t.getGlobalVariable().CHG_CHANGE_GROUP && + 'true' == o && + i.entries.unshift(n), + i + ); + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/facets/affectedItems/ChgCRAffectedItemsDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/UIKIT/Mask', + 'DS/TreeModel/BaseFilter', + 'require', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p) { + 'use strict'; + var h = g.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }), + m = e.extend({ + init: function (e, t) { + (this.contextID = e), (this.contextDetails = t); + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + var e = new t({ + id: 'craffectedItems', + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + for (var t = e.getChildren(), i = 0; i < t.length; i++) + if (this.options.grid.id == t[i].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument + .getFilterManager() + .registerFilter('stringRole', h); + }, + loadAffectedItemsData: function (e, t) { + e.prepareUpdate(); + var i = this.createTreeDocumentNodeModel(t); + if ( + (e.addRoot(i), e.pushUpdate(), o.getGlobalVariable().is3DSpace) + ) { + console.log('unmasking affected item 3dspace'); + let e = document.getElementById( + 'crAffectedItemsFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('crAffectedItems'); + e && u.isMasked(e) && u.unmask(e); + } + }, + createTreeDocumentNodeModel: function (e) { + for (var t = [], i = 0; i < e.length; i++) { + var n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = e.name + ' | ' + e.typeNLS; + var n, + a = e.maturityNLS, + r = this.getCustomTooltip(e); + return ( + (n = o.getGlobalVariable().is3DSpace + ? '' + + UWA.String.escapeHTML(e.title) + + '' + : e.title), + new i({ + label: n, + subLabel: t, + description: a, + grid: e, + icons: [e.icon], + thumbnail: e.thumbnail, + customTooltip: r, + contextualMenu: ['dummy placeholder'], + }) + ); + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + addExistingChildren: function (e) { + var t = this, + i = this.contextID, + n = document.getElementById('outer-affectedItems-grid-div'); + 'undefined' != n && null != n && u.mask(n), + s.addExistingInCRAffectedItems(i, e).then( + function (e) { + var i = l.processCRAffectedItems(e); + m.prototype.addNodesInLayoutModel(t.treeDocument, i), + u.unmask(n); + }, + function (e) { + u.unmask(n); + }, + ); + }, + addNodesInLayoutModel: function (e, t) { + 0 == e.getChildren().length && + e._modelEvents.publish({ + event: 'treeNotEmpty', + }); + var i = m.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else for (var n = i.length - 1; n >= 0; n--) e.addRoot(i[n], 0); + e.pushUpdate(); + }, + removeChildren: function () { + var e = this, + t = this.treeDocument.getSelectedNodes(); + if (t.length) { + for (var i = [], n = 0; n < t.length; n++) + i.push({ + id: t[n].options.grid.id, + updateAction: 'DISCONNECT', + }); + var r = this.contextID; + s.removeCRAffectedItems(r, i).then( + function (i) { + for (var n = 0; n < t.length; n++) + e.treeDocument.removeRoot(t[n]); + if (o.getGlobalVariable().is3DSpace) { + console.log('unmasking affected item 3dspace'); + let e = document.getElementById( + 'crAffectedItemsFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('crAffectedItems'); + e && u.isMasked(e) && u.unmask(e); + } + 0 == e.treeDocument.getChildren().length && + e.treeDocument._modelEvents.publish({ + event: 'treeEmpty', + }), + d.success(a.CHG_GOV_AffectedItems_Remove); + }, + function (e) { + if (o.getGlobalVariable().is3DSpace) { + console.log('unmasking affected item 3dspace'); + let e = document.getElementById( + 'crAffectedItemsFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('crAffectedItems'); + e && u.isMasked(e) && u.unmask(e); + } + }, + ); + } else d.error(a.CHG_GOV_ChangeOrchestration_Remove_No_Objects); + }, + filterView: function (e) { + let t = this.treeDocument, + i = e.matchingIDs; + t.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: i, + }, + }, + }); + }, + enableColorizeView: function (e) { + let t = this.treeDocument.getAllDescendants(); + var i, n; + (i = e), + (n = function (e, i) { + t.map((t) => { + if (t.options.grid.id === i) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + t.updateOptions(n); + } + }); + }), + UWA.is(i, 'array') && + i.forEach(function (e) { + var t = e.color, + i = e.id; + n(t, i); + }); + }, + disableColorizeView: function () { + this.treeDocument.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return m; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/recents/util/ChgGovRecentsCustomFields', + [ + 'UWA/Core', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + ], + function (e, t, i, n) { + 'use strict'; + return { + createCustomNameField: function (t) { + var n = new e.Element('div', {}); + e.createElement('span', { + html: t.name, + }).inject(n); + var o = new e.Element('div', { + class: 'iconsDiv', + }); + if ('true' == t.onHold) { + var a = new e.Element('div', { + class: 'gridIconContainer', + title: i.CHG_GOV_TOOLTIP_HOLD, + }); + e + .createElement('div', { + class: 'fonticon fonticon-pause', + }) + .inject(a), + a.inject(o); + } + return o.inject(n), n.outerHTML; + }, + createCustomSeverity: function (t) { + var i = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == t.severity + ? (i = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == t.severity && + (i = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + var n = new e.Element('div', {}), + o = new e.Element('div', { + class: 'gridIconContainer', + }); + e.createElement('div', { + class: i, + }).inject(o); + var a = e.createElement('span', { + html: t.severityNLS, + }); + return o.inject(n), a.inject(n), n.outerHTML; + }, + createCustomChangeCoordinatorField: function (i) { + var o = new e.Element('div', { + class: 'members', + }); + if ('' != i.changeCoordinatorFullName) { + var a = new e.Element('div', { + class: 'assignee', + }), + r = + '/api/user/getpicture/login/' + + i.changeCoordinator + + '/format/normal', + s = t.getGlobalVariable().computeSwymUrl(r), + l = ''; + if (t.getGlobalVariable().isSwymInstalled) + l = e.createElement('img', { + class: 'userIcon', + src: s, + }); + else { + var c = n.getAvatarDetails(i.changeCoordinatorFullName); + (l = e.createElement('div', { + html: c.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', c.avatarColor); + } + l.inject(a); + var d = e.createElement('span', { + class: 'userName', + html: i.changeCoordinatorFullName, + }); + a.inject(o), d.inject(o); + } + return o.outerHTML; + }, + createCustomOwnerField: function (i) { + var o = '/api/user/getpicture/login/' + i.owner + '/format/normal', + a = t.getGlobalVariable().computeSwymUrl(o), + r = new e.Element('div', { + class: 'members', + }), + s = new e.Element('div', { + class: 'assignee', + }), + l = ''; + if (t.getGlobalVariable().isSwymInstalled) + l = e.createElement('img', { + class: 'userIcon', + src: a, + }); + else { + var c = n.getAvatarDetails(i.ownerFullName); + (l = e.createElement('div', { + html: c.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', c.avatarColor); + } + l.inject(s); + var d = e.createElement('span', { + class: 'userName', + html: i.ownerFullName, + }); + return s.inject(r), d.inject(r), r.outerHTML; + }, + getStatusBarIcons: function (e) { + var t = []; + return ( + 'Low' == e.severity + ? t.push('level-low') + : 'Medium' == e.severity + ? t.push('level-medium') + : 'High' == e.severity && t.push('level-high'), + 'true' == e.onHold && t.push('pause'), + t + ); + }, + statusbarIconsTooltips: function (e) { + var t = []; + return ( + t.push(e.severityNLS), + 'true' == e.onHold && t.push(i.CHG_GOV_TOOLTIP_HOLD), + t + ); + }, + getCustomTooltip: function (e) { + return ( + i.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + i.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + i.CHG_GOV_DataGrid_Column_Severity + + ': ' + + e.severityNLS + + '\n' + + i.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + i.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/config/ChgGovAppGlobalConfig', + [], + function () { + 'use strict'; + var e = { + LEFT_PANEL_SIZE_EXPANDED: 300, + LEFT_PANEL_SIZE_COLLAPSED: 40, + MOBILE_CUTOFF: 500, + TABLET_CUTOFF: 768, + MOBILE_BREAKPOINT: 500, + PATH_HOME: '/home', + PATH_LANDING_PAGE: 'LandingPage', + PATH_CO_INFO: 'COInfo', + PATH_CO_DETAILS: 'CODetails', + PATH_CA_INFO: 'CAInfo', + PATH_CA_DETAILS: 'CADetails', + PATH_CR_INFO: 'CRInfo', + PATH_CR_DETAILS: 'CRDetails', + PATH_CR_ORCHESTRATION_LEVEL1: 'CROrchestrationL1', + PATH_CR_ORCHESTRATION_LEVEL2: 'CROrchestrationL2', + PATH_CR_ORCHESTRATION_LEVEL3: 'CROrchestrationL3', + PATH_CO_ORCHESTRATION_LEVEL1: 'COOrchestrationL1', + PATH_CO_ORCHESTRATION_LEVEL2: 'COOrchestrationL2', + PATH_CO_ORCHESTRATION_LEVEL3: 'COOrchestrationL3', + PATH_NEW_CHANGE_ORDER: 'NewChangeOrder', + PATH_NEW_CHANGE_REQUEST: 'NewChangeRequest', + PATH_NEW_CHANGE_ACTION: 'NewChangeAction', + PATH_OPEN_CHANGE_ORDER: 'OpenChangeOrder', + PATH_OPEN_CHANGE_REQUEST: 'OpenChangeRequest', + PATH_RECENTY_OPENED: 'RecentlyOpened', + PATH_MY_CHANGE_ORDERS: 'MyChangeOrders', + PATH_MY_CHANGE_REQUESTS: 'MyChangeRequests', + PATH_MY_CHANGE_ACTIONS: 'MyChangeActions', + PATH_CO_IDCard: 'Change Order ID Card', + ROUTE_HOME: 'home', + ROUTE_LANDING_PAGE: 'home.LandingPage', + ROUTE_CO_INFO: 'home.COInfo', + ROUTE_CR_INFO: 'home.CRInfo', + ROUTE_CA_INFO: 'home.CAInfo', + ROUTE_CO_DETAILS: 'home.COInfo.CODetails', + ROUTE_CR_DETAILS: 'home.CRInfo.CRDetails', + ROUTE_CA_DETAILS: 'home.CAInfo.CADetails', + ROUTE_CR_ORCHESTRATION_LEVEL1: 'home.CRInfo.CRDetails.OrchestrationL1', + ROUTE_CR_ORCHESTRATION_LEVEL2: + 'home.CRInfo.CRDetails.OrchestrationL1.OrchestrationL2', + ROUTE_CR_ORCHESTRATION_LEVEL3: + 'home.CRInfo.CRDetails.OrchestrationL1.OrchestrationL2.OrchestrationL3', + ROUTE_CO_ORCHESTRATION_LEVEL1: 'home.COInfo.CODetails.OrchestrationL1', + ROUTE_CO_ORCHESTRATION_LEVEL2: + 'home.COInfo.CODetails.OrchestrationL1.OrchestrationL2', + ROUTE_CO_ORCHESTRATION_LEVEL3: + 'home.COInfo.CODetails.OrchestrationL1.OrchestrationL2.OrchestrationL3', + ROUTE_RECENTY_OPENED: 'home.RecentlyOpened', + ROUTE_MY_CHANGE_ORDERS: 'home.MyChangeOrders', + ROUTE_MY_CHANGE_REQUESTS: 'home.MyChangeRequests', + ROUTE_MY_CHANGE_ACTIONS: 'home.MyChangeActions', + }; + return e; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersDataGridViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + var t = Object.create(null); + return ( + (t.toolbar = null), + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function () { + return { + entries: [ + { + id: 'add', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'user-add', + fontIconFamily: 1, + }, + tooltip: e.CHG_Member_Toolbar_AddMember, + position: 'far', + category: 'addRemove', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgAddMemberLayout', + func: 'launchAddMemberPanel', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_Member_Toolbar_Remove, + position: 'far', + disabled: !0, + category: 'addRemove', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'filter', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'filter', + fontIconFamily: 1, + }, + tooltip: e.CHG_Member_Toolbar_Filter, + position: 'far', + category: 'View', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMemberFilterLayout', + func: 'launchFilterMemberPanel', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovBIFilter', + [ + 'UWA/Class', + 'UWA/Class/Promise', + 'UWA/Core', + 'DS/PlatformAPI/PlatformAPI', + ], + function (e, t, i, n) { + 'use strict'; + return { + _initializationPromiseBIFilter: null, + _isBIFilterInitialized: !1, + _biFilter: null, + _currentView: '', + _inputDocument: null, + _isBIFilterActivated: !1, + initializeBIFilter: function (e) { + (this._inputDocument = e), + this._cleanBIFilterProxy(), + (this._initializationPromiseBIFilter = this._createBIFilterProxy()), + (this._isBIFilterActivated = !0); + }, + cleanPathTag: function () { + if (!0 === this._isBIFilterInitialized) { + this._biFilter.setPathTags({ + nodes: [], + paths: [], + }); + } + }, + _createBIFilterProxy: function () { + var e = this; + return new t(function (t, i) { + require([ + 'DS/ENOFilterBIUX/FilterBIComponentProxy', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], function (n, o) { + var a = widget.id, + r = { + tenant: o.getGlobalVariable().tenant, + processingMode: 'appProcessing', + colorize: !0, + widgetId: a, + appId: widget.getValue('appId'), + isWebInWin: o.getGlobalVariable().isNative, + platformServices: o.getGlobalVariable().tenantMappings, + }; + 1 == o.getGlobalVariable().is3DSpace && + (r.contextId = 'context1'); + try { + (e._biFilter = new n(r)), + e._biFilter.addEvent( + 'fetchFilterBIColorizeEvent', + e._onFilterBIColorize, + e, + ), + e._biFilter.addEvent( + 'FilterBIUnColorize', + e._onFilterBIUnColorize, + e, + ), + e._biFilter.addEvent( + 'fetchFilterBIFilteringEvent', + e._onFilterBIFilteringEvent, + e, + ); + } catch (e) { + i( + new Error( + 'The BIFilter proxy could not be initialized: ' + e, + ), + ); + } + (e._isBIFilterInitialized = !0), t(); + }); + }); + }, + focusOnSubjects: function (e) { + var t = this._biFilter; + if (t && t._biFilter) { + if (0 === e.length) return void t._biFilter.unfocus(); + for (var i = {}, n = [], o = 0; o < e.length; o++) + (i[e[o].options.physicalId] = '3DSpace'), + n.push('pid://' + e[o].options.physicalId); + t._biFilter.myTagProxy.focusOnSubjects(n, !0, i); + } + }, + _onSetPathTags: function (e, t) { + var i; + if ( + (((i = this)._inputDocument = t), + !1 !== (i = this)._isBIFilterInitialized) + ) { + var n = { + nodes: [], + paths: [], + }; + if (e && e.data) + e.data.roots.map((e) => { + let t = e.options.grid.id; + n.nodes.push(t); + }); + i._biFilter.setTagsWithFetchSynthesis(n.nodes, function () { + widget.dispatchEvent('onSetPathTags'); + }); + } else + i._initializationPromiseBIFilter.then(function () { + i._onSetPathTags(e, t); + }); + }, + _onSetPathTagsForProposedRealized: function (e, t) { + var i; + ((i = this)._inputDocument = t), + !1 !== (i = this)._isBIFilterInitialized + ? i._biFilter.setTagsWithFetchSynthesis(e, function () { + widget.dispatchEvent('onSetPathTags'); + }) + : i._initializationPromiseBIFilter.then(function () { + i._biFilter.setTagsWithFetchSynthesis(e, function () { + widget.dispatchEvent('onSetPathTags'); + }); + }); + }, + _cleanBIFilterProxy: function () { + this._biFilter && + this._biFilter.cleanProxy && + this._biFilter.cleanProxy(); + }, + _activate: function () { + this._biFilter && + this._biFilter.cleanProxy && + this._biFilter.activate(); + }, + _deactivate: function () { + this._biFilter && + this._biFilter.cleanProxy && + this._biFilter.deactivate(); + }, + _taggerWebInWinEvent: function (e) { + this._biFilter && + this._biFilter.taggerWebInWinEvent && + this._biFilter.taggerWebInWinEvent(e); + }, + _onFilterBIFilteringEvent: function (e) { + n.publish(`${this._inputDocument.options.id} of ${widget.id}`, e), + e && + i.is(e.localfilters, 'object') && + Object.keys(e.localfilters).length > 0 + ? widget.setValue('pathTags', e.localfilters) + : widget.deleteValue('pathTags'); + }, + _onFilterBIColorize: function (e, t, i) { + n.publish( + `${this._inputDocument.options.id} colorize ${widget.id}`, + e, + ); + }, + _onFilterBIUnColorize: function (e) { + n.publish( + `${this._inputDocument.options.id} uncolorize ${widget.id}`, + e, + ); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/applicability/ChgApplicabilityfacet', + [ + 'UWA/Core', + 'DS/EditPropWidget/facets/Common/FacetsBase', + 'DS/EditPropWidget/constants/EditPropConstants', + 'UWA/Class/Model', + 'DS/UIKIT/Mask', + 'css!DS/ENOChgGovernanceUX/ENOChgGovernanceUX', + ], + function (e, t, i, n, o, a) { + 'use strict'; + return t.extend({ + init: function () { + this._parent.apply(this, arguments), + this.elements.container || + (this.elements.container = e.createElement('div', { + id: 'applicability-container', + })); + }, + updateFacet: function () { + var e = this; + o.mask(this.elements.container), + require([ + 'DS/ENOChgGovernanceUX/scripts/components/applicabilityView/ChgApplicabilityView', + ], function (t) { + if (e.elements && e.elements.container) { + var i = e.getModel(); + if (!i) return !1; + if (1 == i.isMergedModel()) return; + var n = { + model: i, + container: e.elements.container, + }; + e.elements.container.setContent(''), + new t(n).build(), + o.unmask(e.elements.container); + } + }); + }, + destroyComponent: function () { + e.is(this.destroy, 'function') && this.destroy(); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovCRTagNavigatorProxy', + [ + 'DS/TagNavigatorProxy/TagNavigatorProxy', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t) { + 'use strict'; + var i = null, + n = null, + o = [], + a = { + init: function (o) { + var r = { + widgetId: widget.id, + filteringMode: 'FilteringOnServer', + colorize: !0, + }; + i && i.die(), + (n = o.DataContext), + (i = e.createProxy(r)).addOpenTaggerListener(function () { + require([ + 'DS/Notifications/NotificationsManagerUXMessages', + 'DS/Notifications/NotificationsManagerViewOnScreen', + 'i18n!DS/ENOChgActionGridUX/assets/nls/ENOChgActionDataGridNLS', + ], function (e, t, i) { + var n = { + level: 'info', + title: i.WARNING_TAGGER_INFO, + subtitle: i.WARNING_TAGGER, + sticky: !1, + }; + (window.notif = e), + t.removeLastNotificationDisplayed(), + t.setNotificationManager(window.notif), + t.setFadeOutPolicy(2), + t.setStackingPolicy(1), + t.setRemoveStackOnFirstTimeoutFlag(!0), + null != t._notifScreen && + t._notifScreen.addClassName('ca-align-center'), + e.addNotif(n); + }); + }), + i.addEvent('onFilterChange', function (e) { + var o = i.getCurrentFilter(); + n.ChgCRlayoutModel.empty(), + Object.keys(o.allfilters).length > 0 + ? ((t.getGlobalVariable().indexCRMode = 'true'), + n.refreshGrid(e, o)) + : ((t.getGlobalVariable().indexCRMode = 'true'), + n.refreshGrid(e, o), + (t.getGlobalVariable().indexCRMode = 'false'), + n.refreshGrid(e, o)); + }), + i.addEvent('colorize', function (e) { + var t = e.tagColors; + a._colorize(t); + }), + i.addEvent('unColorize', function (e) { + a._uncolorize(); + }); + }, + setTags: function (e, t) { + if (i && t) { + var n = a.getTagsList(t); + t.forEach(function (e) { + if (-1 != n.indexOf(e.sixw)) { + for (var t = !1, i = 0; i < o.length; i++) + if (o[i].sixw == e.sixw && o[i].object == e.object) { + (o[i] = e), (t = !0); + break; + } + t || o.push(e); + } + }); + } + i.setTags(e, o); + }, + deactivate: function () { + i && i.deactivate(); + }, + activate: function () { + i && i.activate(); + }, + clearLocalFilter: function () { + i && i.clearLocalFilter(); + }, + getTaglistData: function () { + return [ + { + sixw: 'ds6w:what/ds6w:status', + modelField: 'maturity', + compareType: 'AcontainsB', + }, + { + sixw: 'ds6w:why/ds6w:fulfills/ds6w:severity', + modelField: 'severity', + compareType: 'String', + }, + { + sixw: 'ds6w:who/ds6w:responsible', + modelField: 'responsible', + compareType: 'String', + }, + { + sixw: 'ds6w:when/ds6w:ends/ds6w:dueDate', + modelField: 'dueDate', + compareType: 'date', + }, + ]; + }, + getTagsList: function (e) { + var t = []; + return ( + e && + e.forEach(function (e) { + t.push(e.sixw); + }), + a.getTaglistData().forEach(function (e) { + t.push(e.sixw); + }), + t + ); + }, + tagCompare: function (e, t, i) { + if (t && e) + if ('String' == i) { + if (e == t) return !0; + } else if ('AcontainsB' == i) { + if (e.contains(t)) return !0; + } else if ('BcontainsA' == i) { + if (t.contains(e)) return !0; + } else if ('Array' == i) { + if (t.indexOf(e) > -1) return !0; + } else if ('date' == i) + return ( + (o = t), + (a = n = e), + n.length > 7 + ? (a = new UWA.Date(n).strftime('%Y-%m-%d')) + : n.length > 4 && (a = new UWA.Date(n).strftime('%Y-%m')), + !!o.contains(a) + ); + var n, o, a; + return !1; + }, + _uncolorize: function () { + 'tree' == n.crGridView.options.columns[0].dataIndex && + ((n.crGridView.options.columns[0].getCellKPIColor = null), + n.crGridView.coDatagrid.prepareUpdateView(), + n.crGridView.coDatagrid.pushUpdateView( + { + updateCellContent: !0, + updateCellLayout: !1, + updateCellAttributes: !1, + }, + !0, + )), + n.crGridView.tilesView && + ((n.crGridView.tilesView.getColor = function () {}), + n.crGridView.tilesView.prepareUpdateView(), + n.crGridView.tilesView.pushUpdateView( + { + updateCellContent: !0, + updateCellLayout: !1, + updateCellAttributes: !1, + }, + !0, + )); + }, + _colorize: function (e) { + var t = a.getTagsList().indexOf(e[0].predicate); + if (t >= 0) { + var i = a.getTaglistData()[t]; + 'tree' == n.crGridView.options.columns[0].dataIndex && + ((n.crGridView.options.columns[0].getCellKPIColor = function ( + t, + ) { + for (var n = 0; n < e.length; n++) + if ( + a.tagCompare( + e[n].object, + t.nodeModel.options.grid[i.modelField], + i.compareType, + ) + ) + return e[n].color; + return null; + }), + n.crGridView.caDatagrid.prepareUpdateView(), + n.crGridView.caDatagrid.pushUpdateView( + { + updateCellContent: !0, + updateCellLayout: !1, + updateCellAttributes: !1, + }, + !0, + )), + n.crGridView.tilesView && + ((n.crGridView.tilesView.getColor = function (t) { + t.options.grid; + for (var n = 0; n < e.length; n++) + if ( + a.tagCompare( + e[n].object, + t.options.grid[i.modelField], + i.compareType, + ) + ) + return e[n].color; + }), + n.crGridView.tilesView.prepareUpdateView(), + n.crGridView.tilesView.pushUpdateView( + { + updateCellContent: !0, + updateCellLayout: !1, + updateCellAttributes: !1, + }, + !0, + )); + } + }, + }; + return a; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgCRImpactBasisViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + let t = Object.create(null); + return ( + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + className: 'info-active', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgCRImpactBasisDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgCRImpactBasisTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function (t) { + const i = !(!t || 'true' !== t.AddImpactBasis), + n = !(!t || 'true' !== t.RemoveImpactBasis), + o = !(!t || 'true' !== t.AddImpactedItems); + return { + entries: [ + { + id: 'addExisting', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ImpactBasis_Toolbar_AddImpactBasis, + position: 'far', + visibleFlag: i, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgCRImpactBasisDataGridLayout', + func: 'addExistingHandler', + }, + }, + }, + { + id: 'massUpdate', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'pencil', + fontIconFamily: 1, + }, + disabled: !0, + tooltip: 'Mass Update', + position: 'far', + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgCRImpactBasisDataGridLayout', + func: 'massUpdateHandler', + }, + }, + }, + { + id: 'addImpactedItem', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'change-request-impacted-items', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ImpactBasis_Toolbar_AddImpactedItem, + position: 'far', + disabled: !0, + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgCRImpactBasisDataGridLayout', + func: 'addImpactedItemHandler', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_Remove, + position: 'far', + disabled: !0, + visibleFlag: n, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgCRImpactBasisDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovMakeDroppable', + [ + 'DS/DataDragAndDrop/DataDragAndDrop', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + 'DS/UIKIT/Mask', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o) { + 'use strict'; + var a = { + makeDroppable: function (n, r) { + e.droppable(n, { + drop: function (e, s, l) { + if ( + (l.stopPropagation && l.stopPropagation(), + l.preventDefault && l.preventDefault(), + l.dataTransfer && + l.dataTransfer.dropEffect && + (l.dataTransfer.dropEffect = 'copy'), + UWA.is(e) && '' != e) + ) { + var c = JSON.parse(e), + d = i.checkTenantInforamation(c); + if (0 != d.TenantInfoMissing.length) + t.error(o.CHG_GOV_Pref_PlatformMissing_Error); + else if (0 != d.DiffTenantData.length) + t.error(o.CHG_GOV_Pref_PlatformDoesNotMatch_Error); + else { + c = i.removeDuplicatesToBeDroppedObjects(c); + var u = i.filterBasedOnServiceId(c); + if ( + u.incorrectServiceInfo && + Array.isArray(u.incorrectServiceInfo) && + u.incorrectServiceInfo.length > 0 + ) { + var g = o.CHG_GOV_WARN_DROP_SKIPPED + '
'; + for (var p in u.incorrectServiceInfo) + g += u.incorrectServiceInfo[p] + '
'; + t.warn(g, 'false'); + } + a.ExecuteDrop(c, r); + } + } else t.error(o.CHG_GOV_Drop_Not_Supported); + n.style.borderWidth = '0px'; + }, + over: function () { + arguments[0].setStyles({ + borderStyle: 'solid', + borderColor: '#368ec4', + borderWidth: '1px', + }); + }, + leave: function () { + arguments[0].setStyle('borderWidth', '0px'); + }, + }); + }, + ExecuteDrop: function (e, i) { + if (e) { + var n = e.data.items; + UWA.is(n) && UWA.is(n.length) && n.length > 0 && i(n); + } else t.error(o.CHG_GOV_Drop_Not_Supported); + }, + }; + return a; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/idCardHeader/view/ChgIDCardHeaderBuilder', + [ + 'UWA/Class/View', + 'UWA/Core', + 'DS/Handlebars/Handlebars', + 'DS/ResizeSensor/js/ResizeSensor', + 'DS/UIKIT/DropdownMenu', + 'text!DS/ENOChgGovernanceUX/scripts/components/idCardHeader/template/IDCardHeaderMain.html', + 'text!DS/ENOChgGovernanceUX/scripts/components/idCardHeader/template/AttributesPartial.html', + 'text!DS/ENOChgGovernanceUX/scripts/components/idCardHeader/template/MinifiedAttributesPartial.html', + 'text!DS/ENOChgGovernanceUX/scripts/components/idCardHeader/template/AttributeSectionPartial.html', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChangeIDCard', + 'DS/PlatformAPI/PlatformAPI', + 'DS/Controls/Loader', + 'DS/LifecycleCmd/MaturityCmd', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ChangeMaturityWidget/ChangeMaturityWidget', + 'DS/Controls/TooltipModel', + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'css!DS/ChangeMaturityWidget/ChangeMaturityWidget', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p, h, m, C, v, f, b) { + 'use strict'; + var w = e.extend({ + name: 'chg-id-card', + className: function () { + return this.getClassNames('-container'); + }, + domEvents: { + 'click .toggle-minified-icon': 'toggleMinified', + 'click .attribute-value': '_triggerClickOnAttributeEvent', + }, + init: function (e) { + console.log('inside init ChgIDCardHeaderBuilder'); + this._parent.call(this, e); + }, + setup: function () { + this.container && (this.container.empty(), this.container.destroy()), + (this.modelEvents = this.model.get('modelEvents')), + (this.modelEventsTokens = []), + this._subscribeToModelEvents(), + this._subscribeToPlatformEvents(); + var e = this._parseAttributes( + this.model.get('attributes'), + this.model.get('attributesLayout'), + ); + (this.templateOptions = { + withHomeButton: + void 0 !== this.model.get('withHomeButton') && + this.model.get('withHomeButton'), + withExpandCollapseButton: + void 0 !== this.model.get('withExpandCollapseButton') && + this.model.get('withExpandCollapseButton'), + withActionsButton: + void 0 === this.model.get('withActionsButton') || + this.model.get('withActionsButton'), + withInformationButton: + void 0 !== this.model.get('withInformationButton') && + this.model.get('withInformationButton'), + withToggleMinifiedButton: + void 0 !== this.model.get('withToggleMinifiedButton') && + this.model.get('withToggleMinifiedButton'), + showBackButton: + void 0 !== this.model.get('showBackButton') && + this.model.get('showBackButton'), + thumbnail: this.model.get('thumbnail'), + smallIcon: this.model.get('thumbnail'), + title: this.model.get('title'), + version: + '-' != this.model.get('version') ? this.model.get('version') : '', + attributes: e, + dropdown: + void 0 !== this.model.get('dropdown') && + this.model.get('dropdown'), + freezones: this.model.get('freezones'), + minified: this.model.get('minified'), + nls: c.templateNLS, + }), + void 0 === this.model.get('customEvents') && + this.model.set('customEvents', {}), + (this.modelOnChangeListener = function (e) {}), + this.model.addEvent('onChange', this.modelOnChangeListener); + }, + render: function () { + var e = this, + t = i.compile(a); + i.compile(r), i.compile(s); + i.registerPartial('Attributes', r), + i.registerPartial('MinifiedAttributes', s), + i.registerPartial('AttributeSection', l), + e.container.setHTML(t(e.templateOptions)), + e.addLoaderInAttributes(e.templateOptions.attributes), + e.addCustomTooltipsInAttributes(e.templateOptions.attributes), + e.templateOptions.withHomeButton || + e.templateOptions.withExpandCollapseButton || + e.templateOptions.showBackButton || + (e.container.addClassName('no-sidebar-buttons'), + e.container + .getElement('.sidebar-buttons') + .addClassName('hidden')), + e.templateOptions.withActionsButton && + e.templateOptions.dropdown && + ((e.templateOptions.dropdown.target = + e.container.getElement('.actions-menu-icon')), + e.templateOptions.dropdown.items.length + ? (e.container + .getElement('.actions-menu-icon') + .removeClassName('hidden'), + (e.templateOptions.dropdownElement = new o( + e.templateOptions.dropdown, + ))) + : e.container + .getElement('.actions-menu-icon') + .addClassName('hidden')); + var n = e.model.get('freezones'); + void 0 !== n && + n.length > 0 && + n.forEach(function (t, i) { + var n = e.container.getElement('.free-zone-' + i); + if ('string' == typeof t) { + var o = b.escapeHTML(t); + (n.innerHTML = o), + '' != t && + (n.tooltipInfos = new m({ + title: f.CHG_Common_Dialog_Description, + longHelp: t, + mouseRelativePosition: !1, + allowUnsafeHTMLLongHelp: !1, + position: 'left', + moreHelpCB: function () { + C.getDependency( + 'xChangeApp', + )._applicationChannel.publish({ + event: 'information-panel-open', + data: null, + }); + }, + })); + } else t instanceof HTMLElement ? n.appendChild(t) : void 0 !== t.render && t.render().inject(n); + }), + (e.requestID = window.requestAnimationFrame(function () { + e.resize(); + })), + e.templateOptions.minified && e.container.addClassName('minified'); + var c = e.getMaturityContainer(); + return e.createMaturitySpan(c), e; + }, + addLoaderInAttributes: function (e) { + for (var t = 0; t < e.length; t++) + for (var i = e[t], n = 0; n < i.length; n++) { + var o, + a, + r, + s = i[n]; + if (s.showLoader) + if ( + (s.displayWhenMinified + ? ((o = this.container + .getElements('#' + s.command)[0] + .getElementsByClassName( + 'attribute-value', + )[0].firstChild), + (a = this.container + .getElements('#' + s.command)[1] + .getElementsByClassName( + 'attribute-value', + )[0].firstChild)) + : (a = this.container + .getElements('#' + s.command)[0] + .getElementsByClassName( + 'attribute-value', + )[0].firstChild), + ((r = new u()).height = '15'), + r.inject(a), + r.on(), + o) + ) + ((r = new u()).height = '15'), r.inject(o), r.on(); + } + }, + addCustomTooltipsInAttributes: function (e) { + for (var t = 0; t < e.length; t++) + for (var i = e[t], n = 0; n < i.length; n++) { + i[n].valueCustomTooltip; + } + }, + createMaturitySpan: function (e, t) { + var i = this; + if (!i.maturityCmd || 'true' == t) { + i.stateDiv = UWA.createElement('div', { + styles: { + overflow: 'hidden', + height: '100%', + }, + class: 'maturity-container', + }); + var n = { + securityContext: { + SecurityContext: p.getGlobalVariable().getSecurityContext(), + tenant: p.getGlobalVariable().tenant, + }, + getSecurityContext: function () { + return this.securityContext; + }, + }; + (i.maturityCmd && 'true' != t) || (i.maturityCmd = new g()), + i.maturityCmd + .executeCompactViewAsync(widget, i.stateDiv, n, i.model.id) + .then(function () { + var t = i.maturityCmd.changeMaturityWidget.currentState, + n = i.maturityCmd.changeMaturityWidget.current, + o = { + valueDisplay: t, + valueActual: n, + }; + i.model.set('currentState', o), + console.log('Maturity updated'), + i.modelEvents.publish({ + event: 'maturity-updated', + data: o, + }); + let a = { + valueDisplay: t, + valueActual: n, + id: i.model.id, + }; + d.publish('Change-Maturity-Update', a), + i.createMaturitySpan(e, 'true'); + }); + } + if (e) { + i.model.get('accessBits'); + if (i.model.get('onHold')) { + var o = '[' + f.CHG_GOV_DataGrid_Column_Maturity_Hold + ']'; + (e.innerText = + i.model.get('currentState').valueDisplay + ' ' + o), + e.classList.remove('type-hyperlink'); + } else + (e.innerText = ''), + i.stateDiv.inject(e), + e.classList.add('type-hyperlink'); + } + }, + createNewAttributes: function (e) { + for ( + var t = this.model.get('attributes'), + i = this.model.get('accessBits'), + n = 0; + n < t.length; + n++ + ) { + var o = (l = t[n]).accessBit; + if (o) { + var a = i[o]; + l.editable = 'false' != a; + } + } + for (var r = e.attributes, s = 0; s < t.length; s++) { + var l = t[s]; + for (var d in r) + d == l.command && + (null != r[d].editable && (l.editable = r[d].editable), + null != r[d].displayWhenMinified && + (l.displayWhenMinified = r[d].displayWhenMinified), + null != r[d].fieldNLS && (l.name = r[d].fieldNLS), + null != r[d].valueActual && (l.valueActual = r[d].valueActual), + null != r[d].valueDisplay && + ((l.valueDisplay = r[d].valueDisplay), + (l.valueTooltip = r[d].valueDisplay)), + null != r[d].valueTooltip && + (l.valueTooltip = r[d].valueTooltip), + null != r[d].valueCustomTooltip && + ((l.valueTooltip = ''), + (l.valueCustomTooltip = r[d].valueCustomTooltip)), + 1 == r[d].showLoader + ? ((l.valueDisplay = ''), + (l.valueActual = ''), + (l.valueDisplay = ''), + (l.valueTooltip = c.loading)) + : 0 == r[d].showLoader && (l.showLoader = !1)); + } + return t; + }, + createNewMenu: function () { + var e = [], + t = [], + i = this.model.get('accessBits'); + this.templateOptions.dropdown.items + .concat(this.templateOptions.dropdown.hiddenItems) + .forEach(function (n, o) { + 'true' == i[n.accessBit] ? e.unshift(n) : t.push(n); + }), + (this.templateOptions.dropdown.items = e), + (this.templateOptions.dropdown.hiddenItems = t); + }, + reRenderHeaderNonAttributeFields(e) { + var t = this; + e.title && + ((t.container.getElement('.name').innerHTML = e.title), + (t.container.getElement('.name').title = e.title)), + e.freezones && + e.freezones.constructor === Array && + e.freezones.forEach(function (e, i) { + var n = t.container.getElement('.free-zone-' + i); + 'string' == typeof e + ? (n.innerHTML = e) + : e instanceof HTMLElement + ? n.appendChild(e) + : void 0 !== e.render && e.render().inject(n); + }); + }, + reRenderHeaderAttributes: function (e) { + this.templateOptions.attributes = this._parseAttributes( + e, + this.model.get('attributesLayout'), + ); + var t = i.compile(r), + n = i.compile(s); + (this.container.getElement('.attributes-placeholder').innerHTML = t({ + attributes: this.templateOptions.attributes, + })), + (this.container.getElement( + '.attributes-section-when-minified-container', + ).innerHTML = n({ + attributes: this.templateOptions.attributes, + })), + this.addLoaderInAttributes(this.templateOptions.attributes), + this.addCustomTooltipsInAttributes(this.templateOptions.attributes); + var o = this.getMaturityContainer(); + this.createMaturitySpan(o), this.resize(); + }, + getMaturityContainer: function () { + for ( + var e, t, i = !0, n = this.templateOptions.attributes, o = 0; + o < n.length; + o++ + ) + for (var a = n[o], r = 0; r < a.length; r++) { + var s = a[r]; + 'maturity' == s.command && (i = s.displayWhenMinified); + } + return ( + i + ? ((e = this.container + .getElements('#maturity')[0] + .getElementsByClassName('attribute-value')[0].firstChild), + (t = this.container + .getElements('#maturity')[1] + .getElementsByClassName('attribute-value')[0].firstChild)) + : (t = this.container + .getElements('#maturity')[0] + .getElementsByClassName('attribute-value')[0].firstChild), + this.templateOptions.minified ? e : t + ); + }, + reRenderHeaderMenu: function () { + this.templateOptions.dropdownElement && + this.templateOptions.dropdownElement.destroy(), + 0 == this.templateOptions.dropdown.items.length + ? this.container + .getElement('.actions-menu-icon') + .addClassName('hidden') + : (this.container + .getElement('.actions-menu-icon') + .removeClassName('hidden'), + (this.templateOptions.dropdownElement = new o( + this.templateOptions.dropdown, + ))); + }, + attachResizeSensor: function () { + var e = this; + (e.resizeSensor = new n(e.container, function () { + e.resize(); + })), + e.container + .getElements('.attributes-placeholder .attribute-section') + .forEach(function (e) { + var t = e.getElement('.attribute-value'); + (t.style.width = + e.offsetWidth - + e.getElement('.attribute-name').offsetWidth - + 21 + + 'px'), + (t.style.overflow = 'hidden'), + (t.style.textOverflow = 'ellipsis'); + }); + }, + resize: function () { + var e = this.container.offsetWidth; + this.container.hasClassName('minified') && + this._checkMinifiedAttributesOverflow(); + this.container.offsetWidth; + var t = this.container.getElement( + '.attribute-columns[data-column-index="0"]', + ), + i = this.container.getElement( + '.attribute-columns[data-column-index="1"]', + ), + n = this.container.getElement( + '.attribute-columns[data-column-index="2"]', + ), + o = this.container.getElement( + '.attribute-columns[data-column-index="3"]', + ), + a = this.container.getElement('.image-placeholder'), + r = this.container.getElement('.free-zone-0'), + s = 0; + a && + (a.hasClassName('hidden') + ? (a.removeClassName('hidden'), + (s = a.offsetWidth), + a.addClassName('hidden')) + : (s = a.offsetWidth)), + e - 20 < t.offsetWidth + s + ? (this.container.addClassName('no-image-placeholder'), + a.addClassName('hidden')) + : (this.container.removeClassName('no-image-placeholder'), + a.removeClassName('hidden')); + var l = 0; + i && + (i.hasClassName('hidden') + ? (i.removeClassName('hidden'), + (l = i.offsetWidth), + i.addClassName('hidden')) + : (l = i.offsetWidth)), + null != i && + (e - 40 < t.offsetWidth + a.offsetWidth + l + ? i.addClassName('hidden') + : i.removeClassName('hidden')); + var c = 0; + n && + (n.hasClassName('hidden') + ? (n.removeClassName('hidden'), + (c = n.offsetWidth), + n.addClassName('hidden')) + : (c = n.offsetWidth)), + null != n && + (e - 60 < t.offsetWidth + a.offsetWidth + i.offsetWidth + c + ? n.addClassName('hidden') + : n.removeClassName('hidden')); + var d = 0; + o && + (o.hasClassName('hidden') + ? (o.removeClassName('hidden'), + (d = o.offsetWidth), + o.addClassName('hidden')) + : (d = o.offsetWidth)), + null != o && + (e - 100 < + t.offsetWidth + a.offsetWidth + i.offsetWidth + n.offsetWidth + d + ? o.addClassName('hidden') + : o.removeClassName('hidden')); + null != o + ? 0 == o.offsetWidth || + e - 200 < + t.offsetWidth + + a.offsetWidth + + i.offsetWidth + + n.offsetWidth + + 450 + ? r.addClassName('hidden') + : r.removeClassName('hidden') + : e - 80 < + t.offsetWidth + + a.offsetWidth + + i.offsetWidth + + n.offsetWidth + + 450 + ? r.addClassName('hidden') + : r.removeClassName('hidden'); + }, + minify: function () { + if ( + ((this.templateOptions.minified = !0), + !this.container.hasClassName('minified')) + ) { + this.container.addClassName('minified'), + this.modelEvents.publish({ + event: 'idcard-minified', + }), + console.log('idcard-minified'); + var e = this.getMaturityContainer(); + this.createMaturitySpan(e); + } + }, + expand: function () { + if ( + ((this.templateOptions.minified = !1), + this.container.hasClassName('minified')) + ) { + this.container.removeClassName('minified'), + this.modelEvents.publish({ + event: 'idcard-expanded', + }); + var e = this.getMaturityContainer(); + this.createMaturitySpan(e); + } + }, + toggleMinified: function () { + var e = this.container.querySelector('.toggle-minified-icon'), + t = this.container.hasClassName('minified'); + t + ? (this.expand(), + null !== e && + (e.classList.remove('fonticon-expand-down'), + e.classList.add('fonticon-expand-up'), + (e.title = c.templateNLS.collapse))) + : (this.minify(), + null !== e && + (e.classList.remove('fonticon-expand-up'), + e.classList.add('fonticon-expand-down'), + (e.title = c.templateNLS.expand))); + var i = !t; + console.log('idcard-header-minified' + i), + i + ? (widget + .getElement('.outerContainerTabDiv') + .removeClassName('expanded-header-height'), + widget + .getElement('.outerContainerTabDiv') + .addClassName('minified-header-height')) + : (widget + .getElement('.outerContainerTabDiv') + .addClassName('expanded-header-height'), + widget + .getElement('.outerContainerTabDiv') + .removeClassName('minified-header-height')); + }, + _checkMinifiedAttributesOverflow: function () { + for ( + var e = this.container.getElement( + '.attributes-section-when-minified-container', + ), + t = e.getElements('.attribute-section'), + i = 0; + i < t.length; + i++ + ) + t[i].removeClassName('hidden'); + if (!(e.scrollWidth <= e.offsetWidth)) + for (var n = 0, o = 0; o < t.length; o++) + (n += t[o].offsetWidth) > e.offsetWidth && + t[o].addClassName('hidden'); + }, + _triggerClickOnAttributeEvent: function (e) { + var t = { + index: parseInt( + e._uwaTarget.parentElement.getAttribute('data-attribute-index'), + 10, + ), + attributeName: + e._uwaTarget.parentElement.querySelector('.attribute-name') + .innerHTML, + }; + this.modelEvents.publish({ + event: 'idcard-attributes-clicked', + data: t, + }); + }, + _parseAttributes: function (e, t) { + var i = [], + n = 0; + return ( + void 0 !== e && + (i.push(e.slice(0, t[0])), + t[1] && i.push(e.slice(t[0], t[0] + t[1])), + t[2] && i.push(e.slice(t[0] + t[1], t[0] + t[1] + t[2])), + t[3] && + i.push(e.slice(t[0] + t[1] + t[2], t[0] + t[1] + t[2] + t[3])), + i.forEach(function (e) { + e.forEach(function (e) { + e.index = n++; + }); + })), + i + ); + }, + idCardHeaderUpdate: function (e) { + if ( + (console.log('idcard-header-update modelEvents'), + e.accessBits && + (this.model.set('accessBits', e.accessBits), + this.createNewMenu(), + this.reRenderHeaderMenu()), + e.attributes || e.accessBits) + ) { + var t = this.createNewAttributes(e); + this.reRenderHeaderAttributes(t), + e.attributes && + e.attributes.owner && + this.model.set('owner', e.attributes.owner.valueActual); + } + var i = !1; + if ( + (e.title && (this.model.set('title', e.title), (i = !0)), + e.freezones && e.freezones.constructor === Array && e.freezones[0]) + ) { + var n = this.model.get('freezones'); + (n[0] = e.freezones[0].data), + this.model.set('freezones', n), + (i = !0); + } + i && this.reRenderHeaderNonAttributeFields(e); + }, + }); + return ( + (w.prototype._subscribeToPlatformEvents = function () { + var e = this; + d.unsubscribe('idcard-header-update'), + d.subscribe('idcard-header-update', function (t) { + e.idCardHeaderUpdate(t); + }), + d.unsubscribe('idcard-header-update-maturity'), + d.subscribe('idcard-header-update-maturity', function () { + console.log('====subscribe--idcard-header-update-maturity---'); + var t = e.getMaturityContainer(); + e.createMaturitySpan(t, 'true'); + }), + (w.prototype.platformEventsSubscribed = !0); + }), + (w.prototype._subscribeToModelEvents = function () { + var e = this; + e.model.get('modelEvents').subscribe( + { + event: 'idcard-header-update', + }, + function (t) { + e.idCardHeaderUpdate(t); + }, + ), + e.model.get('modelEvents').subscribe( + { + event: 'idcard-header-update-maturity', + }, + function () { + var t = e.getMaturityContainer(); + e.createMaturitySpan(t, 'true'); + }, + ); + }), + w + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovExpandInputTextBox', + [ + 'UWA/Core', + 'DS/Controls/Abstract', + 'DS/Controls/LineEditor', + 'DS/Controls/Button', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'css!DS/ENOChgGovernanceUX/ENOChgGovernanceUX', + ], + function (e, t, i, n, o) { + 'use strict'; + var a = null, + r = function () { + null != a && + (a.that.lineEditor._myInput.setStyle('width', 'auto'), + a.that.createList.inject(a.that.dropdown), + a.that.lineEditor.inject(a.that.createCAContainer, 'top'), + a.remove(), + (a = null)); + }; + return t.inherit({ + name: 'ExpandInput', + _preBuildView: function () { + (this.elements.container = new UWA.Element('div', { + class: 'container-expandInput wux-tweakers', + id: 'quickCreateContainer', + })), + (this.createCAContainer = new UWA.Element('div', { + class: 'hideBox transition', + })), + (this.lineEditor = new i({ + placeholder: o.CHG_GOV_CREATE_NEW_PLACEHOLDER, + sizeInCharNumber: 25, + selectAllOnFocus: !0, + displayClearFieldButtonFlag: !0, + })), + this.lineEditor.inject(this.createCAContainer), + this.lineEditor.getContent().addClassName('prevent-ios-zoom-in'), + (this.dropdown = new UWA.Element('div', { + class: 'createCAdropdown', + })), + (this.createList = new UWA.Element('ul', { + class: 'createUL', + })); + new UWA.Element('li', { + class: 'createLI', + }); + this.dropdownParent = new UWA.Element('div', { + class: 'dropdownParent', + }); + new UWA.Element('span', { + class: 'item-icon fonticon fonticon-doc cursorPointer', + }), + UWA.createElement('span', { + class: 'item-text', + html: o.CHG_CreateCA, + title: o.CHG_CreateCA, + id: 'idCreateCA', + }); + this.createList.addEvents({ + click: function () { + console.log('CO title entered..'), r(); + }, + }), + (this.cancelBtn = new n({ + label: 'Cancel', + emphasize: 'primary', + domId: 'expandInput_cancel_btn', + })), + this.cancelBtn.getContent().addClassName('expandInput_cancel_btn'), + this.createCAContainer.inject(this.elements.container); + var e = { + icon: {}, + }; + (e.icon.iconName = 'plus'), + (e.icon.fontIconFamily = 1), + (e.tooltip = 'YOLO'); + this.createCAContainer, this.lineEditor; + (this.plusBtn = new n(e)), + this.plusBtn + .getContent() + .addClassName('wux-tweakers-multirep-button') + .addClassName('wux-tweaker-function') + .addClassName('wux-ui-style-icon'), + this.plusBtn.inject(this.elements.container), + this._parent(), + (this.isMultiSelection = !1); + this.cancelBtn.addEventListener('click', function () { + r(); + }), + this.createList.addEventListener('click', function () { + r(); + }), + document.getElementById('zPlaneid') && + document + .getElementById('zPlaneid') + .addEventListener('mouseup', function (e) { + if ( + (r(), + e.target.hasClassName('prevent-ios-zoom-in') || + e.target.getParent().hasClassName('prevent-ios-zoom-in')) + ); + else if (e.target.getParent().hasClassName('icon-blue')); + else { + var t = document.querySelectorAll( + '#quickCreateContainer', + )[0]; + t && + (t.getChildren()[0].removeClassName('showBox'), + t.getChildren()[1].removeClassName('icon-blue')); + } + }), + (a = null); + }, + toggleDisplayLineEditor: function () { + console.log(arguments, this); + }, + getModalInputBox: function (e) { + return ( + null == a && + ((a = UWA.createElement('div', { + class: 'input_FloatingDiv', + id: 'input_FloatingDiv', + })), + this.lineEditor.remove(), + this.createList.remove(), + a.addContent(this.lineEditor), + a.addContent(this.createList), + a.addContent(this.cancelBtn), + (a.that = this), + a.that.lineEditor._myInput.setStyle('width', '100%'), + e.top && a.setStyle('top', e.top), + e.left && + (e.left + 164 > widget.body.getBoundingClientRect().width + ? (a.setStyle('left', 0), a.setStyle('width', '100%')) + : a.setStyle('left', e.left)), + a.addEventListener('click', function (e) { + e.stopPropagation(); + })), + a + ); + }, + removeModalInputBox: function () { + r(); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/ChgCRDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/TreeModel/BaseFilter', + 'require', + ], + function (e, t, i, n, o, a, r, s, l) { + 'use strict'; + var c = s.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }); + return e.extend({ + init: function () {}, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new n(), + i = new t({ + dataModelSet: e, + }); + return this.setTreeDocument(i), i; + }, + registerCustomFilter: function () { + this.treeDocument.getFilterManager().registerFilter('stringRole', c); + }, + loadIndexedChangeRequests: function (e, t) { + var o = e, + a = new n(); + e.prepareUpdate(); + for (var r = 0; r < t.length; r++) { + var s = this.createCustomNameField(t[r]); + t[r].co_name = s; + var l = this.createCustomSeverity(t[r]); + t[r].sev = l; + var c = this.createCustomChangeCoordinatorField(t[r]); + t[r].co_Coordinator = c; + var d = this.createCustomOwnerField(t[r]); + t[r].co_Owner = d; + for ( + var u = this.getStatusBarIcons(t[r]), + g = this.statusbarIconsTooltips(t[r]), + p = this.getSubLevel(t[r]), + h = this.getDescription(t[r]), + m = this.createCustomTooltip(t[r]), + C = !1, + v = o.getChildren(), + f = 0; + f < v.length; + f++ + ) { + v[f].options.grid.id == t[r].id && (C = !0); + } + if (!C) { + var b = i.createTreeNodeDataModel(a, { + label: t[r].title, + subLabel: p, + description: h, + grid: t[r], + icons: [t[r].iconURL], + thumbnail: t[r].thumbnail, + statusbarIcons: u, + statusbarIconsTooltips: g, + customTooltip: m, + contextualMenu: ['Copy1', 'Move1'], + }); + e.addChild(b); + } + } + e.pushUpdate(); + }, + loadChangeRequestData: function (e, t) { + var a = e; + let r = new n(); + e.prepareUpdate(); + for (let n = 0; n < t.length; n++) { + let d = this.createCustomNameField(t[n], 'NonIndex'); + t[n].co_name = d; + let u = this.createCustomSeverity(t[n]); + t[n].sev = u; + let g = this.createCustomChangeCoordinatorField(t[n]); + t[n].co_Coordinator = g; + let p = this.createCustomOwnerField(t[n]); + t[n].co_Owner = p; + let h = this.getStatusBarIcons(t[n], 'NonIndex'), + m = this.statusbarIconsTooltips(t[n], 'NonIndex'), + C = this.getSubLevel(t[n]), + v = this.getDescription(t[n]), + f = this.createCustomTooltip(t[n]); + for ( + var s = !1, + l = + (o.getGlobalVariable().existingCRIds, + (s = !1), + a.getChildren()), + c = 0; + c < l.length; + c++ + ) { + l[c].options.grid.id == t[n].id && (s = !0); + } + if (!s) { + let o = i.createTreeNodeDataModel(r, { + label: t[n].title, + subLabel: C, + description: v, + grid: t[n], + icons: [t[n].iconURL], + thumbnail: t[n].thumbnail, + statusbarIcons: h, + statusbarIconsTooltips: m, + customTooltip: f, + contextualMenu: ['Copy1', 'Move1'], + }); + e.addChild(o); + } + } + e.pushUpdate(); + }, + updateNodeIndexed: function (e, t) { + 0 == e.getChildren().length && + e._modelEvents.publish({ + event: 'crSummaryNotEmpty', + }), + e.unselectAll(); + let o = new n(), + a = this.createCustomNameField(t[0]); + t[0].co_name = a; + let r = this.createCustomSeverity(t[0]); + t[0].sev = r; + let s = this.createCustomChangeCoordinatorField(t[0]); + t[0].co_Coordinator = s; + let l = this.createCustomOwnerField(t[0]); + t[0].co_Owner = l; + let c = this.getStatusBarIcons(t[0]), + d = this.statusbarIconsTooltips(t[0]), + u = this.getSubLevel(t[0]), + g = this.getDescription(t[0]), + p = this.createCustomTooltip(t[0]), + h = i.createTreeNodeDataModel(o, { + label: t[0].title, + subLabel: u, + description: g, + grid: t[0], + icons: [t[0].iconURL], + thumbnail: t[0].thumbnail, + statusbarIcons: c, + statusbarIconsTooltips: d, + customTooltip: p, + }); + e.getXSO().add(h), e.addChild(h, 0); + }, + createCustomNameField: function (e, t) { + let i = new UWA.Element('div', {}); + UWA.createElement('span', { + html: e.name, + }).inject(i); + let n = new UWA.Element('div', { + class: 'iconsDiv', + }); + if ('true' == e.onHold) { + let e = new UWA.Element('div', { + class: 'gridIconContainer', + title: a.CHG_GOV_TOOLTIP_HOLD, + }); + UWA.createElement('div', { + class: 'fonticon fonticon-pause', + }).inject(e), + e.inject(n); + } + if ('NonIndex' == t) { + let e = new UWA.Element('div', { + class: 'gridIconContainer', + title: a.CHG_TOOLTIP_NEW_REQUEST, + }); + UWA.createElement('div', { + class: + 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-database-add recentCA', + }).inject(e), + e.inject(n); + } + return n.inject(i), i.outerHTML; + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + createCustomChangeCoordinatorField: function (e) { + let t = new UWA.Element('div', { + class: 'members', + }); + if ('' != e.changeCoordinatorFullName) { + let i = new UWA.Element('div', { + class: 'assignee', + }), + n = + '/api/user/getpicture/login/' + + e.changeCoordinator + + '/format/normal', + a = o.getGlobalVariable().computeSwymUrl(n), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: a, + }); + else { + let t = r.getAvatarDetails(e.changeCoordinatorFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(i); + let l = UWA.createElement('span', { + class: 'userName', + html: e.changeCoordinatorFullName, + }); + i.inject(t), l.inject(t); + } + return t.outerHTML; + }, + createCustomSeverity: function (e) { + let t = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e.severity + ? (t = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e.severity && + (t = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + let i = new UWA.Element('div', {}), + n = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: t, + }).inject(n); + let o = UWA.createElement('span', { + html: e.severityNLS, + }); + return n.inject(i), o.inject(i), i.outerHTML; + }, + createCustomMaturity: function (e) { + let t = 'co-state co-draft'; + 'InWork' == e.maturity + ? (t = 'co-inwork co-state') + : 'InApproval' == e.maturity + ? (t = 'co-Inapproval co-state') + : 'Approved' == e.maturity + ? (t = 'co-approved co-state') + : 'Completed' == e.maturity && (t = 'co-completed co-state'); + let i = new UWA.Element('div', {}); + return ( + UWA.createElement('span', { + html: e.maturityNLS, + class: t, + }).inject(i), + i.outerHTML + ); + }, + getStatusBarIcons: function (e, t) { + let i = []; + return ( + 'Low' == e.severity + ? i.push('level-low') + : 'Medium' == e.severity + ? i.push('level-medium') + : 'High' == e.severity && i.push('level-high'), + 'true' == e.onHold && i.push('pause'), + 'NonIndex' == t && i.push('database-add'), + i + ); + }, + statusbarIconsTooltips: function (e, t) { + let i = []; + return ( + i.push(e.severityNLS), + 'true' == e.onHold && i.push(a.CHG_GOV_TOOLTIP_HOLD), + 'NonIndex' == t && i.push(a.CHG_TOOLTIP_NEW_REQUEST), + i + ); + }, + createCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Severity + + ': ' + + e.severityNLS + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + getSubLevel: function (e) { + let t = ''; + return (t = e.name + ' | ' + e.ownerFullName); + }, + getDescription: function (e) { + let t = ''; + return (t = e.maturityNLS); + }, + filterView: function (e) { + let t = this.treeDocument, + i = e.matchingIDs; + t.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: i, + }, + }, + }); + }, + enableColorizeView: function (e) { + let t = this.treeDocument.getAllDescendants(); + var i, n; + (i = e), + (n = function (e, i) { + t.map((t) => { + if (t.options.grid.id === i) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + t.updateOptions(n); + } + }); + }), + UWA.is(i, 'array') && + i.forEach(function (e) { + var t = e.color, + i = e.id; + n(t, i); + }); + }, + disableColorizeView: function () { + this.treeDocument.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgImpactAnalysisOnCreateCA', + [ + 'DS/ENOChgActionCMDs/scripts/Commands/AddToNewCA', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENONewWidget/ENONewLauncher', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'require', + ], + function (e, t, i, n, o, a) { + return { + createNewChangeActionInContext: function (e) { + let t = widget.getValue('DefaultCASubType') + ? widget.getValue('DefaultCASubType') + : 'Change Action'; + let r = e.parentID, + s = { + context: { + service: '3DSpace', + tenant: i.getGlobalVariable().tenant, + header: { + SecurityContext: i.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: o.CHG_NEW_CHANGE_ACTION_FORM, + type: 'Change Action', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Action', + preferedType: t, + select: [], + parentPIDs: [r], + }, + events: { + onSuccess: function (e) { + let t = { + objectID: e.result[0].identifier, + type: 'Change Action', + }; + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgChangeActionDataGridLayout', + ], function (i) { + i.ChgChangeActionDataGridModel.addNewChildren(t); + try { + let t = a('DS/ENOChgProbes/scripts/ChgCloudProbeUtils'); + var n = e.result[0]; + (n.isKindOfType = 'Change Action'), + t.cloudProbeUtils.sendChgObjectCreateTrackerEvent({ + createData: n, + View: 'Impact Analysis', + }); + } catch (e) { + console.log(e); + } + i.modelEvents.publish({ + event: 'CA-Creation-Update', + data: {}, + }); + }); + }, + onFailure: function (e) { + console.log('onFailure...............' + e); + }, + onCancel: function (e) {}, + }, + }; + new n().CreateNew(s); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgChangeActionToolbar', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + ], + function (e, t) { + let i = Object.create(null); + return ( + (i.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + className: 'info-active', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgChangeActionDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgChangeActionTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (i.writetoolbarDefinition = function (i) { + var n = i.accessBits; + const o = + 'true' == (n = t.processAccessBitIA(n)).ManageImplementingChanges; + return { + entries: [ + { + id: 'addExisting', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeRequest_IA_Toolbar_AddCA, + position: 'far', + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgChangeActionDataGridLayout', + func: 'AddNewChangeAction', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'trash', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeRequest_IA_Toolbar_DeleteCA, + position: 'far', + disabled: !0, + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgChangeActionDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeAction/facets/context/ChgCAcontextDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/PlatformAPI/PlatformAPI', + 'DS/UIKIT/Mask', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u) { + 'use strict'; + let g = e.extend({ + init: function (e) { + this.parentCAId = e; + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new t({ + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + let t = e.getChildren(); + for (let e = 0; e < t.length; e++) + if (this.options.grid.id == t[e].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + loadContextData: function (e, t) { + e.prepareUpdate(); + let i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + let n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = null, + n = this.createCustomOwnerField(e); + e.chgObjOwner = n; + let o = e.previewicon, + a = e.name + ' | ' + e.ownerFullName; + void 0 !== e.currentNLS && null !== e.currentNLS + ? ((e.current = e.current), + (e.currentNLS = e.currentNLS), + (t = e.currentNLS)) + : ((e.current = e.maturity), + (e.currentNLS = e.maturityNLS), + (t = e.maturityNLS)); + var r = this.getCustomTooltip(e); + return new i({ + label: e.title, + subLabel: a, + description: t, + grid: e, + customTooltip: r, + icons: [e.icon], + thumbnail: o, + useAsyncPreExpand: !0, + }); + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.currentNLS + ); + }, + addExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCAId, + a = document.getElementById('outer-context-grid-div'); + 'undefined' != a && null != a && u.mask(a), + s.updateExistingCAContext(o, e).then( + function (e) { + var n = { + contextid: o, + length: e.data.length, + }; + d.publish('context:update', n); + let r = []; + e && (r = e.data), + t.treeDocument && + 0 == t.treeDocument.getAllDescendants().length && + t.treeDocument._modelEvents.publish({ + event: 'treeNotEmpty', + }), + g.prototype.addNodesInLayoutModel(t.treeDocument, r), + i(e), + u.unmask(a); + }, + function (e) { + u.unmask(a), n(e); + }, + ); + }); + }, + removeExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCAId, + r = document.getElementById('outer-context-grid-div'); + 'undefined' != r && null != r && u.mask(r), + s.updateExistingCAContext(o, e).then( + function (e) { + let n = t.treeDocument.getSelectedNodes(); + i(n); + for (let e = 0; e < n.length; e++) + t.treeDocument.removeRoot(n[e]); + if (0 == t.treeDocument.getAllDescendants().length) { + var s = { + contextid: o, + length: t.treeDocument.getAllDescendants().length, + }; + d.publish('context:update', s); + } + c.success(a.CHG_GOV_context_Remove_Success), u.unmask(r); + }, + function (e) { + u.unmask(r), n(); + }, + ); + }); + }, + addNodesInLayoutModel: function (e, t) { + let i = g.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else + for (let t = i.length - 1; t >= 0; t--) + e.getXSO().add(i[t]), e.addRoot(i[t], 0); + e.pushUpdate(); + }, + }); + return g; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/facets/relatedScope/ChgCRrelatedScopeDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/PlatformAPI/PlatformAPI', + 'DS/UIKIT/Mask', + 'DS/TreeModel/BaseFilter', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g) { + 'use strict'; + let p = g.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + let t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }), + h = e.extend({ + init: function (e) { + this.parentCRId = e; + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new t({ + id: 'CR_RelatedScope', + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + let t = e.getChildren(); + for (let e = 0; e < t.length; e++) + if (this.options.grid.id == t[e].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument + .getFilterManager() + .registerFilter('stringRole', p); + }, + loadRelatedScopeData: function (e, t) { + e.prepareUpdate(); + let i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + let n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = this.createCustomOwnerField(e); + e.chgObjOwner = t; + let n = e.previewicon, + o = e.name + ' | ' + e.ownerFullName, + a = e.currentNLS; + var r = this.getCustomTooltip(e); + return new i({ + label: e.title, + subLabel: o, + description: a, + grid: e, + customTooltip: r, + icons: [e.icon], + thumbnail: n, + useAsyncPreExpand: !0, + }); + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.currentNLS + ); + }, + addExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCRId, + a = document.getElementById('outer-relatedScope-grid-div'); + 'undefined' != a && null != a && u.mask(a), + s.updateExistingRelatedScope(o, e).then( + function (e) { + var n = { + contextid: o, + length: e.data.length, + }; + d.publish('relatedScope:update', n); + let r = []; + e && (r = e.data), + t.treeDocument.getAllDescendants() && + 0 == t.treeDocument.getAllDescendants().length && + t.treeDocument._modelEvents.publish({ + event: 'treeNotEmpty', + }), + h.prototype.addNodesInLayoutModel(t.treeDocument, r), + i(e), + u.unmask(a); + }, + function (e) { + u.unmask(a), n(e); + }, + ); + }); + }, + removeExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCRId, + r = document.getElementById('outer-relatedScope-grid-div'); + 'undefined' != r && null != r && u.mask(r), + s.removeExistingRelatedScope(o, e).then( + function (e) { + let n = t.treeDocument.getSelectedNodes(); + i(n); + for (let e = 0; e < n.length; e++) + t.treeDocument.removeRoot(n[e]); + if (0 == t.treeDocument.getAllDescendants().length) { + var s = { + contextid: o, + length: t.treeDocument.getAllDescendants().length, + }; + d.publish('relatedScope:update', s); + } + c.success(a.CHG_GOV_relatedScope_Remove_Success), + u.unmask(r); + }, + function (e) { + u.unmask(r), n(); + }, + ); + }); + }, + addNodesInLayoutModel: function (e, t) { + let i = h.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else + for (let t = i.length - 1; t >= 0; t--) + e.getXSO().add(i[t]), e.addRoot(i[t], 0); + e.pushUpdate(); + }, + filterView: function (e, t) { + let i = t, + n = e.matchingIDs; + i.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: n, + }, + }, + }); + }, + enableColorizeView: function (e, t) { + let i = t.getAllDescendants(); + var n, o; + (n = e), + (o = function (e, t) { + i.map((i) => { + if (i.options.grid.id === t) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + i.updateOptions(n); + } + }); + }), + UWA.is(n, 'array') && + n.forEach(function (e) { + var t = e.color, + i = e.id; + o(t, i); + }); + }, + disableColorizeView: function (e, t) { + t.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return h; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisCreate', + [ + 'DS/ENONewWidget/ENONewLauncher', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/UIKIT/Mask', + 'require', + 'DS/PlatformAPI/PlatformAPI', + ], + function (e, t, i, n, o, a) { + return { + launchCreateChangeIADialog: function ({ contextCRId: n }) { + console.log( + 'launchCreateChangeIADialog ............................', + ); + let a = { + context: { + service: '3DSpace', + tenant: t.getGlobalVariable().tenant, + header: { + SecurityContext: t.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: i.CHG_NEW_CHANGE_ANALYSIS_FORM, + type: 'Change Analysis', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Analysis', + preferedType: 'Change Analysis', + select: [], + parentPIDs: [n], + }, + events: { + onSuccess: function (e) { + document.getElementsByClassName('moduleWrapper')[0]; + try { + let t = o('DS/ENOChgProbes/scripts/ChgCloudProbeUtils'); + var i = e.result[0]; + (i.isKindOfType = 'Change Analysis'), + t.cloudProbeUtils.sendChgObjectCreateTrackerEvent({ + createData: i, + View: 'Impact Analysis', + }); + } catch (e) { + console.log(e); + } + o( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/util/ChgCRImpactAnalysisGridColsUtil', + ).filterView('activeIA'), + (t.TriggerCustomeUpdate = 'false'); + }, + onFailure: function (e) { + console.log('onFailure...............' + e); + }, + onCancel: function (e) {}, + }, + }; + var r = { + commandInfo: { + type: 'Impact Analysis', + facet: 'Impact Analysis', + action: 'CR>Impact Analysis>New Impact Analysis', + }, + }; + o( + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ).cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: r, + }), + new e().CreateNew(a); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/BaseFilter', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o, a, r) { + 'use strict'; + var s = n.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }); + return e.extend({ + init: function (e) { + this._parent(e), (this.options = e), (this.treeDocument = null); + }, + registerCustomFilter: function () { + this.treeDocument.getFilterManager().registerFilter('stringRole', s); + }, + resetModel: function () { + this.treeDocument.empty(); + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + this.treeDocument = new t({ + id: 'ChgCAProposedChangesTreeDoc', + useAsyncPreExpand: !0, + }); + }, + emptyTreeDocument: function () { + this.treeDocument.empty(); + }, + updateTreeDocument: function (e) { + this.treeDocument.prepareUpdate(); + for (var t = 0; t < e.length; t++) + this.treeDocument.addRoot(this.createTreeNode(e[t])); + this.treeDocument.expandAll(), this.treeDocument.pushUpdate(); + }, + createTreeNode: function (e) { + return this.getProposedTreeNode(e); + }, + getProposedTreeNode: function (e) { + return ( + (e.change = this.getChange(e)), + (e.change_details = this.getChangeDetails(e)), + (e.activityIcon = this.getProposedActivityIconName(e)), + (e.proposedStatus = this.getProposedStatus(e)), + new i({ + id: e.id, + label: e.title, + title: e.title, + name: e.name, + revision: e.revision, + type: e.type, + typeNLS: e.typeNLS, + maturity: e.maturity, + maturityNLS: e.maturityNLS, + description: e.description, + organization: e.organization, + organizationNLS: e.organizationNLS, + collabspace: e.collabspace, + collabspaceNLS: e.collabspaceNLS, + isLastRevision: e.isLastRevision, + icons: [e.icon], + thumbnail: e.previewIcon, + change: e.change, + change_details: e.change_details, + proposedPID: e.proposedPID, + proposedStatus: e.proposedStatus, + reasonForChange: e.proposedWhy, + activityIcon: e.activityIcon, + subLabel: e.type + ' | ' + e.revision + ' | ' + e.name, + grid: e, + useAsyncPreExpand: !0, + }) + ); + }, + getChange: function (e) { + return r['CHG_GOV_Proposed_Activity_' + e.proposedOperation] + ? r['CHG_GOV_Proposed_Activity_' + e.proposedOperation] + : ''; + }, + getChangeDetails: function (e) { + var t = this.getChange(e); + return ( + (t += ' ' + this.getPrefix(e)), + e.activityWhy.forEach(function (e) { + (t += '\n'), (t += e); + }), + t + ); + }, + getPrefix: function (e) { + var t = ''; + if (e && e.proposedOperation) + switch (e.proposedOperation) { + case 'None': + t = ''; + break; + case 'NewEvolution': + t = r.CHG_GOV_Proposed_Grammar_Prefix + ': ' + e.targetState; + break; + case 'NewVersion': + t = ''; + break; + case 'ChangeStatus': + t = + r.CHG_GOV_Proposed_Grammar_MaturityState + + ': ' + + e.targetState; + } + return t; + }, + getProposedActivityIconName: function (e) { + var t = ''; + if (e && e.proposedOperation) + switch (e.proposedOperation) { + case 'None': + t = 'pencil wux-ui-3ds'; + break; + case 'NewEvolution': + t = 'flow-branch-add wux-ui-3ds'; + break; + case 'ChangeStatus': + t = 'collaborative-lifecycle-management'; + break; + case 'NewVersion': + t = 'flow-line-add wux-ui-3ds'; + } + return t; + }, + getProposedStatus: function (e) { + var t = ''; + if (e && e.proposedStatus) + switch (e.proposedStatus) { + case 'Not Started': + t = 'notStartedKey'; + break; + case 'Started': + t = 'startedKey'; + break; + case 'Partial': + t = 'partialKey'; + break; + case 'Complete': + t = 'completedKey'; + break; + default: + t = 'notStartedKey'; + } + return t; + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovPreferenceConstant', + [], + function () { + 'use strict'; + var e = { + _KEY: 'xchange-app', + _VIEWS_PREFERENCES: 'xchange-views-preferences', + _MY_CHANGE_ORDERS: 'xchange-my-change-orders', + _RECENTLY_OPENED: 'xchange-recently-opened', + _CHANGE_ORDERS_DETAILS: 'xchange-change-orders-details', + _CHANGE_REQUESTS_DETAILS: 'xchange-change-requests-details', + _CHANGE_ACTIONS_DETAILS: 'xchange-change-actions-details', + _LIST_VIEW: 'xchange-list-view', + _TAB: 'tab', + _OBJECTIDs: 'objectIDs', + _COTAB: 'cotab', + _CRTAB: 'crtab', + _FILTERVIEW: 'filterview', + _MODEL: 'model', + _ID_CARD: 'id-card', + _ORCHESTRATION_LEVEL1: 'orchestration-level1', + _ORCHESTRATION_LEVEL2: 'orchestration-level2', + _ORCHESTRATION_LEVEL3: 'orchestration-level3', + _LAST_ROUTE: 'last-route', + _FILTERS: 'filters', + _SELECTIONS: 'selections', + _DATE_FORMAT: '%m/%d/%Y , %I:%M:%S %p', + }; + return e; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/util/ChgCRMemberFilterView', + [ + 'UWA/Class/View', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'UWA/Core', + 'DS/Handlebars/Handlebars4', + ], + function (e, t, i, n) { + return e.extend({ + name: 'teamfilter', + tagName: 'div', + className: 'chg-member-view', + setup: function () { + (this.template = + '
' + + t.CHG_Member_Filter_ByName + + '
' + + t.CHG_Member_Filter_ByResponsibilities + + '
'), + (this.renderer = this.getTemplate(this.template)); + }, + init: function (e) { + (e = i.clone(e || {}, !1)), this._parent.call(this, e); + }, + render: function () { + this.name, this.cid; + this.container.empty(), (containerReference = this.container); + var e = UWA.createElement('div', { + class: 'chg-member-view-role-filter', + styles: { + height: '10%', + }, + }), + t = this.renderer(); + return e.addContent(t), e.inject(containerReference), this; + }, + injectSubView: function (e, t) { + var i = this.container.getElement(t); + e && i && i.grab(e.render().getContent()); + }, + getTemplate: function (e) { + var t = n.compile(e), + i = this; + return ( + (i.data = { + placeholder: i.options.placeholder, + }), + function () { + return t(i.data); + } + ); + }, + domEvents: { + 'keyup .filtertext': function (e) { + var t = e.target.value, + i = this.container.getElement('.clear-filter'); + t.length > 0 + ? i.setStyle('visibility', 'visible') + : i.setStyle('visibility', 'hidden'), + this.dispatchEvent('memberRoleFilter', arguments); + }, + 'click .clear-filter': function (e) { + this.container + .getElement('.clear-filter') + .setStyle('visibility', 'hidden'); + var t = this.container.getElement('.filtertext'); + if (t) { + t.value = ''; + } + this.dispatchEvent('memberFilterKeyUp', { + target: { + value: '', + }, + }); + }, + 'focus .filtertext': function () { + var e = document.getElementsByClassName( + 'searchfiler-input-container', + ); + e.addClassName('highlighted-border'), + e.removeClassName('border-without-focus'); + }, + 'click .roleFilter': function () { + this.dispatchEvent('memberRoleFilter', arguments); + }, + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/attachment/ChgAttachmentfacet', + [ + 'UWA/Core', + 'DS/EditPropWidget/facets/Common/FacetsBase', + 'DS/EditPropWidget/constants/EditPropConstants', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'UWA/Class/Model', + 'DS/UIKIT/Mask', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'css!DS/ENOChgGovernanceUX/ENOChgGovernanceUX', + 'DS/PlatformAPI/PlatformAPI', + 'require', + ], + function (e, t, i, n, o, a, r, s, l, c) { + 'use strict'; + return t.extend({ + init: function () { + this._parent.apply(this, arguments), + this.elements.container || + (this.elements.container = e.createElement('div', { + id: 'attachment-mainContainer', + })); + }, + updateFacet: function () { + var e = this; + a.mask(this.elements.container), + require([ + 'DS/ENOChgGovernanceUX/scripts/components/attachmentView/ChgAttachmentView', + ], function (t) { + var i = e.getModel(), + o = i.get('objectId'); + 1 != i.isMergedModel() && + n.getObjectTypeInformation(o).then(function (i) { + if ('Change Order' == i) + n.getChangeOrderUserAccess(o).then(function (n) { + var o = n.data[0].dataelements; + if ( + ((o = r.processAccessBitCO(o)), + e.elements && e.elements.container) + ) { + var s = e.getModel(); + if (!s) return !1; + e.elements.container.setContent(''); + var l = { + id: s.get('objectId'), + target: e.elements.container, + parentType: i, + }; + t.create(l, 'false' == o.AddReferential), + a.unmask(e.elements.container); + } + }); + else if ('Change Request' == i) + n.getChangeRequestUserAccess(o).then(function (n) { + var o = n.data[0].dataelements; + if (e.elements && e.elements.container) { + var r = e.getModel(); + if (!r) return !1; + e.elements.container.setContent(''); + var s = { + id: r.get('objectId'), + target: e.elements.container, + parentType: i, + }; + t.create(s, 'false' == o.AddReferential), + a.unmask(e.elements.container); + } + }); + else if ('Change Action' == i) { + c( + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ) + .getUserAccess('pid:' + o) + .then(function (n) { + var o = n.userAccess; + if (e.elements && e.elements.container) { + var r = e.getModel(); + if (!r) return !1; + e.elements.container.setContent(''); + var s = { + id: r.get('objectId'), + target: e.elements.container, + parentType: i, + }; + t.create(s, 'false' == o.AddReferential), + a.unmask(e.elements.container); + } + }); + } else + '' == i && + n.getImpactAnalysisUserAccess(o).then(function (n) { + var o = n.data[0].dataelements; + if (e.elements && e.elements.container) { + var r = e.getModel(); + if (!r) return !1; + e.elements.container.setContent(''); + var s = { + id: r.get('objectId'), + target: e.elements.container, + parentType: i, + }; + t.create(s, 'false' == o.ManageAttachments), + a.unmask(e.elements.container); + } + }); + }); + }); + }, + destroyComponent: function () { + e.is(this.destroy, 'function') && this.destroy(); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/util/ChgCAMembersFeaturesUtil', + [ + 'UWA/Core', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'require', + ], + function (e, t, i) { + 'use strict'; + return { + showRMBMenuOnGrid: function (e, t) { + return new Promise(function (n, o) { + var a = 'false', + r = {}, + s = i( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/util/ChgCAMembersFeaturesUtil', + ), + l = t.cellInfos.nodeModel.getTreeDocument().getSelectedNodes(), + c = l[0].options.grid.roles; + r.currentObjType = l[0].options.grid.type; + var d = 0; + l.length > 1 && (a = 'true'), + c.indexOf('contributor') >= 0 + ? ((r.contributor = 'DISCONNECT'), d++) + : (r.contributor = 'CONNECT'), + c.indexOf('approver') >= 0 + ? ((r.approver = 'DISCONNECT'), d++) + : (r.approver = 'CONNECT'), + c.indexOf('follower') >= 0 + ? ((r.follower = 'DISCONNECT'), d++) + : (r.follower = 'CONNECT'); + let u, + g = c.indexOf('owner') >= 0; + 0 == g && 1 == d && (r.showConfirmation = !0), + 'false' == a && + (u = i( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersDataGridLayout', + )); + let p = []; + var h = t.cellInfos.nodeModel.options.grid.id, + m = t.cellInfos.nodeModel.options.grid.type, + C = t.cellInfos.nodeModel.options.grid.name, + v = t.cellInfos.nodeModel.options.grid.displayType; + 'Group' == m && + ((m = 'foaf:Group'), + (C = t.cellInfos.nodeModel.options.grid.fullName), + (v = t.cellInfos.nodeModel.options.grid.type)); + var f = { + objectId: h, + objectType: m, + displayName: C, + displayType: v, + facetName: 'dependency', + }; + [].push(f); + var b = i( + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ).openWith(f), + w = []; + w.push(b), + Promise.all(w).then(function (i) { + if ('Person' == r.currentObjType) { + 'true' == u.addContributorAccessBit && + p.push(s.getContributorMenu(e, t, r)); + let i = u.ChgMembersTreeModel.getChildren(); + u.isRouteTempleteAttached = !1; + for (var o = 0; o < i.length; o++) { + 'Route Template' == i[o].options.grid.type && + (u.isRouteTempleteAttached = !0); + } + u.isRouteTempleteAttached || + 'true' != u.addReviewerAccessBit || + p.push(s.getReviewerMenu(e, t, r)), + 'true' == u.addFollowerAccessBit && + p.push(s.getFollowerMenu(e, t, r)); + } else 'Group' == r.currentObjType && ('true' == u.addContributorAccessBit && p.push(s.getContributorMenu(e, t, r)), 'true' == u.addFollowerAccessBit && p.push(s.getFollowerMenu(e, t, r))); + 'true' == u.addFollowerAccessBit && + 0 == g && + p.push(s.getDeleteMenu(e, t, r)), + i[0] && p.push(i[0]), + n(p); + }); + }); + }, + getContributorMenu: function (e, i, n) { + var o = { + type: 'CheckItem', + title: t.CHG_Member_Menu_Assignees, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersDataGridLayout', + ], function (e) { + console.log('contributor : ' + n.contributor), + (n.role = 'contributor'), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + return 'DISCONNECT' == n.contributor && (o.state = 'selected'), o; + }, + getReviewerMenu: function (e, i, n) { + var o = { + type: 'CheckItem', + title: t.CHG_Member_Menu_Approvers, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersDataGridLayout', + ], function (e) { + console.log('approver : ' + n.approver), + (n.role = 'approver'), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + return 'DISCONNECT' == n.approver && (o.state = 'selected'), o; + }, + getFollowerMenu: function (e, i, n) { + var o = { + type: 'CheckItem', + title: t.CHG_Member_Menu_Follower, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersDataGridLayout', + ], function (e) { + console.log('follower : ' + n.follower), + (n.role = 'follower'), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + return 'DISCONNECT' == n.follower && (o.state = 'selected'), o; + }, + getDeleteMenu: function (e, i, n) { + return { + type: 'PushItem', + title: t.CHG_Member_Menu_Remove, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-remove', + }, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersDataGridLayout', + ], function (e) { + console.log('remove '), + (n.role = []), + 'DISCONNECT' == n.follower && n.role.push('follower'), + 'DISCONNECT' == n.approver && n.role.push('approver'), + 'DISCONNECT' == n.contributor && n.role.push('contributor'), + (n.showConfirmation = !0), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemViewToolbar', + [ + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t) { + let i = Object.create(null); + return ( + (i.createData = { + menu: [ + { + type: 'PushItem', + title: + t.CHG_GOV_ImpactedItem_Toolbar_Add_Existing_OrchestrateChangeActions, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemDataGridLayout', + func: '_OrchestrateChangeActions', + }, + tooltip: + t.CHG_GOV_ImpactedItem_Toolbar_Add_Existing_OrchestrateChangeActions, + }, + { + type: 'PushItem', + title: t.CHG_GOV_ImpactedItem_Toolbar_Add_Existing_ChangeAction, + state: 'disabled', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemDataGridLayout', + func: 'addExistingChangeAction', + }, + tooltip: t.CHG_GOV_ImpactedItem_Toolbar_Add_Existing_ChangeAction, + }, + ], + }), + (i.viewData = { + menu: [ + { + type: 'CheckItem', + title: t.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemDataGridLayout', + func: 'changeImpactView', + argument: { + view: 'GridView', + }, + }, + tooltip: t.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: t.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemDataGridLayout', + func: 'changeImpactView', + argument: { + view: 'TileView', + }, + }, + tooltip: t.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (i.writetoolbarDefinition = function (i) { + const n = 'true' === i.accessBits.AddImpactedItems, + o = 'true' === i.accessBits.RemoveImpactedItems, + a = 'true' === i.accessBits.ManageImplementingChanges; + let r = { + entries: [ + { + id: 'addExisting', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: t.CHG_GOV_ImpactedItem_Toolbar_AddImpactedItem, + position: 'far', + visibleFlag: n, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemDataGridLayout', + func: 'addExistingHandler', + }, + }, + }, + { + id: 'changeAssessment', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'component', + fontIconFamily: 1, + }, + tooltip: t.CHG_GOV_ImpactBasis_Toolbar_ChangeAssessment, + position: 'far', + disabled: !0, + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemDataGridLayout', + func: 'changeAssessmentHandler', + }, + }, + }, + { + id: 'massUpdate', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'pencil', + fontIconFamily: 1, + }, + disabled: !0, + tooltip: 'Mass Update', + position: 'far', + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemDataGridLayout', + func: 'massUpdateHandler', + }, + }, + }, + { + id: 'create', + dataElements: { + typeRepresentation: 'addDropdown', + icon: { + iconName: 'change-action', + fontIconFamily: 1, + }, + value: this.createData, + tooltip: + t.CHG_GOV_ImpactedItem_Toolbar_Add_Existing_OrchestrateChangeActions_Drop_Down, + }, + position: 'far', + disabled: !1, + visibleFlag: a, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: t.CHG_GOV_ChangeOrchestration_Toolbar_Remove, + position: 'far', + visibleFlag: o, + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'addDropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + return ( + e.getGlobalVariable().is3DSpace && + (r.entries = r.entries.filter((e) => 'changeAssessment' != e.id)), + r + ); + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/DocumentUtils', + [ + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/DocumentManagement/DocumentManagement', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + ], + function (e, t, i) { + 'use strict'; + return { + init: function () {}, + preview: function (e) { + this._loadCommands(e, 'Preview'); + }, + edit: function (e) { + this._loadCommands(e, 'Edit'); + }, + undoEdit: function (e) { + this._loadCommands(e, 'UndoEdit'); + }, + update: function (e) { + this._loadCommands(e, 'Update'); + }, + download: function (e) { + this._loadCommands(e, 'Download'); + }, + _loadCommands: function (t, n) { + require([ + 'DS/DocumentCommands/ENOXDocumentCommands', + 'DS/DocumentCommands/DocumentCommandsV2', + 'DS/DocumentManagement/DocumentManagement', + 'DS/CoreEvents/ModelEvents', + ], function (o, a, r, s) { + let l = e.getGlobalVariable(); + var c = decodeURIComponent(l.getSecurityContext()), + d = l.tenant, + u = l.get3DSpaceURL(), + g = t; + ('Download' !== n && 'Preview' !== n) || + r.getDocuments(g, { + tenant: d, + securityContext: c, + tenantUrl: u, + onComplete: function (e) { + if (e.success) { + if (!Array.isArray(e.data)) return; + var t = new s(); + t.subscribe( + { + event: 'docv2-show-notification', + }, + function (e) { + e && + i.showNotification( + e.level, + e.title, + e.subtitle, + e.message, + e.sticky, + ); + }, + ), + new a({ + fetchSecurityContext: function () { + return decodeURIComponent(l.getSecurityContext()); + }, + getSelectedNodes: function () { + return e.data; + }, + getDocumentFromNodeModel: function (e) { + return e; + }, + platformUrls: { + '3DSpace': u, + }, + events: t, + }).commands[n].execute(); + } + }, + onFailure: function (e) { + console.log(e); + }, + }); + }); + }, + getDocuments: function (i) { + let n = e.getGlobalVariable(); + var o = decodeURIComponent(n.getSecurityContext()), + a = n.tenant, + r = n.get3DSpaceURL(); + return UWA.is(i, 'array') + ? new Promise(function (e, n) { + t.getDocuments(i, { + getVersions: !1, + additionalURLParams: '$fields=isDocumentType', + tenantUrl: r, + tenant: a, + securityContext: o, + onComplete: function (t) { + e(t.data); + }, + onFailure: n, + }); + }) + : Promise.reject(); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationCreateChange', + [ + 'DS/ENOChgActionCMDs/scripts/Commands/AddToNewCA', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENONewWidget/ENONewLauncher', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o, a) { + var r = { + onCompleteCallback: function (e) { + console.log('................................'); + var t = i.processChangeActionInContext(e).processData; + console.log(t), + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + ], function (e) { + e.addNodesInLayout(t); + }); + }, + onFailureCallback: function () { + console.log('ERROR : FAILED CREATE CA'); + }, + createNewChange: function () { + e.prototype.execute(r.onCompleteCallback); + }, + createNewChangeOrderInContext: function (e) { + let t = e.parentID; + console.log( + 'launchCreateChangeOrderDialog ............................', + ); + let i = { + context: { + service: '3DSpace', + tenant: n.getGlobalVariable().tenant, + header: { + SecurityContext: n.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: a.CHG_NEW_CHANGE_ORDER_FORM, + type: 'Change Order', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Order', + preferedType: 'Change Order', + select: [], + parentPIDs: [t], + }, + events: { + onSuccess: function (e) { + let t = { + objectID: e.result[0].identifier, + type: 'Change Order', + }; + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + ], function (e) { + e.ChgOrchestrationDataGridModel.addNewChildren(t); + }); + }, + onFailure: function (e) { + console.log('onFailure...............' + e); + }, + onCancel: function (e) {}, + }, + }; + new o().CreateNew(i); + }, + createNewChangeActionInContext: function (e) { + let t = e.parentID; + console.log( + 'createNewChangeActionInContext ............................', + ); + let i = { + context: { + service: '3DSpace', + tenant: n.getGlobalVariable().tenant, + header: { + SecurityContext: n.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: a.CHG_NEW_CHANGE_ACTION_FORM, + type: 'Change Action', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Action', + preferedType: 'Change Action', + select: [], + parentPIDs: [t], + }, + events: { + onSuccess: function (e) { + let t = { + objectID: e.result[0].identifier, + type: 'Change Action', + }; + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + ], function (e) { + e.ChgOrchestrationDataGridModel.addNewChildren(t); + }); + }, + onFailure: function (e) { + console.log('onFailure...............' + e); + }, + onCancel: function (e) {}, + }, + }; + new o().CreateNew(i); + }, + createChangeRequestInContext: function (e) { + let t = e.parentID, + i = []; + e.selectedIDs && (i = e.selectedIDs), + console.log( + 'launchCreateChangeRequestDialog ............................', + ); + let r = { + context: { + service: '3DSpace', + tenant: n.getGlobalVariable().tenant, + header: { + SecurityContext: n.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: a.CHG_GOV_Welcome_Activity_New_Change_Request, + type: 'Change Request', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Request', + preferedType: 'Change Request', + select: [], + parentPIDs: [t], + selectedIDs: i, + }, + events: { + onSuccess: function (t) { + let i = { + objectID: t.result[0].identifier, + type: 'Change Request', + }; + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + ], function (t) { + t.ChgOrchestrationDataGridModel.addNewChildren(i), + e.postComplete && e.postComplete(); + }); + }, + onFailure: function (e) { + console.log('onFailure...............' + e); + }, + onCancel: function (e) {}, + }, + }; + new o().CreateNew(r); + }, + }; + return r; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/applicability/ChgCRApplicabilityfacet', + [ + 'UWA/Core', + 'DS/EditPropWidget/facets/Common/FacetsBase', + 'DS/EditPropWidget/constants/EditPropConstants', + 'UWA/Class/Model', + 'DS/UIKIT/Mask', + 'css!DS/ENOChgGovernanceUX/ENOChgGovernanceUX', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o, a, r) { + 'use strict'; + return t.extend({ + init: function () { + this._parent.apply(this, arguments), + this.elements.container || + (this.elements.container = e.createElement('div', { + id: 'applicability-CR-container', + })); + }, + updateFacet: function () { + var e = UWA.createElement('div', { + html: r.CHG_GOV_Empty_DataGrid_PlaceHolder, + }); + document.getElementById('applicability-CR-container').setContent(''), + e.inject(this.elements.container); + }, + destroyComponent: function () { + e.is(this.destroy, 'function') && this.destroy(); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/issue/ChgIssueViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + let t = Object.create(null); + return ( + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + className: 'info-active', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/issue/ChgIssueDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/issue/ChgIssueTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function () { + return { + entries: [ + { + id: 'addExisting', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeRequest_Toolbar_AddIssue, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/issue/ChgIssueDataGridLayout', + func: 'addExistingHandler', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeRequest_Toolbar_RemoveIssue, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/issue/ChgIssueDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealizedChangesFilterModel', + ['UWA/Core'], + function (e) { + 'use strict'; + return { + getFilterModel: function () { + return { + tree: { + filterId: 'stringRegexp', + filterModel: '', + }, + title_instance: { + filterId: 'stringRegexp', + filterModel: '', + }, + typeNLS: { + filterId: 'set', + filterModel: [], + }, + name: { + filterId: 'stringRegexp', + filterModel: '', + }, + revision: { + filterId: 'set', + filterModel: [], + }, + maturityWithBadge: { + filterId: 'set', + filterModel: [], + }, + reasonForChange: { + filterId: 'stringRegexp', + filterModel: '', + }, + change: { + filterId: 'set', + filterModel: [], + }, + change_details: { + filterId: 'stringRegexp', + filterModel: '', + }, + moved_to: { + filterId: 'stringRegexp', + filterModel: '', + }, + }; + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeAction/ChgCADataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/TreeModel/BaseFilter', + 'require', + ], + function (e, t, i, n, o, a, r, s, l) { + 'use strict'; + var c = s.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }); + return e.extend({ + init: function () {}, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new n(), + i = new t({ + dataModelSet: e, + }); + return this.setTreeDocument(i), i; + }, + registerCustomFilter: function () { + this.treeDocument.getFilterManager().registerFilter('stringRole', c); + }, + loadIndexedChangeActions: function (e, t) { + var o = e, + a = new n(); + e.prepareUpdate(); + for (var r = 0; r < t.length; r++) { + var s = this.createCustomNameField(t[r]); + t[r].co_name = s; + var l = this.createCustomSeverity(t[r]); + t[r].sev = l; + var c = this.createCustomChangeCoordinatorField(t[r]); + t[r].co_Coordinator = c; + var d = this.createCustomOwnerField(t[r]); + t[r].co_Owner = d; + for ( + var u = this.getStatusBarIcons(t[r]), + g = this.statusbarIconsTooltips(t[r]), + p = this.getSubLevel(t[r]), + h = this.getDescription(t[r]), + m = this.createCustomTooltip(t[r]), + C = !1, + v = o.getChildren(), + f = 0; + f < v.length; + f++ + ) { + v[f].options.grid.id == t[r].id && (C = !0); + } + if (!C) { + var b = i.createTreeNodeDataModel(a, { + label: t[r].title, + subLabel: p, + description: h, + grid: t[r], + icons: [t[r].iconURL], + thumbnail: t[r].thumbnail, + statusbarIcons: u, + statusbarIconsTooltips: g, + customTooltip: m, + contextualMenu: ['Copy1', 'Move1'], + }); + e.addChild(b); + } + } + e.pushUpdate(); + }, + loadChangeActionData: function (e, t) { + var a = e; + let r = new n(); + e.prepareUpdate(); + for (let n = 0; n < t.length; n++) { + let d = this.createCustomNameField(t[n], 'NonIndex'); + t[n].co_name = d; + let u = this.createCustomSeverity(t[n]); + t[n].sev = u; + let g = this.createCustomChangeCoordinatorField(t[n]); + t[n].co_Coordinator = g; + let p = this.createCustomOwnerField(t[n]); + t[n].co_Owner = p; + let h = this.getStatusBarIcons(t[n], 'NonIndex'), + m = this.statusbarIconsTooltips(t[n], 'NonIndex'), + C = this.getSubLevel(t[n]), + v = this.getDescription(t[n]), + f = this.createCustomTooltip(t[n]); + for ( + var s = !1, + l = + (o.getGlobalVariable().existingCRIds, + (s = !1), + a.getChildren()), + c = 0; + c < l.length; + c++ + ) { + l[c].options.grid.id == t[n].id && (s = !0); + } + if (!s) { + let o = i.createTreeNodeDataModel(r, { + label: t[n].title, + subLabel: C, + description: v, + grid: t[n], + icons: [t[n].iconURL], + thumbnail: t[n].thumbnail, + statusbarIcons: h, + statusbarIconsTooltips: m, + customTooltip: f, + contextualMenu: ['Copy1', 'Move1'], + }); + e.addChild(o); + } + } + e.pushUpdate(); + }, + updateNodeIndexed: function (e, t) { + 0 == e.getChildren().length && + e._modelEvents.publish({ + event: 'caSummaryNotEmpty', + }), + e.unselectAll(); + let o = new n(), + a = this.createCustomNameField(t[0]); + t[0].co_name = a; + let r = this.createCustomSeverity(t[0]); + t[0].sev = r; + let s = this.createCustomChangeCoordinatorField(t[0]); + t[0].co_Coordinator = s; + let l = this.createCustomOwnerField(t[0]); + t[0].co_Owner = l; + let c = this.getStatusBarIcons(t[0]), + d = this.statusbarIconsTooltips(t[0]), + u = this.getSubLevel(t[0]), + g = this.getDescription(t[0]), + p = this.createCustomTooltip(t[0]), + h = i.createTreeNodeDataModel(o, { + label: t[0].title, + subLabel: u, + description: g, + grid: t[0], + icons: [t[0].iconURL], + thumbnail: t[0].thumbnail, + statusbarIcons: c, + statusbarIconsTooltips: d, + customTooltip: p, + }); + e.getXSO().add(h), e.addChild(h, 0); + }, + createCustomNameField: function (e, t) { + let i = new UWA.Element('div', {}); + UWA.createElement('span', { + html: e.name, + }).inject(i); + let n = new UWA.Element('div', { + class: 'iconsDiv', + }); + if ('true' == e.onHold) { + let e = new UWA.Element('div', { + class: 'gridIconContainer', + title: a.CHG_GOV_TOOLTIP_HOLD, + }); + UWA.createElement('div', { + class: 'fonticon fonticon-pause', + }).inject(e), + e.inject(n); + } + if ('NonIndex' == t) { + let e = new UWA.Element('div', { + class: 'gridIconContainer', + title: a.CHG_TOOLTIP_NEW_ACTION, + }); + UWA.createElement('div', { + class: + 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-database-add recentCA', + }).inject(e), + e.inject(n); + } + return n.inject(i), i.outerHTML; + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + createCustomChangeCoordinatorField: function (e) { + let t = new UWA.Element('div', { + class: 'members', + }); + if ('' != e.changeCoordinatorFullName) { + let i = new UWA.Element('div', { + class: 'assignee', + }), + n = + '/api/user/getpicture/login/' + + e.changeCoordinator + + '/format/normal', + a = o.getGlobalVariable().computeSwymUrl(n), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: a, + }); + else { + let t = r.getAvatarDetails(e.changeCoordinatorFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(i); + let l = UWA.createElement('span', { + class: 'userName', + html: e.changeCoordinatorFullName, + }); + i.inject(t), l.inject(t); + } + return t.outerHTML; + }, + createCustomSeverity: function (e) { + let t = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e.severity + ? (t = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e.severity && + (t = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + let i = new UWA.Element('div', {}), + n = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: t, + }).inject(n); + let o = UWA.createElement('span', { + html: e.severityNLS, + }); + return n.inject(i), o.inject(i), i.outerHTML; + }, + createCustomMaturity: function (e) { + let t = 'co-state co-draft'; + 'InWork' == e.maturity + ? (t = 'co-inwork co-state') + : 'InApproval' == e.maturity + ? (t = 'co-Inapproval co-state') + : 'Approved' == e.maturity + ? (t = 'co-approved co-state') + : 'Completed' == e.maturity && (t = 'co-completed co-state'); + let i = new UWA.Element('div', {}); + return ( + UWA.createElement('span', { + html: e.maturityNLS, + class: t, + }).inject(i), + i.outerHTML + ); + }, + getStatusBarIcons: function (e, t) { + let i = []; + return ( + 'Low' == e.severity + ? i.push('level-low') + : 'Medium' == e.severity + ? i.push('level-medium') + : 'High' == e.severity && i.push('level-high'), + 'true' == e.onHold && i.push('pause'), + 'NonIndex' == t && i.push('database-add'), + i + ); + }, + statusbarIconsTooltips: function (e, t) { + let i = []; + return ( + i.push(e.severityNLS), + 'true' == e.onHold && i.push(a.CHG_GOV_TOOLTIP_HOLD), + 'NonIndex' == t && i.push(a.CHG_TOOLTIP_NEW_ACTION), + i + ); + }, + createCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Severity + + ': ' + + e.severityNLS + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + getSubLevel: function (e) { + let t = ''; + return (t = e.name + ' | ' + e.ownerFullName); + }, + getDescription: function (e) { + let t = ''; + return (t = e.maturityNLS); + }, + filterView: function (e) { + let t = this.treeDocument, + i = e.matchingIDs; + t.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: i, + }, + }, + }); + }, + enableColorizeView: function (e) { + let t = this.treeDocument.getAllDescendants(); + var i, n; + (i = e), + (n = function (e, i) { + t.map((t) => { + if (t.options.grid.id === i) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + t.updateOptions(n); + } + }); + }), + UWA.is(i, 'array') && + i.forEach(function (e) { + var t = e.color, + i = e.id; + n(t, i); + }); + }, + disableColorizeView: function () { + this.treeDocument.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + [ + 'UWA/Core', + 'DS/PlatformAPI/PlatformAPI', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i) { + return { + findProposedChanges: function (e) { + t.publish('ECM_GOV_ProposedDGV_FIND:' + (widget ? widget.id : '')); + }, + addProposedChange: function (e) { + t.publish('ECM_GOV_ProposedDGV_ADD:' + (widget ? widget.id : '')); + }, + addProposedViaAssessment: function (e) { + t.publish( + 'ECM_GOV_ProposedDGV_ADD_ASSESSMENT:' + (widget ? widget.id : ''), + ); + }, + massUpdateHandler: function (e) {}, + downloadProposedChange: function (e) { + t.publish('ECM_GOV_Proposed_Download:' + (widget ? widget.id : '')); + }, + removeProposedChange: function (e) {}, + launchCustomColumnManager: function (e) {}, + switchViewHandler: function (e) { + 'DGV' === e.type + ? (e.context.nodeModel.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: i.CHG_TOOLTIP_GRID_VIEW, + }), + (e.context.nodeModel.options.grid.data.menu[0].state = + 'selected'), + (e.context.nodeModel.options.grid.data.menu[1].state = + 'unselected'), + t.publish('ECM_GOV_ProposedDGV_ON:' + (widget ? widget.id : ''))) + : 'LTLV' === e.type && + (e.context.nodeModel.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-big-tile', + }, + }, + }, + tooltip: i.CHG_TOOLTIP_LARGE_TILE_VIEW, + }), + (e.context.nodeModel.options.grid.data.menu[0].state = + 'unselected'), + (e.context.nodeModel.options.grid.data.menu[1].state = + 'selected'), + t.publish( + 'ECM_GOV_ProposedDGV_OFF:' + (widget ? widget.id : ''), + )); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbar', + ['UWA/Core', 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e, t) { + let i = Object.create(null); + return ( + (i.expandCollapseMenu = { + menu: [ + { + type: 'CheckItem', + title: t.CHG_GOV_Expand_All, + state: 'selected', + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-flow-tree-expand-down', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'expandCollapseHandler', + argument: { + action: 'EXPAND', + }, + }, + tooltip: t.CHG_GOV_Expand_All, + }, + { + type: 'CheckItem', + title: t.CHG_GOV_Collapse_All, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-flow-tree-expand-up', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'expandCollapseHandler', + argument: { + action: 'COLLAPSE', + }, + }, + tooltip: t.CHG_GOV_Collapse_All, + }, + ], + }), + (i.switchViewMenu = { + menu: [ + { + type: 'CheckItem', + title: t.CHG_TOOLTIP_GRID_VIEW, + state: 'selected', + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'switchViewHandler', + argument: { + type: 'DGV', + }, + }, + tooltip: t.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: t.CHG_TOOLTIP_LARGE_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-big-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'switchViewHandler', + argument: { + type: 'LTLV', + }, + }, + tooltip: t.CHG_TOOLTIP_LARGE_TILE_VIEW, + }, + ], + }), + (i.getProposedChangesToolbarDefinition = function (e) { + return ( + (this.switchViewMenu.menu[0].state = 'selected'), + (this.switchViewMenu.menu[1].state = 'unselected'), + { + entries: [ + { + id: 'findProposed', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'find', + fontIconFamily: 1, + }, + tooltip: t.CHG_GOV_Proposed_Find, + position: 'far', + category: 'commands', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'findProposedChanges', + }, + }, + }, + { + id: 'addProposed', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: t.CHG_GOV_Proposed_Add, + position: 'far', + category: 'commands', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'addProposedChange', + }, + }, + }, + { + id: 'changeAssessmentProposed', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'component', + fontIconFamily: 1, + }, + tooltip: t.CHG_GOV_Proposed_ChangeAssessment, + position: 'far', + category: 'commands', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'addProposedViaAssessment', + }, + }, + }, + { + id: 'massUpdate', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'pencil', + fontIconFamily: 1, + }, + tooltip: t.CHG_GOV_Proposed_MassUpdate, + position: 'far', + category: 'commands', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'massUpdateHandler', + }, + }, + }, + { + id: 'downloadProposed', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'download', + fontIconFamily: 1, + }, + tooltip: t.CHG_GOV_Download, + position: 'far', + category: 'commands', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'downloadProposedChange', + }, + }, + }, + { + id: 'removeProposed', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: t.CHG_GOV_Proposed_Remove, + position: 'far', + category: 'commands', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'removeProposedChange', + }, + }, + }, + { + id: 'cmd_1_cust_view', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'cog', + fontIconFamily: 1, + }, + tooltip: t.ECM_GOV_CUSTOM_COL, + position: 'far', + category: 'commands', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesToolbarHandler', + func: 'launchCustomColumnManager', + }, + }, + }, + { + id: 'switch_view_menu', + dataElements: { + typeRepresentation: 'functionMenuIcon', + icon: { + iconName: 'view-list', + fontIconFamily: 1, + }, + tooltip: t.CHG_TOOLTIP_GRID_VIEW, + value: this.switchViewMenu, + }, + position: 'far', + category: 'view', + }, + ], + } + ); + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/relatedScope/ChgCRrelatedScopeViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + let t = Object.create(null); + return ( + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + className: 'info-active', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/relatedScope/ChgCRrelatedScopeDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/relatedScope/ChgCRrelatedScopeTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function () { + return { + entries: [ + { + id: 'add', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_Toolbar_AddRelatedScope, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/relatedScope/ChgCRrelatedScopeDataGridLayout', + func: 'addExistingHandler', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_Toolbar_RemoveRelatedScope, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/relatedScope/ChgCRrelatedScopeDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/decisionView/ChgDecisionView', + [ + 'DS/ENXDecisionMgmt/View/Facets/DecisionTab', + 'DS/ENXDecisionMgmt/View/RightSlideIn/DecisionPropPanelView', + 'DS/ENXDecisionMgmt/Controller/DecisionBootstrap', + 'DS/Core/ModelEvents', + 'DS/UIKIT/Mask', + 'DS/Windows/Dialog', + 'DS/Windows/ImmersiveFrame', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t, i, n, o, a, r, s) { + 'use strict'; + return { + createDecisionView: function (n) { + let l = n.target; + null != widget.decisionEvent && + (widget.decisionEvent.unsubscribe('decision-create-click'), + widget.decisionEvent.unsubscribe('decision-preview-click'), + widget.decisionEvent.unsubscribe('decision-create-close-click'), + widget.decisionEvent.unsubscribe('decision-preview-close-click')); + let c = s.getGlobalVariable(), + d = c.tenant, + u = c.get3DSpaceURL(), + g = c.swymURL, + p = c.getSecurityContext(), + h = { + id: n.id, + securityContext: p, + tenant: d, + }; + e.init(h, l).then( + function (e) { + i.set3DSpaceURL(u), i.setSwymUrl(g), i.setCollabSpaceTenant(p, d); + let n, + s, + c = UWA.createElement('div', { + id: 'chg-Decision-container', + styles: { + height: '540px', + 'min-width': '540px', + }, + }), + h = new t(c); + widget.decisionEvent.subscribe( + 'decision-create-click', + function (e) { + h.init(e, 'decisionCreate'), + (n = new r()), + (s = new a({ + titleBarVisibleFlag: !1, + closeButtonFlag: !1, + resizableFlag: !0, + modalFlag: !0, + content: c, + immersiveFrame: n, + })), + n.inject(widget.body); + }, + ), + widget.decisionEvent.subscribe( + 'decision-preview-click', + function (e) { + h.init(e, 'decision'), + (n = new r()), + (s = new a({ + titleBarVisibleFlag: !1, + closeButtonFlag: !1, + resizableFlag: !0, + modalFlag: !0, + content: c, + immersiveFrame: n, + })), + n.inject(widget.body); + }, + ), + widget.decisionEvent.subscribe( + 'decision-preview-close-click', + function (e) { + null != s && ((s.visibleFlag = !1), s.destroy()), + null != n && n.destroy(); + }, + ), + widget.decisionEvent.subscribe( + 'decision-create-close-click', + function (e) { + null != s && ((s.visibleFlag = !1), s.destroy()), + null != n && n.destroy(); + }, + ), + o.unmask(l); + }, + function (e) { + reject(e); + }, + ); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/dependency/ChgCRDependencyfacet', + [ + 'UWA/Core', + 'DS/EditPropWidget/facets/Common/FacetsBase', + 'DS/EditPropWidget/constants/EditPropConstants', + 'UWA/Class/Model', + 'DS/UIKIT/Mask', + 'css!DS/ENOChgGovernanceUX/ENOChgGovernanceUX', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o, a, r) { + 'use strict'; + return t.extend({ + init: function () { + this._parent.apply(this, arguments), + this.elements.container || + (this.elements.container = e.createElement('div', { + id: 'dependency-CR-container', + })); + }, + updateFacet: function () { + var e = UWA.createElement('div', { + html: r.CHG_GOV_Empty_DataGrid_PlaceHolder, + }); + document.getElementById('dependency-CR-container').setContent(''), + e.inject(this.elements.container); + }, + destroyComponent: function () { + e.is(this.destroy, 'function') && this.destroy(); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/dependency/ChgDependencyfacet', + [ + 'UWA/Core', + 'DS/EditPropWidget/facets/Common/FacetsBase', + 'DS/EditPropWidget/constants/EditPropConstants', + 'UWA/Class/Model', + 'DS/UIKIT/Mask', + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'css!DS/ENOChgGovernanceUX/ENOChgGovernanceUX', + ], + function (e, t, i, n, o, a, r, s) { + 'use strict'; + return t.extend({ + init: function () { + this._parent.apply(this, arguments), + this.elements.container || + (this.elements.container = e.createElement('div', { + id: 'dependency-mainContainer', + })); + }, + updateFacet: function () { + var e = this; + o.mask(this.elements.container), + require([ + 'DS/ENOChangeActionUX/scripts/Views/CADependenciesGridView', + ], function (t) { + var i = e.getModel(), + n = i.get('objectId'); + 1 != i.isMergedModel() && + (a.publish('load-dependency' + widget.id, 'pid:' + n), + a.subscribe('dependency:update:View' + widget.id, function (i) { + if (e.elements && e.elements.container) { + if (null != document.getElementById('co-dependency')) + document.getElementById('co-dependency').destroy(); + var n = UWA.createElement('div', { + id: 'co-dependency', + }), + s = e.getModel(); + if (!s) return !1; + var l = s.get('objectId'), + c = 'pid:' + l, + d = {}; + (d.id = c), + (d.widgetId = widget.id), + (d.widgetTitle = widget.title), + r.getObjectTypeInformation(l).then(function (i) { + if ('Change Action' == i) + r.getChangeActionUserAccess(l).then(function (i) { + (d.showFlowdown = i.data[0].FlowdownFrom), + null != + document.getElementById( + 'dependency-mainContainer', + ) && + (document.getElementById( + 'dependency-mainContainer', + ).innerHTML = ''); + var r = new t(d); + (r.container = n), + r.render(), + n.inject(e.elements.container), + o.unmask(e.elements.container), + a.unsubscribe( + 'dependency:update:View' + widget.id, + ); + }); + else { + d.showFlowdown = !1; + var s = new t(d); + null != + document.getElementById( + 'dependency-mainContainer', + ) && + (document.getElementById( + 'dependency-mainContainer', + ).innerHTML = ''), + (s.container = n), + s.render(), + n.inject(e.elements.container), + o.unmask(e.elements.container), + a.unsubscribe('dependency:update:View' + widget.id); + } + }); + } + })); + }); + }, + destroyComponent: function () { + e.is(this.destroy, 'function') && this.destroy(); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/config/ChgGovAutoCompleteFilterlConfig', + ['UWA/Class', 'DS/TreeModel/BaseFilter'], + function (e, t) { + 'use strict'; + return e.extend({ + init: function () { + this.trigramNameFilter = t.inherit({ + isDataFiltered: function (e) { + var t = e.options.name, + i = e.options.identifier, + n = e.options.id; + return ( + void 0 === i && + void 0 !== n && + -1 !== n.indexOf('uuid') && + (i = n), + this.filterModel && this.filterModel.text && t && i + ? !( + -1 !== + t + .toLowerCase() + .indexOf(this.filterModel.text.toLowerCase()) || + -1 !== + i + .toLowerCase() + .indexOf(this.filterModel.text.toLowerCase()) + ) + : !this.filterModel || '' !== this.filterModel.text + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.text; + }, + }); + }, + getTrigramNameFilter: function () { + return UWA.clone(this.trigramNameFilter); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTransferWrapper', + [ + 'DS/ENOCollabSharingCmds/commands/TransferOwnershipCmd/ActionBar_ChangeOwnerCmd', + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + ], + function (e, t, i, n, o) { + return { + launchTransferDialog: function (e) { + this.enableTransferCommand(e); + }, + enableTransferCommand: function (t) { + var i = { + _selectedItems: [], + getSelectedNodes: function () { + return this._selectedItems; + }, + addSelection: function (e, t) { + this._selectedItems = []; + var i = this; + UWA.is(e, 'array') + ? e.forEach(function (e) { + i._selectedItems.push(e); + }) + : i._selectedItems.push(e); + }, + getReference: function (e) { + return getID(); + }, + getParent: function (e) { + return e.getParent(); + }, + getType: function (e) { + return getType(); + }, + getName: function (e) { + return getLabel(); + }, + securityContext: { + SecurityContext: n.getGlobalVariable().getSecurityContext(), + tenant: n.getGlobalVariable().tenant, + }, + getSecurityContext: function () { + return this.securityContext; + }, + }, + o = []; + for (let e = 0; e < t.length; e++) { + var a = UWA.extend(t[e], { + getID: function () { + return t[e].id; + }, + getLabel: function () { + return t[e].name; + }, + getOwner: function () { + return t[e].owner; + }, + getType: function () { + return t[e].type; + }, + getDisplayName: function () { + return t[e].name; + }, + object: { + revision: '-', + }, + }); + o.push(a); + } + i.addSelection(o), + new e({ + context: i, + ID: 'ActionBar_ChangeOwner', + }).begin(); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/util/ChgCRAddMemberView', + [ + 'UWA/Class/View', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'UWA/Core', + 'DS/Handlebars/Handlebars4', + ], + function (e, t, i, n) { + return e.extend({ + name: 'chg-add-member', + tagName: 'div', + className: 'chg-add-member', + setup: function () { + (this.template = + '
\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
' + + t.CHG_Add_Member_Change_Coordinator + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
' + + t.CHG_Add_Member_Assignee + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
' + + t.CHG_Add_Member_Approver + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
' + + t.CHG_Add_Member_Follower + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t
'), + (this.renderer = this.getTemplate(this.template)); + }, + init: function (e) { + (e = i.clone(e || {}, !1)), this._parent.call(this, e); + }, + render: function () { + this.name, this.cid; + this.container.empty(), (containerReference = this.container); + var e = UWA.createElement('div', { + class: 'chg-member-view', + styles: { + height: '10%', + }, + }), + t = this.renderer(); + return e.addContent(t), e.inject(containerReference), this; + }, + injectSubView: function (e, t) { + var i = this.container.getElement(t); + e && i && i.grab(e.render().getContent()); + }, + getTemplate: function (e) { + var t = n.compile(e), + i = this; + return ( + (i.data = { + placeholder: i.options.placeholder, + }), + function () { + return t(i.data); + } + ); + }, + domEvents: { + 'click .change-coordinator-field-search': function () { + this.dispatchEvent('searchChangeCoordinator', arguments); + }, + 'click .assignee-field-search': function () { + this.dispatchEvent('searchAssignee', arguments); + }, + 'click .approver-field-search': function () { + this.dispatchEvent('searchApprover', arguments); + }, + 'click .informed-user-field-search': function () { + this.dispatchEvent('searchInformedUser', arguments); + }, + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/util/ChgOrchestrationFeatureUtil', + [ + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgCustomAttributeService', + ], + function (e, t) { + 'use strict'; + return { + createCustomColumn: function (i) { + let n = this; + return new Promise(function (i, o) { + let a = e.getGlobalVariable().changeActionSubTypes, + r = [...e.getGlobalVariable().changeOrderSubTypes, ...a]; + t.getCombinedClassList(r).then(function (e) { + t.getPropertyForClassGrid(e).then(function (e) { + let o = t.makeCombinedColumnList(e), + a = n.filterColumn(o); + i(a); + }); + }); + }); + }, + filterColumn: function (e) { + let t = this, + i = [], + n = [ + 'ds6w:label', + 'ds6w:severity', + 'ds6w:status', + 'ds6w:type', + 'ds6w:identifier', + 'ds6w:responsible', + 'ds6w:project', + ]; + for (let t of n) for (let i of e) i.delete(t); + for (let n of e) + return ( + n.forEach((e, n, o) => { + let a = t.createColumnDefination(e, n); + i.push(a); + }), + i + ); + }, + createColumnDefination: function (e, t) { + e.dataType.replace('http://www.w3.org/2001/XMLSchema#', ''); + let i = e.dataType.replace('http://www.w3.org/2001/XMLSchema#', ''); + return { + text: e.vocabColumnsNameNLS, + dataIndex: t, + editableFlag: !1, + allowUnsafeHTMLContent: !1, + visibleFlag: !1, + dataType: i, + range: e.range, + getCellTypeRepresentation: function (e) { + return null != e.cellModel ? 'string' : 'functionIcon'; + }, + getCellSemantics: function (e) { + if (null != e.cellModel); + else if ('undefined' == e.cellModel || null == e.cellModel) + return { + icon: { + iconName: 'reload wux-ui-3ds-spin', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + }; + }, + getCellValue: function (e, i) { + return e.nodeModel.getAttributeValue(t); + }, + }; + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationCreateChange', + [ + 'DS/ENOChgActionCMDs/scripts/Commands/AddToNewCA', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENONewWidget/ENONewLauncher', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o) { + var a = { + onCompleteCallback: function (e) { + console.log('................................'); + var i = t.processChangeActionInContext(e).processData; + console.log(i), + require([ + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + ], function (e) { + e.addNodesInLayout(i); + }); + }, + onFailureCallback: function () { + console.log('ERROR : FAILED CREATE CA'); + }, + createNewChange: function () { + e.prototype.execute(a.onCompleteCallback); + }, + createNewChangeOrderInContext: function (e) { + let t = e.parentID; + console.log( + 'launchCreateChangeOrderDialog ............................', + ); + let a = { + context: { + service: '3DSpace', + tenant: i.getGlobalVariable().tenant, + header: { + SecurityContext: i.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: o.CHG_NEW_CHANGE_ORDER_FORM, + type: 'Change Order', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Order', + preferedType: 'Change Order', + select: [], + parentPIDs: [t], + }, + events: { + onSuccess: function (e) { + let t = { + objectID: e.result[0].identifier, + type: 'Change Order', + }; + require([ + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + ], function (e) { + e.ChgOrchestrationDataGridModel.addNewChildren(t); + }); + }, + onFailure: function (e) { + console.log('onFailure...............' + e); + }, + onCancel: function (e) {}, + }, + }; + new n().CreateNew(a); + }, + createNewChangeActionInContext: function (e) { + let t = widget.getValue('DefaultCASubType') + ? widget.getValue('DefaultCASubType') + : 'Change Action'; + let a = e.parentID, + r = { + context: { + service: '3DSpace', + tenant: i.getGlobalVariable().tenant, + header: { + SecurityContext: i.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: o.CHG_NEW_CHANGE_ACTION_FORM, + type: 'Change Action', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Action', + preferedType: t, + select: [], + parentPIDs: [a], + }, + events: { + onSuccess: function (e) { + let t = { + objectID: e.result[0].identifier, + type: 'Change Action', + }; + require([ + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + ], function (e) { + e.ChgOrchestrationDataGridModel.addNewChildren(t); + }); + }, + onFailure: function (e) { + console.log('onFailure...............' + e); + }, + onCancel: function (e) {}, + }, + }; + new n().CreateNew(r); + }, + }; + return a; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/applicabilityView/ChgApplicabilityView', + [ + 'UWA/Class/View', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i) { + 'use strict'; + return e.extend({ + container: '', + setup: function () {}, + build: function () { + UWA.is(this.container) && this.getBody().inject(this.container); + }, + getBody: function () { + var e = UWA.createElement('div', { + id: 'applicability-body', + }), + t = new (this._createView_Applicability())(); + return (t.container = e), (t.model = this.model), t.render(), e; + }, + _createView_Applicability: function () { + return e.extend({ + tagName: 'div', + className: 'generic-detail6', + render: function () { + var e = this.container, + i = new UWA.Element('div'); + i.setAttributes({ + id: 'FacetDivForApplicabilityContext', + }), + i.setStyles({ + height: '100%', + }), + e.addContent(i); + var n, + o = model.get('objectId'); + (n = t.getGlobalVariable().isNative + ? 'Native' + : t.getGlobalVariable().is3DSpace + ? '3DSpace' + : 'Dashboard'), + require([ + 'DS/CfgEvolutionUX/CfgEvolutionLayoutFactory', + ], function (e) { + var a = { + mode: 'Applicability', + objectid: o, + parent: i, + environment: n, + }; + a.tenant = t.getGlobalVariable().tenant; + e.create(a); + '3DSpace' == n && + (enoviaServerFilterWidget.fixForSearchInOpener = !0); + }); + }, + }); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/issue/ChgCRIssueViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + let t = Object.create(null); + return ( + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + className: 'info-active', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/issue/ChgCRIssueDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/issue/ChgCRIssueTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function () { + return { + entries: [ + { + id: 'addExisting', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeRequest_Toolbar_AddIssue, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/issue/ChgCRIssueDataGridLayout', + func: 'addExistingHandler', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeRequest_Toolbar_RemoveIssue, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/issue/ChgCRIssueDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/facets/issue/ChgCRIssueDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/UIKIT/Mask', + 'DS/TreeModel/BaseFilter', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u) { + 'use strict'; + var g = u.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + let t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }); + let p = e.extend({ + init: function (e) { + this.parentCRId = e; + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new t({ + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + let t = e.getChildren(); + for (let e = 0; e < t.length; e++) + if (this.options.grid.id == t[e].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument.getFilterManager().registerFilter('stringRole', g); + }, + loadIssueData: function (e, t) { + e.prepareUpdate(); + let i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + let n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = this.createCustomOwnerField(e); + e.chgObjOwner = t; + let n = e.name + ' | ' + e.ownerFullName; + '' == e.maturityNLS && (e.maturityNLS = e.stateNLS); + let o = e.maturityNLS; + var a = this.getCustomTooltip(e); + return new i({ + label: e.title, + subLabel: n, + description: o, + grid: e, + customTooltip: a, + icons: [e.icon], + thumbnail: e.thumbnail, + useAsyncPreExpand: !0, + }); + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + addExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCRId; + var a = e[0].id, + r = { + resolvedBy: [], + }; + (r.physicalId = a), + r.resolvedBy.push({ + physicalId: o, + }); + let c = document.getElementById('outer-issue-grid-div'); + 'undefined' != c && null != c && d.mask(c), + s.updateExistingIssue(a, r).then( + function (e) { + s.getIssueDetails(a).then(function (n) { + let o = n.body; + l.processedChangeRequestNewIssueList(o).then(function (n) { + p.prototype.addNodesInLayoutModel(t.treeDocument, n), + i(e); + }), + d.unmask(c); + }); + }, + function (e) { + d.unmask(c), n(e); + }, + ); + }); + }, + removeExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCRId; + var r = e[0].id, + l = { + resolvedBy: [], + }; + (l.physicalId = r), + l.resolvedBy.push({ + physicalId: o, + }); + let u = document.getElementById('outer-issue-grid-div'); + 'undefined' != u && null != u && d.mask(u), + s.removeExistingIssue(r, l).then( + function (e) { + let n = t.treeDocument.getSelectedNodes(); + i(n); + for (let e = 0; e < n.length; e++) + t.treeDocument.removeRoot(n[e]); + c.success(a.CHG_GOV_Issue_Remove_Success), d.unmask(u); + }, + function (e) { + d.unmask(u), n(); + }, + ); + }); + }, + addNodesInLayoutModel: function (e, t) { + let i = p.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else for (let t = i.length - 1; t >= 0; t--) e.addRoot(i[t], 0); + e.pushUpdate(); + }, + filterView: function (e, t) { + let i = t, + n = e.matchingIDs; + i.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: n, + }, + }, + }); + }, + enableColorizeView: function (e, t) { + let i = t.getAllDescendants(); + var n, o; + (n = e), + (o = function (e, t) { + i.map((i) => { + if (i.options.grid.id === t) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + i.updateOptions(n); + } + }); + }), + UWA.is(n, 'array') && + n.forEach(function (e) { + var t = e.color, + i = e.id; + o(t, i); + }); + }, + disableColorizeView: function (e, t) { + t.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return p; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/propertiesView/ChgGovPropertiesServices', + [ + 'UWA/Core', + 'UWA/Class', + 'DS/PlatformAPI/PlatformAPI', + 'DS/EditPropWidget/models/EditPropModel', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t, i, n, o) { + 'use strict'; + return t.singleton({ + init: function (e) {}, + getSecurityContext: function () { + return { + SecurityContext: o.getGlobalVariable().mySecurityContext, + }; + }, + getpropOptions: function (e) { + var t = this, + i = [e.FACET_PROPERTIES]; + return { + typeOfDisplay: e.ALL, + selectionType: e.NO_SELECTION, + readOnly: !1, + extraNotif: !0, + editMode: !1, + facets: i, + context: { + getSecurityContext: function () { + return t.getSecurityContext(); + }, + }, + }; + }, + getPropModel: function (e) { + var t = []; + if (e instanceof Array) + for (var a = 0; a < e.length; a++) { + var r = new n({ + metatype: e[a].metatype, + objectId: e[a].physicalId, + source: o.getGlobalVariable().serviceName, + tenant: o.getGlobalVariable().tenant, + }); + r.addEvent('onSave', function (e) { + i.publish('CO-Properties-Update', this); + }), + '' != r._attributes.objectId && t.push(r); + } + return t; + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersDataGridViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + var t = Object.create(null); + return ( + (t.toolbar = null), + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function () { + return { + entries: [ + { + id: 'add', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'user-add', + fontIconFamily: 1, + }, + tooltip: e.CHG_Member_Toolbar_AddMember, + position: 'far', + category: 'addRemove', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAAddMemberLayout', + func: 'launchAddMemberPanel', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_Member_Toolbar_Remove, + position: 'far', + category: 'addRemove', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'filter', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'filter', + fontIconFamily: 1, + }, + tooltip: e.CHG_Member_Toolbar_Filter, + position: 'far', + category: 'addRemove', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMemberFilterLayout', + func: 'launchFilterMemberPanel', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/idCardHeader/util/ChgIDCardHeaderMenuSubscriber', + [ + 'DS/ENOChgServices/scripts/components/ChgCommonDailog', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/PlatformAPI/PlatformAPI', + 'DS/UIKIT/SuperModal', + 'DS/ENOChgServices/scripts/services/ChgNativeInitService', + ], + function (e, t, i, n, o, a, r, s) { + return { + init: function (e) { + (this._modelForIdCard = e), this._subscribeToModelEvents(); + }, + _subscribeToModelEvents: function () { + var i = this; + (i.modelEvents = i._modelForIdCard.get('modelEvents')), + i.modelEvents.subscribe( + { + event: 'chg-idcard-dropdown-menu-action', + }, + function (n) { + if ( + (console.log( + 'in model event subscribe: chg-idcard-dropdown-menu-action', + ), + n.id) + ) { + var o = {}; + switch (n.id) { + case 'chgHold': + o = { + chgPhysicalId: i._modelForIdCard.id, + chgType: i._modelForIdCard.get('isKindOfType'), + btnId: n.id, + boxTitle: n.text, + subTitle: t.CHG_CO_Hold_SubTitle, + txtPlaceHolder: t.CHG_CO_Hold_PlaceHolder, + DoneCallback: DoneCallback, + CancelCallback: CancelCallback, + }; + break; + case 'chgResume': + o = { + chgPhysicalId: i._modelForIdCard.id, + chgType: i._modelForIdCard.get('isKindOfType'), + btnId: n.id, + boxTitle: n.text, + subTitle: t.CHG_CO_Resume_SubTitle, + txtPlaceHolder: t.CHG_CO_Resume_PlaceHolder, + DoneCallback: DoneCallback, + CancelCallback: CancelCallback, + }; + break; + case 'chgCancel': + o = { + chgPhysicalId: i._modelForIdCard.id, + chgType: i._modelForIdCard.get('isKindOfType'), + btnId: n.id, + boxTitle: n.text, + subTitle: t.CHG_CO_Cancel_SubTitle, + txtPlaceHolder: t.CHG_CO_Cancel_PlaceHolder, + DoneCallback: DoneCallback, + CancelCallback: CancelCallback, + }; + break; + case 'chgCAWorkUnder': + let e = { + btnId: n.id, + chgPhysicalId: i._modelForIdCard.id, + }; + DoneCallback(e); + break; + case 'chgBOMSync': + let a = { + btnId: n.id, + chgPhysicalId: i._modelForIdCard.id, + }; + DoneCallback(a); + } + 'chgCAWorkUnder' != n.id && + 'chgBOMSync' != n.id && + e.launchInfoDailog(o); + } + }, + ), + (DoneCallback = function (i) { + var o = i.btnId, + l = i.chgType; + if (o) { + switch (o) { + case 'chgHold': + 'ChangeOrder' == l + ? n.handleContextMenuClickHold(i).then(function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ], function (e) { + e.onRefresh(); + }); + }) + : 'ChangeRequest' == l + ? n.handleContextMenuClickHoldForCR(i).then(function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ], function (e) { + e.onRefresh(); + }); + }) + : 'ChangeAction' == l && + n.handleContextMenuClickHoldForCA(i).then(function (e) { + s.takeOffFromWorkUnder(), + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ], function (e) { + e.onRefresh(); + }); + }); + break; + case 'chgResume': + 'ChangeOrder' == l + ? n.handleContextMenuClickResume(i).then(function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ], function (e) { + e.onRefresh(); + }); + }) + : 'ChangeRequest' == l + ? n + .handleContextMenuClickResumeForCR(i) + .then(function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ], function (e) { + e.onRefresh(); + }); + }) + : 'ChangeAction' == l && + n + .handleContextMenuClickResumeForCA(i) + .then(function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ], function (e) { + e.onRefresh(); + }); + }); + break; + case 'chgCancel': + 'ChangeOrder' == l + ? n.handleContextMenuClickCancel(i).then(function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ], function (e) { + e.onRefresh(); + }); + }) + : 'ChangeRequest' == l + ? n + .handleContextMenuClickCancelForCR(i) + .then(function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ], function (e) { + e.onRefresh(); + }); + }) + : 'ChangeAction' == l && + n + .handleContextMenuClickCancelForCA(i) + .then(function (e) { + s.takeOffFromWorkUnder(), + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ], function (e) { + e.onRefresh(); + }); + }); + break; + case 'chgCAWorkUnder': + console.log('Work under menu clicked...!'), + n.handleContextMenuClickWorkUnder(i).then(function (e) { + a.publish('change-action-work-under', e); + }); + break; + case 'chgBOMSync': + n.handleContextMenuClickBOMSyncForCA(i).then(function (e) { + var i, + n = new r({ + closable: !0, + renderTo: widget.body, + }), + o = ''; + e && 'true' === e.OPERATION_STATUS + ? (o = t.ECM_CA_EBOMSync_Successful) + : e && + 'false' === e.OPERATION_STATUS && + (o = t.ECM_CA_EBOMSync_Failure), + (i = + '

\t\t\t\t\t\t\t\t\t\t\t\t\t\x3c!--h6>\t\t\t\t\t\t\t\t\t\t\t\t\t\t

  • ' + + o + + '
  • \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

    '), + n.dialog({ + body: i, + title: t.ECM_CA_Action_EBOMSync_CollabStatus, + buttons: [ + { + className: 'primary', + value: t.ECM_CA_Collab_Dialog_Done, + action: function (e) { + e.hide(); + }, + }, + ], + }); + }); + break; + default: + console.log('Match not found'); + } + 'chgBOMSync' != o && e.closeDialog(); + } + }), + (CancelCallback = function (t) { + e.closeDialog(t); + }); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesView', + [ + 'DS/ENOChangeActionUX/scripts/Views/CANewProposedView', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/PlatformAPI/PlatformAPI', + ], + function (e, t, i, n) { + 'use strict'; + return { + createProposedChangesView: function (o) { + var a = {}; + (a = UWA.merge(a, o)), + (this._modelEvents = a.contextDetails._modelEvents), + (this.id = a.id); + let r = a.contextDetails.title; + var s = 'pid:' + a.id, + l = ''; + a.targetclassName = a.target.className; + let c = { + id: s, + name: a.contextDetails.name, + title: r, + description: a.contextDetails.description, + severity: a.contextDetails.severity, + maturity: a.contextDetails.maturity, + invokedFrom: 'gov', + isSelected: a.isSelected, + init_options: a, + }, + d = a.target, + u = new new e._createView_TestProposed( + 'div', + 'test-proposed-facet', + !0, + c, + )(); + (u.container = d), + i.getChangeActionUserAccess(a.id).then(function (e) { + (l = e.data[0]), + (l = t.processAccessBitCA(l)), + (u.model = { + id: s, + name: a.contextDetails.name, + title: r, + description: a.contextDetails.description, + severity: a.contextDetails.severity, + maturity: a.contextDetails.maturity, + invokedFrom: 'gov', + isSelected: a.isSelected, + get: function (e) { + return 'userAccess' == e + ? l + : 'id' == e + ? s + : 'synopsis' === e + ? r + : void 0; + }, + fetch: function (e) { + console.log('dummy fetch called...!'), + n.publish('load-dependency' + widget.id, s), + e.onComplete(); + }, + }), + d.addContent(u.render()); + }); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/decision/ChgCRDecisionfacet', + [ + 'UWA/Core', + 'DS/EditPropWidget/facets/Common/FacetsBase', + 'DS/EditPropWidget/constants/EditPropConstants', + 'UWA/Class/Model', + 'DS/UIKIT/Mask', + 'css!DS/ENOChgGovernanceUX/ENOChgGovernanceUX', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o, a, r) { + 'use strict'; + return t.extend({ + init: function () { + this._parent.apply(this, arguments), + this.elements.container || + (this.elements.container = e.createElement('div', { + id: 'decision-CR-container', + })); + }, + updateFacet: function () { + var e = UWA.createElement('div', { + html: r.CHG_GOV_Empty_DataGrid_PlaceHolder, + }); + document.getElementById('decision-CR-container').setContent(''), + e.inject(this.elements.container); + }, + destroyComponent: function () { + e.is(this.destroy, 'function') && this.destroy(); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + var t = Object.create(null); + return ( + (t.toolbar = null), + (t.sortingData = { + menu: [ + { + type: 'PushItem', + title: e.CHG_GOV_DataGrid_Column_Severity, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-alpha-sorting-a-z', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridLayout', + func: 'sortBySeverity', + }, + }, + { + type: 'PushItem', + title: e.CHG_GOV_DataGrid_Column_Maturity, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-alpha-sorting-a-z', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridLayout', + func: 'sortByMaturity', + }, + }, + ], + }), + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/ChgCOTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.filterData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_Filter_ActiveCO, + state: 'selected', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridLayout', + func: 'filterView', + argument: { + filter: 'activeCO', + }, + }, + tooltip: e.CHG_Filter_ActiveCO_Def, + }, + { + type: 'CheckItem', + title: e.CHG_Filter_InactiveCO, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridLayout', + func: 'filterView', + argument: { + filter: 'inactiveCO', + }, + }, + tooltip: e.CHG_Filter_InactiveCO_Def, + }, + ], + }), + (t.writetoolbarDefination = function () { + return { + entries: [ + { + id: 'filter', + className: 'menuCA', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'list-filter', + fontIconFamily: 1, + }, + value: this.filterData, + }, + position: 'far', + tooltip: e.CHG_Toolbar_FilterBy, + category: 'View', + }, + { + id: 'view', + className: 'menuCA', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + { + id: 'sorting', + className: 'menuCA', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'sorting', + fontIconFamily: 1, + }, + value: this.sortingData, + }, + position: 'far', + tooltip: e.CHG_TOOLTIP_SORT, + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealiedChangesToolbarMenu', + ['UWA/Core', 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e, t) { + let i = Object.create(null); + return ( + (i.filterMenu = { + menu: [ + { + type: 'CheckItem', + title: t.CHG_GOV_Realized_Tracked_SF, + state: 'selected', + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-change-action-realized', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealiedChangesToolbarHandler', + func: 'filterViewHandler', + argument: { + filter: 'TRACKED', + }, + }, + tooltip: t.CHG_GOV_Realized_Tracked, + }, + { + type: 'CheckItem', + title: t.CHG_GOV_Realized_Moved_SF, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-move-to', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealiedChangesToolbarHandler', + func: 'filterViewHandler', + argument: { + filter: 'MOVED', + }, + }, + tooltip: t.CHG_GOV_Realized_Moved, + }, + { + type: 'CheckItem', + title: t.CHG_GOV_Realized_Ignored_SF, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-ignore', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealiedChangesToolbarHandler', + func: 'filterViewHandler', + argument: { + filter: 'IGNORED', + }, + }, + tooltip: t.CHG_GOV_Realized_Ignored, + }, + ], + }), + (i.expandCollapseMenu = { + menu: [ + { + type: 'CheckItem', + title: t.CHG_GOV_Expand_All, + state: 'selected', + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-flow-tree-expand-down', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealiedChangesToolbarHandler', + func: 'expandCollapseHandler', + argument: { + action: 'EXPAND', + }, + }, + tooltip: t.CHG_GOV_Expand_All, + }, + { + type: 'CheckItem', + title: t.CHG_GOV_Collapse_All, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-flow-tree-expand-up', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealiedChangesToolbarHandler', + func: 'expandCollapseHandler', + argument: { + action: 'COLLAPSE', + }, + }, + tooltip: t.CHG_GOV_Collapse_All, + }, + ], + }), + (i.switchViewMenu = { + menu: [ + { + type: 'CheckItem', + title: t.CHG_TOOLTIP_GRID_VIEW, + state: 'selected', + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealiedChangesToolbarHandler', + func: 'switchViewHandler', + argument: { + type: 'DGV', + }, + }, + tooltip: t.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: t.CHG_TOOLTIP_LARGE_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-big-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/realizedChanges/ChgCARealiedChangesToolbarHandler', + func: 'switchViewHandler', + argument: { + type: 'LTLV', + }, + }, + tooltip: t.CHG_TOOLTIP_LARGE_TILE_VIEW, + }, + ], + }), + (i.getFilterMenu = function (n) { + return ( + n && + (e.is(n.trackedObjects) && + (i.filterMenu.menu[0].title = + t.CHG_GOV_Realized_Tracked + ' (' + n.trackedObjects + ')'), + e.is(n.movedObjects) && + (i.filterMenu.menu[1].title = + t.CHG_GOV_Realized_Moved + ' (' + n.movedObjects + ')'), + e.is(n.ignoredObjects) && + (i.filterMenu.menu[2].title = + t.CHG_GOV_Realized_Ignored + ' (' + n.ignoredObjects + ')')), + i.filterMenu + ); + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/TreeModel/BaseFilter', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'require', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u) { + 'use strict'; + var g = c.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }), + p = e.extend({ + init: function (e, t) { + (this.contextID = e), (this.contextDetails = t); + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + var e = new t({ + id: 'crImpactAnalysis', + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + for (var t = e.getChildren(), i = 0; i < t.length; i++) + if (this.options.grid.id == t[i].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument + .getFilterManager() + .registerFilter('stringRole', g); + }, + loadImpactAnalysisData: function (e, t) { + e.prepareUpdate(); + var n = this.createTreeDocumentNodeModel(t); + e.addRoot(n), + n.length > 1 && + 'true' == o.getGlobalVariable().CHG_IA_COLUMN_ASSESSMENT && + 'Cancelled' != n[0].options.grid.maturity && + e.addRoot( + new i({ + label: a.CHG_GOV_IA_LastColumn_label, + grid: { + isLastNode: !0, + id: 'ia_Total', + title: a.CHG_GOV_IA_LastColumn_label, + }, + }), + ), + e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + for (var t = [], i = 0; i < e.length; i++) { + var n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = this.createCustomOwnerField(e); + e.chgObjOwner = t; + var n = this.createCustomNameField(e); + e.ia_name = n; + var a, + r = e.name + ' | ' + e.ownerFullName, + s = e.maturityNLS, + l = this.getStatusBarIcons(e), + c = this.statusbarIconsTooltips(e); + (a = o.getGlobalVariable().is3DSpace + ? UWA.String.escapeHTML(e.title) + : e.title), + (e.refinement = this.createCustomRefinementField(e.refinement)); + var d = this.getCustomTooltip(e); + return new i({ + label: a, + subLabel: r, + description: s, + grid: e, + icons: [e.icon], + thumbnail: e.thumbnail, + contextualMenu: ['dummy placeholder'], + customTooltip: d, + statusbarIcons: l, + statusbarIconsTooltips: c, + useAsyncPreExpand: !0, + }); + }, + getStatusBarIcons: function (e) { + var t = []; + return 'Cancelled' == e.maturity && t.push('block'), t; + }, + statusbarIconsTooltips: function (e) { + var t = []; + return 'Cancelled' == e.maturity && t.push(e.cancelComment), t; + }, + createCustomNameField: function (e) { + var t = new UWA.Element('div', {}); + UWA.createElement('span', { + html: e.name, + }).inject(t); + var i = new UWA.Element('div', { + class: 'iconsDiv', + }); + if ('Cancelled' == e.maturity) { + var n = new UWA.Element('div', { + class: 'gridIconContainer', + title: e.cancelComment, + }); + UWA.createElement('div', { + class: 'fonticon fonticon-block', + }).inject(n), + n.inject(i); + } + if ( + e.Dispatch_From_ParentCR && + e.Dispatch_From_ParentCR.length > 0 && + e.Dispatch_To && + e.Dispatch_To.length > 0 + ) { + var o = UWA.createElement('div', { + class: 'fonticon fonticon-graph-egraph', + styles: { + color: 'grey', + }, + }), + a = UWA.createElement('div', { + class: 'fonticon fonticon-up', + styles: { + color: 'grey', + }, + }), + r = UWA.createElement('div', { + class: 'fonticon fonticon-down', + styles: { + color: 'grey', + marginLeft: '-5px', + }, + }); + o.inject(i), a.inject(i), r.inject(i); + } else if ( + e.Dispatch_From_ParentCR && + e.Dispatch_From_ParentCR.length > 0 + ) { + (o = UWA.createElement('div', { + class: 'fonticon fonticon-graph-egraph', + styles: { + color: 'grey', + }, + })), + (a = UWA.createElement('div', { + class: 'fonticon fonticon-up', + styles: { + color: 'grey', + }, + })); + o.inject(i), a.inject(i); + } else if (e.Dispatch_To && e.Dispatch_To.length > 0) { + (o = UWA.createElement('div', { + class: 'fonticon fonticon-graph-egraph', + styles: { + color: 'grey', + }, + })), + (r = UWA.createElement('div', { + class: 'fonticon fonticon-down', + styles: { + color: 'grey', + }, + })); + o.inject(i), r.inject(i); + } + return i.inject(t), t.outerHTML; + }, + createCustomRefinementField: function (e) { + var t = new UWA.Element('div', { + class: 'cr-ia-refinement-val', + }); + return ( + (e = UWA.createElement('a', { + html: e, + })).inject(t), + t.outerHTML + ); + }, + createCustomOwnerField: function (e) { + var t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + var l = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: l.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', l.avatarColor); + } + s.inject(a); + var c = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), c.inject(n), n.outerHTML; + }, + createCustomSeverity: function (e) { + var t = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e.severity + ? (t = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e.severity && + (t = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + var i = new UWA.Element('div', {}), + n = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: t, + }).inject(n); + var o = UWA.createElement('span', { + html: e.severityNLS, + }); + return n.inject(i), o.inject(i), i.outerHTML; + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + updateNodeIndexed: function (e, t) { + console.log(t); + }, + removeNodeInModelFromId: function (e) { + this.treeDocument.prepareUpdate(); + for ( + var t = this.treeDocument.getAllDescendants(), i = 0; + i < t.length; + i++ + ) + t[i].options.grid.id === e && t[i].remove(); + this.treeDocument.pushUpdate(); + }, + addNodeInModelFromId: function (e) { + const t = this; + let n = !1; + 0 == this.treeDocument.getChildren().length && + this.treeDocument._modelEvents.publish({ + event: 'treeNotEmpty', + }); + const r = this.contextDetails.id; + s.getImpactAnalysisFromId(e).then((e) => { + let s = l.processCRImpactAnalysis(e, r); + var c = p.prototype.createTreeDocumentNodeModel(s); + if ( + (t.treeDocument.prepareUpdate(), + 0 == t.treeDocument.getRoots().length) + ) + t.treeDocument.addRoot(c); + else + for (var u = c.length - 1; u >= 0; u--) + t.treeDocument.addRoot(c[u], 0); + t.treeDocument.pushUpdate(); + for (let e of t.treeDocument.getAllDescendants()) + if ('ia_Total' === e.options.grid.id) { + n = !0; + break; + } + !1 === n && + 'true' == o.getGlobalVariable().CHG_IA_COLUMN_ASSESSMENT && + 'Cancelled' != c[0].options.grid.maturity && + t.treeDocument.addRoot( + new i({ + label: a.CHG_GOV_IA_LastColumn_label, + grid: { + isLastNode: !0, + id: 'ia_Total', + title: a.CHG_GOV_IA_LastColumn_label, + }, + }), + ), + d.warn(a.CHG_CUSTOM_COLUMN_WARN_IA, !0); + }); + }, + filterView: function (e, t) { + let i = t, + n = e.matchingIDs; + i.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: n, + }, + }, + }); + }, + enableColorizeView: function (e, t) { + let i = t.getAllDescendants(); + var n, o; + (n = e), + (o = function (e, t) { + i.map((i) => { + if (i.options.grid.id === t) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + i.updateOptions(n); + } + }); + }), + UWA.is(n, 'array') && + n.forEach(function (e) { + var t = e.color, + i = e.id; + o(t, i); + }); + }, + disableColorizeView: function (e, t) { + t.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return p; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemReportViewToolbar', + [ + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t) { + let i = Object.create(null); + return ( + (i.viewData = { + menu: [ + { + type: 'CheckItem', + title: t.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'changeImpactView', + argument: { + view: 'GridView', + }, + }, + tooltip: t.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: t.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'changeImpactView', + argument: { + view: 'TileView', + }, + }, + tooltip: t.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (i.writetoolbarDefinition = function (e) { + let t = { + entries: [ + { + id: 'view', + dataElements: { + typeRepresentation: 'addDropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + return JSON.stringify(t); + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/ChangeImpactsView/ChgChangeImpactsFeatureUtil', + [ + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgCustomAttributeService', + ], + function (e, t) { + 'use strict'; + return { + createCustomColumn: function (i) { + let n = this; + return new Promise(function (i, o) { + let a = e.getGlobalVariable().changeActionSubTypes; + t.getCombinedClassList(a).then(function (e) { + t.getPropertyForClassGrid(e).then(function (e) { + let o = t.makeCombinedColumnList(e), + a = n.filterColumn(o); + i(a); + }); + }); + }); + }, + filterColumn: function (e) { + let t = this, + i = [], + n = [ + 'ds6w:label', + 'ds6w:severity', + 'ds6w:status', + 'ds6w:type', + 'ds6w:identifier', + 'ds6w:responsible', + 'ds6w:project', + ]; + for (let t of n) for (let i of e) i.delete(t); + for (let n of e) + return ( + n.forEach((e, n, o) => { + let a = t.createColumnDefination(e, n); + i.push(a); + }), + i + ); + }, + createColumnDefination: function (e, t) { + e.dataType.replace('http://www.w3.org/2001/XMLSchema#', ''); + let i = e.dataType.replace('http://www.w3.org/2001/XMLSchema#', ''); + return { + text: e.vocabColumnsNameNLS, + dataIndex: t, + editableFlag: !1, + allowUnsafeHTMLContent: !0, + visibleFlag: !1, + dataType: i, + getCellTypeRepresentation: function (e) { + return null != e.cellModel ? 'string' : 'functionIcon'; + }, + getCellSemantics: function (e) { + if (null != e.cellModel); + else if ('undefined' == e.cellModel || null == e.cellModel) + return { + icon: { + iconName: 'reload wux-ui-3ds-spin', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + }; + }, + getCellValue: function (e, i) { + return e.nodeModel.getAttributeValue(t); + }, + }; + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/util/ChgAddMemberView', + [ + 'UWA/Class/View', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'UWA/Core', + 'DS/Handlebars/Handlebars4', + ], + function (e, t, i, n) { + return e.extend({ + name: 'chg-add-member', + tagName: 'div', + className: 'chg-add-member', + setup: function () { + (this.template = + '
    \t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    ' + + t.CHG_Add_Member_Change_Coordinator + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    ' + + t.CHG_Add_Member_Assignee + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    ' + + t.CHG_Add_Member_Approver + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    ' + + t.CHG_Add_Member_Follower + + '\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t\t\t\t\t\t
    '), + (this.renderer = this.getTemplate(this.template)); + }, + init: function (e) { + (e = i.clone(e || {}, !1)), this._parent.call(this, e); + }, + render: function () { + this.name, this.cid; + this.container.empty(), (containerReference = this.container); + var e = UWA.createElement('div', { + class: 'chg-member-view', + styles: { + height: '10%', + }, + }), + t = this.renderer(); + return e.addContent(t), e.inject(containerReference), this; + }, + injectSubView: function (e, t) { + var i = this.container.getElement(t); + e && i && i.grab(e.render().getContent()); + }, + getTemplate: function (e) { + var t = n.compile(e), + i = this; + return ( + (i.data = { + placeholder: i.options.placeholder, + }), + function () { + return t(i.data); + } + ); + }, + domEvents: { + 'click .change-coordinator-field-search': function () { + this.dispatchEvent('searchChangeCoordinator', arguments); + }, + 'click .assignee-field-search': function () { + this.dispatchEvent('searchAssignee', arguments); + }, + 'click .approver-field-search': function () { + this.dispatchEvent('searchApprover', arguments); + }, + 'click .informed-user-field-search': function () { + this.dispatchEvent('searchInformedUser', arguments); + }, + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/facets/changeOrchestration/ChgOrchestrationDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/UIKIT/Mask', + 'DS/TreeModel/BaseFilter', + 'require', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p) { + 'use strict'; + var h = g.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }), + m = e.extend({ + init: function (e, t) { + (this.contextID = e), (this.contextDetails = t); + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + var e = new t({ + id: 'coOrchestration', + useAsyncPreExpand: !0, + }); + return ( + e.onPreExpand(function (e) { + var t = e.target.options.grid.id; + console.log('call for children' + e.target), + t && + s.getChangeOrchestration(t).then( + function (t) { + l.processedChangeOrchestrationSummaryList(t).then( + function (t) { + var i = m.prototype.createTreeDocumentNodeModel(t); + if (e.target.hasChildren()) + for ( + var n = !1, o = e.target.getChildren(), a = 0; + a < i.length; + a++ + ) { + n = !1; + for (var r = 0; r < o.length; r++) + if ( + o[r].options.grid.id == i[a].options.grid.id + ) { + n = !0; + break; + } + n || e.target.addChild(i[r]); + } + else e.target.addChild(i); + e.target.preExpandDone(); + }, + ); + }, + function (e) { + return Promise.reject(e); + }, + ); + }), + (e.isChildOf = function (e) { + for (var t = e.getChildren(), i = 0; i < t.length; i++) + if (this.options.grid.id == t[i].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument + .getFilterManager() + .registerFilter('stringRole', h); + }, + loadChangeOrchestrationData: function (e, t) { + e.prepareUpdate(); + var i = this.createTreeDocumentNodeModel(t); + if ( + (e.addRoot(i), e.pushUpdate(), o.getGlobalVariable().is3DSpace) + ) { + console.log('unmasking orchestration item 3dspace'); + let e = document.getElementById( + 'coOrchestrationFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('coOrchestration'); + e && u.isMasked(e) && u.unmask(e); + } + }, + createTreeDocumentNodeModel: function (e) { + for (var t = [], i = 0; i < e.length; i++) { + var n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + var t = this.createCustomNameField(e); + e.chgObjName = t; + var n = this.createCustomSeverity(e); + e.sev = n; + var a = this.createCustomChangeCoordinatorField(e); + e.chgObjCoordinator = a; + var r = this.createCustomOwnerField(e); + e.chgObjOwner = r; + var s, + l = e.name + ' | ' + e.ownerFullName, + c = e.maturityNLS, + d = this.getStatusBarIcons(e), + u = this.statusbarIconsTooltips(e), + g = this.getCustomTooltip(e); + return ( + (s = o.getGlobalVariable().is3DSpace + ? '' + + UWA.String.escapeHTML(e.title) + + '' + : e.title), + new i({ + label: s, + subLabel: l, + description: c, + children: e.isKindOfChangeAction ? null : [], + grid: e, + icons: [e.iconURL], + thumbnail: e.thumbnail, + contextualMenu: ['Copy1', 'Move1'], + statusbarIcons: d, + statusbarIconsTooltips: u, + customTooltip: g, + useAsyncPreExpand: !0, + }) + ); + }, + createCustomNameField: function (e) { + var t = new UWA.Element('div', { + class: + 'wux-tweakers wux-tweakers-string wux-tweakers-string-label wux-tweakers-labelonly', + }), + i = UWA.createElement('span', { + html: e.name, + }); + i.style.setProperty('text-overflow', 'ellipsis'), i.inject(t); + var n = new UWA.Element('div', { + class: 'iconsDiv', + }); + if ('TRUE' == e.ecm_change_on_hold) { + var o = new UWA.Element('div', { + class: 'gridIconContainer', + title: a.CHG_GOV_TOOLTIP_HOLD, + }); + UWA.createElement('div', { + class: 'fonticon fonticon-pause', + }).inject(o), + o.inject(n); + } + return n.inject(t), t.outerHTML; + }, + createCustomSeverity: function (e) { + var t = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e.severity + ? (t = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e.severity && + (t = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + var i = new UWA.Element('div', {}), + n = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: t, + }).inject(n); + var o = UWA.createElement('span', { + html: e.severityNLS, + }); + return n.inject(i), o.inject(i), i.outerHTML; + }, + createCustomChangeCoordinatorField: function (e) { + var t = new UWA.Element('div', { + class: 'members', + }); + if ('' != e.changeCoordinatorFullName) { + var i = new UWA.Element('div', { + class: 'assignee', + }), + n = + '/api/user/getpicture/login/' + + e.changeCoordinator + + '/format/normal', + a = o.getGlobalVariable().computeSwymUrl(n), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: a, + }); + else { + var l = r.getAvatarDetails(e.changeCoordinatorFullName); + (s = UWA.createElement('div', { + html: l.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', l.avatarColor); + } + s.inject(i); + var c = UWA.createElement('span', { + class: 'userName', + html: e.changeCoordinatorFullName, + }); + i.inject(t), c.inject(t); + } + return t.outerHTML; + }, + createCustomOwnerField: function (e) { + var t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + var l = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: l.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', l.avatarColor); + } + s.inject(a); + var c = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), c.inject(n), n.outerHTML; + }, + getStatusBarIcons: function (e) { + var t = []; + return ( + 'Low' == e.severity + ? t.push('level-low') + : 'Medium' == e.severity + ? t.push('level-medium') + : 'High' == e.severity && t.push('level-high'), + 'TRUE' == e.ecm_change_on_hold && t.push('pause'), + t + ); + }, + statusbarIconsTooltips: function (e) { + var t = []; + return ( + t.push(e.severityNLS), + 'TRUE' == e.ecm_change_on_hold && t.push(a.CHG_GOV_TOOLTIP_HOLD), + t + ); + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Severity + + ': ' + + e.severityNLS + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS + ); + }, + updateNodeIndexed: function (e, t) { + console.log(t); + }, + addNewChildren: function (e) { + var t = this; + if (this.treeDocument.getSelectedNodes().length > 1) + d.error( + a.CHG_GOV_ChangeOrchestration_AddExisting_Single_Selection, + ); + else { + this.treeDocument.getSelectedNodes().length + ? this.treeDocument.getSelectedNodes()[0].options.grid.id + : this.contextID; + var i = document.getElementById('outer-orchestration-grid-div'); + 'undefined' != i && null != i && u.mask(i), + 'Change Order' == e.type + ? s.getChangeOrderInfo(e.objectID).then( + function (e) { + l.processedChangeOrchestrationSummaryList(e).then( + function (e) { + m.prototype.addNodesInLayoutModel( + t.treeDocument, + e, + !0, + ), + u.unmask(i); + }, + ); + }, + function (e) { + u.unmask(i); + }, + ) + : 'Change Action' == e.type && + s.getNewCADetails(e.objectID).then( + function (e) { + var t = l.processChangeActionInContext(e).processData; + console.log(t), + require([ + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + ], function (e) { + e.addNodesInLayout(t), u.unmask(i); + }); + }, + function (e) { + u.unmask(i); + }, + ); + } + }, + addExistingChildren: function (e) { + var t, + i = this; + if (this.treeDocument.getSelectedNodes().length > 1) + d.error( + a.CHG_GOV_ChangeOrchestration_AddExisting_Single_Selection, + ); + else { + t = this.treeDocument.getSelectedNodes().length + ? this.treeDocument.getSelectedNodes()[0].options.grid.id + : this.contextID; + var n = document.getElementById('outer-orchestration-grid-div'); + 'undefined' != n && null != n && u.mask(n), + s.addExistingChangeOrchestration(t, e).then( + function (e) { + l.processedChangeOrchestrationSummaryList(e).then(function ( + e, + ) { + m.prototype.addNodesInLayoutModel(i.treeDocument, e), + u.unmask(n); + }); + }, + function (e) { + u.unmask(n); + }, + ); + } + }, + addNodesInLayoutModel: function (e, t, i = !1) { + 0 == e.getChildren().length && + e._modelEvents.publish({ + event: 'treeNotEmpty', + }); + var n, + o, + a = m.prototype.createTreeDocumentNodeModel(t); + if ( + (e.getSelectedNodes().length + ? ((n = !1), (o = e.getSelectedNodes()[0])) + : (n = !0), + n) + ) { + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(a); + else for (var r = a.length - 1; r >= 0; r--) e.addRoot(a[r], 0); + if ((e.pushUpdate(), i)) + try { + let e = p('DS/ENOChgProbes/scripts/ChgCloudProbeUtils'); + var s = t[0]; + e.cloudProbeUtils.sendChgObjectCreateTrackerEvent({ + createData: s, + View: 'Change Orchestration', + }); + } catch (e) { + console.log(e); + } + } else if (null == o.getChildren()) e.addRoot(a, 0); + else { + if ((o.prepareUpdate(), 0 == o.getChildren().length)) + o.addChild(a); + else for (r = a.length - 1; r >= 0; r--) o.addChild(a[r], 0); + o.pushUpdate(), o.isExpanded() || o.expand(); + } + }, + removeChildren: function () { + var e = this, + t = e.treeDocument.getSelectedNodes(); + if (t.length) { + var i, + n, + r = t[0].getParent().options.grid.id; + void 0 === r + ? ((i = e.contextID), (n = !0)) + : ((i = r), (n = !1)); + var l = []; + l.push({ + id: t[0].options.grid.id, + type: t[0].options.grid.type, + }); + for (var c = 1; c < t.length; c++) { + if (r !== t[c].getParent().options.grid.id) { + if ( + (d.error( + a.CHG_GOV_ChangeOrchestration_Toolbar_Invalid_Selection, + ), + o.getGlobalVariable().is3DSpace) + ) { + console.log('unmasking orchestration item 3dspace'); + let e = document.getElementById( + 'coOrchestrationFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('coOrchestration'); + e && u.isMasked(e) && u.unmask(e); + } + return; + } + l.push({ + id: t[c].options.grid.id, + type: t[c].options.grid.type, + }); + } + s.removeChangeOrchestration(i, l).then( + function (i) { + if (n) { + for (var r = 0; r < t.length; r++) + e.treeDocument.removeRoot(t[r]); + 0 == e.treeDocument.getChildren().length && + e.treeDocument._modelEvents.publish({ + event: 'treeEmpty', + }); + } else { + var s = t[0].getParent(); + s.prepareUpdate(); + for (r = 0; r < t.length; r++) s.removeChild(t[r]); + s.pushUpdate(); + } + if (o.getGlobalVariable().is3DSpace) { + console.log('unmasking orchestration item 3dspace'); + let e = document.getElementById( + 'coOrchestrationFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('coOrchestration'); + e && u.isMasked(e) && u.unmask(e); + } + d.success( + a.CHG_GOV_ChangeOrchestration_Toolbar_Remove_Success, + ); + }, + function (e) { + if (o.getGlobalVariable().is3DSpace) { + console.log('unmasking orchestration item 3dspace'); + let e = document.getElementById( + 'coOrchestrationFullViewContainer', + ); + e && u.isMasked(e) && u.unmask(e); + } else { + let e = document.getElementById('coOrchestration'); + e && u.isMasked(e) && u.unmask(e); + } + }, + ); + } else d.error(a.CHG_GOV_ChangeOrchestration_Remove_No_Objects); + }, + filterView: function (e, t) { + let i = t, + n = e.matchingIDs; + i.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: n, + }, + }, + }); + }, + enableColorizeView: function (e, t) { + let i = t.getAllDescendants(); + var n, o; + (n = e), + (o = function (e, t) { + i.map((i) => { + if (i.options.grid.id === t) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + i.updateOptions(n); + } + }); + }), + UWA.is(n, 'array') && + n.forEach(function (e) { + var t = e.color, + i = e.id; + o(t, i); + }); + }, + disableColorizeView: function (e, t) { + t.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return m; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/facets/relatedScope/ChgRelatedScopeDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/PlatformAPI/PlatformAPI', + 'DS/UIKIT/Mask', + 'DS/TreeModel/BaseFilter', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g) { + 'use strict'; + let p = g.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + let t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }), + h = e.extend({ + init: function (e) { + this.parentCRId = e; + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new t({ + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + let t = e.getChildren(); + for (let e = 0; e < t.length; e++) + if (this.options.grid.id == t[e].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument + .getFilterManager() + .registerFilter('stringRole', p); + }, + loadRelatedScopeData: function (e, t) { + e.prepareUpdate(); + let i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + let n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = this.createCustomOwnerField(e); + e.chgObjOwner = t; + let n = e.previewicon, + o = e.name + ' | ' + e.ownerFullName, + a = e.currentNLS; + var r = this.getCustomTooltip(e); + return new i({ + label: e.title, + subLabel: o, + description: a, + grid: e, + customTooltip: r, + icons: [e.icon], + thumbnail: n, + useAsyncPreExpand: !0, + }); + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.currentNLS + ); + }, + addExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCRId, + a = document.getElementById('outer-relatedScope-grid-div'); + 'undefined' != a && null != a && u.mask(a), + s.updateExistingCORelatedScope(o, e).then( + function (e) { + var n = { + contextid: o, + length: e.data.length, + }; + d.publish('relatedScope:update', n); + let r = []; + e && (r = e.data), + h.prototype.addNodesInLayoutModel(t.treeDocument, r), + i(e), + u.unmask(a); + }, + function (e) { + u.unmask(a), n(e); + }, + ); + }); + }, + removeExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.parentCRId, + r = document.getElementById('outer-CO-relatedScope-grid-div'); + 'undefined' != r && null != r && u.mask(r), + s.removeExistingCORelatedScope(o, e).then( + function (e) { + let n = t.treeDocument.getSelectedNodes(); + i(n); + for (let e = 0; e < n.length; e++) + t.treeDocument.removeRoot(n[e]); + if (0 == t.treeDocument.getAllDescendants().length) { + var s = { + contextid: o, + length: t.treeDocument.getAllDescendants().length, + }; + d.publish('relatedScope:update', s); + } + c.success(a.CHG_GOV_relatedScope_Remove_Success), + u.unmask(r); + }, + function (e) { + u.unmask(r), n(); + }, + ); + }); + }, + addNodesInLayoutModel: function (e, t) { + let i = h.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else for (let t = i.length - 1; t >= 0; t--) e.addRoot(i[t], 0); + e.pushUpdate(); + }, + filterView: function (e, t) { + let i = t, + n = e.matchingIDs; + i.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: n, + }, + }, + }); + }, + enableColorizeView: function (e, t) { + let i = t.getAllDescendants(); + var n, o; + (n = e), + (o = function (e, t) { + i.map((i) => { + if (i.options.grid.id === t) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + i.updateOptions(n); + } + }); + }), + UWA.is(n, 'array') && + n.forEach(function (e) { + var t = e.color, + i = e.id; + o(t, i); + }); + }, + disableColorizeView: function (e, t) { + t.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return h; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/flowdown/ChgCAFlowdownfacet', + [ + 'UWA/Core', + 'DS/EditPropWidget/facets/Common/FacetsBase', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/EditPropWidget/constants/EditPropConstants', + 'UWA/Class/Model', + 'DS/UIKIT/Mask', + 'DS/PlatformAPI/PlatformAPI', + 'css!DS/ENOChgGovernanceUX/ENOChgGovernanceUX', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'require', + ], + function (e, t, i, n, o, a, r, s, l, c) { + 'use strict'; + return t.extend({ + init: function () { + this._parent.apply(this, arguments), + this.elements.container || + (this.elements.container = e.createElement('div', { + id: 'flowdwon-CA-container', + })); + }, + updateFacet: function () { + var e = this; + a.mask(this.elements.container); + var t = e.getModel(); + if (1 != t.isMergedModel()) { + if (!t) return !1; + e.elements.container.setContent(''); + var n = { + id: t.get('objectId'), + }; + i.getObjectTypeInformation(n.id).then(function (t) { + if ('Change Action' == t) { + let t = n.id; + i.getChangeActionUserAccess(t).then(function (e) { + e.data[0].id, e.data[0]; + }); + var o = e.elements.container; + let s = c( + 'DS/ENOChangeActionUX/scripts/Views/CANewProposedView', + ); + s && + s.addProposedWithFlowdown({ + target: o, + }); + let l = () => { + o.empty(), + s.addProposedWithFlowdown({ + target: o, + }); + }; + r.unsubscribe(`CA_Flowdown:${widget.id}`), + r.subscribe(`CA_Flowdown:${widget.id}`, function (e) { + l(); + }), + a.unmask(e.elements.container); + } + }); + } + }, + destroyComponent: function () { + e.is(this.destroy, 'function') && this.destroy(); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/util/ChgMembersFeaturesUtil', + [ + 'UWA/Core', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'require', + ], + function (e, t, i) { + 'use strict'; + var n = { + showRMBMenuOnGrid: function (e, t) { + return new Promise(function (o, a) { + var r = 'false', + s = {}, + l = i( + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/util/ChgMembersGridUtil', + ), + c = t.cellInfos.nodeModel.getTreeDocument().getSelectedNodes(), + d = c[0].options.grid.roles; + s.currentObjType = c[0].options.grid.type; + var u = 0; + c.length > 1 && (r = 'true'), + d.indexOf('Approver') >= 0 + ? ((s.Approver = 'DISCONNECT'), u++) + : (s.Approver = 'CONNECT'), + d.indexOf('Coordinator') >= 0 + ? ((s.Coordinator = 'DISCONNECT'), u++) + : (s.Coordinator = 'CONNECT'), + d.indexOf('Follower') >= 0 + ? ((s.Follower = 'DISCONNECT'), u++) + : (s.Follower = 'CONNECT'), + d.indexOf('Assignee') >= 0 + ? ((s.Assignee = 'DISCONNECT'), u++) + : (s.Assignee = 'CONNECT'); + var g = d.indexOf('Owner') >= 0 || d.indexOf('Originator') >= 0; + if ((0 == g && 1 == u && (s.showConfirmation = !0), 'false' == r)) + var p = i( + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersDataGridLayout', + ); + var h = [], + m = t.cellInfos.nodeModel.options.grid.id, + C = t.cellInfos.nodeModel.options.grid.type, + v = t.cellInfos.nodeModel.options.grid.name, + f = t.cellInfos.nodeModel.options.grid.displayType; + 'Group' == C && + ((C = 'foaf:Group'), + (v = t.cellInfos.nodeModel.options.grid.fullName), + (f = t.cellInfos.nodeModel.options.grid.type)); + var b = { + objectId: m, + objectType: C, + displayName: v, + displayType: f, + facetName: 'dependency', + }; + [].push(b); + var w = i( + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ).openWith(b), + D = []; + D.push(w), + Promise.all(D).then(function (i) { + 'Person' == s.currentObjType && + (1 == p.setCoordinatorAccessBit && + (1 != l.isChangeCoordinatorConnected || + (1 == l.isChangeCoordinatorConnected && + 'DISCONNECT' == s.Coordinator)) && + h.push(n.getChangeCoordinatorMenu(e, t, s)), + 1 == p.ManageFollowersAccessBit && + h.push(n.getFollowerMenu(e, t, s)), + 1 == p.ManageAssigneesAccessBit && + h.push(n.getAssigneeMenu(e, t, s))), + 'Group' == s.currentObjType && + (1 == p.ManageFollowersAccessBit && + h.push(n.getFollowerMenu(e, t, s)), + 1 == p.ManageAssigneesAccessBit && + h.push(n.getAssigneeMenu(e, t, s))), + 1 == p.setCoordinatorAccessBit && + 0 == g && + h.push(n.getDeleteMenu(e, t, s)), + i[0] && h.push(i[0]), + o(h); + }); + }); + }, + getChangeCoordinatorMenu: function (e, i, n) { + var o = { + type: 'CheckItem', + title: t.CHG_Member_Menu_Change_Coordinator, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersDataGridLayout', + ], function (e) { + console.log('Coordinator : ' + n.Coordinator), + (n.role = 'Coordinator'), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + return 'DISCONNECT' == n.Coordinator && (o.state = 'selected'), o; + }, + getFollowerMenu: function (e, i, n) { + var o = { + type: 'CheckItem', + title: t.CHG_Member_Menu_Follower, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersDataGridLayout', + ], function (e) { + console.log('Follower : ' + n.Follower), + (n.role = 'Follower'), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + return 'DISCONNECT' == n.Follower && (o.state = 'selected'), o; + }, + getAssigneeMenu: function (e, i, n) { + var o = { + type: 'CheckItem', + title: t.CHG_Member_Menu_Assignee, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersDataGridLayout', + ], function (e) { + console.log('Assignee : ' + n.Assignee), + (n.role = 'Assignee'), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + return 'DISCONNECT' == n.Assignee && (o.state = 'selected'), o; + }, + getDeleteMenu: function (e, i, n) { + return { + type: 'PushItem', + title: t.CHG_Member_Menu_Remove, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-remove', + }, + action: { + callback: function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersDataGridLayout', + ], function (e) { + console.log('remove '), + (n.role = []), + 'DISCONNECT' == n.Follower && n.role.push('Follower'), + 'DISCONNECT' == n.Approver && n.role.push('Approver'), + 'DISCONNECT' == n.Coordinator && n.role.push('Coordinator'), + 'DISCONNECT' == n.Assignee && n.role.push('Assignee'), + (n.showConfirmation = !0), + e.updatePersonRole(i.cellInfos, n); + }); + }, + }, + }; + }, + }; + return n; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersDataGridViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + var t = Object.create(null); + return ( + (t.toolbar = null), + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function () { + return { + entries: [ + { + id: 'add', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'user-add', + fontIconFamily: 1, + }, + tooltip: e.CHG_Member_Toolbar_AddMember, + position: 'far', + category: 'addRemove', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRAddMemberLayout', + func: 'launchAddMemberPanel', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_Member_Toolbar_Remove, + position: 'far', + disabled: !0, + category: 'addRemove', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'filter', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'filter', + fontIconFamily: 1, + }, + tooltip: e.CHG_Member_Toolbar_Filter, + position: 'far', + category: 'View', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMemberFilterLayout', + func: 'launchFilterMemberPanel', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridReportViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + let t = Object.create(null); + return ( + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'changeCRView', + argument: { + view: 'GridView', + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'changeCRView', + argument: { + view: 'TileView', + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.writetoolbarDefinition = function (e) { + return { + entries: [ + { + id: 'view', + dataElements: { + typeRepresentation: 'addDropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + className: 'currentView', + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovCommonDelete', + [ + 'UWA/Core', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgInfodialog', + 'DS/UIKIT/Mask', + 'require', + ], + function (e, t, i, n, o, a, r) { + 'use strict'; + return { + deleteNodes: function (r, s, l, c, d) { + for ( + var u = n.CHG_GOV_Delete_Info_Content + '

    ', g = [], p = 0; + p < r.length; + p++ + ) { + var h = r[p]; + u += e.String.escapeHTML(h.nodeTitle) + ' (' + h.nodeName + ')
    '; + var m = { + physicalid: h.physicalid, + }; + g.push(m); + } + var C = function (e) { + if (e.report && e.report.length > 0) { + for (var t = [], o = 0; o < e.report.length; o++) { + t.push(e.report[o].physicalids); + var r = e.report, + d = r[o].displaytype, + u = r[o].name, + g = r[o].error; + } + i.error( + n.CHG_GOV_Operation_Partially_Failed + + '
    ' + + d + + ' ' + + u + + ': ' + + g, + ); + } else if (e.data && e.data.length > 0) { + var p = []; + for (o = 0; o < e.data.length; o++) p.push(e.data[o].id); + l(p, c), + i.success( + n.CHG_GOV_ChangeOrchestration_Toolbar_Delete_Success, + ); + } else if (e.results && e.results.length > 0) { + for (p = [], o = 0; o < e.results.length; o++) + p.push(e.results[o].physicalid); + l(p, c), + i.success( + n.CHG_GOV_ChangeOrchestration_Toolbar_Delete_Success, + ); + } else + i.warn(n.CHG_GOV_ChangeOrchestration_Toolbar_Delete_Failure); + 'undefined' != s && null != s && a.unmask(s); + }, + v = [ + { + label: n.CHG_GOV_OK_Button_Label, + handler: function () { + 'undefined' != s && null != s && a.mask(s), + 'ImpactAnalysis' === d + ? t.deleteImpactAnalysis(r[0].parentCRId, g).then( + function (e) { + C(e); + }, + function (e) { + return a.unmask(s), Promise.reject(e); + }, + ) + : t.deleteObjectStructure(g).then( + function (e) { + C(e); + }, + function (e) { + return a.unmask(s), Promise.reject(e); + }, + ), + o.closeDialog(); + }, + className: 'primary', + }, + { + label: n.CHG_GOV_CANCEL_Button_Label, + handler: function () { + o.closeDialog(); + }, + className: 'default', + }, + ], + f = { + title: n.CHG_GOV_Delete_Info_Title, + content: u, + buttonArray: v, + }; + o.launchInfoDailog(f); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/facets/contributors/ChgCRContributorsDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/UIKIT/Mask', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o, a, r, s, l, c) { + 'use strict'; + let d = e.extend({ + init: function (e, t) { + (this.parentCRId = e), (this.impactAnalysisId = t); + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new t({ + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + let t = e.getChildren(); + for (let e = 0; e < t.length; e++) + if (this.options.grid.id == t[e].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + loadContributor: function (e, t) { + e.prepareUpdate(); + let i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + let n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + var t = ''; + e.icon, e.roleList; + 'Person' == e.type + ? (t = this.getPersonImageDiv(e, !0)).addClassName( + 'chg-member-profile-picture', + ) + : 'Group' == e.type || 'Group Proxy' == e.type + ? (t = this.getUserGroupImageDiv(e, !0)).addClassName( + 'chg-member-profile-picture', + ) + : (t = e.thumbnail); + let n = new i({ + label: e.personFullName, + description: c.CHG_Add_Member_Assignee, + grid: e, + icons: [e.icon], + thumbnail: t, + }); + return ( + ('Group' != e.type && 'Group Proxy' != e.type) || + (n.options.label = e.title), + n + ); + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.name + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + r = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = a.getAvatarDetails(e.personFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(r); + let l = UWA.createElement('span', { + class: 'userName', + html: e.personFullName, + }); + return r.inject(n), l.inject(n), n.outerHTML; + }, + getPersonImageDiv: function (e, t) { + null == e.name && (e.name = e.userid); + var i = '/api/user/getpicture/login/' + e.name + '/format/normal'; + i = o.getGlobalVariable().computeSwymUrl(i); + var n = new UWA.Element('div', {}), + r = ''; + if (o.getGlobalVariable().isSwymInstalled) + r = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + var s = a.getAvatarDetails(e.personFullName); + (r = UWA.createElement('div', { + html: s.avatarStr, + })), + 1 == t + ? (r.addClassName('chg-member-profile-picture'), + r.addClassName('chg-team-profile-text')) + : r.addClassName('avatarIcon'), + r.style.setProperty('background', s.avatarColor); + } + return r.inject(n), n; + }, + getUserGroupImageDiv: function (e, t) { + var i = new UWA.Element('div', {}), + n = ''; + return ( + (n = UWA.createElement('img', { + class: 'userIcon', + src: e.icon, + })), + 1 == t + ? (n.addClassName('chg-member-profile-picture'), + n.addClassName('chg-team-profile-text')) + : n.addClassName('avatarIcon'), + n.inject(i), + i + ); + }, + addExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.impactAnalysisId, + a = t.parentCRId, + l = document.getElementById('outer-contributor-grid-div'); + 'undefined' != l && null != l && s.mask(l), + r.updateExistingContributors(a, o, e).then( + function (e) { + let n = []; + e && (n = e.data), + d.prototype.addNodesInLayoutModel(t.treeDocument, n), + i(e), + s.unmask(l); + }, + function (e) { + s.unmask(l), n(e); + }, + ); + }); + }, + addNodesInLayoutModel: function (e, t) { + let i = d.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else for (let t = i.length - 1; t >= 0; t--) e.addRoot(i[t], 0); + e.pushUpdate(), + e.getRoots().length > 0 && + e._modelEvents.publish({ + event: 'treeNotEmpty', + }); + }, + removeExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.impactAnalysisId, + a = t.parentCRId, + d = document.getElementById('outer-contributor-grid-div'); + 'undefined' != d && null != d && s.mask(d), + r.updateExistingContributors(a, o, e).then( + function (e) { + let n = t.treeDocument.getSelectedNodes(); + i(n); + for (let e = 0; e < n.length; e++) + t.treeDocument.removeRoot(n[e]); + 0 == t.treeDocument.getRoots().length && + t.treeDocument._modelEvents.publish({ + event: 'treeEmpty', + }), + l.success( + c.CHG_Contributors_Toolbar_RemoveContributor_suceess, + ), + s.unmask(d); + }, + function (e) { + s.unmask(d), n(); + }, + ); + }); + }, + }); + return d; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCreateChangeAction', + [ + 'DS/ENONewWidget/ENONewLauncher', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/UIKIT/Mask', + 'require', + ], + function (e, t, i, n, o) { + return { + launchCreateChangeActionDialog: function (a) { + console.log( + 'launchCreateChangeActionDialog ............................', + ); + let r = widget.getValue('DefaultCASubType') + ? widget.getValue('DefaultCASubType') + : 'Change Action', + s = { + context: { + service: '3DSpace', + tenant: t.getGlobalVariable().tenant, + header: { + SecurityContext: t.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: i.CHG_NEW_CHANGE_ACTION_FORM, + type: 'Change Action', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Action', + preferedType: r, + select: [], + }, + events: { + onSuccess: function (e) { + a && (a.isClickProcessing = !1); + var t = document.getElementsByClassName('moduleWrapper')[0]; + (null == t && 'undefined' == t) || n.mask(t); + let i = e.result[0].identifier, + r = {}; + (r.context = i), (r.type = 'ChangeAction'); + let s = o( + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ), + l = o( + 'DS/ENOChgGovernanceUX/scripts/util/changeAction/ChgChangeActionUtil', + ); + s.launchPropertyPanelContext(r), + l.displayObjectInfoInsideIDcard(i, !0); + }, + onFailure: function (e) { + a && (a.isClickProcessing = !1), + console.log('onFailure...............' + e); + }, + onCancel: function (e) { + a && (a.isClickProcessing = !1); + }, + }, + }; + var l = { + commandInfo: { + type: 'Change Action', + facet: 'Start a New Activity', + action: 'CA>Start a New Activity>New Change Action', + }, + }; + o( + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ).cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: l, + }), + new e().CreateNew(s); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/facets/impactBasis/ChgCRImpactBasisDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/TreeModel/BaseFilter', + 'DS/UIKIT/Mask', + ], + function (e, t, i, n, o, a, r, s, l, c, d) { + 'use strict'; + let u = c.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }), + g = e.extend({ + init: function (e, t) { + (this.parentCRId = e), (this.impactAnalysisId = t); + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new t({ + id: 'crImpactBasis', + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + let t = e.getChildren(); + for (let e = 0; e < t.length; e++) + if (this.options.grid.id == t[e].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument + .getFilterManager() + .registerFilter('stringRole', u); + }, + loadImpactBasisData: function (e, t) { + e.prepareUpdate(); + let i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + let n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = this.createCustomOwnerField(e); + e.chgObjOwner = t; + let n = e.name + ' | ' + e.ownerFullName, + a = e.currentNLS; + var r, + s = this.getCustomTooltip(e); + return ( + (r = o.getGlobalVariable().is3DSpace + ? '' + + UWA.String.escapeHTML(e.title) + + '' + : e.title), + new i({ + label: r, + subLabel: n, + description: a, + grid: e, + icons: [e.icon], + thumbnail: e.previewicon, + contextualMenu: ['dummy placeholder'], + useAsyncPreExpand: !0, + customTooltip: s, + }) + ); + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.currentNLS + ); + }, + addExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.impactAnalysisId, + a = t.parentCRId, + r = document.getElementById('outer-impactBasis-grid-div'); + 'undefined' != r && null != r && d.mask(r), + s.updateExistingImpactBasis(a, o, e).then( + function (e) { + let n = []; + e && (n = e.data); + let o = []; + for (let e of n) (e.reasonForChange = ''), o.push(e); + g.prototype.addNodesInLayoutModel(t.treeDocument, o), + i(e), + d.unmask(r); + }, + function (e) { + d.unmask(r), n(e); + }, + ); + }); + }, + removeExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.impactAnalysisId, + r = t.parentCRId, + c = document.getElementById('outer-impactBasis-grid-div'); + 'undefined' != c && null != c && d.mask(c), + s.updateExistingImpactBasis(r, o, e).then( + function (e) { + let n = t.treeDocument.getSelectedNodes(); + i(n); + for (let e = 0; e < n.length; e++) + t.treeDocument.removeRoot(n[e]); + l.success(a.CHG_GOV_ImpactBasis_Remove_Success), + d.unmask(c); + }, + function (e) { + d.unmask(c), n(); + }, + ); + }); + }, + addNodesInLayoutModel: function (e, t) { + let i = g.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else for (let t = i.length - 1; t >= 0; t--) e.addRoot(i[t], 0); + e.pushUpdate(); + }, + filterView: function (e, t) { + let i = t, + n = e.matchingIDs; + i.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: n, + }, + }, + }); + }, + enableColorizeView: function (e, t) { + let i = t.getAllDescendants(); + var n, o; + (n = e), + (o = function (e, t) { + i.map((i) => { + if (i.options.grid.id === t) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + i.updateOptions(n); + } + }); + }), + UWA.is(n, 'array') && + n.forEach(function (e) { + var t = e.color, + i = e.id; + o(t, i); + }); + }, + disableColorizeView: function (e, t) { + t.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return g; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridViewToolbar', + ['i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS'], + function (e) { + let t = Object.create(null); + return ( + (t.toolbar = null), + (t.sortingData = { + menu: [ + { + type: 'PushItem', + title: e.CHG_GOV_DataGrid_Column_Severity, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-alpha-sorting-a-z', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridLayout', + func: 'sortBySeverity', + }, + }, + { + type: 'PushItem', + title: e.CHG_GOV_DataGrid_Column_Maturity, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-alpha-sorting-a-z', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridLayout', + func: 'sortByMaturity', + }, + }, + ], + }), + (t.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (t.filterData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_Filter_ActiveCR, + state: 'selected', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridLayout', + func: 'filterView', + argument: { + filter: 'activeCR', + }, + }, + tooltip: e.CHG_Filter_ActiveCR_Def, + }, + { + type: 'CheckItem', + title: e.CHG_Filter_InactiveCR, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridLayout', + func: 'filterView', + argument: { + filter: 'inactiveCR', + }, + }, + tooltip: e.CHG_Filter_InactiveCR_Def, + }, + ], + }), + (t.writetoolbarDefination = function () { + return { + entries: [ + { + id: 'filter', + className: 'menuCA', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'list-filter', + fontIconFamily: 1, + }, + value: this.filterData, + }, + position: 'far', + tooltip: e.CHG_Toolbar_FilterBy, + category: 'View', + }, + { + id: 'view', + className: 'menuCA', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + { + id: 'sorting', + className: 'menuCA', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'sorting', + fontIconFamily: 1, + }, + value: this.sortingData, + }, + position: 'far', + tooltip: e.CHG_TOOLTIP_SORT, + category: 'View', + }, + ], + }; + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/decision/ChgDecisionfacet', + [ + 'UWA/Core', + 'DS/ENOChgGovernanceUX/scripts/components/decisionView/ChgDecisionView', + 'DS/EditPropWidget/facets/Common/FacetsBase', + 'DS/EditPropWidget/constants/EditPropConstants', + 'UWA/Class/Model', + 'DS/UIKIT/Mask', + 'css!DS/ENOChgGovernanceUX/ENOChgGovernanceUX', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o, a, r, s) { + 'use strict'; + return i.extend({ + init: function () { + this._parent.apply(this, arguments), + this.elements.container || + (this.elements.container = e.createElement('div', { + id: 'DecisionContainer', + class: + 'decisions-facet-container chg-decisions-facet-container', + })); + }, + updateFacet: function () { + a.mask(this.elements.container); + var e = this.getModel(); + if (!e || '' == e.get('objectId')) + return a.unmask(this.elements.container), !1; + this.elements.container.setContent(''); + var i = { + id: e.get('objectId'), + target: this.elements.container, + }; + t.createDecisionView(i); + }, + destroyComponent: function () { + e.is(this.destroy, 'function') && this.destroy(); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + [ + 'UWA/Core', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgNativeInitService', + 'DS/ENOXVersionExplorerController/VersionExplorerController', + 'DS/LifecycleServices/LifecycleServicesSettings', + 'DS/Windows/ImmersiveFrame', + 'DS/Windows/Dialog', + 'require', + 'DS/LifecycleCmd/MaturityCmd', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'DS/ENOChgGovernanceUX/scripts/util/DocumentUtils', + 'DS/ENOChgServices/scripts/services/ChgErrors', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g) { + 'use strict'; + let p = Object.create(null); + return ( + (p.getColumnDefinition = function (n) { + if (n && n.dataIndex) { + var o = this; + switch (n.dataIndex) { + case 'titleTree': + return { + dataIndex: 'tree', + text: i.CHG_GOV_DataGrid_Column_Title, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !e.is(n.visibleFlag) || n.visibleFlag, + alwaysVisibleFlag: + !e.is(n.alwaysVisibleFlag) || n.alwaysVisibleFlag, + pinned: 'left', + width: e.is(n.width) ? n.width : 200, + filterId: 'stringRegexp', + filterModel: '', + }; + case 'title': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Title, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !e.is(n.visibleFlag) || n.visibleFlag, + alwaysVisibleFlag: + !e.is(n.alwaysVisibleFlag) || n.alwaysVisibleFlag, + width: e.is(n.width) ? n.width : 200, + typeRepresentation: 'url', + filterId: 'stringRegexp', + filterModel: '', + getCellValue: function (e) { + if (e.nodeModel) + return { + icon: e.nodeModel.getAttributeValue('icon'), + label: e.nodeModel.getAttributeValue('title'), + }; + }, + }; + case 'name': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Name, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !e.is(n.visibleFlag) || n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + allowUnsafeHTMLContent: + !!e.is(n.allowUnsafeHTMLContent) && + n.allowUnsafeHTMLContent, + width: e.is(n.width) ? n.width : 150, + filterId: 'stringRegexp', + filterModel: '', + }; + case 'chgObjName': + case 'co_name': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Name, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !e.is(n.visibleFlag) || n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + allowUnsafeHTMLContent: + !e.is(n.allowUnsafeHTMLContent) || n.allowUnsafeHTMLContent, + width: e.is(n.width) ? n.width : 150, + filterId: 'stringRegexp', + filterModel: '', + getCellGroupingKey: function (e) { + return e.nodeModel.options.grid.name; + }, + }; + case 'typeNLS': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Type, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !!e.is(n.visibleFlag) && n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + filterId: 'set', + filterModel: [], + }; + case 'revision': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Revision, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !e.is(n.visibleFlag) || n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + width: 65, + filterId: 'set', + filterModel: [], + }; + case 'maturityNLS': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Maturity, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !e.is(n.visibleFlag) || n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + allowUnsafeHTMLContent: !0, + filterId: 'set', + filterModel: [], + }; + case 'maturityWithBadge': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Maturity, + typeRepresentation: 'tag', + className: 'lc-maturity-state', + filterId: 'set', + filterModel: [], + width: 100, + getCellClassName: function (e) { + if (e.nodeModel) { + var t, + i = e.nodeModel.options.grid.maturity; + if (i) { + if (!1 === i.contains('.')) + i = e.nodeModel.getReferenceValue('policy') + '.' + i; + t = o.getAndCreateMaturityClass( + i, + 'wux-controls-label', + ); + } + return t; + } + }, + }; + case 'currentNLS': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Maturity, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !e.is(n.visibleFlag) || n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + allowUnsafeHTMLContent: !0, + filterId: 'set', + filterModel: [], + }; + case 'collabspaceNLS': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_CollabSpace, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !!e.is(n.visibleFlag) && n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + filterId: 'set', + filterModel: [], + }; + case 'organizationNLS': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Organization, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !!e.is(n.visibleFlag) && n.visibleFlag, + sortableFlag: !e.is(n.sortableFlag) || n.sortableFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + filterId: 'set', + filterModel: [], + }; + case 'reasonForChange': + return { + dataIndex: n.dataIndex, + text: i.Chg_GOV_Reason_For_Change, + editableFlag: !e.is(n.editableFlag) || n.editableFlag, + visibleFlag: !e.is(n.visibleFlag) || n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + typeRepresentation: 'editor', + massUpdateAllowedFlag: + !e.is(n.massUpdateAllowedFlag) || n.massUpdateAllowedFlag, + filterId: 'stringRegexp', + filterModel: '', + }; + case 'applicabilityNLS': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Applicability, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !!e.is(n.visibleFlag) && n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + filterId: 'stringRegexp', + filterModel: '', + }; + case 'modificationDate': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_ModificationDate, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !!e.is(n.visibleFlag) && n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + filterModel: '', + }; + case 'creationDate': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_CreationDate, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !!e.is(n.visibleFlag) && n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + filterModel: '', + }; + case 'severityNLS': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Severity, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + typeRepresentation: 'url', + filterId: 'set', + filterModel: [], + getCellValue: function (e) { + if (e.nodeModel) { + var t = e.nodeModel.getAttributeValue('severity'); + let i, n; + return ( + 'Low' == t + ? ((i = 'level-low'), (n = 'success')) + : 'Medium' == t + ? ((i = 'level-medium'), (n = 'warning')) + : 'High' == t && ((i = 'level-high'), (n = 'error')), + { + icon: i, + label: e.nodeModel.getAttributeValue('severityNLS'), + emphasize: n, + } + ); + } + }, + getCellClassName: function (e) { + return e && e.nodeModel ? 'change-sev' : null; + }, + compareFunction: function (e, t, i, n, o) { + return 'undefined' != i.options.grid.severityGrade && + 'undefined' != n.options.grid.severityGrade + ? i.options.grid.severityGrade == + n.options.grid.severityGrade + ? 0 + : i.options.grid.severityGrade < + n.options.grid.severityGrade + ? -1 + : 1 + : 0; + }, + getCellGroupingKey: function (e) { + return e.nodeModel.options.grid.severityNLS; + }, + }; + case 'ownerFullName': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_Owner, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !e.is(n.visibleFlag) || n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + typeRepresentation: 'user', + filterId: 'set', + filterModel: [], + getCellValue: function (e) { + if (e.nodeModel) { + if (t.getGlobalVariable().isSwymInstalled) { + var i = + '/api/user/getpicture/login/' + + e.nodeModel.getAttributeValue('owner') + + '/format/normal'; + return { + icon: (i = t.getGlobalVariable().computeSwymUrl(i)), + label: e.nodeModel.getAttributeValue('ownerFullName'), + }; + } + return { + label: e.nodeModel.getAttributeValue('ownerFullName'), + }; + } + }, + getCellGroupingKey: function (e) { + return e.nodeModel.options.grid.ownerFullName; + }, + }; + case 'changeCoordinatorFullName': + return { + dataIndex: n.dataIndex, + text: i.CHG_GOV_DataGrid_Column_ChangeCoordinator, + editableFlag: !!e.is(n.editableFlag) && n.editableFlag, + visibleFlag: !!e.is(n.visibleFlag) && n.visibleFlag, + alwaysVisibleFlag: + !!e.is(n.alwaysVisibleFlag) && n.alwaysVisibleFlag, + typeRepresentation: 'user', + filterId: 'set', + filterModel: [], + getCellValue: function (e) { + if (e.nodeModel) { + if (t.getGlobalVariable().isSwymInstalled) { + var i = + '/api/user/getpicture/login/' + + e.nodeModel.getAttributeValue('changeCoordinator') + + '/format/normal'; + return { + icon: (i = t.getGlobalVariable().computeSwymUrl(i)), + label: e.nodeModel.getAttributeValue( + 'changeCoordinatorFullName', + ), + }; + } + return { + label: e.nodeModel.getAttributeValue( + 'changeCoordinatorFullName', + ), + }; + } + }, + getCellGroupingKey: function (e) { + return e.nodeModel.options.grid.changeCoordinatorFullName; + }, + }; + } + } + }), + (p.launchVersionExplorer = function (n) { + var l = e.createElement('div', { + styles: { + height: '100%', + }, + }), + c = new o({ + versionGraphContainer: l, + }), + d = [ + { + '3DSpace': t.getGlobalVariable().baseURL, + platformId: t.getGlobalVariable().tenant, + }, + ]; + a.setOption('platform_services', d), + c.setSingleSelectionMode(), + c.setCheckVersionExternalFunction( + 'ENOXVersionExplorerOpenVersion', + function (e) { + return !1; + }, + ), + c.publishEvent('ENOXVersionExplorerLoadVersionModel', { + id: n.id, + securityContext: t.getGlobalVariable().getSecurityContext(), + tenantId: t.getGlobalVariable().tenant, + type: n.type, + context: null, + onComplete: function () {}, + }); + var u = new r({ + identifier: 'WebUX_IMF_ECM_VERSION_EXP', + }); + new s({ + immersiveFrame: u, + title: + (n.title_prefix ? n.title_prefix : i.CHG_GOV_VE_Revisions) + + ' : ' + + n.name, + content: l, + height: 360, + width: 620, + resizableFlag: !0, + modalFlag: !0, + identifier: 'WebUX_PANEL_ECM_VERSION_EXP', + }); + u.inject(widget.body); + }), + (p.getRelationalExplorerMenu = function (e) { + var o = e.selectedNodeIDs; + return { + type: 'PushItem', + title: i.CHG_GOV_Menu_Relational_Explorer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-object-related', + }, + action: { + callback: function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/util/ProbesRMBCommandUtil', + ], function (e) { + e.createProbesData('Relations'); + }), + t.getGlobalVariable().isNative + ? n.DispatchEventToWin('onRelations', o) + : require([ + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ], function (e) { + e.openRelationalExplorer(o); + }); + }, + }, + }; + }), + (p.getMaturityMenu = function (e, t, n) { + var o = this; + return { + type: 'PushItem', + title: i.CHG_GOV_Menu_Maturity, + fonticon: { + family: 1, + content: 'fonticon fonticon-collaborative-lifecycle-management', + }, + action: { + callback: function (i) { + o.executeMaturity(e, t, n); + }, + }, + }; + }), + (p.executeMaturity = function (e, i, n) { + require([ + 'DS/ENOChgGovernanceUX/scripts/util/ProbesRMBCommandUtil', + ], function (e) { + e.createProbesData('Maturity'); + }); + var o = { + securityContext: { + SecurityContext: t.getGlobalVariable().getSecurityContext(), + tenant: t.getGlobalVariable().tenant, + }, + getSecurityContext: function () { + return this.securityContext; + }, + }, + a = []; + if (e) + for ( + var r = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + s = 0; + s < r.length; + s++ + ) + 'ia_Total' != r[s].options.grid.id && + a.push({ + physicalid: r[s].options.grid['@id'] || r[s].options.grid.id, + }); + else + i && + (Array.isArray(i) + ? i.forEach((e) => { + a.push({ + physicalid: e, + }); + }) + : '' != i && + a.push({ + physicalid: i, + })); + new c({ + context: o, + ID: 'MaturityHdr', + }) + .executeAsync(a) + .then(function () { + n && n(); + }); + }), + (p.getHandleForMaturityUpdate = function (e, t) { + var i = {}; + if (t && t.length) { + for (const t of e.Refresh.modified) + (t.maturity = t.policy + '.' + t.state), + (i['ds6w:status'] = [t.maturity]); + e && + e.Refresh && + Array.isArray(e.Refresh.modified) && + d.getNLSValuesPromise(i).then(function (i) { + if (i) + for (const a of e.Refresh.modified) + for (const e of t) + if (a.physicalid === e.options.grid.id) { + var n = { + title: e.options.grid.title, + name: e.options.grid.name, + severityNLS: e.options.grid.severityNLS, + ownerFullName: e.options.grid.ownerFullName, + maturityNLS: i['ds6w:status'][a.maturity], + currentNLS: i['ds6w:status'][a.maturity], + }, + o = p.getCustomTooltip(n); + e.updateOptions({ + description: i['ds6w:status'][a.maturity], + grid: { + maturity: a.state, + maturityNLS: i['ds6w:status'][a.maturity], + maturityWithBadge: i['ds6w:status'][a.maturity], + current: a.state, + currentNLS: i['ds6w:status'][a.maturity], + }, + customTooltip: o, + }); + } + }); + } + }), + (p.getCustomTooltip = function (e) { + return void 0 !== e.currentNLS + ? i.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + i.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + i.CHG_GOV_DataGrid_Column_Severity + + ': ' + + e.severityNLS + + '\n' + + i.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + i.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.currentNLS + : i.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + i.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + i.CHG_GOV_DataGrid_Column_Severity + + ': ' + + e.severityNLS + + '\n' + + i.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + i.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.maturityNLS; + }), + (p.cleanStatusForCSS = function (e) { + return e.replace(/(\.| )/g, '-'); + }), + (p.createCSSClass = function (e, t, i) { + if (null === document.getElementById(e)) { + var n = document.createElement('style'); + (n.type = 'text/css'), (n.id = e); + let o = i || '.' + e; + (n.innerHTML = o + t), + document.getElementsByTagName('head')[0].appendChild(n); + } + }), + (p.getAndCreateMaturityClass = function (e, t, i) { + return ( + 'lc-status-' + this.cleanStatusForCSS(e) + (t ? '-withClass' : '') + ); + }), + (p.addCSSMaturityClasses = function (e, t, i) { + var n = {}; + if (void 0 === e) return; + let o = i.policies; + for (let e = 0; o && e < o.length; e++) { + n[o[e].policyName] = o[e].states; + } + for (let i = 0; i < e.length; i++) { + let o = e[i]; + if (n[o]) { + let e = n[o]; + for (let i = 0; i < e.length; i++) { + let n = e[i].activeColor, + a = + '{color:' + + ('#FFFFFF' === n ? '#000000' : '#FFFFFF') + + ' ; background-color:' + + n + + '; cursor:pointer;}', + r = this.cleanStatusForCSS(e[i].stateSysName), + s = + 'lc-status-' + + this.cleanStatusForCSS(o) + + '-' + + r + + (t ? '-withClass' : ''), + l = '.' + s + (t ? ' .' + t : ''); + this.createCSSClass(s, a, l); + } + } + } + }), + (p.download = function (e) { + var t = []; + u.getDocuments(e).then(function (n) { + n.forEach(function (e) { + 'TRUE' === e.dataelements.isDocumentType && t.push(e.id); + }), + t.length < e.length && g.warn(i.CHG_GOV_Download_Skipped), + u.download(t); + }); + }), + p + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTweakerExpandInput', + [ + 'UWA/Core', + 'DS/Tweakers/TweakerBase', + 'DS/Utilities/Dom', + 'DS/Utilities/Utils', + 'DS/Core/PointerEvents', + 'DS/Utilities/KeyboardUtils', + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovExpandInputTextBox', + ], + function (e, t, i, n, o, a, r) { + 'use strict'; + var s = t.inherit({ + name: 'TweakerExpandInput', + publishedProperties: { + displayStyle: { + defaultValue: 'TextBox', + type: 'string', + }, + value: { + defaultValue: '', + type: 'string', + advancedSetter: !0, + }, + valueType: { + defaultValue: 'string', + type: 'string', + }, + }, + computeTweakerContentLength: function () { + return this._getCurrentTouchMode() ? 19 : 14; + }, + _upgradeValue: function (e) { + return ( + '1' === e || + 1 === e || + 'true' === e || + !0 === e || + ('0' !== e && 0 !== e && 'false' !== e && !1 !== e && 'undefined') + ); + }, + }), + l = function (e, i) { + t.prototype.baseViewModule.call(this, e, i); + }; + n.applyMixin(l, t.prototype.baseViewModule); + var c = function (e, t) { + l.call(this, e, t); + }; + return ( + n.applyMixin(c, l), + (c.prototype.buildView = function () { + var e = this._options.viewOptions || {}; + (e.escapeHTML = this._tweaker.escapeHTML), + (e.touchMode = this._tweaker._getCurrentTouchMode()), + (e.disabled = this._tweaker.readOnly), + (e.selectAllOnFocus = !0), + (e.fireOnlyFromUIInteractionFlag = !0), + (e.autoCommitFlag = !0); + var t = new r(e); + (this._view = t), this.setValue(this._tweaker.value); + }), + (c.prototype.handleEvents = function () { + var e = this, + t = this._tweaker, + n = this._view; + n.addEventListener('buttonclick', function (e) { + if ( + (e.stopPropagation(), + document + .getElementsByClassName('toolbar-co-div')[0] + .getBoundingClientRect().width > 500) + ) + n.createCAContainer.hasClassName('showBox') + ? (n.createCAContainer.removeClassName('openBox'), + n.createCAContainer.removeClassName('showBox'), + n.plusBtn.getContent().removeClassName('icon-blue')) + : (n.createCAContainer.addClassName('showBox'), + setTimeout(function () { + n.createCAContainer.addClassName('openBox'); + }, 20), + n.lineEditor._myInput.focus(), + n.plusBtn.getContent().addClassName('icon-blue')); + else { + n.plusBtn.getContent().removeClassName('icon-blue'), + (n.createCAContainer.style.display = 'none'); + var i = {}; + (i.top = t.getContent().getBoundingClientRect().bottom), + (i.left = t.getContent().getBoundingClientRect().right), + (i.zIndex = 40003), + document.body.addContent(n.getModalInputBox(i)), + n.lineEditor._myInput.focus(); + } + }), + n && + t && + (i.addEventOnElement(t, n, 'focus', function (e) { + e.stopPropagation(); + }), + i.addEventOnElement(t, n, 'blur', function (e) { + e.stopPropagation(), t.onPostEdit(); + }), + i.addEventOnElement(t, n, 'uncommittedChange', function (e) { + e.stopPropagation(), t.onPreEdit(); + }), + i.addEventOnElement(t, n.dropdown, 'click', function (e) { + e.stopPropagation(), + n.createCAContainer.style.setProperty('display', 'none'), + n.plusBtn.getContent().removeClassName('icon-blue'), + n.createCAContainer.removeClassName('showBox'); + }), + i.addEventOnElement(t, n.lineEditor, 'keydown', function (e) { + e.stopPropagation(), + e.keyCode === a.ESCAPE && t.onCancelEdit(), + e.keyCode === a.ENTER && + ((n.value = n.lineEditor.value), + t.keyDownEventCallback && + t.keyDownEventCallback(e, t, n.lineEditor), + n.removeModalInputBox()); + }), + i.addEventOnElement(t, n, 'change', function (i) { + i.stopPropagation(); + var o = n.value, + a = void 0; + (a = + null == o + ? o + : (function (e, t) { + switch (e) { + case 'integer': + var i = parseInt(t, 10); + return ( + isNaN(i) && + ((this.valueType = 'string'), + (i = t ? t.toString() : '')), + i + ); + case 'number': + return ( + (i = parseFloat(t)), + isNaN(i) && + ((this.valueType = 'string'), + (i = t ? t.toString() : '')), + i + ); + case 'boolean': + return null !== /true/i.exec(t) || '1' === t; + case 'string': + return t ? t.toString() : ''; + case 'object': + return JSON.parse(t); + default: + return t; + } + })(t.valueType, o)), + e.setTweakerValue(a); + })); + }), + (c.prototype.setValue = function (e) { + var t, + i, + n = this._tweaker, + o = this._view; + o && + n && + (o.value = + null == e + ? e + : ((t = n.valueType), + 'string' == typeof (i = e) + ? i + : 'object' === t + ? JSON.stringify(i) + : ('integer' !== t && 'number' !== t) || + !( + (Number.isNan && !0 === Number.isNaN(i)) || + (void 0 !== isNaN && !0 === isNaN(i)) + ) + ? 'integer' === t || 'number' === t + ? i.toString() + : i + : 'NaN')); + }), + (s.prototype.baseViewModule = l), + (s.prototype.VIEW_MODULES = { + TextBox: { + classObject: c, + }, + readOnly: { + classObject: c, + }, + }), + (s.prototype.registerViewModule = function (e, t) {}), + (s.prototype.registerkeyDownCallback = function (e) { + this.keyDownEventCallback = e; + }), + s + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/config/ChgGovAppGlobalConfig', + 'DS/ENOChangeActionUX/scripts/CAPreferencesManager', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovCommonDelete', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/LifecycleCmd/MaturityCmd', + 'DS/Controls/ProgressBar', + 'DS/UIKIT/Input/Text', + 'DS/UIKIT/Input/Button', + 'DS/Notifications/NotificationsManagerUXMessages', + 'DS/Notifications/NotificationsManagerViewOnScreen', + 'DS/UIKIT/DropdownMenu', + 'DS/UIKIT/Dropdown', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + 'require', + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p, h, m, C, v, f) { + 'use strict'; + var b = Object.create(null); + return ( + (b.getColumns = function () { + let e = []; + return ( + e.push( + C.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'co_name', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'severityNLS', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'changeCoordinatorFullName', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'collabspaceNLS', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'organizationNLS', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'applicabilityNLS', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'modificationDate', + }), + ), + e.push( + C.getColumnDefinition({ + dataIndex: 'creationDate', + }), + ), + e + ); + }), + (b.getRelationalExplorerMenu = function (t, i) { + return { + type: 'PushItem', + title: e.CHG_GOV_Menu_Relational_Explorer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-object-related', + }, + action: { + callback: function (e) { + var t = { + commandInfo: { + type: 'Change Order', + facet: 'Change Orchestration', + action: 'CO>Change Orchestration>RMB>Relations', + }, + }; + f.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: t, + }), + require([ + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ], function (e) { + for ( + var t = i.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = [], + o = 0; + o < t.length; + o++ + ) { + var a = t[o].options.grid.id; + n.push(a); + } + e.openRelationalExplorer(n); + }); + }, + }, + }; + }), + (b.getTransferMenu = function (t, i) { + return { + type: 'PushItem', + title: e.CHG_GOV_Menu_Transfer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-move-to', + }, + action: { + callback: function (e) { + var t = { + commandInfo: { + type: 'Change Order', + facet: 'Change Orchestration', + action: 'CO>Change Orchestration>RMB>Move', + }, + }; + f.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: t, + }); + for ( + var n = i.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + o = [], + a = 0; + a < n.length; + a++ + ) + o.push(n[a].options.grid); + require([ + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTransferWrapper', + ], function (e) { + e.launchTransferDialog(o); + }); + }, + }, + }; + }), + (b.getDeleteMenu = function (t, i, n, o) { + return { + type: 'PushItem', + title: e.CHG_GOV_Menu_Delete, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-trash', + }, + action: { + callback: function () { + var e = { + commandInfo: { + type: 'Change Order', + facet: 'Change Orchestration', + action: 'CO>Change Orchestration>RMB>Delete', + }, + }; + f.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: e, + }); + for ( + var t = i.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + r = [], + s = 0; + s < t.length; + s++ + ) { + var l = t[s], + c = { + physicalid: l.options.grid.id, + nodeName: l.options.grid.name, + nodeTitle: l.options.grid.title, + }; + r.push(c); + } + a.deleteNodes(r, n, o); + }, + }, + }; + }), + (b.makeCopyLinkObject = function (e) { + var t = { + protocol: '3DXContent', + data: { + items: [], + }, + }; + return ( + t.data.items.push({ + envId: i.getGlobalVariable().tenant, + objectId: e.id, + openLink: !0, + }), + t + ); + }), + (b.showNotification = function (e, t, i, n, o, a, r) { + var s = { + level: e, + title: t, + subtitle: i, + message: n, + sticky: o, + allowUnsafeHTML: r || !1, + }; + window.notifs || + ((window.notifs = g), p.setNotificationManager(window.notifs)), + a ? p.inject(a) : p.elements.container.isInjected() || p.inject(), + window.notifs.addNotif(s); + }), + (b.changeView = function (i) { + if ( + (widget.body.getDimensions().width <= n.MOBILE_CUTOFF + ? o.updateCASummaryViewMobile(i) + : o.updateCASummaryViewDesktop(i), + 'GridView' == i) + ) + (this.currentView = 'Grid'), + (a = t.toolbar.getNodeModelByID('view')) && + 'view-list' != a.options.grid.semantics.icon.iconName && + a.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (a.options.grid.data.menu[0].state = 'selected'), + (a.options.grid.data.menu[1].state = 'unselected'), + (r = document.querySelector( + '.toolbar-co-div .wux-ui-3ds-view-list', + )) && r.addClassName('currentView'), + (s = document.querySelector( + '.toolbar-co-div .wux-ui-3ds-view-small-tile', + )) && s.removeClassName('currentView'), + (l = document.querySelector('.cogridView')) && + (l.removeClassName('hideView'), + l.removeClassName('nonVisible'), + l.addClassName('showView')), + (c = document.querySelector('.cotileView')) && + (c.removeClassName('showView'), c.addClassName('hideView')); + else if ('TileView' == i) { + var a, r, s, l, c; + (this.currentView = 'Tile'), + (a = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != a.options.grid.semantics.icon.iconName && + a.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (a.options.grid.data.menu[0].state = 'unselected'), + (a.options.grid.data.menu[1].state = 'selected'), + (r = document.querySelector( + '.toolbar-co-div .wux-ui-3ds-view-list', + )) && r.removeClassName('currentView'), + (s = document.querySelector( + '.toolbar-co-div .wux-ui-3ds-view-small-tile', + )) && s.addClassName('currentView'), + (l = document.querySelector('.cogridView')) && + (l.removeClassName('showView'), l.addClassName('hideView')), + (c = document.querySelector('.cotileView')) && + (c.removeClassName('hideView'), c.addClassName('showView')); + } + }), + (b.createCustomSeverity = function (e, t) { + var i = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e + ? (i = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e && + (i = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + var n = new UWA.Element('div', {}), + o = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: i, + }).inject(o); + var a = UWA.createElement('span', { + html: t, + }); + return o.inject(n), a.inject(n), n.outerHTML; + }), + (b.createCustomOwner = function (e, t) { + var n = '/api/user/getpicture/login/' + t + '/format/normal', + o = i.getGlobalVariable().computeSwymUrl(n), + a = new UWA.Element('div', { + class: 'members', + }), + s = new UWA.Element('div', { + class: 'assignee', + }), + l = ''; + if (i.getGlobalVariable().isSwymInstalled) + l = UWA.createElement('img', { + class: 'userIcon', + src: o, + }); + else { + var c = r.getAvatarDetails(t); + (l = UWA.createElement('div', { + html: c.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', c.avatarColor); + } + l.inject(s); + var d = UWA.createElement('span', { + class: 'userName', + html: t, + }); + return s.inject(a), d.inject(a), a.outerHTML; + }), + (b.filterView = function (e) { + if ('activeCO' == e) + ((i = + t.toolbar.getNodeModelByID( + 'filter', + )).options.grid.data.menu[0].state = 'selected'), + (i.options.grid.data.menu[1].state = 'unselected'); + else if ('inactiveCO' == e) { + var i; + ((i = + t.toolbar.getNodeModelByID( + 'filter', + )).options.grid.data.menu[0].state = 'unselected'), + (i.options.grid.data.menu[1].state = 'selected'); + } + }), + b + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/ChgInActiveCOFilterView', + ['UWA/Core', 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderUtil'], + function (e, t) { + 'use strict'; + return { + filterView: function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridLayout', + ], function (e) { + e.coGridView.coDatagrid.groupRows({ + dataIndexesToGroup: [], + }), + setTimeout(function () { + t.filterView('inactiveCO'); + }, 100); + }); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/util/ChgMembersGridUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/facets/members/ChgMembersDataGridViewToolbar', + ], + function (e, t) { + 'use strict'; + var i = Object.create(null); + return ( + (i.getColumns = function () { + return [ + { + text: e.CHG_Member_DataGrid_Column_Name, + dataIndex: 'person_name', + editableFlag: !1, + alwaysVisibleFlag: !0, + pinned: 'left', + allowUnsafeHTMLContent: !0, + width: '200', + getCellGroupingKey: function (e) { + return e.nodeModel.options.grid.fullName; + }, + }, + { + text: e.CHG_Member_DataGrid_Column_Role, + dataIndex: 'roleList', + }, + ]; + }), + (i.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-member-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.membertileView')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-member-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.membertileView')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + (i.makeUpdateMemberJson = function (e, t, i, n, o) { + var a = { + data: [], + }; + if ( + ('' != t && + a.data.push({ + updateAction: e, + dataelements: { + role: 'Coordinator', + user: t, + list: '', + }, + }), + '' != i && + a.data.push({ + updateAction: e, + dataelements: { + role: 'Approver', + user: '', + list: i, + }, + }), + '' != n.person) + ) + if ('string' != typeof n.person) + for (var r = 0; r < n.person.length; r++) { + var s = { + updateAction: e, + dataelements: { + role: 'Follower', + user: n.person[r], + list: '', + }, + }; + a.data.push(s); + } + else + a.data.push({ + updateAction: e, + dataelements: { + role: 'Follower', + user: n.person, + list: '', + }, + }); + if ('' != n.userGroup) + if ('string' != typeof n.userGroup) + for (r = 0; r < n.userGroup.length; r++) { + var l = { + updateAction: e, + dataelements: { + role: 'Follower', + user: '', + list: n.userGroup[r], + }, + }; + a.data.push(l); + } + else + a.data.push({ + updateAction: e, + dataelements: { + role: 'Follower', + user: '', + list: n.userGroup, + }, + }); + if ('' != o.person) + if ('string' != typeof o.person) + for (r = 0; r < o.person.length; r++) { + s = { + updateAction: e, + dataelements: { + role: 'Assignee', + user: o.person[r], + list: '', + }, + }; + a.data.push(s); + } + else + a.data.push({ + updateAction: e, + dataelements: { + role: 'Assignee', + user: o.person, + list: '', + }, + }); + if ('' != o.userGroup) + if ('string' != typeof o.userGroup) + for (r = 0; r < o.userGroup.length; r++) { + l = { + updateAction: e, + dataelements: { + role: 'Assignee', + user: '', + list: o.userGroup[r], + }, + }; + a.data.push(l); + } + else + a.data.push({ + updateAction: e, + dataelements: { + role: 'Assignee', + user: '', + list: o.userGroup[r], + }, + }); + return a; + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/util/ChgCAMembersGridUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMembersDataGridViewToolbar', + ], + function (e, t) { + 'use strict'; + var i = Object.create(null); + return ( + (i.getColumns = function () { + return [ + { + text: e.CHG_Member_DataGrid_Column_Name, + dataIndex: 'person_name', + editableFlag: !1, + alwaysVisibleFlag: !0, + pinned: 'left', + allowUnsafeHTMLContent: !0, + width: '200', + getCellGroupingKey: function (e) { + return e.nodeModel.options.grid.fullName; + }, + }, + { + text: e.CHG_Member_DataGrid_Column_Role, + dataIndex: 'roleList', + }, + ]; + }), + (i.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-member-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.membertileView')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-member-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.membertileView')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + (i.makeUpdateMemberJson = function (e, t, i, n) { + var o = { + data: [], + }; + if ('' != t.person) + if ('string' != typeof t.person) + for (var a = 0; a < t.person.length; a++) { + let i = { + updateAction: e, + role: 'contributor', + user: t.person[a], + list: '', + }; + o.data.push(i); + } + else + o.data.push({ + updateAction: e, + role: 'contributor', + user: t.person, + list: '', + }); + if ('' != t.userGroup) + if ('string' != typeof t.userGroup) + for (a = 0; a < t.userGroup.length; a++) { + let i = { + updateAction: e, + role: 'contributor', + user: '', + list: t.userGroup[a], + }; + o.data.push(i); + } + else + o.data.push({ + updateAction: e, + role: 'contributor', + user: '', + list: t.userGroup, + }); + if ('' != i.person) + if ('string' != typeof i.person) + for (a = 0; a < i.person.length; a++) { + let t = { + updateAction: e, + role: 'approver', + user: i.person[a], + list: '', + }; + o.data.push(t); + } + else + o.data.push({ + updateAction: e, + role: 'approver', + user: i.person, + list: '', + }); + if ( + ('' != i.routeTemplate && + o.data.push({ + updateAction: e, + role: 'approver', + user: '', + list: i.routeTemplate, + }), + '' != n.person) + ) + if ('string' != typeof n.person) + for (a = 0; a < n.person.length; a++) { + var r = { + updateAction: e, + role: 'follower', + user: n.person[a], + list: '', + }; + o.data.push(r); + } + else + o.data.push({ + updateAction: e, + role: 'follower', + user: n.person, + list: '', + }); + if ('' != n.userGroup) + if ('string' != typeof n.userGroup) + for (a = 0; a < n.userGroup.length; a++) { + var s = { + updateAction: e, + role: 'follower', + user: '', + list: n.userGroup[a], + }; + o.data.push(s); + } + else + o.data.push({ + updateAction: e, + role: 'follower', + user: '', + list: n.userGroup, + }); + return o; + }), + (i.getRoleNLSValue = function (t) { + let i = ''; + switch (t) { + case 'owner': + i = e.CHG_Member_Role_Owner; + break; + case 'originator': + i = e.CHG_Member_Role_Originator; + break; + case 'coordinator': + i = e.CHG_Member_Role_ChangeCoordinator; + break; + case 'contributor': + i = e.CHG_Member_Role_Assignee; + break; + case 'approver': + i = e.CHG_Member_Role_Approver; + break; + case 'follower': + i = e.CHG_Member_Role_Follower; + break; + default: + console.log('NLS is not defined for : ' + t); + } + return i; + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/util/ChgCRMembersGridUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/members/ChgCRMembersDataGridViewToolbar', + ], + function (e, t) { + 'use strict'; + var i = Object.create(null); + return ( + (i.getColumns = function () { + return [ + { + text: e.CHG_Member_DataGrid_Column_Name, + dataIndex: 'person_name', + editableFlag: !1, + alwaysVisibleFlag: !0, + pinned: 'left', + allowUnsafeHTMLContent: !0, + width: '200', + getCellGroupingKey: function (e) { + return e.nodeModel.options.grid.fullName; + }, + }, + { + text: e.CHG_Member_DataGrid_Column_Role, + dataIndex: 'roleList', + }, + ]; + }), + (i.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-member-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.membertileView')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-member-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-member-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.membertileView')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + (i.makeUpdateMemberJson = function (e, t, i, n, o) { + var a = { + data: [], + }; + if ( + ('' != t && + a.data.push({ + updateAction: e, + role: 'Coordinator', + user: t, + list: '', + }), + '' != i && + a.data.push({ + updateAction: e, + role: 'Approver', + user: [], + list: i, + }), + '' != n.person) + ) + if ('string' != typeof n.person) + for (var r = 0; r < n.person.length; r++) { + var s = { + updateAction: e, + role: 'Follower', + user: n.person[r], + list: '', + }; + a.data.push(s); + } + else + a.data.push({ + updateAction: e, + role: 'Follower', + user: n.person, + list: '', + }); + if ('' != n.userGroup) + if ('string' != typeof n.userGroup) + for (r = 0; r < n.userGroup.length; r++) { + var l = { + updateAction: e, + role: 'Follower', + user: '', + list: n.userGroup[r], + }; + a.data.push(l); + } + else + a.data.push({ + updateAction: e, + role: 'Follower', + user: '', + list: n.userGroup, + }); + if ('' != o.person) + if ('string' != typeof o.person) + for (r = 0; r < o.person.length; r++) { + s = { + updateAction: e, + role: 'Assignee', + user: o.person[r], + list: '', + }; + a.data.push(s); + } + else + a.data.push({ + updateAction: e, + role: 'Assignee', + user: o.person, + list: '', + }); + if ('' != o.userGroup) + if ('string' != typeof o.userGroup) + for (r = 0; r < o.userGroup.length; r++) { + l = { + updateAction: e, + role: 'Assignee', + user: '', + list: o.userGroup[r], + }; + a.data.push(l); + } + else + a.data.push({ + updateAction: e, + role: 'Assignee', + user: '', + list: o.userGroup, + }); + return a; + }), + (i.getRoleNLSValue = function (t) { + let i = ''; + switch (t) { + case 'Owner': + i = e.CHG_Member_Role_Owner; + break; + case 'Originator': + i = e.CHG_Member_Role_Originator; + break; + case 'Coordinator': + i = e.CHG_Member_Role_ChangeCoordinator; + break; + case 'Assignee': + i = e.CHG_Member_Role_Assignee; + break; + case 'Approver': + i = e.CHG_Member_Role_Approver; + break; + case 'Follower': + i = e.CHG_Member_Role_Follower; + break; + default: + console.log('NLS is not defined for : ' + t); + } + return i; + }), + (i.removeRole = function (e, t) { + let i = ',' + t, + n = ', ' + t, + o = t + ',', + a = t + ' ,'; + return ( + e.includes(i) + ? (e = e.replace(i, '')) + : e.includes(n) + ? (e = e.replace(n, '')) + : e.includes(o) + ? (e = e.replace(o, '')) + : e.includes(a) && (e = e.replace(a, '')), + e + ); + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderFeaturesUtil', + [ + 'UWA/Core', + 'DS/i3DXCompassPlatformServices/OpenWith', + 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderUtil', + 'DS/ENOChgServices/scripts/services/ChgPropertiesServices', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgCustomAttributeService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'require', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o, a, r, s, l, c) { + 'use strict'; + return { + showRMBMenuOnGrid: function (e, t, a) { + return new Promise(function (d, u) { + var g = 'false', + p = t.cellInfos.nodeModel.getTreeDocument().getSelectedNodes(); + const h = p.map((e) => e.options.grid.id); + p.length > 1 && (g = 'true'); + var m = []; + m.push(n.createPropertyPushItem(h)), + m.push(i.getRelationalExplorerMenu(e, t)); + var C = { + objectId: t.cellInfos.nodeModel.options.grid.id, + objectType: t.cellInfos.nodeModel.options.grid.type, + displayName: t.cellInfos.nodeModel.options.grid.name, + displayType: t.cellInfos.nodeModel.options.grid.displayType, + facetName: 'dependency', + }; + [].push(C); + var v = l('DS/ENOChgServices/scripts/services/ChgDataService'), + f = l( + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ), + b = null, + w = f.openWith(C), + D = t.cellInfos.nodeModel.options.grid.isKindOfChangeAction, + S = [], + y = document.getElementById('outer-co-div'); + 'false' == g && + (S.push(w), + (b = + 1 == D + ? f.getUserAccess( + 'pid:' + t.cellInfos.nodeModel.options.grid.id, + ) + : v.getChangeOrderUserAccess( + t.cellInfos.nodeModel.options.grid.id, + )), + S.push(b)); + let _ = null; + if (a) { + var E = l( + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + ); + _ = E.removeDeletedNodesUsingIDs; + } else { + var O = l( + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridLayout', + ); + _ = O.removeDataFromGrid; + } + Promise.all(S).then(function (n) { + if ((n[0] && m.push(n[0]), 'false' == g && 1 == D)) { + var a = n[1].userAccess; + (a = r.processAccessBitCO(a)), + ((n[1] && 'true' == a.Promote) || 'true' == a.Demote) && + m.push(c.getMaturityMenu(t)), + m.push(s.getCopyLink(p)), + n[1] && + 'true' == a.TransferOwnership && + m.push(i.getTransferMenu(e, t)), + n[1] && + 'true' == a.Delete && + m.push(i.getDeleteMenu(e, t, y, _)); + } else if ('false' == g) { + a = n[1].data[0].dataelements; + (a = r.processAccessBitCO(a)), + ((n[1] && 'true' == a.Promote) || 'true' == a.Demote) && + m.push(c.getMaturityMenu(t)), + m.push(s.getCopyLink(p)), + n[1] && + 'true' == a.TransferOwnership && + m.push(i.getTransferMenu(e, t)), + n[1] && + 'true' == a.Delete && + m.push(i.getDeleteMenu(e, t, y, _)); + } else + 'true' == o.getGlobalVariable().isFullLicence && + m.push(c.getMaturityMenu(t)), + m.push(s.getCopyLink(p)), + m.push(i.getTransferMenu(e, t)), + 'true' == o.getGlobalVariable().isFullLicence && + m.push(i.getDeleteMenu(e, t, y, _)); + d(m); + }); + }); + }, + createCustomColumn: function (e) { + let t = this; + return new Promise(function (e, i) { + let n = o.getGlobalVariable().changeOrderSubTypes; + a.getCombinedClassList(n).then(function (i) { + a.getPropertyForClassGrid(i).then(function (i) { + let n = a.makeCombinedColumnList(i), + o = t.filterColumn(n); + e(o); + }); + }); + }); + }, + filterColumn: function (e) { + console.log('filterColumn...............'); + let t = this, + i = [], + n = [ + 'ds6w:label', + 'ds6w:severity', + 'ds6w:status', + 'ds6w:type', + 'ds6w:identifier', + 'ds6w:responsible', + 'ds6w:project', + 'ds6w:changeCoordinator', + 'ds6w:organizationResponsible', + 'ds6w:modified', + 'ds6w:created', + ]; + for (let t of n) e.delete(t); + return ( + e.forEach((e, n, o) => { + let a = t.createColumnDefination(e, n); + i.push(a); + }), + i + ); + }, + createColumnDefination: function (e, t) { + e.dataType.replace('http://www.w3.org/2001/XMLSchema#', ''); + let i = e.dataType.replace('http://www.w3.org/2001/XMLSchema#', ''); + return { + text: e.vocabColumnsNameNLS, + dataIndex: t, + editableFlag: !1, + allowUnsafeHTMLContent: !1, + visibleFlag: !1, + dataType: i, + range: e.range, + getCellTypeRepresentation: function (e) { + return null != e.cellModel ? 'string' : 'functionIcon'; + }, + getCellSemantics: function (e) { + if (null != e.cellModel); + else if ('undefined' == e.cellModel || null == e.cellModel) + return { + icon: { + iconName: 'reload wux-ui-3ds-spin', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + }; + }, + getCellValue: r.getGetCellValueFunction(i, t), + }; + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovWidgetPreferenceManager', + ['DS/ENOChgGovernanceUX/scripts/util/ChgGovPreferenceConstant'], + function (e) { + 'use strict'; + var t = function () {}; + return ( + (t._KEY = e._KEY), + (t._LAST_ROUTE = e._LAST_ROUTE), + (t._MY_CHANGE_ORDERS = e._MY_CHANGE_ORDERS), + (t._RECENTLY_OPENED = e._RECENTLY_OPENED), + (t.prototype.initWidgetViewPreferences = function () { + if (!widget.getValue(t._KEY)) { + widget.setValue( + t._KEY, + JSON.stringify({ + 'xchange-app': { + model: { + 'id-card': {}, + 'orchestration-level1': {}, + 'orchestration-level2': {}, + 'orchestration-level3': {}, + }, + 'last-route': {}, + 'xchange-views-preferences': { + 'info-panel': { + 'info-open': '', + 'info-context': '', + 'info-width': '', + }, + 'xchange-my-change-orders': { + 'xchange-list-view': { + view: '', + filterview: '', + sort: {}, + search: '', + selections: [], + filters: {}, + tagFilter: {}, + }, + }, + 'xchange-change-orders-details': { + tab: '', + }, + 'xchange-change-requests-details': { + tab: '', + }, + 'xchange-change-actions-details': { + tab: '', + }, + 'xchange-recently-opened': { + objectIDs: '', + }, + }, + }, + }), + ); + } + }), + (t.prototype.updateWidgetViewPreferences = function (e, i) { + if (this.isPath(e, !1)) { + var n = JSON.parse(widget.getValue(t._KEY)), + o = JSON.parse(JSON.stringify(e)); + widget.setValue( + t._KEY, + JSON.stringify(this.recursiveSearch(n, o, i, !0)), + ); + } + }), + (t.prototype.recursiveSearch = function (e, t, i, n) { + return ( + n && 2 == t.length + ? (e[t[0]][t[1]] = i) + : 2 == t.length + ? (e[t[1]] = i) + : n + ? this.recursiveSearch(e[t[0]], t, i, !1) + : (t.shift(), this.recursiveSearch(e[t[0]], t, i, !1)), + e + ); + }), + (t.prototype.isPath = function (e, i) { + try { + var n = widget.getValue(t._KEY); + if (n) { + if (Array.isArray(e)) { + for (var o = JSON.parse(n), a = 0; a < e.length; a++) { + if (void 0 === o[e[a]] && '' != o[e[a]]) + return ( + console.log( + "xChangeWidgetPreferencesManager isPath() path doesn't exist", + ), + !!i && void 0 + ); + o = o[e[a]]; + } + return !i || o; + } + return ( + console.log( + 'xChangeWidgetPreferencesManager isPath() parameter 1 is not a Array', + ), + !!i && void 0 + ); + } + return ( + console.log( + 'xChangeWidgetPreferencesManager isPath() widgetPreferences not initialize', + ), + !!i && void 0 + ); + } catch (e) { + return console.error(e), !!i && void 0; + } + }), + (t.prototype.getValue = function (e) { + return this.isPath(e, !0); + }), + t + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/util/ChgCROrchestrationGridContextualMenu', + [ + 'UWA/Core', + 'DS/i3DXCompassPlatformServices/OpenWith', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovCommonDelete', + 'DS/ENOChgServices/scripts/services/ChgPropertiesServices', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/LifecycleCmd/MaturityCmd', + 'DS/UIKIT/Input/Text', + 'DS/UIKIT/Input/Button', + 'DS/Notifications/NotificationsManagerUXMessages', + 'DS/Notifications/NotificationsManagerViewOnScreen', + 'DS/UIKIT/DropdownMenu', + 'DS/UIKIT/Dropdown', + 'DS/ENOChgServices/scripts/services/ChgCustomAttributeService', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'require', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p, h, m, C, v, f) { + 'use strict'; + var b = { + showRMBMenuOnGrid: function (e, t, i) { + return new Promise(function (i, o) { + var a = 'false', + r = t.cellInfos.nodeModel.getTreeDocument().getSelectedNodes(); + r.length > 1 && (a = 'true'); + var s = []; + const l = r.map((e) => e.options.grid.id); + s.push(n.createPropertyPushItem(l)), + s.push(b.getRelationalExplorerMenu(t)), + s.push(m.getCopyLink(r)); + var c = { + objectId: t.cellInfos.nodeModel.options.grid.id, + objectType: t.cellInfos.nodeModel.options.grid.type, + displayName: t.cellInfos.nodeModel.options.grid.name, + displayType: t.cellInfos.nodeModel.options.grid.displayType, + facetName: 'dependency', + }; + [].push(c); + var d = C('DS/ENOChgServices/scripts/services/ChgDataService'), + u = C( + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ), + g = C( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + ), + p = null, + h = u.openWith(c), + f = t.cellInfos.nodeModel.options.grid.isKindOfChangeAction, + w = t.cellInfos.nodeModel.options.grid.isKindOfChangeRequest, + D = [], + S = document.getElementById('outer-co-div'); + 'false' == a && D.push(h), + 'false' == a && + ((p = + 1 == f + ? u.getUserAccess( + 'pid:' + t.cellInfos.nodeModel.options.grid.id, + ) + : 1 == w + ? d.getChangeRequestUserAccess( + t.cellInfos.nodeModel.options.grid.id, + ) + : d.getChangeOrderUserAccess( + t.cellInfos.nodeModel.options.grid.id, + )), + D.push(p)), + Promise.all(D).then(function (n) { + n[0] && s.push(n[0]), + s.push(v.getMaturityMenu(t)), + 'false' == a && 1 == f + ? (n[1] && + 'true' == n[1].userAccess.Transfer && + s.push(b.getTransferMenu(t)), + n[1] && + 'true' == n[1].userAccess.Delete && + s.push( + b.getDeleteMenu( + e, + t, + S, + g.removeDeletedNodesUsingIDs, + ), + )) + : 'false' == a + ? (n[1] && + 'true' == n[1].data[0].dataelements.TransferOwnership && + s.push(b.getTransferMenu(t)), + n[1] && + 'true' == n[1].data[0].dataelements.Delete && + s.push( + b.getDeleteMenu( + e, + t, + S, + g.removeDeletedNodesUsingIDs, + ), + )) + : (s.push(b.getTransferMenu(t)), + s.push( + b.getDeleteMenu(e, t, S, g.removeDeletedNodesUsingIDs), + )), + i(s); + }); + }); + }, + getRelationalExplorerMenu: function (e) { + return { + type: 'PushItem', + title: o.CHG_GOV_Menu_Relational_Explorer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-object-related', + }, + action: { + callback: function (t) { + var i = { + commandInfo: { + type: 'Change Request', + facet: 'Change Orchestration', + action: 'CR>Change Orchestration>RMB>Relations', + }, + }; + f.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }), + require([ + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ], function (t) { + for ( + var i = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = [], + o = 0; + o < i.length; + o++ + ) { + var a = i[o].options.grid.id; + n.push(a); + } + t.openRelationalExplorer(n); + }); + }, + }, + }; + }, + getTransferMenu: function (e) { + return { + type: 'PushItem', + title: o.CHG_GOV_Menu_Transfer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-move-to', + }, + action: { + callback: function (t) { + var i = { + commandInfo: { + type: 'Change Request', + facet: 'Change Orchestration', + action: 'CR>Change Orchestration>RMB>Move', + }, + }; + f.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }); + for ( + var n = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + o = [], + a = 0; + a < n.length; + a++ + ) + o.push(n[a].options.grid); + require([ + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTransferWrapper', + ], function (e) { + e.launchTransferDialog(o); + }); + }, + }, + }; + }, + getDeleteMenu: function (e, t, n, a) { + return { + type: 'PushItem', + title: o.CHG_GOV_Menu_Delete, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-trash', + }, + action: { + callback: function () { + var o = { + commandInfo: { + type: 'Change Request', + facet: 'Change Orchestration', + action: 'CR>Change Orchestration>RMB>Delete', + }, + }; + f.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: o, + }); + for ( + var r = t.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + s = [], + l = 0; + l < r.length; + l++ + ) { + var c = r[l], + d = { + physicalid: c.options.grid.id, + nodeName: c.options.grid.name, + nodeTitle: c.options.grid.title, + }; + s.push(d); + } + i.deleteNodes(s, n, a, e); + }, + }, + }; + }, + makeCopyLinkObject: function (e) { + var t = { + protocol: '3DXContent', + data: { + items: [], + }, + }; + return ( + t.data.items.push({ + envId: r.getGlobalVariable().tenant, + objectId: e.id, + openLink: !0, + }), + t + ); + }, + showNotification: function (e, t, i, n, o, a, r) { + var s = { + level: e, + title: t, + subtitle: i, + message: n, + sticky: o, + allowUnsafeHTML: r || !1, + }; + window.notifs || + ((window.notifs = d), u.setNotificationManager(window.notifs)), + a ? u.inject(a) : u.elements.container.isInjected() || u.inject(), + window.notifs.addNotif(s); + }, + createCustomColumn: function (e) { + let t = this; + return new Promise(function (e, i) { + let n = r.getGlobalVariable().changeActionSubTypes, + o = [...r.getGlobalVariable().changeOrderSubTypes, ...n]; + h.getCombinedClassList(o).then(function (i) { + h.getPropertyForClassGrid(i).then(function (i) { + let n = h.makeCombinedColumnList(i), + o = t.filterColumn(n); + e(o); + }); + }); + }); + }, + filterColumn: function (e) { + let t = this, + i = [], + n = [ + 'ds6w:label', + 'ds6w:severity', + 'ds6w:status', + 'ds6w:type', + 'ds6w:identifier', + 'ds6w:responsible', + 'ds6w:project', + ]; + for (let t of n) for (let i of e) i.delete(t); + for (let n of e) + return ( + n.forEach((e, n, o) => { + let a = t.createColumnDefination(e, n); + i.push(a); + }), + i + ); + }, + createColumnDefination: function (e, t) { + e.dataType.replace('http://www.w3.org/2001/XMLSchema#', ''); + let i = e.dataType.replace('http://www.w3.org/2001/XMLSchema#', ''); + return { + text: e.vocabColumnsNameNLS, + dataIndex: t, + editableFlag: !1, + allowUnsafeHTMLContent: !1, + visibleFlag: !1, + dataType: i, + range: e.range, + getCellTypeRepresentation: function (e) { + return null != e.cellModel ? 'string' : 'functionIcon'; + }, + getCellSemantics: function (e) { + if (null != e.cellModel); + else if ('undefined' == e.cellModel || null == e.cellModel) + return { + icon: { + iconName: 'reload wux-ui-3ds-spin', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + }; + }, + getCellValue: function (e, i) { + return e.nodeModel.getAttributeValue(t); + }, + }; + }, + }; + return b; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/propertiesView/ChgGovPropertiesPanel', + [ + 'DS/Utilities/Utils', + 'DS/EditPropWidget/EditPropWidget', + 'DS/EditPropWidget/constants/EditPropConstants', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/components/propertiesView/ChgGovPropertiesServices', + 'DS/ENOChgGovernanceUX/scripts/components/propertiesView/ChgPropertiesPanelTab', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t, i, n, o, a, r) { + 'use strict'; + + function s() { + var e = o.getpropOptions(i); + this._informationPanel = new t(e); + } + return ( + (s.prototype.start = function (e) { + if ( + (this.setState(e.objectInfo), e.facets && Array.isArray(e.facets)) + ) { + this._informationPanel.addFacets(e.facets); + var t = []; + e.facets.includes(i.FACET_RELATIONS) || t.push(i.FACET_RELATIONS), + t.length > 0 && this._informationPanel.removeFacets(t); + } + if ( + (this._informationPanel.initDatas(this.getPropertyModels()), + e.container) + ) + this._informationPanel.elements.container.inject(e.container); + else { + var n = document.querySelectorAll('.gov-triptych-wrapper'); + let e = document.querySelector('.secondmainContainer-sidepanel'); + if ( + (e || + (e = new UWA.Element('div', { + class: 'secondmainContainer-sidepanel', + })), + n) + ) { + if (n[1].children.length > 0) + for (var o = n[1].children, a = 0; a < o.length; a++) + o[0].destroy(); + this._informationPanel.elements.container.inject(n[1]), + e.inject(n[1]); + } else + this._informationPanel.elements.container.inject(widget.body), + e.inject(widget.body); + } + this.reRender = function () { + let e = void 0, + t = this.getSate(); + Array.isArray(t) && + t.length > 0 && + UWA.is(t[0].facetSelect) && + (e = t[0].facetSelect), + this._informationPanel.initDatas(this.getPropertyModels(), e), + this._informationPanel.elements.container.onResize(); + }; + }), + (s.prototype.setState = function (e, t) { + var i = this; + if ( + ((this._currentSelection = Array.isArray(e) ? e : []), + 0 != e.length) + ) { + var n = e[0].type; + a.addAllFacet(i._informationPanel, e), + a.hideFacet(i._informationPanel), + a.updateFacetOnSelection( + n, + i._currentSelection, + i._informationPanel, + ), + 'ChangeOrder' == n && + 'false' == r.getGlobalVariable().isFullLicence && + 'false' == r.getGlobalVariable().isDerivativeLicense && + this._informationPanel.setReadonlyStatus(!0), + 'ChangeAnalysis' === n + ? a.getUpdateIMpactAnalysisFacet(e).then(function (e) { + t && i.reRender(); + }) + : t && this.reRender(); + } else t && this.reRender(); + }), + (s.prototype.changeSequence = function (e) { + for ( + var t = 0; + t < this._informationPanel.elements.container._lFacets.length; + t++ + ) { + var i = this._informationPanel.elements.container._lFacets[t]; + if (i.facet.name === e) { + for ( + var n = t; + n < + this._informationPanel.elements.container._lFacets.length - 1; + n++ + ) + this._informationPanel.elements.container._lFacets[n] = + this._informationPanel.elements.container._lFacets[n + 1]; + this._informationPanel.elements.container._lFacets[ + this._informationPanel.elements.container._lFacets.length - 1 + ] = i; + } + } + }), + (s.prototype.getSate = function () { + return this._currentSelection; + }), + (s.prototype.getPropertyModels = function () { + return o.getPropModel(this.getSate()); + }), + (s.prototype.resizePropertiesPanel = function () { + this._informationPanel.onResize(); + }), + s + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceInfoPanel', + [ + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceSlideIn', + 'DS/ENOChgGovernanceUX/scripts/components/propertiesView/ChgGovPropertiesPanel', + 'DS/ENOChgGovernanceUX/scripts/components/propertiesView/ChgPropertiesPanelTab', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t, i, n, o) { + 'use strict'; + let a = { + slideinview: '', + slideInContainer: '', + parentContainer: '', + modelEvents: null, + setContainersForSlideIn: ({ + contextDetails: t, + infoPanelContainer: i, + target: o, + modelEvents: r, + }) => { + (a.slideInContainer = i), (a.parentContainer = o); + let s = UWA.createElement('div', { + id: 'emptyInitInfoPanel', + styles: { + position: 'absolute', + top: '50%', + left: '50%', + transform: 'translate(-50%,-50%)', + }, + html: n.CHG_GOV_Empty_InfoPanel3DSpace_PlaceHolder, + }); + (a.slideinview = new e(a.slideInContainer, a.parentContainer, s)), + a.slideinview.buildSlideIn(), + (a.modelEvents = r), + r.subscribe( + { + event: 'update-property-panel-data', + }, + function (e) { + if ( + e.context && + e.context.getTreeDocument() && + e.context.getTreeDocument().getSelectedNodes().length > 0 + ) { + a.slideinview.content = ''; + let t = e.context.getTreeDocument().getSelectedNodes(), + i = a.createJsonForInfoPanel(t); + a.launchPropertyPanel(i); + } else { + let t = { + physicalId: e.PhysicalID, + metatype: 'businessobject', + type: e.type, + modelEvents: a.modelEvents, + }, + i = []; + i.push(t), a.launchPropertyPanel(i); + } + }, + ), + r.publish({ + event: 'update-property-panel-data', + data: { + PhysicalID: t.id, + type: t.isKindOfType, + }, + }); + }, + createSlidein: () => { + a.slideinview.showSlideIn(); + }, + launchPropertyPanel: (e) => { + if (a.propertyCmp) { + o.getGlobalVariable().lastSelectedInfoType != e[0].type && + (i.hideFacet(a.propertyCmp._informationPanel), + (o.getGlobalVariable().lastSelectedInfoType = e[0].type)); + var n = e; + a.propertyCmp.setState(n, !0); + } else { + var r = { + objectInfo: e, + container: a.slideInContainer.getElement('#slideInBody'), + }, + s = new t(); + s.start(r), + (a.propertyCmp = s), + (o.getGlobalVariable().lastSelectedInfoType = e[0].type); + } + }, + createJsonForInfoPanel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + let n = { + physicalId: e[i].options.grid.id, + metatype: 'businessobject', + type: e[i].options.grid.isKindOfType, + modelEvents: a.modelEvents, + }; + t.push(n); + } + return t; + }, + }; + return a; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridViewToolbar', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceInfoPanel', + ], + function (e, t, i) { + var n = Object.create(null); + return ( + (n.toolbar = null), + (n.createData = { + menu: [ + { + type: 'PushItem', + title: e.CHG_GOV_ChangeOrchestration_Toolbar_NewChangeRequest, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + func: 'createChangeRequestInContext', + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_NewChangeRequest, + }, + { + type: 'PushItem', + title: e.CHG_GOV_ChangeOrchestration_Toolbar_NewChangeOrder, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + func: 'createChangeOrderInContext', + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_NewChangeOrder, + }, + { + type: 'PushItem', + title: e.CHG_GOV_ChangeOrchestration_Toolbar_AddExisting, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + func: 'addExistingHandler', + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_AddExisting, + }, + ], + }), + (n.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (n.writetoolbarDefinition = function (n) { + 'false' === t.getGlobalVariable().isFullLicence && + 'false' === t.getGlobalVariable().isDerivativeLicense && + this.createData.menu.splice(1, 1); + var o = { + entries: [ + { + id: 'create', + dataElements: { + typeRepresentation: 'addDropdown', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + value: this.createData, + }, + position: 'far', + category: 'Create', + }, + { + id: 'MergeCA', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'merge', + fontIconFamily: 1, + }, + tooltip: e.CHG_TOOLTIP_MERGE_CA, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + func: 'mergeChangeAction', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_Remove, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'delete', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'trash', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_Delete, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridLayout', + func: 'deleteHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'addDropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + if (t.getGlobalVariable().is3DSpace) { + i.setContainersForSlideIn(n); + o.entries.unshift({ + id: 'infoPanel', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'info', + fontIconFamily: 1, + }, + category: '3dspace', + }, + position: 'far', + tooltip: 'Information', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceInfoPanel', + func: 'createSlidein', + }, + }); + } + return o; + }), + n + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisViewToolbar', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceInfoPanel', + ], + function (e, t, i) { + var n = Object.create(null); + return ( + (n.toolbar = null), + (n.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (n.filterData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_Filter_ActiveIA, + state: 'selected', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'filterActiveView', + }, + tooltip: e.CHG_Filter_ActiveIA_Def, + }, + { + type: 'CheckItem', + title: e.CHG_Filter_InactiveIA, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'filterInActiveView', + }, + tooltip: e.CHG_Filter_InactiveIA_Def, + }, + { + type: 'CheckItem', + title: e.CHG_Filter_RolledUpIA, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'filterRolledUpView', + }, + tooltip: e.CHG_Filter_RolledUpIA_Def, + }, + ], + }), + (n.writetoolbarDefinition = function (n) { + let o = !0; + o = !( + !n.contextDetails.accessBits || + 'true' != n.contextDetails.accessBits.ManageChangeAnalysis + ); + var a = { + entries: [ + { + id: 'IADispatchMenu', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'graph-egraph-down', + fontIconFamily: 1, + }, + visibleFlag: !t.getGlobalVariable().is3DSpace && o, + value: { + menu: [ + { + type: 'PushItem', + title: e.CHG_GOV_ImpactAnalysis_Toolbar_DispatchToNew, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'dispatchToNewSubCRDialog', + argument: { + contextCRId: n.contextDetails.id, + }, + }, + tooltip: + e.CHG_GOV_ImpactAnalysis_Toolbar_DispatchToNewSubCR, + }, + { + type: 'PushItem', + title: + e.CHG_GOV_ImpactAnalysis_Toolbar_DispatchToExisting, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'dispatchToExistingSubCRDialog', + argument: { + contextCRId: n.contextDetails.id, + }, + }, + tooltip: + e.CHG_GOV_ImpactAnalysis_Toolbar_DispatchToExistingSubCR, + }, + ], + }, + }, + position: 'far', + tooltip: e.CHG_GOV_ImpactAnalysis_Toolbar_DispatchMenu, + }, + { + id: 'refine', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'tree-revision-update', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_Refine_ImpactAnalysis, + position: 'far', + disabled: !0, + visibleFlag: !t.getGlobalVariable().is3DSpace && o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'refineImpactAnalysis', + argument: { + contextCRId: n.contextDetails.id, + }, + }, + }, + }, + { + id: 'duplicate', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'copy', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_Duplicate_ImpactAnalysis, + position: 'far', + disabled: !0, + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'duplicateImpactAnalysis', + argument: { + contextCRId: n.contextDetails.id, + }, + }, + }, + }, + { + id: 'cancel', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'block', + fontIconFamily: 1, + }, + tooltip: + e.CHG_GOV_ImpactAnalysis_Toolbar_CancelImpactAnalysis, + position: 'far', + disabled: !0, + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'cancelHandler', + argument: { + contextCRId: n.contextDetails.id, + }, + }, + }, + }, + { + id: 'delete', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'trash', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_Delete, + position: 'far', + disabled: !0, + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'deleteHandler', + }, + }, + }, + { + id: 'impactedItems', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'change-request-impacted-items', + fontIconFamily: 1, + }, + tooltip: e.ECM_CR_IA_IMPACTED_ITEMS, + position: 'far', + disabled: !1, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'impactsHandler', + }, + }, + }, + { + id: 'filter', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'list-filter', + fontIconFamily: 1, + }, + value: this.filterData, + }, + position: 'far', + tooltip: e.CHG_Toolbar_FilterBy, + category: 'View', + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + if ( + t.getGlobalVariable().CHG_ADD_IA_FROM_PARENT_CR && + 1 == t.getGlobalVariable().CHG_ADD_IA_FROM_PARENT_CR + ) { + var r = { + id: 'IAMenu', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'change-request-chart-line-bar', + fontIconFamily: 1, + }, + value: { + menu: [ + { + type: 'PushItem', + title: e.CHG_GOV_ImpactAnalysis_Toolbar_NewImpactAnalysis, + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisCreate', + func: 'launchCreateChangeIADialog', + argument: { + contextCRId: n.contextDetails.id, + }, + }, + tooltip: + e.CHG_GOV_ImpactAnalysis_Toolbar_NewImpactAnalysis, + }, + { + type: 'PushItem', + title: e.CHG_GOV_ImpactAnalysis_Toolbar_AddIAFromParent, + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + func: 'addIAFromParentCRDialog', + argument: { + contextCRId: n.contextDetails.id, + }, + }, + tooltip: e.CHG_GOV_ImpactAnalysis_Toolbar_AddIAFromParent, + }, + ], + }, + }, + position: 'far', + tooltip: e.CHG_GOV_ImpactAnalysis_Toolbar_IAMenu, + }; + a.entries.unshift(r); + } else { + var s = { + id: 'newImpactAnalysis', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ImpactAnalysis_Toolbar_NewImpactAnalysis, + position: 'far', + visibleFlag: o, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisCreate', + func: 'launchCreateChangeIADialog', + argument: { + contextCRId: n.contextDetails.id, + }, + }, + }, + }; + a.entries.unshift(s); + } + if (t.getGlobalVariable().is3DSpace) { + i.setContainersForSlideIn(n); + var l = { + id: 'infoPanel', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'info', + fontIconFamily: 1, + }, + }, + position: 'far', + tooltip: e.CHG_GOV_ImpactAnalysis_Information, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceInfoPanel', + func: 'createSlidein', + }, + }; + a.entries.unshift(l), + 'ChangeAnalysis' == n.contextDetails.isKindOfType && + (a.entries = a.entries.filter( + (e) => 'delete' != e.id && 'IAMenu' != e.id, + )); + } + return a; + }), + n + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridViewToolbar', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceInfoPanel', + ], + function (e, t, i) { + var n = Object.create(null); + return ( + (n.toolbar = null), + (n.createData = { + menu: [ + { + type: 'PushItem', + title: e.CHG_GOV_ChangeOrchestration_Toolbar_NewChangeOrder, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + func: 'createChangeOrderInContext', + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_NewChangeOrder, + }, + { + type: 'PushItem', + title: e.CHG_GOV_ChangeOrchestration_Toolbar_NewChangeAction, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + func: 'createChangeActionInContext', + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_NewChangeAction, + }, + { + type: 'PushItem', + title: e.CHG_GOV_ChangeOrchestration_Toolbar_AddExisting, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + func: 'addExistingHandler', + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_AddExisting, + }, + ], + }), + (n.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (n.writetoolbarDefinition = function (n) { + var o = { + entries: [ + { + id: 'create', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + value: this.createData, + }, + position: 'far', + category: 'Create', + }, + { + id: 'MergeCA', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'merge', + fontIconFamily: 1, + }, + tooltip: e.CHG_TOOLTIP_MERGE_CA, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + func: 'mergeChangeAction', + }, + }, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_Remove, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'delete', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'trash', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_Delete, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridLayout', + func: 'deleteHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'sortingdropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + if (t.getGlobalVariable().is3DSpace) { + i.setContainersForSlideIn(n); + o.entries.unshift({ + id: 'infoPanel', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'info', + fontIconFamily: 1, + }, + category: '3dspace', + }, + position: 'far', + tooltip: 'Information', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceInfoPanel', + func: 'createSlidein', + }, + }); + } + return o; + }), + n + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/issue/util/ChgCRIssueGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/issue/ChgCRIssueViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o) { + 'use strict'; + let a = Object.create(null); + return ( + (a.getColumns = function () { + let e = []; + return ( + e.push( + o.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'name', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e + ); + }), + (a.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-issue-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-issue-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-issue-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.content-issue-tile-div')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-issue-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-issue-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-issue-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.content-issue-tile-div')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + a + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/issue/util/ChgIssueGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/facets/issue/ChgIssueViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o) { + 'use strict'; + let a = Object.create(null); + return ( + (a.getColumns = function () { + let e = []; + return ( + e.push( + o.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'name', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e + ); + }), + (a.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-CO-issue-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-CO-issue-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-CO-issue-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.content-CO-issue-tile-div')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-CO-issue-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-CO-issue-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-CO-issue-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.content-CO-issue-tile-div')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + a + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/util/ChgOrchestrationGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/facets/changeOrchestration/ChgOrchestrationDataGridViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o) { + 'use strict'; + var a = Object.create(null); + return ( + (a.getColumns = function () { + var e = []; + return ( + e.push( + o.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'chgObjName', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'severityNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'changeCoordinatorFullName', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'collabspaceNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'organizationNLS', + }), + ), + (e[2].compareFunction = function (e, t, i, n, o) { + return 'undefined' != i.options.grid.stateGrade && + 'undefined' != n.options.grid.stateGrade + ? i.options.grid.stateGrade == n.options.grid.stateGrade + ? 0 + : i.options.grid.stateGrade < n.options.grid.stateGrade + ? -1 + : 1 + : 0; + }), + i.getGlobalVariable().is3DSpace && + ((e[0].allowUnsafeHTMLContent = !0), + (e[0].getCellGroupingKey = function (e) { + return e.nodeModel.options.grid.title; + })), + e + ); + }), + (a.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-orchestration-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-orchestration-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-orchestration-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.orchestrationtileView')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-orchestration-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-orchestration-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-orchestration-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.orchestrationtileView')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + (a.createCustomSeverity = function (e, t) { + var i = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e + ? (i = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e && + (i = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + var n = new UWA.Element('div', {}), + o = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: i, + }).inject(o); + var a = UWA.createElement('span', { + html: t, + }); + return o.inject(n), a.inject(n), n.outerHTML; + }), + (a.createCustomOwner = function (e, t) { + var o = '/api/user/getpicture/login/' + t + '/format/normal', + a = i.getGlobalVariable().computeSwymUrl(o), + r = new UWA.Element('div', { + class: 'members', + }), + s = new UWA.Element('div', { + class: 'assignee', + }), + l = ''; + if (i.getGlobalVariable().isSwymInstalled) + l = UWA.createElement('img', { + class: 'userIcon', + src: a, + }); + else { + var c = n.getAvatarDetails(t); + (l = UWA.createElement('div', { + html: c.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', c.avatarColor); + } + l.inject(s); + var d = UWA.createElement('span', { + class: 'userName', + html: t, + }); + return s.inject(r), d.inject(r), r.outerHTML; + }), + a + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/contributor/util/ChgCRContributorsGridUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/contributor/ChgCRContributorsDataGridViewToolbar', + ], + function (e, t) { + 'use strict'; + var i = Object.create(null); + (i.getColumns = function () {}), + (i.changeView = function (n) { + if ('GridView' == n); + else if ('TileView' == n) { + this.currentView = 'Tile'; + var o = t.toolbar.getNodeModelByID('view'); + o && + 'view-small-tile' != o.options.grid.semantics.icon.iconName && + o.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }); + var a = document.querySelector( + '.toolbar-contributor-grid-div .wux-ui-3ds-view-small-tile', + ); + if (a) { + a.addClassName('currentView'); + var r = document.querySelector('.contributortileView'); + r && (r.removeClassName('hideView'), r.addClassName('showView')); + } + } + return i; + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsViewToolbar', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceInfoPanel', + ], + function (e, t, i) { + var n = Object.create(null); + return ( + (n.toolbar = null), + (n.createData = { + menu: [ + { + type: 'PushItem', + title: e.CHG_GOV_ImpactBasis_Toolbar_OrchestrateImpactAnalysis, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsDataGridLayout', + func: '_orchestrateImpactAnalysis', + }, + tooltip: e.CHG_GOV_ImpactBasis_Toolbar_OrchestrateImpactAnalysis, + }, + { + type: 'PushItem', + title: e.CHG_GOV_AffactedItem_Toolbar_Add_Existing_ImpactAnalysis, + state: 'disabled', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsDataGridLayout', + func: 'addExistingImpactAnalysisInContext', + }, + tooltip: + e.CHG_GOV_AffactedItem_Toolbar_Add_Existing_ImpactAnalysis, + }, + ], + }), + (n.viewData = { + menu: [ + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_GRID_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-list', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsDataGridLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }, + { + type: 'CheckItem', + title: e.CHG_TOOLTIP_TILE_VIEW, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-view-small-tile', + }, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsTileViewLayout', + func: 'changeView', + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }, + ], + }), + (n.writetoolbarDefinition = function (n) { + var o = { + entries: [ + { + id: 'addExisting', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'plus', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_AffectedItems_Toolbar_AddExisting, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsDataGridLayout', + func: 'addExistingHandler', + }, + }, + }, + { + id: 'changeAssessment', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'component', + fontIconFamily: 1, + }, + disabled: !0, + tooltip: e.CHG_GOV_ImpactBasis_Toolbar_ChangeAssessment, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsDataGridLayout', + func: 'changeAssessmentHandler', + }, + }, + }, + { + id: 'massUpdate', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'pencil', + fontIconFamily: 1, + }, + disabled: !0, + tooltip: e.CHG_GOV_AffectedItems_Toolbar_MassUpdate, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsDataGridLayout', + func: 'massUpdateHandler', + }, + }, + }, + { + id: 'moveToCR', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'exchange wux-ui-3ds', + fontIconFamily: 1, + }, + disabled: !0, + tooltip: + e.CHG_GOV_AffactedItem_Toolbar_Move_AffactedItem_To_CR, + position: 'far', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsDataGridLayout', + func: 'moveAffactedItemToOtherCR', + }, + }, + }, + { + id: 'create', + dataElements: { + typeRepresentation: 'addDropdown', + icon: { + iconName: 'change-request-chart-line-bar wux-ui-3ds', + fontIconFamily: 1, + }, + value: this.createData, + }, + position: 'far', + disabled: !1, + }, + { + id: 'remove', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'remove', + fontIconFamily: 1, + }, + tooltip: e.CHG_GOV_ChangeOrchestration_Toolbar_Remove, + position: 'far', + disabled: !0, + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsDataGridLayout', + func: 'removeHandler', + }, + }, + }, + { + id: 'view', + dataElements: { + typeRepresentation: 'addDropdown', + icon: { + iconName: 'view-legacy-thb', + fontIconFamily: 1, + }, + value: this.viewData, + }, + position: 'far', + category: 'View', + }, + ], + }; + if (t.getGlobalVariable().is3DSpace) { + i.setContainersForSlideIn(n), + (o.entries = o.entries.filter((e) => 'changeAssessment' != e.id)); + o.entries.unshift({ + id: 'infoPanel', + dataElements: { + typeRepresentation: 'functionIcon', + icon: { + iconName: 'info', + fontIconFamily: 1, + }, + category: '3dspace', + }, + position: 'far', + tooltip: 'Information', + action: { + module: + 'DS/ENOChgGovernanceUX/scripts/util/Chg3DSpaceInfoPanel', + func: 'createSlidein', + }, + }); + } + return o; + }), + n + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/util/ChgCRImpactAnalysisGridContextualMenu', + [ + 'UWA/Core', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/LifecycleCmd/MaturityCmd', + 'DS/ENOChgServices/scripts/services/ChgPropertiesServices', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgCustomAttributeService', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovCommonDelete', + 'DS/UIKIT/Input/Text', + 'DS/UIKIT/Input/Button', + 'DS/Notifications/NotificationsManagerUXMessages', + 'DS/Notifications/NotificationsManagerViewOnScreen', + 'DS/UIKIT/DropdownMenu', + 'DS/UIKIT/Dropdown', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'require', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p, h, m, C, v, f) { + 'use strict'; + var b = { + columnMap: null, + attrMap: [], + showRMBMenuOnGrid: function (e, t, i) { + return new Promise(function (i, o) { + const a = []; + let r = !1; + const s = t.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(); + s.length > 1 && (r = !0); + const l = s.map((e) => e.options.grid.id), + c = + (s.map((e) => ({ + physicalid: e.options.grid.id, + nodeName: e.options.grid.name, + nodeTitle: e.options.grid.title, + })), + C( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + )), + d = C( + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ), + u = C('DS/ENOChgServices/scripts/services/ChgDataService'), + g = t.cellInfos.nodeModel.options.grid.id, + p = t.cellInfos.nodeModel.options.grid.type, + h = t.cellInfos.nodeModel.options.grid.name, + f = t.cellInfos.nodeModel.options.grid.displayType, + w = + c.ChgCRImpactAnalysisDataGridModel.contextDetails.access + .accessBits.ManageChangeAnalysis, + D = { + objectId: g, + objectType: p, + displayName: h, + displayType: f, + facetName: 'dependency', + }, + S = d.openWith(D); + if (r) + a.push(n.createPropertyPushItem(l)), + a.push(b.getRelationalExplorerMenu(l)), + S.then((n) => { + n && a.push(n), + a.push(b.getTransferMenu(t)), + a.push(v.getMaturityMenu(t)), + a.push(m.getCopyLink(s, e.options.contextDetails.id)), + 'true' == w && + a.push( + b.getDeleteMenu( + t, + e.options.target, + c.removeDeletedNodesUsingIDs, + void 0, + 'ImpactAnalysis', + ), + ), + i(a); + }); + else { + a.push(n.createPropertyPushItem(l)), + a.push(b.getRelationalExplorerMenu(l)); + const o = []; + o.push(S); + const r = u.getImpactAnalysisUserAccess( + t.cellInfos.nodeModel.options.grid.id, + ); + o.push(r), + Promise.all(o).then((n) => { + n[0] && a.push(n[0]); + const o = n[1].data[0].dataelements; + 'true' === o.TransferOwnership && + a.push(b.getTransferMenu(t)), + ('true' !== o.Promote && 'true' !== o.Demote) || + a.push(v.getMaturityMenu(t)), + a.push(m.getCopyLink(s, e.options.contextDetails.id)), + 'true' == w && + a.push( + b.getDeleteMenu( + t, + e.options.target, + c.removeDeletedNodesUsingIDs, + void 0, + 'ImpactAnalysis', + ), + ), + i(a); + }); + } + }); + }, + getTransferMenu: function (e) { + return { + type: 'PushItem', + title: t.CHG_GOV_Menu_Transfer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-move-to', + }, + action: { + callback: function (t) { + var i = { + commandInfo: { + type: 'Change Request', + facet: 'Impact Analysis', + action: 'CR>Impact Analysis>RMB>Move', + }, + }; + f.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }); + for ( + var n = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + o = [], + a = 0; + a < n.length; + a++ + ) + o.push(n[a].options.grid); + require([ + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTransferWrapper', + ], function (e) { + e.launchTransferDialog(o); + }); + }, + }, + }; + }, + makeCopyLinkObject: function (e, t) { + var i = { + protocol: '3DXContent', + data: { + items: [], + }, + }; + return ( + i.data.items.push({ + envId: o.getGlobalVariable().tenant, + objectId: t, + openLink: !0, + IAid: e.options.grid.id, + tabName: 'crAssessment', + }), + i + ); + }, + showNotification: function (e, t, i, n, o, a, r) { + var s = { + level: e, + title: t, + subtitle: i, + message: n, + sticky: o, + allowUnsafeHTML: r || !1, + }; + window.notifs || + ((window.notifs = u), g.setNotificationManager(window.notifs)), + a ? g.inject(a) : g.elements.container.isInjected() || g.inject(), + window.notifs.addNotif(s); + }, + getRelationalExplorerMenu: function (e) { + return { + type: 'PushItem', + title: t.CHG_GOV_Menu_Relational_Explorer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-object-related', + }, + action: { + callback: function (t) { + var i = { + commandInfo: { + type: 'Change Request', + facet: 'Impact Analysis', + action: 'CR>Impact Analysis>RMB>Relations', + }, + }; + f.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: i, + }), + require([ + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ], function (t) { + t.openRelationalExplorer(e); + }); + }, + }, + }; + }, + getDeleteMenu: function (e, i, n, o, a) { + return { + type: 'PushItem', + title: t.CHG_GOV_Menu_Delete, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-trash', + }, + action: { + callback: function () { + var t = { + commandInfo: { + type: 'Change Request', + facet: 'Impact Analysis', + action: 'CR>Impact Analysis>RMB>Delete', + }, + }; + f.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: t, + }); + for ( + var r = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + s = [], + c = 0; + c < r.length; + c++ + ) { + var d = r[c], + u = { + physicalid: d.options.grid.id, + nodeName: d.options.grid.name, + nodeTitle: d.options.grid.title, + parentCRId: d.options.grid.parentCRId, + }; + s.push(u); + } + l.deleteNodes(s, i, n, o, a); + }, + }, + }; + }, + createCustomColumn: function () { + let e = this; + return new Promise(function (t, i) { + let n = o.getGlobalVariable().changeAnalysisSubTypes; + a.getCombinedClassList(n).then(function (i) { + a.getPropertyForClassGrid(i).then(function (i) { + let n = a.makeCombinedColumnList(i), + o = e.filterColumn(n); + (e.columnMap = n), t(o); + }); + }); + }); + }, + filterColumn: function (e) { + let t = this, + i = [], + n = [ + 'ds6w:label', + 'ds6w:severity', + 'ds6w:status', + 'ds6w:type', + 'ds6w:identifier', + 'ds6w:responsible', + 'ds6wg:Default Change Analysis Metrics.Implementation Effort', + 'ds6wg:Default Change Analysis Metrics.Benefit Impact', + 'ds6wg:Default Change Analysis Metrics.Risk Impact', + 'ds6wg:Default Change Analysis Metrics.Cost Impact', + 'ds6wg:Default Change Analysis Metrics.Validation Effort', + ]; + for (let t of n) e.delete(t); + return ( + e.forEach((e, n, o) => { + let a = t.createColumnDefination(e, n); + i.push(a); + }), + i + ); + }, + createColumnDefination: function (e, t) { + var i = this; + let n = e.dataType.replace('http://www.w3.org/2001/XMLSchema#', ''), + o = new Map(); + return ( + this.attrMap.push(o), + { + text: e.vocabColumnsNameNLS, + dataIndex: t, + editableFlag: !1, + allowUnsafeHTMLContent: !0, + visibleFlag: !1, + dataType: n, + range: e.range, + getCellTooltip: function () { + return { + shortHelp: 'my custo help', + updateModel: !1, + }; + }, + getCellTypeRepresentation: function (e) { + return null != e.cellModel ? 'string' : 'functionIcon'; + }, + getCellSemantics: function (e) { + if (null != e.cellModel); + else if ('undefined' == e.cellModel || null == e.cellModel) + return { + icon: { + iconName: 'reload wux-ui-3ds-spin', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + }; + }, + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + if ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id + ) { + if (e > t) return 1; + if (e == t) return 0; + if (e < t) return -1; + } + return !1; + }, + getCellValue: function (e) { + if (e.nodeModel.getAttributeValue('isLastNode')) { + let n = e.nodeModel.getBrothers(), + o = i.checkAssessmentType(t); + if ( + ((n = n.filter( + (e) => + 'ia_Total' != e.options.grid.id && + 'Cancelled' != e.options.grid.maturity, + )), + 'boolean' == o) + ) { + return i.booleanAggregation(n, t); + } + if ('integer' == o || 'real' == o || 'double' == o) { + return i.sumAvgAggregation(n, t); + } + if ('range' == o) { + return i.rangeAggregation(n, t); + } + return ''; + } + return e.nodeModel.getAttributeValue(t); + }, + getCellTooltip: function (e) { + console.log(e), console.log('cellInfos...................'); + }, + } + ); + }, + checkAssessmentType: function (e) { + let t = [...b.columnMap.entries()].filter(([t, i]) => t == e), + i = t[0][1].dataType, + n = t[0][1].range, + o = i.replace('http://www.w3.org/2001/XMLSchema#', ''); + return n && 'integer' == o ? 'range' : o; + }, + sumAvgAggregation: function (e, t) { + let i = 0; + for (var n = 0; n < e.length; n++) + '' != e[n].options.grid['' + t] && + (i += parseFloat(e[n].options.grid['' + t])); + let o = 0; + return `∑ ${i} | x̄ ${(o = i / e.length)} `; + }, + rangeAggregation: function (e, t) { + let i = 0, + n = 0; + for (var o = 0; o < e.length; o++) + '' != e[o].options.grid['' + t] && + (i += parseInt(e[o].options.grid['' + t])); + return (n = Math.round(i / e.length)); + }, + booleanAggregation: function (e, t) { + let i = ''; + for (var n = 0; n < e.length; n++) { + let o = e[n].options.grid['' + t]; + if ('TRUE' != o) { + if ('FALSE' == o) { + i = 'FALSE'; + break; + } + } else i = 'TRUE'; + } + return i; + }, + }; + return b; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/util/ChgCRAffectedItemsGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/affectedItems/ChgCRAffectedItemsViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n) { + 'use strict'; + var o = Object.create(null); + return ( + (o.getColumns = function () { + var t = []; + return ( + t.push( + n.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + t.push( + n.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + ), + t.push( + n.getColumnDefinition({ + dataIndex: 'name', + }), + ), + t.push( + n.getColumnDefinition({ + dataIndex: 'revision', + }), + ), + t.push( + n.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + t.push( + n.getColumnDefinition({ + dataIndex: 'collabspaceNLS', + }), + ), + t.push( + n.getColumnDefinition({ + dataIndex: 'organizationNLS', + }), + ), + t.push( + n.getColumnDefinition({ + dataIndex: 'reasonForChange', + editableFlag: !0, + }), + ), + t.push({ + text: e.CHG_GOV_DataGrid_Column_ImpactAnalysis, + dataIndex: 'countImpactAnalysis', + editableFlag: !1, + typeRepresentation: 'url', + filterId: 'number', + filterModel: '', + getCellValue: function (e) { + if (e.nodeModel) { + return { + label: e.nodeModel.getAttributeValue('countImpactAnalysis'), + }; + } + }, + }), + t.push( + n.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + i.getGlobalVariable().is3DSpace && + ((t[0].allowUnsafeHTMLContent = !0), + (t[0].getCellGroupingKey = function (e) { + return e.nodeModel.options.grid.title; + })), + t + ); + }), + (o.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-affectedItems-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-affectedItems-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-affectedItems-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.affectedItemsTileView')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-affectedItems-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-affectedItems-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-affectedItems-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.affectedItemsTileView')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + o + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/context/util/ChgCAcontextGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/context/ChgCAcontextViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o) { + 'use strict'; + let a = Object.create(null); + return ( + (a.getColumns = function () { + let e = []; + return ( + e.push( + o.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'name', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'currentNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e + ); + }), + (a.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-context-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-context-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-context-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.content-context-tile-div')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-context-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-context-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-context-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.content-context-tile-div')) && + (s.removeClassName('hideView'), + s.removeClassName('nonVisible'), + s.addClassName('showView')); + } + }), + a + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/relatedScope/util/ChgCRrelatedScopeGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/relatedScope/ChgCRrelatedScopeViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o) { + 'use strict'; + let a = Object.create(null); + return ( + (a.getColumns = function () { + var e = []; + return ( + e.push( + o.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'name', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'revision', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e + ); + }), + (a.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-relatedScope-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-relatedScope-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-relatedScope-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.content-relatedScope-tile-div')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-relatedScope-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-relatedScope-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-relatedScope-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.content-relatedScope-tile-div')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + a + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/util/ChgCROrchestrationGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o) { + 'use strict'; + var a = Object.create(null); + return ( + (a.getColumns = function () { + var e = []; + return ( + e.push( + o.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'chgObjName', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'severityNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'changeCoordinatorFullName', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'collabspaceNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'organizationNLS', + }), + ), + (e[2].compareFunction = function (e, t, i, n, o) { + return 'undefined' != i.options.grid.stateGrade && + 'undefined' != n.options.grid.stateGrade + ? i.options.grid.stateGrade == n.options.grid.stateGrade + ? 0 + : i.options.grid.stateGrade < n.options.grid.stateGrade + ? -1 + : 1 + : 0; + }), + i.getGlobalVariable().is3DSpace && + ((e[0].allowUnsafeHTMLContent = !0), + (e[0].getCellGroupingKey = function (e) { + return e.nodeModel.options.grid.title; + })), + e + ); + }), + (a.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-orchestration-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-orchestration-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-orchestration-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.orchestrationtileView')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-orchestration-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-orchestration-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-orchestration-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.orchestrationtileView')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + (a.createCustomSeverity = function (e, t) { + var i = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e + ? (i = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e && + (i = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + var n = new UWA.Element('div', {}), + o = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: i, + }).inject(o); + var a = UWA.createElement('span', { + html: t, + }); + return o.inject(n), a.inject(n), n.outerHTML; + }), + (a.createCustomOwner = function (e, t) { + var o = '/api/user/getpicture/login/' + t + '/format/normal', + a = i.getGlobalVariable().computeSwymUrl(o), + r = new UWA.Element('div', { + class: 'members', + }), + s = new UWA.Element('div', { + class: 'assignee', + }), + l = ''; + if (i.getGlobalVariable().isSwymInstalled) + l = UWA.createElement('img', { + class: 'userIcon', + src: a, + }); + else { + var c = n.getAvatarDetails(t); + (l = UWA.createElement('div', { + html: c.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', c.avatarColor); + } + l.inject(s); + var d = UWA.createElement('span', { + class: 'userName', + html: t, + }); + return s.inject(r), d.inject(r), r.outerHTML; + }), + a + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/welcomePanel/ChgGovWelcomePanelWrapper', + [ + 'DS/Core/PointerEvents', + 'DS/Utilities/TouchUtils', + 'DS/ENOXWelcomePanel/js/ENOXWelcomePanel', + 'DS/ENOChgGovernanceUX/scripts/config/ChgGovAppGlobalConfig', + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t, i, n, o, a, r) { + 'use strict'; + var s = function () {}; + return ( + (s.prototype.init = function (e, t, o) { + this._applicationChannel = e; + var s = []; + 0 == r.getGlobalVariable().isNative && + (s.push({ + id: n.PATH_RECENTY_OPENED, + text: a.CHG_GOV_Welcome_Activity_Recent, + fonticon: 'clock', + className: 'action-new', + tooltip: a.CHG_GOV_Welcome_Activity_Recent, + category: 'View', + }), + s.push({ + id: n.PATH_OPEN_CHANGE_ORDER, + text: a.CHG_GOV_Welcome_Activity_Open_Change_Orders, + fonticon: 'open', + className: 'action-new', + isNotHighlightable: !0, + tooltip: a.CHG_GOV_Welcome_Activity_Open_Change_Orders, + category: 'View', + }), + s.push({ + id: n.PATH_MY_CHANGE_REQUESTS, + text: a.CHG_GOV_Welcome_Activity_My_Change_Requests, + fonticon: 'change-request', + className: 'action-new', + tooltip: a.CHG_GOV_Welcome_Activity_My_Change_Requests, + category: 'View', + }), + s.push({ + id: n.PATH_MY_CHANGE_ORDERS, + text: a.CHG_GOV_Welcome_Activity_My_Change_Orders, + fonticon: 'change-order', + className: 'action-new', + tooltip: a.CHG_GOV_Welcome_Activity_My_Change_Orders, + category: 'View', + })), + s.push({ + id: n.PATH_MY_CHANGE_ACTIONS, + text: a.CHG_GOV_Welcome_Activity_My_Change_Actions, + fonticon: 'change-action', + className: 'action-new', + tooltip: a.CHG_GOV_Welcome_Activity_My_Change_Actions, + category: 'View', + }); + var l = []; + 0 == r.getGlobalVariable().isNative && + (l.push({ + id: n.PATH_NEW_CHANGE_REQUEST, + text: a.CHG_GOV_Welcome_Activity_New_Change_Request, + fonticon: 'change-request-add', + className: 'action-new', + isNotHighlightable: !0, + tooltip: a.CHG_GOV_Welcome_Activity_New_Change_Request, + category: 'View', + }), + (('true' === r.getGlobalVariable().isFullLicence && + !1 === r.getGlobalVariable().isNative) || + ('true' === r.getGlobalVariable().isDerivativeLicense && + !1 === r.getGlobalVariable().isNative)) && + l.push({ + id: n.PATH_NEW_CHANGE_ORDER, + text: a.CHG_GOV_Welcome_Activity_New_Change_Order, + fonticon: 'change-order-add', + className: 'action-new', + isNotHighlightable: !0, + tooltip: a.CHG_GOV_Welcome_Activity_New_Change_Order, + category: 'View', + })), + l.push({ + id: n.PATH_NEW_CHANGE_ACTION, + text: a.CHG_GOV_Welcome_Activity_New_Change_Action, + fonticon: 'change-action-add', + className: 'action-new', + isNotHighlightable: !0, + tooltip: a.CHG_GOV_Welcome_Activity_New_Change_Action, + category: 'View', + }); + var c = [ + { + id: 'appHeader', + title: a.CHG_GOV_Welcome_Activity_AppHeader, + actions: [ + { + id: 'appInfo', + text: a.CHG_GOV_Welcome_Activity_AppIntro, + fonticon: 'dummy', + className: 'chg-welcome-panel-appInfo', + }, + ], + }, + { + id: 'quick_access', + title: a.CHG_GOV_Welcome_Activity_QuickAccess, + actions: s, + }, + { + id: 'start_activities', + title: a.CHG_GOV_Welcome_Activity_StartActivities, + actions: l, + }, + ]; + 'ENOWCHA_AP' == widget.getValue('appId') && + (c[0].title = a.CHG_EXE_Welcome_Activity_AppHeader), + new i({ + collapsed: !1, + title: 'chgGov', + notifications: [], + activities: c, + parentContainer: o, + modelEvents: e, + }).render(), + this._subscribeToEvents(); + }), + (s.prototype._subscribeToEvents = function () { + var i = this; + this._applicationChannel.subscribe( + { + event: 'welcome-panel-action-selected', + }, + function (i) { + if ( + (i && 'home' === i.id + ? o.navigate(n.ROUTE_LANDING_PAGE) + : i && i.id === n.PATH_MY_CHANGE_ORDERS + ? o.navigate(n.ROUTE_MY_CHANGE_ORDERS, { + data: 'from welcomepanel', + }) + : i && i.id === n.PATH_RECENTY_OPENED + ? o.navigate(n.ROUTE_RECENTY_OPENED, { + data: 'from welcomepanel', + }) + : i && i.id === n.PATH_MY_CHANGE_REQUESTS + ? o.navigate(n.ROUTE_MY_CHANGE_REQUESTS, { + data: 'from welcomepanel', + }) + : i && + i.id === n.PATH_MY_CHANGE_ACTIONS && + o.navigate(n.ROUTE_MY_CHANGE_ACTIONS, { + data: 'from welcomepanel', + }), + t.getTouchMode()) + ) { + var a = new MouseEvent(e.POINTERDOWN, { + bubbles: !1, + }); + document.dispatchEvent(a); + } + }, + ), + this._applicationChannel.subscribe( + { + event: 'welcome-panel-select-action', + }, + function (e) { + e && e.id === n.PATH_MY_CHANGE_ORDERS + ? i._applicationChannel.publish({ + event: 'topbar-show-title', + data: { + id: n.ROUTE_MY_CHANGE_ORDERS, + label: a.CHG_GOV_Welcome_Activity_My_Change_Orders, + }, + }) + : e && e.id === n.PATH_RECENTY_OPENED + ? i._applicationChannel.publish({ + event: 'topbar-show-title', + data: { + id: n.ROUTE_RECENTY_OPENED, + label: a.CHG_GOV_Welcome_Activity_Recent, + }, + }) + : e && e.id === n.PATH_MY_CHANGE_REQUESTS + ? i._applicationChannel.publish({ + event: 'topbar-show-title', + data: { + id: n.ROUTE_MY_CHANGE_REQUESTS, + label: a.CHG_GOV_Welcome_Activity_My_Change_Requests, + }, + }) + : e && e.id === n.PATH_MY_CHANGE_ACTIONS + ? i._applicationChannel.publish({ + event: 'topbar-show-title', + data: { + id: n.ROUTE_MY_CHANGE_ACTIONS, + label: a.CHG_GOV_Welcome_Activity_My_Change_Actions, + }, + }) + : e && (e.id, n.PATH_CO_IDCard); + }, + ); + }), + s + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/contributor/ChgCRContributorsTileViewLayout', + [ + 'UWA/Core', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/contributor/util/ChgCRContributorsGridUtil', + ], + function (e, t) { + 'use strict'; + return { + changeView: function (e) { + setTimeout(function () { + t.changeView('TileView'); + }, 100); + }, + showEmptyView: function () { + var e = document.getElementById('contributorEmptyTileViewDiv'); + e && (e.removeClassName('hideView'), e.addClassName('showEmptyView')); + }, + hideEmptyView: function () { + var e = document.getElementById('contributorEmptyTileViewDiv'); + e && (e.addClassName('hideView'), e.removeClassName('showEmptyView')); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/util/ChgChangeActionGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeAction/ChgChangeActionToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o) { + 'use strict'; + let a = Object.create(null); + return ( + (a.getColumns = function () { + let e = []; + return ( + e.push( + o.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'name', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'severityNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e + ); + }), + (a.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-CA-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-CA-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-CA-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.content-CA-tile-div')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-CA-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-CA-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-CA-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.content-CA-tile-div')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + a + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/util/ChgRelatedScopeGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/ChgRelatedScopeViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o) { + 'use strict'; + let a = Object.create(null); + return ( + (a.getColumns = function () { + var e = []; + return ( + e.push( + o.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'name', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'revision', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'currentNLS', + }), + ), + e.push( + o.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e + ); + }), + (a.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-CO-relatedScope-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-CO-relatedScope-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector( + '.content-CO-relatedScope-grid-div', + )) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector( + '.content-CO-relatedScope-tile-div', + )) && (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-CO-relatedScope-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-CO-relatedScope-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector( + '.content-CO-relatedScope-grid-div', + )) && (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector( + '.content-CO-relatedScope-tile-div', + )) && (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + a + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/recents/util/ChgGovRecentsContextualMenu', + [ + 'UWA/Core', + 'DS/i3DXCompassPlatformServices/OpenWith', + 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderUtil', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovCommonDelete', + 'DS/LifecycleCmd/MaturityCmd', + 'DS/ENOChgServices/scripts/services/ChgPropertiesServices', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/UIKIT/Input/Text', + 'DS/UIKIT/Input/Button', + 'DS/Notifications/NotificationsManagerUXMessages', + 'DS/Notifications/NotificationsManagerViewOnScreen', + 'DS/UIKIT/DropdownMenu', + 'DS/UIKIT/Dropdown', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'require', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p, h, m, C, v) { + 'use strict'; + var f = { + showRMBMenuOnGrid: function (e, t, i) { + return new Promise(function (n, o) { + var r = e.cellInfos.nodeModel.getTreeDocument().getSelectedNodes(); + const s = r.map((e) => e.options.grid.id); + var l = !1; + r.length > 1 && (l = !0); + var c = []; + c.push(a.createPropertyPushItem(s)), + c.push(f.getRelationalExplorerMenu(e)); + var d = C('DS/ENOChgServices/scripts/services/ChgDataService'), + u = C( + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ), + g = { + objectId: e.cellInfos.nodeModel.options.grid.id, + objectType: e.cellInfos.nodeModel.options.grid.type, + displayName: e.cellInfos.nodeModel.options.grid.name, + displayType: e.cellInfos.nodeModel.options.grid.displayType, + facetName: 'dependency', + }, + b = u.openWith(g), + w = null, + D = []; + D.push(b), + l || + ('ChangeRequest' == r[0].options.grid.isKindOfType + ? ((w = d.getChangeRequestUserAccess( + e.cellInfos.nodeModel.options.grid.id, + )), + D.push(w)) + : 'ChangeOrder' == r[0].options.grid.isKindOfType + ? ((w = d.getChangeOrderUserAccess( + e.cellInfos.nodeModel.options.grid.id, + )), + D.push(w)) + : ((w = d.getChangeActionUserAccess( + e.cellInfos.nodeModel.options.grid.id, + )), + D.push(w))), + Promise.all(D).then(function (o) { + if ((o[0] && c.push(o[0]), l)) + 'true' == p.getGlobalVariable().isFullLicence && + c.push(v.getMaturityMenu(e)), + c.push(m.getCopyLink(r)), + c.push(f.getTransferMenu(e)), + 'true' == p.getGlobalVariable().isFullLicence && + (c.push(v.getMaturityMenu(e)), + c.push(f.getDeleteMenu(e, t, i))); + else { + if ('ChangeOrder' == r[0].options.grid.isKindOfType) { + var a = o[1].data[0].dataelements; + (a = h.processAccessBitCO(a)), + ((o[1] && 'true' == a.Promote) || 'true' == a.Demote) && + c.push(v.getMaturityMenu(e)), + c.push(m.getCopyLink(r)), + o[1] && + 'true' == a.TransferOwnership && + c.push(f.getTransferMenu(e)), + 'true' == a.Delete && c.push(f.getDeleteMenu(e, t, i)); + } + 'ChangeRequest' == r[0].options.grid.isKindOfType && + (c.push(v.getMaturityMenu(e)), + c.push(m.getCopyLink(r)), + o[1] && + 'true' == o[1].data[0].dataelements.TransferOwnership && + c.push(f.getTransferMenu(e)), + 'true' == o[1].data[0].dataelements.Delete && + c.push(f.getDeleteMenu(e, t, i))), + 'ChangeAction' == r[0].options.grid.isKindOfType && + (c.push(v.getMaturityMenu(e)), + c.push(m.getCopyLink(r)), + o[1] && + o[1].data[0] && + ('true' == o[1].data[0].Transfer && + c.push(f.getTransferMenu(e)), + 'true' == o[1].data[0].Delete && + c.push(f.getDeleteMenu(e, t, i)))); + } + n(c); + }); + }); + }, + getRelationalExplorerMenu: function (e) { + return { + type: 'PushItem', + title: r.CHG_GOV_Menu_Relational_Explorer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-object-related', + }, + action: { + callback: function (t) { + require([ + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ], function (t) { + for ( + var i = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = [], + o = 0; + o < i.length; + o++ + ) { + var a = i[o].options.grid.id; + n.push(a); + } + t.openRelationalExplorer(n); + }); + }, + }, + }; + }, + getTransferMenu: function (e) { + return { + type: 'PushItem', + title: r.CHG_GOV_Menu_Transfer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-move-to', + }, + action: { + callback: function (t) { + for ( + var i = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = [], + o = 0; + o < i.length; + o++ + ) + n.push(i[o].options.grid); + require([ + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTransferWrapper', + ], function (e) { + e.launchTransferDialog(n); + }); + }, + }, + }; + }, + getDeleteMenu: function (e, t, i) { + return { + type: 'PushItem', + title: r.CHG_GOV_Menu_Delete, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-trash', + }, + action: { + callback: function () { + for ( + var o = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + a = [], + r = 0; + r < o.length; + r++ + ) { + var s = o[r], + l = { + physicalid: s.options.grid.id, + nodeName: s.options.grid.name, + nodeTitle: s.options.grid.title, + }; + a.push(l); + } + n.deleteNodes(a, t, i); + }, + }, + }; + }, + makeCopyLinkObject: function (e) { + var t = { + protocol: '3DXContent', + data: { + items: [], + }, + }; + return ( + t.data.items.push({ + envId: p.getGlobalVariable().tenant, + objectId: e.options.grid.id, + openLink: !0, + }), + t + ); + }, + showNotification: function (e, t, i, n, o, a, r) { + var s = { + level: e, + title: t, + subtitle: i, + message: n, + sticky: o, + allowUnsafeHTML: r || !1, + }; + window.notifs || + ((window.notifs = c), d.setNotificationManager(window.notifs)), + a ? d.inject(a) : d.elements.container.isInjected() || d.inject(), + window.notifs.addNotif(s); + }, + }; + return f; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/util/ChgCRImpactBasisGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgCRImpactBasisViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o) { + 'use strict'; + let a = Object.create(null); + return ( + (a.getColumns = function (e) { + let t = !1; + void 0 !== e && + 'true' === e.AddImpactBasis && + 'true' === e.RemoveImpactBasis && + (t = !0); + let n = []; + return ( + n.push( + o.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + n.push( + o.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + ), + n.push( + o.getColumnDefinition({ + dataIndex: 'name', + }), + ), + n.push( + o.getColumnDefinition({ + dataIndex: 'revision', + }), + ), + n.push( + o.getColumnDefinition({ + dataIndex: 'reasonForChange', + editableFlag: t, + massUpdateAllowedFlag: t, + }), + ), + n.push( + o.getColumnDefinition({ + dataIndex: 'currentNLS', + }), + ), + n.push( + o.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + i.getGlobalVariable().is3DSpace && + ((n[0].allowUnsafeHTMLContent = !0), + (n[0].getCellGroupingKey = function (e) { + return e.nodeModel.options.grid.title; + })), + n + ); + }), + (a.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-impactBasis-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-impactBasis-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-impactBasis-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.content-impactBasis-tile-div')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-impactBasis-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-impactBasis-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-impactBasis-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.content-impactBasis-tile-div')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + a + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/recents/ChgCORecentsTreeModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/view/recents/util/ChgGovRecentsCustomFields', + 'require', + ], + function (e, t, i, n, o, a, r, s, l) { + 'use strict'; + return e.extend({ + init: function () {}, + setModelEvents: function (e) { + this._modelEvents = e; + }, + getModelEvents: function () { + return this._modelEvents; + }, + createTreeDocument: function (e) { + var i = new n(); + return ( + this.setModelEvents(e), + new t({ + dataModelSet: i, + }) + ); + }, + loadRecentChangeOrderData: function (e, t) { + e.prepareUpdate(); + var i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + for (var t = [], i = 0; i < e.length; i++) { + var n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + var t = s.createCustomNameField(e); + e.chgObjName = t; + var n = s.createCustomSeverity(e); + e.sev = n; + var o = s.createCustomChangeCoordinatorField(e); + e.chgObjCoordinator = o; + var a = s.createCustomOwnerField(e); + e.chgObjOwner = a; + var r = e.name + ' | ' + e.ownerFullName, + l = e.maturityNLS, + c = s.getStatusBarIcons(e), + d = s.statusbarIconsTooltips(e), + u = s.getCustomTooltip(e); + return new i({ + label: e.title, + subLabel: r, + description: l, + children: e.isKindOfChangeAction ? null : [], + grid: e, + icons: [e.iconURL], + thumbnail: e.thumbnail, + contextualMenu: ['Copy1', 'Move1'], + statusbarIcons: c, + statusbarIconsTooltips: d, + customTooltip: u, + useAsyncPreExpand: !0, + }); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/ChgCAMemberFilterLayout', + [ + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/members/util/ChgCAMemberFilterView', + 'require', + ], + function (e, t) { + 'use strict'; + var i = { + createMemberFilter: function (t) { + (i.teamlayoutModel = t.model), + new e({ + events: { + memberFilterKeyUp: function (e) { + i.enteredText = e.target.value; + var t = { + filteringMode: 'name', + text: i.enteredText, + }; + i.filterCollectionAndUpdateUI(t); + }, + memberRoleFilter: function (e) { + 'option1' != e.target.value && + (i.enteredText = e.target.value); + var t = { + filteringMode: 'role', + text: i.enteredText ? i.enteredText : '', + contributorInclude: !1, + reviewInclude: !1, + followInclude: !1, + }, + n = document.getElementById('allToggle'), + o = document.getElementById('contributorToggle'); + o && o.checked && (t.contributorInclude = !0); + var a = document.getElementById('revMemToggle'); + a && a.checked && (t.reviewInclude = !0); + var r = document.getElementById('followMemToggle'); + r && r.checked && (t.followInclude = !0), + (0 == t.contributorInclude && + 0 == t.reviewInclude && + 0 == t.followInclude) || + (1 == t.contributorInclude && + 1 == t.reviewInclude && + 1 == t.followInclude) || + ('allToggle' == e.target.id && 1 == n.checked) + ? ((t.allInclude = !0), + (n.checked = !0), + (o.checked = !1), + (a.checked = !1), + (r.checked = !1)) + : ((t.allInclude = !1), (n.checked = !1)), + i.filterCollectionAndUpdateUI(t); + }, + }, + }) + .render() + .inject(t.target); + }, + filterCollectionAndUpdateUI: function (e) { + var t = e.text; + i.teamlayoutModel.setFilterModel({ + label: { + filterId: 'stringRegexp', + filterModel: { + condition1: { + type: 'contains', + filter: t, + }, + }, + }, + role: { + filterId: 'stringRegexp', + }, + }); + var n = i.teamlayoutModel.getFilterManager().getFilters().role, + o = {}; + 0 == e.allInclude && + (1 == e.contributorInclude && + (o.condition1 = { + type: 'contains', + filter: 'contributor', + }), + 1 == e.reviewInclude && + (o.hasOwnProperty('condition1') + ? ((o.operator = 'or'), + (o.condition2 = { + type: 'contains', + filter: 'approver', + })) + : (o.condition1 = { + type: 'contains', + filter: 'approver', + })), + 1 == e.followInclude && + (o.hasOwnProperty('condition1') + ? ((o.operator = 'or'), + (o.condition2 = { + type: 'contains', + filter: 'follower', + })) + : (o.condition1 = { + type: 'contains', + filter: 'follower', + })), + (n.filterModel = o)); + }, + launchFilterMemberPanel: function () { + var e = { + commandInfo: { + type: 'Change Action', + facet: 'Members', + action: 'CA>Members>Filter', + }, + }; + t( + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ).cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: e, + }); + var i = document.querySelector('.addmemberView'), + n = document.querySelector('.memberfilterView'), + o = document.querySelector('.content-member-grid-div'), + a = document.querySelector('.content-member-tile-div'); + i.hide(), + o.removeClassName('teamview-opaque'), + a.removeClassName('teamview-opaque'), + 'block' == n.style.display + ? (n.hide(), + o.setStyle('height', 'calc(100% - 45px)'), + a.setStyle('height', 'calc(100% - 45px)')) + : (n.show(), + o.setStyle('height', 'calc(100% - 165px)'), + a.setStyle('height', 'calc(100% - 165px)')); + }, + }; + return i; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/ChgCOTileViewLayout', + ['UWA/Core', 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderUtil'], + function (e, t) { + 'use strict'; + return { + changeView: function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridLayout', + ], function (e) { + e.coGridView.coDatagrid.groupRows({ + dataIndexesToGroup: [], + }), + setTimeout(function () { + t.changeView('TileView'); + }, 100); + }); + }, + showEmptyView: function () { + var e = document.getElementById('emptyTileViewDiv'); + e && (e.removeClassName('hideView'), e.addClassName('showEmptyView')); + }, + hideEmptyView: function () { + var e = document.getElementById('emptyTileViewDiv'); + e && (e.addClassName('hideView'), e.removeClassName('showEmptyView')); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovLocalStorage', + ['DS/ENOChgGovernanceUX/scripts/util/ChgGovPreferenceConstant'], + function (e) { + 'use strict'; + var t = { + init: function (e) { + var n; + ((t._LOCALSTORAGE_USER_ID = e), + window.localStorage.getItem(t._LOCALSTORAGE_KEY)) + ? ((n = JSON.parse( + window.localStorage.getItem(t._LOCALSTORAGE_KEY), + ))[t._LOCALSTORAGE_KEY].hasOwnProperty(t._LOCALSTORAGE_USER_ID) + ? (n[t._LOCALSTORAGE_KEY][t._LOCALSTORAGE_USER_ID] = + Object.assign( + i, + n[t._LOCALSTORAGE_KEY][t._LOCALSTORAGE_USER_ID], + )) + : (n[t._LOCALSTORAGE_KEY][t._LOCALSTORAGE_USER_ID] = i), + window.localStorage.setItem( + t._LOCALSTORAGE_KEY, + JSON.stringify(n), + )) + : (((n = {})[t._LOCALSTORAGE_KEY] = {}), + (n[t._LOCALSTORAGE_KEY][t._LOCALSTORAGE_USER_ID] = i), + window.localStorage.setItem( + t._LOCALSTORAGE_KEY, + JSON.stringify(n), + )); + }, + destroy: function () { + window.localStorage.removeItem(t._LOCALSTORAGE_KEY); + }, + isPath: function (e, i) { + try { + if (window.localStorage.getItem(t._LOCALSTORAGE_KEY)) { + if (Array.isArray(e)) { + for ( + var n = JSON.parse( + window.localStorage.getItem(t._LOCALSTORAGE_KEY), + ), + o = 0; + o < e.length; + o++ + ) { + if (!n[e[o]] && '' != n[e[o]]) + return ( + console.log( + "ChgGovLocalStorage getItem() path doesn't exist", + ), + !!i && void 0 + ); + n = n[e[o]]; + } + return !i || n; + } + return ( + console.log( + 'ChgGovLocalStorage getItem() argument is not a Array', + ), + !!i && void 0 + ); + } + return ( + console.log( + 'ChgGovLocalStorage getItem() LocalStorage not initialize', + ), + !!i && void 0 + ); + } catch (e) { + return console.error(e), !!i && void 0; + } + }, + getValue: function (e) { + return this.isPath(e, !0); + }, + setValue: function (e, i) { + if (this.isPath(e, !1)) { + var n = JSON.parse( + window.localStorage.getItem(t._LOCALSTORAGE_KEY), + ), + o = JSON.parse(JSON.stringify(e)); + window.localStorage.setItem( + t._LOCALSTORAGE_KEY, + JSON.stringify(this.recursiveSearch(n, o, i, !0)), + ); + } + }, + recursiveSearch: function (e, t, i, n) { + return ( + 2 == t.length + ? (e[t[1]] = i) + : n + ? this.recursiveSearch(e[t[0]], t, i, !1) + : (t.shift(), this.recursiveSearch(e[t[0]], t, i, !1)), + e + ); + }, + }; + (t._LOCALSTORAGE_KEY = e._KEY), + (t._LOCALSTORAGE_VIEWS_PREFERENCES = e._VIEWS_PREFERENCES), + (t._LOCALSTORAGE_MY_CHANGE_ORDERS = e._MY_CHANGE_ORDERS), + (t._LOCALSTORAGE_CHANGE_ORDERS_DETAILS = e._CHANGE_ORDERS_DETAILS), + (t._LOCALSTORAGE_RECENTLY_OPENED = e._RECENTLY_OPENED); + var i = { + 'xchange-views-preferences': { + 'info-panel': { + 'info-open': '', + 'info-context': '', + 'info-width': '', + }, + 'xchange-my-change-orders': { + 'xchange-list-view': { + view: '', + filterview: '', + sort: {}, + search: '', + selections: [], + filters: {}, + tagFilter: {}, + }, + }, + 'xchange-change-orders-details': { + tab: '', + }, + 'xchange-change-requests-details': { + tab: '', + }, + 'xchange-change-actions-details': { + tab: '', + }, + 'xchange-recently-opened': { + objectIDs: '', + }, + }, + }; + return t; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovApplicationPreferencesManager', + [ + 'UWA/Class', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovLocalStorage', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovWidgetPreferenceManager', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovPreferenceConstant', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t, i, n, o) { + 'use strict'; + return e.singleton({ + init: function () { + var e = o.getGlobalVariable(); + this.contextUser = e.contextUser; + }, + initialize: function (e, n, o) { + (this._withLocalStorage = e), + (this._withWidgetPreferences = n), + (this._withUserPreferences = o), + e && t.init(this.contextUser), + n && i.prototype.initWidgetViewPreferences(); + }, + setUserId: function (e) { + this.userID = e; + }, + isWidgetPreferencePath: function (e) { + return !!this._withWidgetPreferences && i.prototype.isPath(e, !1); + }, + updatePreference: function (e, n) { + this._withWidgetPreferences && + i.prototype.updateWidgetViewPreferences(e, n), + this._withLocalStorage && + (e.splice(1, 0, this.userID), t.setValue(e, n)), + this._withUserPreferences; + }, + updateTab: function (e, t) { + this.updatePreference(e.concat([n._TAB]), t); + }, + updateFilter: function (e, t) { + this.updatePreference(e.concat([n._LIST_VIEW, n._FILTERVIEW]), t); + }, + updateRecents: function (e, t) { + this.updatePreference(e.concat([n._OBJECTIDs]), t); + }, + getPreference: function (e) { + return ( + console.log( + 'XChangeApplicationPreferencesLanager -getPreference : ' + e, + ), + this._withWidgetPreferences && + null != this.getWidgetPreferenceValue(e) && + this.getWidgetPreferenceValue(e) + ? this.getWidgetPreferenceValue(e) + : this._withLocalStorage + ? (e.splice(1, 0, this.userID), this.getLocalStorageValue(e)) + : void 0 + ); + }, + getTab: function (e) { + return this.getPreference(e.concat([n._TAB])); + }, + getFilter: function (e) { + return this.getPreference(e.concat([n._LIST_VIEW, n._FILTERVIEW])); + }, + getRecents: function (e) { + return this.getPreference(e.concat([n._OBJECTIDs])); + }, + setRouteInfo: function (e) { + if (this._withWidgetPreferences) { + var t = [n._KEY, n._LAST_ROUTE], + o = { + name: e && e.name ? e.name : void 0, + params: e && e.params ? e.params : void 0, + }; + i.prototype.updateWidgetViewPreferences(t, o), + console.log(JSON.parse(widget.getValue('xchange-app'))), + console.log(''); + } + }, + getRouteInfo: function () { + if (this._withWidgetPreferences) { + var e = [n._KEY, n._LAST_ROUTE]; + return this.getWidgetPreferenceValue(e); + } + return { + name: void 0, + params: {}, + }; + }, + getLocalStorageValue: function (e) { + return t.getValue(e); + }, + getWidgetPreferenceValue: function (e) { + return i.prototype.getValue(e); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/changeRequest/ChgChangeRequestUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/config/ChgGovAppGlobalConfig', + 'DS/ENOChangeActionUX/scripts/CAPreferencesManager', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovCommonDelete', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovApplicationPreferencesManager', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovPreferenceConstant', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'DS/PlatformAPI/PlatformAPI', + 'DS/LifecycleCmd/MaturityCmd', + 'DS/UIKIT/Input/Text', + 'DS/UIKIT/Input/Button', + 'DS/Notifications/NotificationsManagerUXMessages', + 'DS/Notifications/NotificationsManagerViewOnScreen', + 'DS/UIKIT/DropdownMenu', + 'DS/UIKIT/Dropdown', + 'DS/UIKIT/Mask', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + 'require', + ], + function ( + e, + t, + i, + n, + o, + a, + r, + s, + l, + c, + d, + u, + g, + p, + h, + m, + C, + v, + f, + b, + w, + D, + S, + y, + ) { + 'use strict'; + var _ = Object.create(null); + return ( + (_.getColumns = function () { + let e = []; + return ( + e.push( + S.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'co_name', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'severityNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'changeCoordinatorFullName', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'collabspaceNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'organizationNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'applicabilityNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'modificationDate', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'creationDate', + }), + ), + e + ); + }), + (_.makeCopyLinkObject = function (e) { + var t = { + protocol: '3DXContent', + data: { + items: [], + }, + }; + return ( + t.data.items.push({ + envId: i.getGlobalVariable().tenant, + objectId: e.options.grid.id, + openLink: !0, + }), + t + ); + }), + (_.showNotification = function (e, t, i, n, o, a, r) { + var s = { + level: e, + title: t, + subtitle: i, + message: n, + sticky: o, + allowUnsafeHTML: r || !1, + }; + window.notifs || + ((window.notifs = v), f.setNotificationManager(window.notifs)), + a ? f.inject(a) : f.elements.container.isInjected() || f.inject(), + window.notifs.addNotif(s); + }), + (_.getRelationalExplorerMenu = function (t, i, n) { + return { + type: 'PushItem', + title: e.CHG_GOV_Menu_Relational_Explorer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-object-related', + }, + action: { + callback: function (e) { + require([ + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ], function (e) { + let t = i.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + o = []; + for (let e = 0; e < t.length; e++) { + let i = t[e].options.grid.id; + o.push(i); + } + e.openRelationalExplorer(n || o); + }); + }, + }, + }; + }), + (_.getTransferMenu = function (t, i) { + return { + type: 'PushItem', + title: e.CHG_GOV_Menu_Transfer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-move-to', + }, + action: { + callback: function (e) { + let t = i.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = []; + for (let e = 0; e < t.length; e++) n.push(t[e].options.grid); + require([ + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTransferWrapper', + ], function (e) { + e.launchTransferDialog(n); + }); + }, + }, + }; + }), + (_.getDeleteMenu = function (t, i, n) { + return { + type: 'PushItem', + title: e.CHG_GOV_Menu_Delete, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-trash', + }, + action: { + callback: function () { + let e = i.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + t = []; + for (let i = 0; i < e.length; i++) { + let n = e[i], + o = { + physicalid: n.options.grid.id, + nodeName: n.options.grid.name, + nodeTitle: n.options.grid.title, + }; + t.push(o); + } + let o = require('DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridLayout'); + a.deleteNodes(t, n, o.removeDataFromGrid); + }, + }, + }; + }), + (_.changeView = function (i) { + if ( + (widget.body.getDimensions().width <= n.MOBILE_CUTOFF + ? o.updateCASummaryViewMobile(i) + : o.updateCASummaryViewDesktop(i), + 'GridView' == i) + ) { + this.currentView = 'Grid'; + let i = t.toolbar.getNodeModelByID('view'); + i && + 'view-list' != i.options.grid.semantics.icon.iconName && + i.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (i.options.grid.data.menu[0].state = 'selected'), + (i.options.grid.data.menu[1].state = 'unselected'); + let n = document.querySelector( + '.toolbar-cr-div .wux-ui-3ds-view-list', + ); + n && n.addClassName('currentView'); + let o = document.querySelector( + '.toolbar-co-div .wux-ui-3ds-view-small-tile', + ); + o && o.removeClassName('currentView'); + let a = document.querySelector('.crgridView'); + a && + (a.removeClassName('hideView'), + a.removeClassName('nonVisible'), + a.addClassName('showView')); + let r = document.querySelector('.crtileView'); + r && (r.removeClassName('showView'), r.addClassName('hideView')); + } else if ('TileView' == i) { + this.currentView = 'Tile'; + let i = t.toolbar.getNodeModelByID('view'); + i && + 'view-small-tile' != i.options.grid.semantics.icon.iconName && + i.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (i.options.grid.data.menu[0].state = 'unselected'), + (i.options.grid.data.menu[1].state = 'selected'); + let n = document.querySelector( + '.toolbar-co-div .wux-ui-3ds-view-list', + ); + n && n.removeClassName('currentView'); + let o = document.querySelector( + '.toolbar-cr-div .wux-ui-3ds-view-small-tile', + ); + o && o.addClassName('currentView'); + let a = document.querySelector('.crgridView'); + a && (a.removeClassName('showView'), a.addClassName('hideView')); + let r = document.querySelector('.crtileView'); + r && (r.removeClassName('hideView'), r.addClassName('showView')); + } + }), + (_.createCustomSeverity = function (e, t) { + let i = 'sevLow wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-low'; + 'Medium' == e + ? (i = 'sevMed wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-medium') + : 'High' == e && + (i = 'sevHigh wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-level-high'); + let n = new UWA.Element('div', {}), + o = new UWA.Element('div', { + class: 'gridIconContainer', + }); + UWA.createElement('div', { + class: i, + }).inject(o); + let a = UWA.createElement('span', { + html: t, + }); + return o.inject(n), a.inject(n), n.outerHTML; + }), + (_.createCustomOwner = function (e, t) { + let n = '/api/user/getpicture/login/' + t + '/format/normal', + o = i.getGlobalVariable().computeSwymUrl(n), + a = new UWA.Element('div', { + class: 'members', + }), + s = new UWA.Element('div', { + class: 'assignee', + }), + l = ''; + if (i.getGlobalVariable().isSwymInstalled) + l = UWA.createElement('img', { + class: 'userIcon', + src: o, + }); + else { + let e = r.getAvatarDetails(t); + (l = UWA.createElement('div', { + html: e.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', e.avatarColor); + } + l.inject(s); + let c = UWA.createElement('span', { + class: 'userName', + html: t, + }); + return s.inject(a), c.inject(a), a.outerHTML; + }), + (_.createHeaderFieldsJSON = function (t) { + return new Promise(function (i, n) { + let o = { + 'ds6w:project': [t.model.collabspace], + 'ds6w:organizationResponsible': [t.model.organization], + }; + g.getNLSValuesPromise(o).then(function (n) { + let o = n['ds6w:organizationResponsible'][t.model.organization], + a = n['ds6w:project'][t.model.collabspace], + r = { + id: t.model.id, + name: t.model.name, + revision: t.model.revision, + type: t.model.type, + title: t.model.title, + thumbnail: t.model.thumbnail, + iconURL: t.model.iconURL, + minified: !1, + onHold: t.model.onHold, + isKindOfType: t.model.isKindOfType, + attributes: { + layout: [ + ['maturity', 'owner', 'collabSpace'], + ['Applicability', 'Attachments', 'RelatedScope'], + ['orgnaization'], + ], + mapping: { + owner: { + fieldNLS: e.CHG_GOV_DataGrid_Column_Owner, + valueActual: t.model.owner, + valueDisplay: t.model.ownerFullName, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + accessBit: 'TransferOwnership', + }, + collabSpace: { + fieldNLS: e.CHG_GOV_DataGrid_Column_CollabSpace, + valueActual: t.model.collabspace, + valueDisplay: a, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + accessBit: 'TransferOwnership', + }, + maturity: { + fieldNLS: e.CHG_GOV_DataGrid_Column_Maturity, + valueActual: t.model.maturity, + valueDisplay: t.model.maturityNLS, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + }, + orgnaization: { + fieldNLS: e.CHG_GOV_DataGrid_Column_Organization, + valueActual: t.model.organization, + valueDisplay: o, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + accessBit: 'TransferOwnership', + }, + Applicability: { + fieldNLS: e.CHG_GOV_Header_Applicability, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !0, + displayWhenMinified: !0, + editable: !0, + }, + Attachments: { + fieldNLS: e.CHG_GOV_Header_Attachments, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + }, + RelatedScope: { + fieldNLS: e.CHG_GOV_Header_RelatedScope, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + }, + }, + }, + freeSpaces: [ + { + type: 'text', + data: t.model.description, + }, + ], + menuItems: [ + { + id: 'chgHold', + text: e.CHG_GOV_Header_Menu_Hold, + fonticon: 'fonticon fonticon-pause', + accessBit: 'Hold', + }, + { + id: 'chgResume', + text: e.CHG_GOV_Header_Menu_Resume, + fonticon: 'fonticon fonticon-resume', + accessBit: 'Resume', + }, + { + id: 'chgCancel', + text: e.CHG_GOV_Header_Menu_Cancel, + fonticon: 'fonticon fonticon-block', + accessBit: 'Cancel', + }, + ], + }; + i(r); + }); + }); + }), + (_.getCRTabs = function (e, t, i) { + this._pathRequestsDetails = [ + l._KEY, + l._VIEWS_PREFERENCES, + l._CHANGE_REQUESTS_DETAILS, + ]; + var n = s.getTab(this._pathRequestsDetails); + let o = 'crAffectedItems'; + (o = '' == n ? 'crAffectedItems' : n), console.log(n); + let a = this.getCRMembersTab(e, t, o), + r = this.getCRAssessmentTab(e, t, o, i); + return [ + this.getCRCusTab(e, t, o, i), + this.getCRAffectedItemsTab(e, t, o, i), + r, + this.getCRChangeOrchestrationTab(e, t, o, i), + a, + this.getCRApprovalsTab(e, t, o), + ]; + }), + (_.getCRAssessmentTab = (t, i, n, o) => { + let a = !1; + return ( + 'crAssessment' == n && (a = !0), + (i.isSelected = a), + { + label: e.CHG_GOV_Home_Tab_Assessment, + isSelected: a, + index: 1, + value: 'crAssessment', + content: t.createCRAssessmentTab(i, o), + icon: { + iconName: 'change-request-chart-line-bar', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.getCRAffectedItemsTab = (t, i, n, o) => { + let a = !1; + return ( + 'crAffectedItems' == n && (a = !0), + (i.isSelected = a), + { + label: e.CHG_GOV_Home_Tab_AffectedItems, + isSelected: a, + value: 'crAffectedItems', + index: 0, + content: t.createCRAffectedItemsTab(i, o), + icon: { + iconName: 'change-request-attention', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.getCRApprovalsTab = (t, i, n) => { + let o = !1; + return ( + 'crApprovals' == n && (o = !0), + (i.isSelected = o), + { + label: e.CHG_GOV_Home_Tab_Approvals, + isSelected: o, + value: 'crApprovals', + index: 4, + content: t.createCRApprovalsTab(i, n), + icon: { + iconName: 'status-ok', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.getCRMembersTab = (t, i, n) => { + let o = !1; + return ( + 'crMembers' == n && (o = !0), + (i.isSelected = o), + { + label: e.CHG_GOV_Home_Tab_Members, + isSelected: o, + value: 'crMembers', + index: 3, + content: t.createCRMembersTab(i), + icon: { + iconName: 'users', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.getCRChangeOrchestrationTab = (t, i, n, o) => { + let a = !1; + return ( + 'crOrchestration' == n && (a = !0), + (i.isSelected = a), + { + label: e.CHG_GOV_Home_Tab_ChangeOrchestration, + isSelected: a, + value: 'crChangeOrchestration', + index: 2, + content: t.createCROrchestrationTab(i, o), + icon: { + iconName: 'flow-tree-ordered', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.getCRCusTab = (t, i, n, o) => { + let a = !1; + return ( + 'crCusTab' == n && (a = !0), + (i.isSelected = a), + { + label: e.CHG_GOV_Home_Tab_CusTab, + isSelected: a, + value: 'crCusTab', + index: 5, + content: t.createCRCusTab(i, o), + icon: { + iconName: 'wux-ui-3ds wux-ui-3ds-1x fonticon-eye', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.displayObjectInfoInsideIDcard = function (e, t = !1) { + var i = this; + c.getChangeRequestInfo(e).then( + function (e) { + d.processedCRSummaryList(e).then(function (o) { + var a = { + model: o[0], + }; + i.createHeaderFieldsJSON(a).then(function (i) { + var a = { + model: i, + }; + if (t) + try { + let t = y('DS/ENOChgProbes/scripts/ChgCloudProbeUtils'); + ((i = o[0]).dueDate = e.data[0].dueDate), + (i.isKindOfType = 'Change Request'), + t.cloudProbeUtils.sendChgObjectCreateTrackerEvent({ + createData: i, + }); + } catch (e) { + console.log(e); + } + u.navigate( + n.ROUTE_CR_DETAILS, + { + id: i.id, + name: i.name, + title: i.title, + nodeModel: a, + mode: 'outsideCall', + }, + { + reload: !0, + }, + ); + }); + }); + }, + function (e) { + var t = document.getElementsByClassName('moduleWrapper')[0]; + return t && D.isMasked(t) && D.unmask(t), Promise.reject(e); + }, + ); + }), + (_.getChangeRequestModelForIDCard = function (e) { + return new Promise(function (t, i) { + c.getChangeRequestInfo(e).then(function (e) { + d.processedCRSummaryList(e).then(function (e) { + var i = { + model: e[0], + }; + t(i); + }); + }); + }); + }), + (_.filterView = function (e) { + if ('activeCR' == e) + ((i = + t.toolbar.getNodeModelByID( + 'filter', + )).options.grid.data.menu[0].state = 'selected'), + (i.options.grid.data.menu[1].state = 'unselected'); + else if ('inactiveCR' == e) { + var i; + ((i = + t.toolbar.getNodeModelByID( + 'filter', + )).options.grid.data.menu[0].state = 'unselected'), + (i.options.grid.data.menu[1].state = 'selected'); + } + }), + _ + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgInActiveCRFilterView', + [ + 'UWA/Core', + 'DS/ENOChgGovernanceUX/scripts/util/changeRequest/ChgChangeRequestUtil', + ], + function (e, t) { + 'use strict'; + return { + filterView: function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/ChgCRDataGridLayout', + ], function (e) { + e.crGridView.crDatagrid.groupRows({ + dataIndexesToGroup: [], + }), + setTimeout(function () { + t.filterView('inactiveCR'); + }, 100); + }); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/changeAction/ChgChangeActionUtil', + [ + 'DS/UIKIT/Mask', + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridViewToolbar', + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovCommonDelete', + 'DS/ENOChgServices/scripts/services/ChgNativeInitService', + 'DS/ENOChgGovernanceUX/scripts/config/ChgGovAppGlobalConfig', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovPreferenceConstant', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovApplicationPreferencesManager', + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChangeActionUX/scripts/CAPreferencesManager', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/UIKIT/Input/Text', + 'DS/UIKIT/Input/Button', + 'DS/UIKIT/Dropdown', + 'DS/Notifications/NotificationsManagerUXMessages', + 'DS/Notifications/NotificationsManagerViewOnScreen', + 'DS/LifecycleCmd/MaturityCmd', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + 'require', + ], + function ( + e, + t, + i, + n, + o, + a, + r, + s, + l, + c, + d, + u, + g, + p, + h, + m, + C, + v, + f, + b, + w, + D, + S, + y, + ) { + 'use strict'; + var _ = Object.create(null); + return ( + (_.getColumns = function () { + let e = []; + return ( + e.push( + S.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'co_name', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'severityNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'collabspaceNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'organizationNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'applicabilityNLS', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'modificationDate', + }), + ), + e.push( + S.getColumnDefinition({ + dataIndex: 'creationDate', + }), + ), + e + ); + }), + (_.makeCopyLinkObject = function (e) { + var t = { + protocol: '3DXContent', + data: { + items: [], + }, + }; + return ( + t.data.items.push({ + envId: s.getGlobalVariable().tenant, + objectId: e.options.grid.id, + openLink: !0, + }), + t + ); + }), + (_.showNotification = function (e, t, i, n, o, a, r) { + var s = { + level: e, + title: t, + subtitle: i, + message: n, + sticky: o, + allowUnsafeHTML: r || !1, + }; + window.notifs || + ((window.notifs = b), w.setNotificationManager(window.notifs)), + a ? w.inject(a) : w.elements.container.isInjected() || w.inject(), + window.notifs.addNotif(s); + }), + (_.createHeaderFieldsJSON = function (e) { + return new Promise(function (t, i) { + let o = { + 'ds6w:project': [e.model.collabspace], + 'ds6w:organizationResponsible': [e.model.organization], + }; + n.getNLSValuesPromise(o).then(function (i) { + let n = i['ds6w:organizationResponsible'][e.model.organization], + o = i['ds6w:project'][e.model.collabspace], + a = []; + var r = { + id: e.model.id, + name: e.model.name, + revision: e.model.revision, + type: e.model.type, + title: e.model.title, + description: e.model.description, + severity: e.model.severity, + maturity: e.model.maturity, + thumbnail: e.model.thumbnail, + iconURL: e.model.iconURL, + minified: !1, + onHold: e.model.onHold, + isKindOfType: e.model.isKindOfType, + attributes: { + layout: [ + ['maturity', 'owner', 'collabSpace'], + ['Applicability', 'Dependency', 'Attachments'], + ['orgnaization', 'Flowdown', 'isGoverned'], + ], + mapping: { + owner: { + fieldNLS: m.CHG_GOV_DataGrid_Column_Owner, + valueActual: e.model.owner, + valueDisplay: e.model.ownerFullName, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + accessBit: 'Transfer', + }, + collabSpace: { + fieldNLS: m.CHG_GOV_DataGrid_Column_CollabSpace, + valueActual: e.model.collabspace, + valueDisplay: o, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + accessBit: 'Transfer', + }, + maturity: { + fieldNLS: m.CHG_GOV_DataGrid_Column_Maturity, + valueActual: e.model.maturity, + valueDisplay: e.model.maturityNLS, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + }, + orgnaization: { + fieldNLS: m.CHG_GOV_DataGrid_Column_Organization, + valueActual: e.model.organization, + valueDisplay: n, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + accessBit: 'Transfer', + }, + Applicability: { + fieldNLS: m.CHG_GOV_Header_Applicability, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !0, + displayWhenMinified: !0, + editable: !0, + }, + Dependency: { + fieldNLS: m.CHG_GOV_Header_Dependency, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !0, + displayWhenMinified: !0, + editable: !0, + }, + Attachments: { + fieldNLS: m.CHG_GOV_Header_Attachments, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !0, + displayWhenMinified: !0, + editable: !0, + }, + Flowdown: { + fieldNLS: m.CHG_GOV_Header_Flowdown, + valueActual: 'Unassigned', + valueDisplay: 'Unassigned', + showLoader: !0, + displayWhenMinified: !0, + editable: !0, + }, + isGoverned: { + fieldNLS: m.CHG_GOV_Header_isGoverned, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !0, + displayWhenMinified: !0, + editable: !0, + }, + Group: { + fieldNLS: m.CHG_GOV_Header_Group, + valueActual: void 0, + valueDisplay: 'Unassigned', + showLoader: !0, + displayWhenMinified: !0, + accessBit: 'AddToGroup', + }, + }, + }, + freeSpaces: [ + { + type: 'text', + data: e.model.description, + }, + ], + menuItems: [ + { + id: 'chgBOMSync', + text: m.ECM_CA_EBOM_Sync_Action, + fonticon: 'fonticon fonticon-change-action-sync', + accessBit: 'Synchronization', + }, + { + id: 'chgHold', + text: m.CHG_GOV_Header_Menu_Hold, + fonticon: 'fonticon fonticon-pause', + accessBit: 'Hold', + }, + { + id: 'chgResume', + text: m.CHG_GOV_Header_Menu_Resume, + fonticon: 'fonticon fonticon-resume', + accessBit: 'Resume', + }, + { + id: 'chgCancel', + text: m.CHG_GOV_Header_Menu_Cancel, + fonticon: 'fonticon fonticon-block', + accessBit: 'Cancel', + }, + ], + }; + 'true' == s.getGlobalVariable().CHG_CHANGE_GROUP && + a.push('Group'), + r.attributes.layout.push(a); + let l = { + id: 'chgCAWorkUnder', + text: m.CHG_GOV_Header_Menu_WorkUnder, + fonticon: 'fonticon fonticon-hardhat', + accessBit: 'WorkUnder', + }; + (s.getGlobalVariable().isNative || + s.getGlobalVariable().isPoweredBy) && + (r.menuItems.push(l), + p.unsubscribe('change-action-work-under'), + p.subscribe('change-action-work-under', function (e) { + _.publishEventToWebnWinForWorkUnder(e); + })), + t(r); + }); + }); + }), + (_.getMaturityMenu = function (e) { + return { + type: 'PushItem', + title: m.CHG_GOV_Menu_Maturity, + fonticon: { + family: 1, + content: 'fonticon fonticon-collaborative-lifecycle-management', + }, + action: { + callback: function (t) { + for ( + var i = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = [], + o = [], + a = 0; + a < i.length; + a++ + ) + n.push(i[a].options.grid), + o.push({ + physicalid: + i[a].options.grid['@id'] || i[a].options.grid.id, + }); + new D({ + context: n, + ID: 'MaturityHdr', + }).executeAsync(o); + }, + }, + }; + }), + (_.publishEventToWebnWinForWorkUnder = function (e) { + let t = e.changeaction; + if (t && t.editability) + if ('allowed' === t.editability.work_under) { + let e = 'Work_Under', + n = 'TRUE'; + if (s.getGlobalVariable().isPoweredBy) { + var i = t.attributes.find( + (e) => 'attribute_Synopsis' === e.name, + ); + let e = i && i.value ? i.value : '', + n = t.name, + o = t.description, + a = t.id; + if (t.attributes) { + let i = t.attributes; + UWA.is(i) && + i.forEach(function (t) { + 'attribute_Synopsis' === t.name && (e = t.value); + }); + } + let r = { + operation: 'Work_Under', + operationVersion: '1.0', + content: { + id: a.replace('pid:', ''), + name: n, + title: e, + description: o, + }, + }; + p.publish('webinwin:web:notification', JSON.stringify(r)); + } else c.DispatchEventToWin(e, n); + } else r.error(m.CHG_GOV_Action_WorkUnder_Forbidden); + }), + (_.getTabs = function (e, t) { + this._pathChangeActionsDetails = [ + u._KEY, + u._VIEWS_PREFERENCES, + u._CHANGE_ACTIONS_DETAILS, + ]; + var i = g.getTab(this._pathChangeActionsDetails); + let n = 'ProposedChange'; + (n = null == i || '' == i ? 'ProposedChange' : i), console.log(i); + let o = this.getProposedChangeTab(e, t, n), + a = this.getRealizedChangeTab(e, t, n); + return [ + this.getMembersTab(e, t, n), + o, + a, + this.getCusTab(e, t, n), + this.getApprovalsTab(e, t, n), + ]; + }), + (_.getMembersTab = (e, t, i) => { + let n = !1; + return ( + 'Members' == i && (n = !0), + (t.isSelected = n), + { + label: m.CHG_GOV_Home_Tab_Members, + isSelected: n, + value: 'caMembers', + index: 0, + content: e.createMembersTab(t), + icon: { + iconName: 'users', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.getProposedChangeTab = (e, t, i) => { + let n = !1; + return ( + 'ProposedChange' == i && (n = !0), + (t.isSelected = n), + { + label: m.CHG_GOV_Home_Tab_ProposedChanges, + isSelected: n, + index: 1, + value: 'caProposedChange', + content: e.createProposedChangeTab(t), + icon: { + iconName: 'change-action-proposed', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.getRealizedChangeTab = (e, t, i) => { + let n = !1; + return ( + 'RealizedChange' == i && (n = !0), + (t.isSelected = n), + { + label: m.CHG_GOV_Home_Tab_RealizedChanges, + isSelected: n, + index: 2, + value: 'caRealizedChange', + content: e.createRealizedChangeTab(t), + icon: { + iconName: 'change-action-realized', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.getApprovalsTab = (e, t, i) => { + let n = !1; + return ( + 'Approvals' == i && (n = !0), + (t.isSelected = n), + { + label: m.CHG_GOV_Home_Tab_Approvals, + isSelected: n, + value: 'caApprovals', + index: 3, + content: e.createApprovalsTab(t, i), + icon: { + iconName: 'status-ok', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.getCusTab = (e, t, i) => { + let n = !1; + return ( + 'Cus' == i && (n = !0), + (t.isSelected = n), + { + label: m.CHG_GOV_Home_Tab_CusTab, + isSelected: n, + value: 'caCus', + index: 4, + content: e.createCusTab(), + icon: { + iconName: 'wux-ui-3ds wux-ui-3ds-1x fonticon-eye', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (_.displayObjectInfoInsideIDcard = function (t, n = !1) { + var r = this; + o.getChangeActionInfo(t).then( + function (e) { + var t = a.processChangeActionDetails(e); + let o = { + model: t[0], + }; + r.createHeaderFieldsJSON(o).then(function (e) { + var o = { + model: e, + }; + if (n) + try { + let i = y('DS/ENOChgProbes/scripts/ChgCloudProbeUtils'); + ((e = t[0]).isKindOfType = 'Change Action'), + i.cloudProbeUtils.sendChgObjectCreateTrackerEvent({ + createData: e, + }); + } catch (e) { + console.log(e); + } + (i.navigate( + d.ROUTE_CA_DETAILS, + { + id: e.id, + name: e.name, + title: e.title, + nodeModel: o, + mode: 'outsideCall', + }, + { + reload: !0, + }, + ), + s.getGlobalVariable().isNative) && + (window.history.replaceState( + '', + e.title, + s.getGlobalVariable().nativeURL, + ), + 'true' != s.getGlobalVariable().CHG_NATIVE_BREADCRUMB && + i.getDependency('applicationChannel').publish({ + event: 'breadcrumb-hide', + })); + }); + }, + function (t) { + var i = document.getElementsByClassName('moduleWrapper')[0]; + i && e.isMasked(i) && e.unmask(i); + }, + ); + }), + (_.getChangeActionModelForIDCard = function (e) { + return new Promise(function (t, i) { + o.getChangeActionInfo(e).then(function (e) { + var i = { + model: a.processChangeActionDetails(e)[0], + }; + t(i); + }); + }); + }), + (_.changeView = function (e) { + if ( + (widget.body.getDimensions().width <= d.MOBILE_CUTOFF + ? h.updateCASummaryViewMobile(e) + : h.updateCASummaryViewDesktop(e), + 'GridView' == e) + ) { + this.currentView = 'Grid'; + let e = t.toolbar.getNodeModelByID('view'); + e && + 'view-list' != e.options.grid.semantics.icon.iconName && + e.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: m.CHG_TOOLTIP_GRID_VIEW, + }), + (e.options.grid.data.menu[0].state = 'selected'), + (e.options.grid.data.menu[1].state = 'unselected'); + let i = document.querySelector( + '.toolbar-ca-div .wux-ui-3ds-view-list', + ); + i && i.addClassName('currentView'); + let n = document.querySelector( + '.toolbar-co-div .wux-ui-3ds-view-small-tile', + ); + n && n.removeClassName('currentView'); + let o = document.querySelector('.cagridView'); + o && + (o.removeClassName('hideView'), + o.removeClassName('nonVisible'), + o.addClassName('showView')); + let a = document.querySelector('.catileView'); + a && (a.removeClassName('showView'), a.addClassName('hideView')); + } else if ('TileView' == e) { + this.currentView = 'Tile'; + let e = t.toolbar.getNodeModelByID('view'); + e && + 'view-small-tile' != e.options.grid.semantics.icon.iconName && + e.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: m.CHG_TOOLTIP_TILE_VIEW, + }), + (e.options.grid.data.menu[0].state = 'unselected'), + (e.options.grid.data.menu[1].state = 'selected'); + let i = document.querySelector( + '.toolbar-co-div .wux-ui-3ds-view-list', + ); + i && i.removeClassName('currentView'); + let n = document.querySelector( + '.toolbar-ca-div .wux-ui-3ds-view-small-tile', + ); + n && n.addClassName('currentView'); + let o = document.querySelector('.cagridView'); + o && (o.removeClassName('showView'), o.addClassName('hideView')); + let a = document.querySelector('.catileView'); + a && (a.removeClassName('hideView'), a.addClassName('showView')); + } + }), + (_.getDeleteMenu = function (e, t, i) { + return { + type: 'PushItem', + title: m.CHG_GOV_Menu_Delete, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-trash', + }, + action: { + callback: function () { + let e = t.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = []; + for (let t = 0; t < e.length; t++) { + let i = e[t], + o = { + physicalid: i.options.grid.id, + nodeName: i.options.grid.name, + nodeTitle: i.options.grid.title, + }; + n.push(o); + } + let o = require('DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridLayout'); + l.deleteNodes(n, i, o.removeDataFromGrid); + }, + }, + }; + }), + (_.getTransferMenu = function (e, t) { + return { + type: 'PushItem', + title: m.CHG_GOV_Menu_Transfer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-move-to', + }, + action: { + callback: function (e) { + let i = t.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = []; + for (let e = 0; e < i.length; e++) n.push(i[e].options.grid); + require([ + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTransferWrapper', + ], function (e) { + e.launchTransferDialog(n); + }); + }, + }, + }; + }), + (_.getRelationalExplorerMenu = function (e, t) { + return { + type: 'PushItem', + title: m.CHG_GOV_Menu_Relational_Explorer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-object-related', + }, + action: { + callback: function (e) { + require([ + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ], function (e) { + let i = t.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = []; + for (let e = 0; e < i.length; e++) { + let t = i[e].options.grid.id; + n.push(t); + } + e.openRelationalExplorer(n); + }); + }, + }, + }; + }), + (_.createCustomOwner = function (e, t) { + let i = '/api/user/getpicture/login/' + t + '/format/normal', + n = s.getGlobalVariable().computeSwymUrl(i), + o = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + r = ''; + if (s.getGlobalVariable().isSwymInstalled) + r = UWA.createElement('img', { + class: 'userIcon', + src: n, + }); + else { + let e = ChgMembersServices.getAvatarDetails(t); + (r = UWA.createElement('div', { + html: e.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', e.avatarColor); + } + r.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: t, + }); + return a.inject(o), l.inject(o), o.outerHTML; + }), + (_.filterView = function (e) { + if ('activeCA' == e) + ((i = + t.toolbar.getNodeModelByID( + 'filter', + )).options.grid.data.menu[0].state = 'selected'), + (i.options.grid.data.menu[1].state = 'unselected'); + else if ('inactiveCA' == e) { + var i; + ((i = + t.toolbar.getNodeModelByID( + 'filter', + )).options.grid.data.menu[0].state = 'unselected'), + (i.options.grid.data.menu[1].state = 'selected'); + } + }), + _ + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgInActiveCAFilterView', + [ + 'UWA/Core', + 'DS/ENOChgGovernanceUX/scripts/util/changeAction/ChgChangeActionUtil', + ], + function (e, t) { + 'use strict'; + return { + filterView: function (e) { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/ChgCADataGridLayout', + ], function (e) { + e.caGridView.caDatagrid.groupRows({ + dataIndexesToGroup: [], + }), + setTimeout(function () { + t.filterView('inactiveCA'); + }, 100); + }); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/util/ChgCRImpactedItemGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemViewToolbar', + 'DS/Controls/Popup', + 'DS/ENOChgGovernanceUX/scripts/util/changeRequest/ChgChangeRequestUtil', + 'DS/Menu/ContextualMenu', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + 'DS/Handlebars/Handlebars4', + 'text!DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/util/ChgCRImpactedItemGridProposedCAPopoverTemplate.html', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o, a, r, s, l, c, d) { + 'use strict'; + let u = Object.create(null); + return ( + (u.getColumns = function (i, n) { + let o = !0; + ((i && + 'false' === i.AddImpactedItems && + 'false' === i.RemoveImpactedItems) || + n) && + (o = !1); + let a = []; + return ( + a.push( + d.getColumnDefinition({ + dataIndex: 'titleTree', + }), + ), + a.push( + d.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + ), + a.push( + d.getColumnDefinition({ + dataIndex: 'name', + }), + ), + a.push( + d.getColumnDefinition({ + dataIndex: 'revision', + }), + ), + a.push( + d.getColumnDefinition({ + dataIndex: 'reasonForChange', + editableFlag: o, + massUpdateAllowedFlag: o, + }), + ), + a.push( + d.getColumnDefinition({ + dataIndex: 'currentNLS', + }), + ), + a.push( + d.getColumnDefinition({ + dataIndex: 'ownerFullName', + }), + ), + a.push({ + text: e.CHG_GOV_DataGrid_Column_ProposedCA, + dataIndex: 'proposedChangeAction', + editableFlag: !1, + alwaysVisibleFlag: !1, + visibleFlag: !0, + allowUnsafeHTMLContent: !0, + filterId: 'set', + filterModel: [], + getCellGroupingKey: function (e) { + let t = e.nodeModel.options.grid.proposedChangeActionsData; + if (!t) return ''; + switch (t.length) { + case 0: + return 'none'; + case 1: + return t[0].title; + default: + return t.length; + } + }, + }), + a.push({ + text: e.CHG_COUMN_IMPACT, + dataIndex: 'impact', + editableFlag: !n && o, + typeRepresentation: 'impact', + editionPolicy: 'EditionOnOver', + massUpdateAllowedFlag: !0, + filterId: 'set', + filterModel: [], + }), + t.getGlobalVariable().is3DSpace && + ((a[0].allowUnsafeHTMLContent = !0), + (a[0].getCellGroupingKey = function (e) { + return e.nodeModel.options.grid.title; + })), + a + ); + }), + (u.changeView = function (t, i) { + if ('GridView' == t) + (this.currentView = 'Grid'), + (n = i.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-impactedItem-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-impactedItem-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector('.content-impactedItem-grid-div')) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.content-impactedItem-tile-div')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == t) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = i.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-impactedItem-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-impactedItem-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector('.content-impactedItem-grid-div')) && + (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.content-impactedItem-tile-div')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + (u.getProposedColumnBasedOnData = function (e) { + if (e.length > 1) { + let t = new UWA.createElement('a', { + class: 'proposedChangeActionsCount', + }); + return (t.innerText = e.length), t.outerHTML; + } + if (1 == e.length) { + var t = UWA.createElement('div', { + class: 'proposedChangeActionField', + }), + i = UWA.createElement('span', { + class: 'proposedChangeActionTitle', + html: ' ' + e[0].title + ' (' + e[0].name + ')', + }), + n = e[0].icon; + return ( + UWA.createElement('img', { + src: n, + }).inject(t), + i.inject(t), + t.outerHTML + ); + } + }), + (u.getRMBProposedChangeColumn = function (t) { + return new Promise((i, n) => { + let o = [], + a = [], + r = null; + t.forEach((e) => { + a.push(e.id), + (r = { + objectId: e.id, + objectType: e.type, + displayName: e.name, + displayType: e.typeNLS, + facetName: 'impactedItem', + }); + }), + o.push({ + type: 'PushItem', + title: e.CHG_GOV_Menu_Relational_Explorer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-object-related', + }, + action: { + callback: function (e) { + s.openRelationalExplorer(a); + }, + }, + }), + s.openWith(r).then((e) => { + o.push(e), i(o); + }); + }); + }), + (u.getPopupProposedChangeColumn = function (e, t) { + let i = u.getPopupContentProposedChangeColumn( + t.options.grid.proposedChangeActionsData, + ); + var n = new o({ + target: e, + trigger: 'click', + constraint: widget.body, + className: + 'wux-controls-abstract wux-controls-popup impactedItemProposedChangePopup', + }); + n.setBody(i), + t.options.grid.proposedChangeActionsData.forEach((e, t) => { + r.addEventListener( + n.elements.container.getElementsByClassName( + 'impactedItem-proposedChange-popup-table-tr', + )[t], + { + callback: function (e) { + if (e.data.listener.getAttribute('data-changeId')) { + let t = [], + i = { + id: e.data.listener.getAttribute('data-changeId'), + type: e.data.listener.getAttribute('data-changeType'), + name: e.data.listener.getAttribute('data-changeName'), + typeNLS: + e.data.listener.getAttribute('data-changeTypeNLS'), + }; + return ( + t.push(i), + u.getRMBProposedChangeColumn(t).then(function (e) { + return e; + }) + ); + } + return []; + }, + }, + ); + }); + }), + (u.getPopupContentProposedChangeColumn = function (t) { + return l.compile(c)({ + changes: t, + heading: e.CHG_GOV_DataGrid_Column_ProposedCA_Popup_Heading, + }); + }), + u + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/util/ChgCRImpactAnalysisGridColsUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + 'DS/ENOChgServices/scripts/services/ChgPropertiesServices', + 'DS/ENOChgGovernanceUX/scripts/util/changeRequest/ChgChangeRequestUtil', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o, a, r, s) { + 'use strict'; + var l = Object.create(null); + + function c(e, t) { + return e > t ? 1 : e == t ? 0 : e < t ? -1 : void 0; + } + return ( + (l.getColumns = function () { + var t = [ + { + text: e.CHG_GOV_DataGrid_Column_Title, + dataIndex: 'tree', + editableFlag: !1, + alwaysVisibleFlag: !0, + allowUnsafeHTMLContent: !0, + pinned: 'left', + width: 150, + filterId: 'stringRegexp', + filterModel: '', + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + }, + { + text: e.CHG_GOV_DataGrid_Column_Name, + dataIndex: 'ia_name', + editableFlag: !1, + alwaysVisibleFlag: !1, + allowUnsafeHTMLContent: !0, + filterId: 'stringRegexp', + filterModel: '', + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + getCellGroupingKey: function (e) { + return e.nodeModel.options.grid.Name; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + }, + { + text: e.CHG_GOV_DataGrid_Column_Owner, + dataIndex: 'ownerFullName', + editableFlag: !1, + alwaysVisibleFlag: !1, + typeRepresentation: 'user', + filterId: 'set', + filterModel: [], + getCellValue: function (e) { + if (e.nodeModel) { + if (i.getGlobalVariable().isSwymInstalled) { + var t = + '/api/user/getpicture/login/' + + e.nodeModel.getAttributeValue('owner') + + '/format/normal'; + return { + icon: (t = i.getGlobalVariable().computeSwymUrl(t)), + label: e.nodeModel.getAttributeValue('ownerFullName'), + }; + } + return { + label: e.nodeModel.getAttributeValue('ownerFullName'), + }; + } + }, + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + getCellGroupingKey: function (e) { + return e.nodeModel.options.grid.ownerFullName; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + }, + { + text: e.CHG_GOV_DataGrid_Column_Maturity, + dataIndex: 'maturityNLS', + editableFlag: !1, + alwaysVisibleFlag: !1, + allowUnsafeHTMLContent: !0, + filterId: 'set', + filterModel: [], + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + getCellValue: function (e) { + if (e.nodeModel) { + return e.nodeModel.getAttributeValue('maturityNLS'); + } + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + }, + { + text: e.CHG_GOV_IA_Column_Refinement, + dataIndex: 'refinement', + editableFlag: !1, + visibleFlag: !0, + allowUnsafeHTMLContent: !0, + filterId: 'set', + filterModel: [], + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + getCellValue: function (e) { + if (e.nodeModel) { + return e.nodeModel.getAttributeValue('refinement'); + } + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + }, + { + text: e.CHG_GOV_IA_Column_Disp_From, + dataIndex: 'dispFrom', + editableFlag: !1, + visibleFlag: !0, + allowUnsafeHTMLContent: !0, + filterId: 'stringRegexp', + filterModel: '', + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + getCellValue: function (e) { + if (e.nodeModel) { + return e.nodeModel.getAttributeValue('dispFrom'); + } + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + }, + { + text: e.CHG_GOV_IA_Column_Disp_From_Title, + dataIndex: 'dispFromTitle', + editableFlag: !1, + visibleFlag: !1, + allowUnsafeHTMLContent: !0, + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + getCellValue: function (e) { + if (e.nodeModel) { + return e.nodeModel.getAttributeValue('dispFromTitle'); + } + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + }, + { + text: e.CHG_GOV_DataGrid_Column_ImpactBasis, + dataIndex: 'countImpactBasis', + editableFlag: !1, + typeRepresentation: 'integer', + filterId: 'number', + filterModel: '', + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + getCellValue: function (e) { + return ( + e.nodeModel.getAttributeValue('isLastNode'), + e.nodeModel.getAttributeValue('countImpactBasis') + ); + }, + setCellValue: function (e, t) {}, + }, + { + text: e.CHG_GOV_DataGrid_Column_ImpactedItem, + dataIndex: 'countImpactedItems', + editableFlag: !1, + typeRepresentation: 'integer', + filterId: 'number', + filterModel: '', + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + getCellValue: function (e) { + return ( + e.nodeModel.getAttributeValue('isLastNode'), + e.nodeModel.getAttributeValue('countImpactedItems') + ); + }, + }, + { + text: e.CHG_GOV_DataGrid_Column_Attachment, + dataIndex: 'countAttachment', + editableFlag: !1, + typeRepresentation: 'integer', + filterId: 'number', + filterModel: '', + getCellClassName: function (e) { + if (e.rowID >= 0 && 'ia_Total' == e.nodeModel.options.grid.id) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + getCellValue: function (e) { + return ( + e.nodeModel.getAttributeValue('isLastNode'), + e.nodeModel.getAttributeValue('countAttachment') + ); + }, + }, + ]; + i.getGlobalVariable().is3DSpace && + ((t[0].allowUnsafeHTMLContent = !0), + (t[0].getCellGroupingKey = function (e) { + return e.nodeModel.options.grid.title; + })); + let n = [ + { + dataIndex: 'attribute', + text: e.CHG_IA_COLUMN_GROUP_ATTRIBURES, + children: [ + { + text: e.CHG_GOV_DataGrid_Column_Benefit_Impact, + dataIndex: 'benefitImpact', + editableFlag: !1, + typeRepresentation: 'integer', + getCellClassName: function (e) { + if ( + e.rowID >= 0 && + 'ia_Total' == e.nodeModel.options.grid.id + ) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + getCellValue: function (e) { + if (e.nodeModel.getAttributeValue('isLastNode')) { + var t = e.nodeModel.getTreeDocument().getAllDescendants(); + t = t.filter( + (e) => + 'false' != e.options.grid.benefitImpactValid && + 'Cancelled' != e.options.grid.maturity, + ); + let n = 0, + o = 0, + a = 0; + for (var i = 0; i < t.length; i++) + isNaN(t[i].options.grid.benefitImpact) || + ((n += t[i].options.grid.benefitImpact), a++); + return (o = Math.round(n / a)); + } + return e.nodeModel.getAttributeValue('benefitImpact'); + }, + }, + { + text: e.CHG_GOV_DataGrid_Column_Cost_Impact, + dataIndex: 'costImpact', + editableFlag: !1, + typeRepresentation: 'integer', + getCellClassName: function (e) { + if ( + e.rowID >= 0 && + 'ia_Total' == e.nodeModel.options.grid.id + ) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + getCellValue: function (e) { + if (e.nodeModel.getAttributeValue('isLastNode')) { + var t = e.nodeModel.getTreeDocument().getAllDescendants(); + t = t.filter( + (e) => + 'false' != e.options.grid.costImpactValid && + 'Cancelled' != e.options.grid.maturity, + ); + let n = 0, + o = 0, + a = 0; + for (var i = 0; i < t.length; i++) + isNaN(t[i].options.grid.costImpact) || + ((n += t[i].options.grid.costImpact), a++); + return (o = Math.round(n / a)); + } + return e.nodeModel.getAttributeValue('costImpact'); + }, + }, + { + text: e.CHG_GOV_DataGrid_Column_Validation_Effort, + dataIndex: 'validationEffort', + editableFlag: !1, + typeRepresentation: 'string', + allowUnsafeHTMLContent: !0, + getCellClassName: function (e) { + if ( + e.rowID >= 0 && + 'ia_Total' == e.nodeModel.options.grid.id + ) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + getCellValue: function (e) { + if (e.nodeModel.getAttributeValue('isLastNode')) { + var t = e.nodeModel.getTreeDocument().getAllDescendants(); + t = t.filter( + (e) => + 'false' != e.options.grid.validationEffortValid && + 'Cancelled' != e.options.grid.maturity, + ); + var i = 0; + let o = 0, + a = 0; + for (var n = 0; n < t.length; n++) + isNaN(t[n].options.grid.validationEffort) || + ((i += parseFloat( + t[n].options.grid.validationEffort, + )), + a++); + return `∑ ${i} | x̄ ${(o = i / a)} `; + } + return e.nodeModel.getAttributeValue('validationEffort'); + }, + }, + { + text: e.CHG_GOV_DataGrid_Column_Risk_Impact, + dataIndex: 'riskImpact', + editableFlag: !1, + typeRepresentation: 'integer', + getCellClassName: function (e) { + if ( + e.rowID >= 0 && + 'ia_Total' == e.nodeModel.options.grid.id + ) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + getCellValue: function (e) { + if (e.nodeModel.getAttributeValue('isLastNode')) { + var t = e.nodeModel.getTreeDocument().getAllDescendants(); + t = t.filter( + (e) => + 'false' != e.options.grid.riskImpactValid && + 'Cancelled' != e.options.grid.maturity, + ); + let n = 0, + o = 0, + a = 0; + for (var i = 0; i < t.length; i++) + isNaN(t[i].options.grid.riskImpact) || + ((n += t[i].options.grid.riskImpact), a++); + return (o = Math.round(n / a)); + } + return e.nodeModel.getAttributeValue('riskImpact'); + }, + }, + { + text: e.CHG_GOV_DataGrid_Column_Implementation_Effort, + dataIndex: 'implementationEffort', + editableFlag: !1, + typeRepresentation: 'string', + allowUnsafeHTMLContent: !0, + getCellClassName: function (e) { + if ( + e.rowID >= 0 && + 'ia_Total' == e.nodeModel.options.grid.id + ) + return 'iaTotalAttribute'; + }, + compareFunction: function (e, t, i, n, o) { + return ( + 'ia_Total' != i.options.grid.id && + 'ia_Total' != n.options.grid.id && + c(e, t) + ); + }, + getCellValue: function (e) { + if (e.nodeModel.getAttributeValue('isLastNode')) { + var t = e.nodeModel.getTreeDocument().getAllDescendants(); + t = t.filter( + (e) => + 'false' != e.options.grid.implementationEffortValid && + 'Cancelled' != e.options.grid.maturity, + ); + var i = 0; + let o = 0, + a = 0; + for (var n = 0; n < t.length; n++) + isNaN(t[n].options.grid.implementationEffort) || + ((i += parseFloat( + t[n].options.grid.implementationEffort, + )), + a++); + return `∑ ${i} | x̄ ${(o = i / a)}`; + } + return e.nodeModel.getAttributeValue( + 'implementationEffort', + ); + }, + }, + ], + }, + ]; + return ( + 'true' == i.getGlobalVariable().ECMEnableDefaultChangeAnalysis && + (t = [...t, ...n]), + t + ); + }), + (l.changeView = function (i) { + if ('GridView' == i) + (this.currentView = 'Grid'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-list' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-list', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_GRID_VIEW, + }), + (n.options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (o = document.querySelector( + '.toolbar-impactAnalysis-grid-div .wux-ui-3ds-view-list', + )) && o.addClassName('currentView'), + (a = document.querySelector( + '.toolbar-impactAnalysis-grid-div .wux-ui-3ds-view-small-tile', + )) && a.removeClassName('currentView'), + (r = document.querySelector( + '.content-impactAnalysis-grid-div', + )) && + (r.removeClassName('hideView'), + r.removeClassName('nonVisible'), + r.addClassName('showView')), + (s = document.querySelector('.impactAnalysisTileView')) && + (s.removeClassName('showView'), s.addClassName('hideView')); + else if ('TileView' == i) { + var n, o, a, r, s; + (this.currentView = 'Tile'), + (n = t.toolbar.getNodeModelByID('view')) && + 'view-small-tile' != n.options.grid.semantics.icon.iconName && + n.updateOptions({ + grid: { + semantics: { + icon: { + iconName: 'view-small-tile', + }, + }, + }, + tooltip: e.CHG_TOOLTIP_TILE_VIEW, + }), + (n.options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (o = document.querySelector( + '.toolbar-impactAnalysis-grid-div .wux-ui-3ds-view-list', + )) && o.removeClassName('currentView'), + (a = document.querySelector( + '.toolbar-impactAnalysis-grid-div .wux-ui-3ds-view-small-tile', + )) && a.addClassName('currentView'), + (r = document.querySelector( + '.content-impactAnalysis-grid-div', + )) && (r.removeClassName('showView'), r.addClassName('hideView')), + (s = document.querySelector('.impactAnalysisTileView')) && + (s.removeClassName('hideView'), s.addClassName('showView')); + } + }), + (l.getRMBForChangeRequest = function (e, t) { + return new Promise((i, n) => { + let l = [], + c = { + objectId: e.id, + objectType: e.type, + displayName: e.name, + displayType: e.typeNLS, + }, + d = []; + d.push(e.id), + l.push(a.createPropertyPushItem(d)), + l.push(r.getRelationalExplorerMenu(void 0, t, d)), + l.push(s.getMaturityMenu(void 0, e.id)), + o.openWith(c).then((e) => { + l.splice(2, 0, e), i(l); + }); + }); + }), + (l.createCustomOwner = function (e, t) { + var o = '/api/user/getpicture/login/' + t + '/format/normal', + a = i.getGlobalVariable().computeSwymUrl(o), + r = new UWA.Element('div', { + class: 'members', + }), + s = new UWA.Element('div', { + class: 'assignee', + }), + l = ''; + if (i.getGlobalVariable().isSwymInstalled) + l = UWA.createElement('img', { + class: 'userIcon', + src: a, + }); + else { + var c = n.getAvatarDetails(t); + (l = UWA.createElement('div', { + html: c.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', c.avatarColor); + } + l.inject(s); + var d = UWA.createElement('span', { + class: 'userName', + html: t, + }); + return s.inject(r), d.inject(r), r.outerHTML; + }), + (l.filterView = function (e, i) { + if ('activeIA' == e) + (this.currentFilterView = 'activeIA'), + ((n = + t.toolbar.getNodeModelByID( + 'filter', + )).options.grid.data.menu[0].state = 'selected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (n.options.grid.data.menu[2].state = 'unselected'), + setTimeout(function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + ], function (e) { + e.ChgCRImpactAnalysisTreeModel.empty(); + e.refreshGrid({ + filterView: 'activeIA', + }); + }); + }, 100); + else if ('inactiveIA' == e) { + (this.currentFilterView = 'inactiveIA'), + ((n = + t.toolbar.getNodeModelByID( + 'filter', + )).options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'selected'), + (n.options.grid.data.menu[2].state = 'unselected'), + setTimeout(function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + ], function (e) { + e.ChgCRImpactAnalysisTreeModel.empty(); + e.refreshGrid({ + filterView: 'inactiveIA', + }); + }); + }, 100); + } else if ('rolledUpIA' == e) { + var n; + (this.currentFilterView = 'rolledUpIA'), + ((n = + t.toolbar.getNodeModelByID( + 'filter', + )).options.grid.data.menu[0].state = 'unselected'), + (n.options.grid.data.menu[1].state = 'unselected'), + (n.options.grid.data.menu[2].state = 'selected'), + setTimeout(function () { + require([ + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactAnalysis/ChgCRImpactAnalysisDataGridLayout', + ], function (e) { + e.ChgCRImpactAnalysisTreeModel.empty(); + e.refreshGrid({ + filterView: 'rollecdUpIA', + }); + }); + }, 100); + } + }), + (l.filterInactiveIAView = function () { + that.filterView('inactiveIA'); + }), + l + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/proposedChanges/ChgCAProposedChangesUtil', + [ + 'UWA/Core', + 'DS/ENOChgGovernanceUX/scripts/util/changeAction/ChgChangeActionUtil', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + 'DS/ENOChgGovernanceUX/scripts/util/DocumentUtils', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + ], + function (e, t, i, n, o, a, r, s) { + 'use strict'; + return { + getColumns: function () { + return [ + i.getColumnDefinition({ + dataIndex: 'titleTree', + }), + i.getColumnDefinition({ + dataIndex: 'typeNLS', + }), + i.getColumnDefinition({ + dataIndex: 'name', + }), + i.getColumnDefinition({ + dataIndex: 'revision', + }), + i.getColumnDefinition({ + dataIndex: 'maturityNLS', + }), + i.getColumnDefinition({ + dataIndex: 'collabspaceNLS', + visibleFlag: !0, + }), + i.getColumnDefinition({ + dataIndex: 'organizationNLS', + }), + { + dataIndex: 'description', + text: s.CHG_GOV_DataGrid_Column_Description, + editableFlag: !1, + visibleFlag: !1, + alwaysVisibleFlag: !1, + }, + { + dataIndex: 'change', + text: s.CHG_GOV_Proposed_Changes, + editableFlag: !1, + visibleFlag: !0, + alwaysVisibleFlag: !1, + typeRepresentation: 'url', + width: 75, + filterId: 'set', + filterModel: [], + getCellValue: function (e) { + if (e.nodeModel) + return { + icon: e.nodeModel.getAttributeValue('activityIcon'), + }; + }, + getCellTooltip: function (e) { + if (e.nodeModel) + return { + shortHelp: e.nodeModel.getAttributeValue('change'), + }; + }, + }, + { + dataIndex: 'change_details', + text: s.CHG_GOV_Realized_Change_Details, + editableFlag: !1, + visibleFlag: !0, + alwaysVisibleFlag: !1, + filterId: 'stringRegexp', + filterModel: '', + }, + i.getColumnDefinition({ + dataIndex: 'reasonForChange', + }), + { + dataIndex: 'proposedStatus', + text: s.CHG_GOV_Proposed_ProposalStatus, + editableFlag: !0, + visibleFlag: !0, + alwaysVisibleFlag: !1, + editionPolicy: 'EditionOnOver', + typeRepresentation: 'proposedStatus', + massUpdateAllowedFlag: !0, + filterId: 'set', + filterModel: [], + }, + ]; + }, + getNativeContextualMenu: async function (e, t) { + let i = []; + return ( + i.push(a.getExploreMenu(null, t)), + i.push(a.getExploreWithMenu(null, t)), + i.push(a.getOpenMenu(null, t)), + i.push(a.getOpenWithNativeMenu(null, t)), + this.getCommonMenu(e, t).forEach((e) => { + i.push(e); + }), + i + ); + }, + getDashboardContextualMenu: async function (e, t) { + let i = [], + n = await a.openWith(e); + return ( + i.push(n), + (await this.getCommonMenu(e, t)).forEach((e) => { + i.push(e); + }), + i + ); + }, + getCommonMenu: async function (e, t) { + var i = []; + let n = { + type: 'PushItem', + title: s.CHG_GOV_Proposed_Edit, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-pencil', + }, + action: { + callback: function (e) { + alert('ignore'); + }, + }, + }; + i.push(n); + let o = { + type: 'PushItem', + title: s.CHG_GOV_Proposed_ChangeAssessment, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-component', + }, + action: { + callback: function (e) { + alert('compare'); + }, + }, + }; + i.push(o); + let a = { + type: 'PushItem', + title: s.CHG_GOV_Proposed_ProposalStatus, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-progress-0-clock', + }, + submenu: [ + { + type: 'PushItem', + title: s.CHG_GOV_Proposed_ProposalStatus_NotStarted, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-progress-0', + }, + action: { + callback: function (e) { + alert('move 1'); + }, + }, + }, + { + type: 'PushItem', + title: s.CHG_GOV_Proposed_ProposalStatus_Started, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-progress-1', + }, + action: { + callback: function (e) { + alert('move 2'); + }, + }, + }, + { + type: 'PushItem', + title: s.CHG_GOV_Proposed_ProposalStatus_Partial, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-progress-2', + }, + action: { + callback: function (e) { + alert('move 2'); + }, + }, + }, + { + type: 'PushItem', + title: s.CHG_GOV_Proposed_ProposalStatus_Complete, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-progress-3', + }, + action: { + callback: function (e) { + alert('move 2'); + }, + }, + }, + ], + }; + i.push(a); + let l = { + type: 'PushItem', + title: s.CHG_GOV_Proposed_Resolution, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-target-add', + }, + submenu: [ + { + type: 'PushItem', + title: s.CHG_GOV_Proposed_ResolutionVersion, + fonticon: { + family: 1, + content: + 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-flow-branch-list', + }, + action: { + callback: function (e) { + alert('move 1'); + }, + }, + }, + { + type: 'PushItem', + title: s.CHG_GOV_Proposed_ResolutionSearch, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-search', + }, + action: { + callback: function (e) { + alert('move 2'); + }, + }, + }, + ], + }; + i.push(l); + let c = { + type: 'PushItem', + title: s.CHG_GOV_Proposed_ChangeImpact, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-change', + }, + action: { + callback: function (e) { + alert('compare'); + }, + }, + }; + i.push(c); + let d = { + type: 'PushItem', + title: s.CHG_GOV_Download, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-download', + }, + action: { + callback: function (t) { + r.download([e.objectId]); + }, + }, + }, + u = { + type: 'PushItem', + title: s.CHG_GOV_Preview, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-eye', + }, + action: { + callback: function (t) { + r.preview([e.objectId]); + }, + }, + }, + g = await r.getDocuments([e.objectId]); + g && + g[0] && + g[0].dataelements && + 'TRUE' === g[0].dataelements.isDocumentType && + (i.push(d), i.push(u)); + let p = { + type: 'PushItem', + title: s.CHG_GOV_Header_Menu_Information, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-info', + }, + action: { + callback: function (e) { + alert('info'); + }, + }, + }; + return i.push(p), i; + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderHomeUtil', + [ + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/ENOChgGovernanceUX/scripts/config/ChgGovAppGlobalConfig', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovApplicationPreferencesManager', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovPreferenceConstant', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'DS/UIKIT/Mask', + 'require', + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u) { + 'use strict'; + var g = Object.create(null); + return ( + (g.getTabs = function (e, t) { + this._pathChangeOrdersDetails = [ + l._KEY, + l._VIEWS_PREFERENCES, + l._CHANGE_ORDERS_DETAILS, + ]; + var i = s.getTab(this._pathChangeOrdersDetails); + let n = 'ChangeOrchestration'; + return ( + (n = '' == i ? 'ChangeOrchestration' : i), + console.log(i), + [ + this.getChangeOrchestrationTab(e, t, n), + this.getMembersTab(e, t, n), + this.getApprovalsTab(e, t, n), + this.getCusTab(e, t, n), + ] + ); + }), + (g.createHeaderFieldsJSON = function (t) { + return new Promise(function (i, n) { + let o = { + 'ds6w:project': [t.model.collabspace], + 'ds6w:organizationResponsible': [t.model.organization], + }; + c.getNLSValuesPromise(o).then(function (n) { + let o = n['ds6w:organizationResponsible'][t.model.organization], + a = n['ds6w:project'][t.model.collabspace]; + var r = { + id: t.model.id, + name: t.model.name, + revision: t.model.revision, + type: t.model.type, + title: t.model.title, + thumbnail: t.model.thumbnail, + iconURL: t.model.iconURL, + minified: !1, + onHold: t.model.onHold, + isKindOfType: t.model.isKindOfType, + attributes: { + layout: [ + ['maturity', 'owner', 'collabSpace'], + ['Applicability', 'Dependency', 'Attachments'], + ['orgnaization', 'RelatedScope'], + ], + mapping: { + owner: { + fieldNLS: e.CHG_GOV_DataGrid_Column_Owner, + valueActual: t.model.owner, + valueDisplay: t.model.ownerFullName, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + accessBit: 'TransferOwnership', + }, + collabSpace: { + fieldNLS: e.CHG_GOV_DataGrid_Column_CollabSpace, + valueActual: t.model.collabspace, + valueDisplay: a, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + accessBit: 'TransferOwnership', + }, + maturity: { + fieldNLS: e.CHG_GOV_DataGrid_Column_Maturity, + valueActual: t.model.maturity, + valueDisplay: t.model.maturityNLS, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + }, + orgnaization: { + fieldNLS: e.CHG_GOV_DataGrid_Column_Organization, + valueActual: t.model.organization, + valueDisplay: o, + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + accessBit: 'TransferOwnership', + }, + Applicability: { + fieldNLS: e.CHG_GOV_Header_Applicability, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !0, + displayWhenMinified: !0, + editable: !0, + }, + Dependency: { + fieldNLS: e.CHG_GOV_Header_Dependency, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !0, + displayWhenMinified: !0, + editable: !0, + }, + Attachments: { + fieldNLS: e.CHG_GOV_Header_Attachments, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !0, + displayWhenMinified: !0, + editable: !0, + }, + RelatedScope: { + fieldNLS: e.CHG_GOV_Header_RelatedScope, + valueActual: 'No', + valueDisplay: 'No', + showLoader: !1, + displayWhenMinified: !0, + editable: !0, + }, + }, + }, + freeSpaces: [ + { + type: 'text', + data: t.model.description, + }, + ], + menuItems: [ + { + id: 'chgHold', + text: e.CHG_GOV_Header_Menu_Hold, + fonticon: 'fonticon fonticon-pause', + accessBit: 'Hold', + }, + { + id: 'chgResume', + text: e.CHG_GOV_Header_Menu_Resume, + fonticon: 'fonticon fonticon-resume', + accessBit: 'Resume', + }, + { + id: 'chgCancel', + text: e.CHG_GOV_Header_Menu_Cancel, + fonticon: 'fonticon fonticon-block', + accessBit: 'Cancel', + }, + ], + }; + i(r); + }); + }); + }), + (g.displayObjectInfoInsideIDcard = function (e, t = !1) { + var a = this; + n.getChangeOrderInfo(e).then( + function (e) { + var n = o.processedChangeOrderDetail(e); + if (t) + try { + let t = u('DS/ENOChgProbes/scripts/ChgCloudProbeUtils'); + var s = e.data[0].dataelements; + (s.type = e.data[0].type), + (s.isKindOfType = 'Change Order'), + t.cloudProbeUtils.sendChgObjectCreateTrackerEvent({ + createData: s, + }); + } catch (e) { + console.log(e); + } + var l = { + model: n[0], + }; + a.createHeaderFieldsJSON(l).then(function (e) { + var t = { + model: e, + }; + i.navigate( + r.ROUTE_CO_DETAILS, + { + id: e.id, + name: e.name, + title: e.title, + nodeModel: t, + mode: 'outsideCall', + }, + { + reload: !0, + }, + ); + }); + }, + function (e) { + var t = document.getElementsByClassName('moduleWrapper')[0]; + return t && d.isMasked(t) && d.unmask(t), Promise.reject(e); + }, + ); + }), + (g.getChangeOrderModelForIDCard = function (e) { + return new Promise(function (t, i) { + n.getChangeOrderInfo(e).then(function (e) { + var i = { + model: o.processedChangeOrderDetail(e)[0], + }; + t(i); + }); + }); + }), + (g.getChangeOrchestrationTab = (t, i, n) => { + let o = !1; + return ( + 'ChangeOrchestration' == n && (o = !0), + (i.isSelected = o), + { + label: e.CHG_GOV_Home_Tab_ChangeOrchestration, + isSelected: o, + index: 0, + value: 'coOrchestration', + content: t.createOrchestrationTab(i), + icon: { + iconName: 'flow-tree-ordered', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (g.getMembersTab = (t, i, n) => { + let o = !1; + return ( + 'Members' == n && (o = !0), + (i.isSelected = o), + { + label: e.CHG_GOV_Home_Tab_Members, + isSelected: o, + value: 'coMembers', + index: 1, + content: t.createMembersTab(i), + icon: { + iconName: 'users', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + (g.getApprovalsTab = (t, i, n) => { + let o = !1; + return ( + 'Approvals' == n && (o = !0), + (i.isSelected = o), + { + label: e.CHG_GOV_Home_Tab_Approvals, + isSelected: o, + value: 'coApprovals', + index: 2, + content: t.createApprovalsTab(i, n), + icon: { + iconName: 'status-ok', + fontIconFamily: WUXManagedFontIcons.Font3DS, + }, + } + ); + }), + g + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/ChgCreateChangeOrder', + [ + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'DS/UIKIT/Mask', + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderHomeUtil', + 'DS/ENOChgServices/scripts/components/ChgCommonCreateDialog', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENONewWidget/ENONewLauncher', + 'require', + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ], + function (e, t, i, n, o, a, r, s, l, c) { + var d = { + onCompleteCallback: function (e) { + let t = e.data[0].id, + a = {}; + (a.context = t), + (a.type = 'ChangeOrder'), + c( + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ).launchPropertyPanelContext(a), + s.getGlobalVariable().existingCOIds.push(t), + o.displayObjectInfoInsideIDcard(t), + n.publish('load-dependency' + widget.id, 'pid:' + t); + var r = document.getElementById('outer-co-div'); + i.unmask(r); + }, + onFailureCallback: function () { + var e = document.getElementById('outer-co-div'); + i.unmask(e), console.log('ERROR : FAILED CREATE CO'); + }, + createChangeOrder: function (e) { + let t = { + context: { + service: '3DSpace', + tenant: s.getGlobalVariable().tenant, + header: { + SecurityContext: s.getGlobalVariable().getSecurityContext(), + }, + }, + labelTopBar: r.CHG_NEW_CHANGE_ORDER_FORM, + type: 'Change Order', + silentMode: !1, + overlay: !0, + options: { + typeName: 'Change Order', + preferedType: 'Change Order', + select: [], + }, + events: { + onSuccess: function (t) { + e && (e.isClickProcessing = !1); + var n = document.getElementsByClassName('moduleWrapper')[0]; + (null == n && 'undefined' == n) || i.mask(n); + let o = t.result[0].identifier, + a = {}; + (a.context = o), (a.type = 'ChangeOrder'); + let r = c( + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ), + s = c( + 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderHomeUtil', + ); + r.launchPropertyPanelContext(a), + s.displayObjectInfoInsideIDcard(o, !0); + }, + onFailure: function (t) { + console.log('onFailure...............' + t), + e && (e.isClickProcessing = !1); + }, + onCancel: function (t) { + e && (e.isClickProcessing = !1); + }, + }, + }; + var n = { + commandInfo: { + type: 'Change Order', + facet: 'Start a New Activity', + action: 'CO>Start a New Activity>New Change Order', + }, + }; + c( + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + ).cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: n, + }), + new l().CreateNew(t); + }, + processChangeOrder: function (e) { + var i = e.titleText, + n = { + data: [ + { + dataelements: { + description: e.DescText, + policy: 'Fast track Change', + title: i, + }, + }, + ], + }; + t.createChangeOrder( + JSON.stringify(n), + d.onCompleteCallback, + d.onFailureCallback, + ); + }, + createBlankChangeOrder: function (e, n, o) { + var a = o.value; + if ( + (void 0 !== window.__karma__ && (a = 'ODT_CA'), + null != a && '' != a.trim()) + ) { + var r = document.getElementById('outer-co-div'); + (null == r && 'undefined' == r) || i.mask(r); + var s = { + data: [ + { + dataelements: { + description: a, + policy: 'Fast track Change', + title: a, + }, + }, + ], + }; + t.createChangeOrder( + JSON.stringify(s), + d.onCompleteCallback, + d.onFailureCallback, + ); + } + o.value = ''; + }, + }; + return d; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/model/changeRequest/facets/impactedItem/ChgCRImpacedItemDataGridModel', + [ + 'UWA/Class/Model', + 'DS/TreeModel/TreeDocument', + 'DS/TreeModel/TreeNodeModel', + 'DS/TreeModel/DataModelSet', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgServices/scripts/services/ChgMembersServices', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/util/ChgCRImpactedItemGridColsUtil', + 'DS/ENOChgServices/scripts/services/ChgErrors', + 'DS/UIKIT/Mask', + 'DS/TreeModel/BaseFilter', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u) { + 'use strict'; + var g = u.inherit({ + publishedProperties: {}, + isDataFiltered: function (e) { + var t = e.getAttributeValue('id'); + return ( + !(!this.filterModel || !this.filterModel.allowedIDs) && + -1 === this.filterModel.allowedIDs.indexOf(t) + ); + }, + isEmpty: function () { + return void 0 === this.filterModel.allowedIDs; + }, + }); + let p = e.extend({ + init: function (e, t) { + (this.parentCRId = e), + Array.isArray(t) + ? (this.impactAnalysisIds = t) + : (this.impactAnalysisId = t); + }, + setTreeDocument: function (e) { + this.treeDocument = e; + }, + getTreeDocument: function () { + return this.treeDocument; + }, + createTreeDocument: function () { + let e = new t({ + id: 'IA_ImpactItem', + useAsyncPreExpand: !0, + }); + return ( + (e.isChildOf = function (e) { + let t = e.getChildren(); + for (let e = 0; e < t.length; e++) + if (this.options.grid.id == t[e].options.grid.id) return !0; + return !1; + }), + this.setTreeDocument(e), + e + ); + }, + registerCustomFilter: function () { + this.treeDocument.getFilterManager().registerFilter('stringRole', g); + }, + loadImpactedItem: function (e, t) { + e.prepareUpdate(); + let i = this.createTreeDocumentNodeModel(t); + e.addRoot(i), e.pushUpdate(); + }, + createTreeDocumentNodeModel: function (e) { + let t = []; + for (let i = 0; i < e.length; i++) { + e[i].impactedItem && 'IMPACTED' != e[i].impactedItem + ? (e[i].impact = 'notImpactedKey') + : (e[i].impact = 'impactedKey'), + e[i].reasonForChange || (e[i].reasonForChange = ''); + let n = this.createTreeNode(e[i]); + t.push(n); + } + return t; + }, + createTreeNode: function (e) { + let t = this.createCustomOwnerField(e); + e.chgObjOwner = t; + let n = e.name + ' | ' + e.ownerFullName, + a = e.currentNLS; + var r, + s = this.getCustomTooltip(e); + return ( + (r = o.getGlobalVariable().is3DSpace + ? '' + + UWA.String.escapeHTML(e.title) + + '' + : e.title), + new i({ + label: r, + subLabel: n, + description: a, + grid: e, + icons: [e.icon], + thumbnail: e.previewicon, + contextualMenu: ['dummy placeholder'], + useAsyncPreExpand: !0, + customTooltip: s, + }) + ); + }, + createCustomOwnerField: function (e) { + let t = '/api/user/getpicture/login/' + e.owner + '/format/normal', + i = o.getGlobalVariable().computeSwymUrl(t), + n = new UWA.Element('div', { + class: 'members', + }), + a = new UWA.Element('div', { + class: 'assignee', + }), + s = ''; + if (o.getGlobalVariable().isSwymInstalled) + s = UWA.createElement('img', { + class: 'userIcon', + src: i, + }); + else { + let t = r.getAvatarDetails(e.ownerFullName); + (s = UWA.createElement('div', { + html: t.avatarStr, + class: 'avatarIcon', + })).style.setProperty('background', t.avatarColor); + } + s.inject(a); + let l = UWA.createElement('span', { + class: 'userName', + html: e.ownerFullName, + }); + return a.inject(n), l.inject(n), n.outerHTML; + }, + getCustomTooltip: function (e) { + return ( + a.CHG_GOV_DataGrid_Column_Title + + ': ' + + e.title + + '\n' + + a.CHG_GOV_DataGrid_Column_Name + + ': ' + + e.name + + '\n' + + a.CHG_GOV_DataGrid_Column_Owner + + ': ' + + e.ownerFullName + + '\n' + + a.CHG_GOV_DataGrid_Column_Maturity + + ': ' + + e.currentNLS + ); + }, + addExistingChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.impactAnalysisId, + a = t.parentCRId, + r = document.getElementById('outer-impactedItem-grid-div'); + 'undefined' != r && null != r && d.mask(r), + s.updateExistingImpactItem(a, o, e).then( + function (e) { + let n = []; + e && (n = e.data); + let o = []; + for (let e of n) + (e.reasonForChange = ''), + (e.impactedItem = 'IMPACTED'), + o.push(e); + t.addNodesInLayoutModel(t.treeDocument, o), i(e), d.unmask(r); + }, + function (e) { + d.unmask(r), n(e); + }, + ); + }); + }, + addNodesInLayoutModel: function (e, t) { + 0 == e.getChildren().length && + e._modelEvents.publish({ + event: 'treeNotEmpty', + }); + let i = p.prototype.createTreeDocumentNodeModel(t); + if ((e.prepareUpdate(), 0 == e.getRoots().length)) e.addRoot(i); + else for (let t = i.length - 1; t >= 0; t--) e.addRoot(i[t], 0); + e.pushUpdate(); + let n = []; + i.forEach((e) => + n.push({ + id: e.options.grid.id, + }), + ), + this.addCAInfoForImpactedItems(n); + }, + removeChildren: function (e) { + let t = this; + return new Promise(function (i, n) { + let o = t.impactAnalysisId, + r = t.parentCRId, + l = t.treeDocument.getSelectedNodes(); + l.length + ? s.updateExistingImpactItem(r, o, e).then( + function (e) { + for (let e = 0; e < l.length; e++) + t.treeDocument.removeRoot(l[e]); + 0 == t.treeDocument.getChildren().length && + t.treeDocument._modelEvents.publish({ + event: 'treeEmpty', + }), + i(l), + c.success(a.CHG_GOV_ImpactItem_Remove_Success); + }, + function (e) { + d.unmask(outerDiv), n(); + }, + ) + : c.error(a.CHG_GOV_ChangeOrchestration_Remove_No_Objects); + }); + }, + addCAInfoForImpactedItems: function (e) { + var t = this; + s.getCAInfoImpactedItems(e).then( + (e) => { + t.mergeProposedCA(e.data); + }, + (e) => {}, + ); + }, + mergeProposedCA: function (e) { + let t = this.getTreeDocument().getAllDescendants(); + for (let i = 0; i < e.length; i++) + for (let n = 0; n < t.length; n++) + if (e[i].id == t[n].options.grid.id) { + let o = l.getProposedColumnBasedOnData( + e[i].proposedChangeActions, + ); + t[n].updateOptions({ + grid: { + proposedChangeActionsData: e[i].proposedChangeActions, + proposedChangeAction: o, + }, + }); + } + }, + filterView: function (e, t) { + let i = t, + n = e.matchingIDs; + i.setFilterModel({ + role: { + filterId: 'stringRole', + filterModel: { + allowedIDs: n, + }, + }, + }); + }, + enableColorizeView: function (e, t) { + let i = t.getAllDescendants(); + var n, o; + (n = e), + (o = function (e, t) { + i.map((i) => { + if (i.options.grid.id === t) { + var n = { + grid: { + biColor: e, + }, + color: e, + }; + i.updateOptions(n); + } + }); + }), + UWA.is(n, 'array') && + n.forEach(function (e) { + var t = e.color, + i = e.id; + o(t, i); + }); + }, + disableColorizeView: function (e, t) { + t.getAllDescendants().map((e) => { + e.updateOptions({ + grid: { + biColor: 'rgba(0, 0, 0, 0)', + }, + color: 'rgba(0, 0, 0, 0)', + }); + }); + }, + }); + return p; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderDataGridView', + [ + 'UWA/Class/View', + 'DS/CoreEvents/ModelEvents', + 'DS/Core/PointerEvents', + 'DS/DataGridView/DataGridView', + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'DS/CollectionView/CollectionViewStatusBar', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/util/ChgChangeOrderFeaturesUtil', + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTweakerExpandInput', + 'DS/ENOChgGovernanceUX/scripts/view/ChgCreateChangeOrder', + 'DS/CollectionView/ResponsiveTilesCollectionView', + 'DS/ENOChgServices/scripts/services/ChgCustomAttributeService', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'require', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p, h) { + 'use strict'; + return e.extend({ + init: function (e) { + this._parent(e), + (this._modelEvents = null), + 'undefined' != e && 'undefined' != e.modelEvents + ? (this._modelEvents = e.modelEvents) + : (this._modelEvents = new t()), + (this.coDatagridView = ''); + }, + render: function () { + if ( + 'undefined' != this.options.target && + null != this.options.target + ) { + var e = this.processColumns(), + t = this, + h = { + treeDocument: this.options.treeDocument, + columns: e, + cellSelection: 'none', + rowSelection: 'multiple', + cellDragEnabledFlag: !0, + showNodeKPIColorFlag: !0, + placeholder: '', + identifier: 'chgCOSummaryGrid', + defaultColumnDef: { + width: 'auto', + resizableFlag: !0, + sortableFlag: !0, + }, + onContextualEvent: function (e) { + var i = []; + if (e && e.collectionView && e.cellInfos) { + if (e.cellInfos.rowID > -1) + return l.showRMBMenuOnGrid(t, e).then(function (e) { + return e; + }); + e.collectionView.columns.length, e.cellInfos.columnID; + i = e.collectionView.buildDefaultContextualMenu(e, { + pin: !0, + firstColumnsVisibility: !0, + columnsManagement: !0, + sizeColumnToFit: !1, + }); + } + return i; + }, + filterBaseCAId: 'All My Active Changes', + onDragStartRowHeader: function (e, t) { + a.readyDragContent(e, t); + }, + onDragStartCell: function (e, t) { + a.readyDragContent(e, t); + }, + }; + (h = UWA.merge(h, this.options)), + (this.coDatagrid = new n(h)), + (this.coDatagrid.cellSelection = 'none'), + (this.coDatagrid.getCustomViewsManager().onCustomViewsSave = + function (e, t) { + e.map((e) => { + if (e.identifier == t) { + let t = e.columnsVisibleFlag; + if (null != t && null != t) { + let e = Object.keys(t); + p.getGlobalVariable().customeViewCOList = e; + } + } + }); + }), + (this.coDatagrid.onDelayedModelDataRequest = function (e) { + let i = t.coDatagrid.getCustomViewsManager().getCustomViews(), + n = + t.coDatagrid.getCustomViewsManager() + ._currentCustomViewIdentifier; + i.map((e) => { + if (e.identifier == n) { + let t = e.columnsVisibleFlag; + if (null != t && null != t) { + let e = Object.keys(t); + p.getGlobalVariable().customeViewCOList = e; + } + } + }); + var o = e.collectionView; + let a = [], + r = [], + s = [ + 'applicabilityNLS', + 'organizationNLS', + 'collabspaceNLS', + 'co_Coordinator', + 'co_Owner', + 'sev', + 'maturityNLS', + 'co_name', + 'modificationDate', + 'creationDate', + ], + l = p.getGlobalVariable().customeViewCOList, + c = []; + if ( + (l.forEach(function (e) { + s.includes(e) || c.push(e); + }), + -1 != e.endNodeIndex && -1 != e.startNodeIndex) + ) { + for (let t = e.startNodeIndex; t <= e.endNodeIndex; t++) { + a.push(o.model[t].options.grid.id), r.push(o.model[t]); + for (let e = 0; e < c.length; e++) + o.model[t].setAttribute(c[e], void 0); + } + var d = a.filter((e) => !!e); + d.length > 0 && g.updateAsynAttributeColumn(c, d, r); + } + }), + (this.coTilesView = new u({ + model: this.options.treeDocument, + height: 'inherit', + displayedOptionalCellProperties: [ + 'contextualMenu', + 'description', + 'propertiesList', + 'activeFlag', + 'statusbarIcons', + ], + allowUnsafeHTMLContent: !1, + useDragAndDrop: !0, + grid: { + selectionBehavior: { + toggle: !0, + unselectAllOnEmptyArea: !0, + canMultiSelect: !0, + canInteractiveMultiselectWithCheckboxClick: !0, + }, + }, + onDragStartCell: function (e, t) { + a.readyDragContent(e, t); + }, + onDragEnterBlankDefault: function (e) {}, + onDragEnterBlank: function (e) {}, + })); + var m = { + callback: function (e) { + if (e && e.cellInfos && e.cellInfos.cellModel) + return l.showRMBMenuOnGrid(t, e).then(function (e) { + return e; + }); + }, + }; + this.coTilesView.onContextualEvent = m; + var C = { + viewdropdown: { + stdTemplate: 'comboSelector', + semantics: { + possibleValues: [ + { + value: s.CHG_VIEW_LIST, + icon: { + iconName: 'view-list', + fontIconFamily: 1, + }, + }, + { + value: s.CHG_VIEW_TILE, + icon: { + iconName: 'view-small-tile', + fontIconFamily: 1, + }, + }, + ], + }, + }, + }, + v = { + expandInput: { + stdTemplate: 'expandInputtemplate', + }, + }, + f = { + expandInputtemplate: { + path: 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTweakerExpandInput', + options: { + displayStyle: 'TextBox', + }, + }, + }; + try { + new c(); + } catch (e) { + console.log(e); + } + this.coDatagrid + .getTypeRepresentationFactory() + .registerTypeTemplates(f), + this.coDatagrid + .getTypeRepresentationFactory() + .registerTypeRepresentations(v), + this.coDatagrid + .getTypeRepresentationFactory() + .registerTypeRepresentations(C), + this.coDatagrid + .getTypeRepresentationFactory() + .registerTypeRepresentations({ + sortingdropdown: { + stdTemplate: 'functionMenuIcon', + semantics: { + label: 'action', + icon: 'sorting', + }, + }, + }), + (o.toolbar = this.coDatagrid.setToolbar( + o.writetoolbarDefination(), + )), + (this.toolbar = o.toolbar), + this.toolbar.typeRepresentationFactory.registerTypeTemplates(f), + this.toolbar.typeRepresentationFactory.registerTypeRepresentations( + v, + ), + (t = this).toolbar.addEventListener('onReady', function (e) { + var i = t.toolbar.getNodeModelByID('addNewBlankCAId'); + i && + i._associatedView.registerkeyDownCallback( + d.createBlankChangeOrder, + ); + }), + this.coDatagrid.addEventListener('allCellsRendered', function () { + t.coDatagrid.buildStatusBar([ + { + type: r.STATUS.CUSTOM, + id: 'totalItems', + dataElements: { + typeRepresentation: 'string', + value: + s.CHG_GOV_StatusBar_TotalItems + + t.coDatagrid.getTreeDocument().getAllDescendants() + .length, + }, + }, + { + type: r.STATUS.CUSTOM, + id: 'selectedGridCount', + dataElements: { + typeRepresentation: 'string', + value: + s.CHG_GOV_StatusBar_SelectedItems + + t.coDatagrid.getTreeDocument().getSelectedNodes() + .length, + }, + }, + ]), + t.coTilesView.buildStatusBar([ + { + type: r.STATUS.CUSTOM, + id: 'totalItems', + dataElements: { + typeRepresentation: 'string', + value: + s.CHG_GOV_StatusBar_TotalItems + + t.coTilesView.getTreeDocument().getAllDescendants() + .length, + }, + }, + { + type: r.STATUS.CUSTOM, + id: 'selectedTileCount', + dataElements: { + typeRepresentation: 'string', + value: + s.CHG_GOV_StatusBar_SelectedItems + + t.coTilesView.getTreeDocument().getSelectedNodes() + .length, + }, + }, + ]); + }), + t.coDatagrid.addEventListener(i.POINTERHIT, function (e, i) { + t.onItemClick(e, i); + }), + t.coDatagrid + .getTreeDocument() + .getXSO() + .onAdd(function (e) { + t.coDatagrid.elements.statusBar + .getNodeModelByID('selectedGridCount') + .updateOptions({ + grid: { + data: + s.CHG_GOV_StatusBar_SelectedItems + + t.coDatagrid.getTreeDocument().getSelectedNodes() + .length, + }, + }), + t.coTilesView.elements.statusBar + .getNodeModelByID('selectedTileCount') + .updateOptions({ + grid: { + data: + s.CHG_GOV_StatusBar_SelectedItems + + t.coDatagrid.getTreeDocument().getSelectedNodes() + .length, + }, + }), + t._modelEvents.publish({ + event: 'co-DataGrid-on-click', + data: { + model: e.options.grid, + context: e, + }, + context: e, + }); + }), + t.coDatagrid + .getTreeDocument() + .getXSO() + .onRemove(function (e) { + t.coDatagrid.elements.statusBar + .getNodeModelByID('selectedGridCount') + .updateOptions({ + grid: { + data: + s.CHG_GOV_StatusBar_SelectedItems + + e.getTreeDocument().getSelectedNodes().length, + }, + }), + t.coTilesView.elements.statusBar + .getNodeModelByID('selectedTileCount') + .updateOptions({ + grid: { + data: + s.CHG_GOV_StatusBar_SelectedItems + + e.getTreeDocument().getSelectedNodes().length, + }, + }), + 0 == e.getTreeDocument().getSelectedNodes().length + ? t._modelEvents.publish({ + event: 'co-DataGrid-on-unselect-all', + data: { + model: e.options.grid, + context: e, + type: e.options.grid.isKindOfType, + load: !1, + }, + context: e, + }) + : t._modelEvents.publish({ + event: 'co-DataGrid-on-unselect', + data: { + model: e, + context: e, + }, + context: e, + }); + }), + t.coTilesView.addEventListener(i.POINTERHIT, function (e, i) { + t.onItemClick(e, i); + }), + (this.onItemClick = function (e, i) { + i && + i.nodeModel && + i.nodeModel.options.grid && + 2 == e.multipleHitCount && + (i.nodeModel.select(!0), + t._modelEvents.publish({ + event: 'co-DataGrid-on-dblclick', + data: { + model: i.nodeModel.options.grid, + }, + context: i.nodeModel, + })); + }), + (this.coDatagridView = UWA.createElement('div', { + id: 'outer-co-div', + styles: { + width: '100%', + height: '100%', + display: 'inline-block', + }, + class: 'outer-co-div', + })); + var b = UWA.createElement('div', { + styles: { + width: '100%', + }, + class: 'toolbar-co-div', + }); + this.toolbar.inject(b); + var w = UWA.createElement('div', { + class: 'content-co-div cogridView showView', + }), + D = UWA.createElement('div', { + class: 'cotileView hideView', + }), + S = UWA.createElement('div', { + class: 'hideView', + id: 'emptyTileViewDiv', + }); + UWA.createElement('div', { + html: s.CHG_GOV_DataGrid_PlaceHolder, + }).inject(S), + this.coDatagrid.inject(w), + this.coTilesView.inject(D), + S.inject(D), + this.coDatagridView.addContent(b), + this.coDatagridView.addContent(w), + this.coDatagridView.addContent(D), + this.coDatagridView.inject(this.options.target), + this.coDatagridView.setStyle( + 'width', + this.options.target.offsetWidth, + ), + this._modelEvents.subscribe( + { + event: 'co-DataGrid-on-search', + }, + function (e) { + var i = e.query; + i && + t.coDatagrid + .getTreeDocument() + .getAllDescendants() + .forEach(function (e) { + !e.isVisible() || + e.options.grid.title.contains(i) || + e.options.grid.name.contains(i) + ? e.isVisible() || + (!e.options.grid.title.contains(i) && + !e.options.grid.name.contains(i)) || + e.show() + : e.hide(); + }); + }, + ), + this._modelEvents.subscribe( + { + event: 'co-DataGrid-on-reset-search', + }, + function (e) { + t.coDatagrid + .getTreeDocument() + .getAllDescendants() + .forEach(function (e) { + e.isVisible() || e.show(); + }); + }, + ); + } + }, + processColumns: function () { + return this.options.columns; + }, + reapplySortModel: function () { + this.coDatagrid.reapplySortModel(); + }, + setListnersOnToolbar: function () { + (widget.onRefresh = function () {}), + (widget.onResize = function () { + h( + 'DS/ENOChgGovernanceUX/scripts/view/ChgCODataGridLayout', + ).loadingViewPreference(); + }); + }, + }); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovGlobalSubscriber', + [ + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderDataGridView', + ], + function (e, t) { + 'use strict'; + var i = { + globalRegisterationObj: {}, + addObserver: function (e, t, n) { + if (i.globalRegisterationObj[t]) { + for (var o = !1, a = 0; a < i.globalRegisterationObj[t].length; a++) + if (i.globalRegisterationObj[t][a].observerID == e) { + (i.globalRegisterationObj[t][a].callback = n), (o = !0); + break; + } + o || + i.globalRegisterationObj[t].push({ + observerID: e, + callback: n, + }); + } else + (i.globalRegisterationObj[t] = []), + i.globalRegisterationObj[t].push({ + observerID: e, + callback: n, + }); + }, + removeObserver: function (e, t) { + for (var n = 0; n < i.globalRegisterationObj[e].length; n++) + i.globalRegisterationObj[e][n].observerID == t && + i.globalRegisterationObj[e].splice(n, 1); + }, + notify(e, t) { + for (var n = i.globalRegisterationObj[e], o = 0; o < n.length; o++) + try { + n[o].callback(t); + } catch (e) { + console.log(e); + } + }, + }; + return ( + e.subscribe('CO-Properties-Update', function (e) { + i.notify('CO-Properties-Update', e); + }), + e.subscribe('ENOLC_MOVE_CMD_UPDATE', function (e) { + console.log('globally new transfer data ' + e), + i.notify('ENOLC_MOVE_CMD_UPDATE', e); + }), + e.subscribe('CA-Group-Update', function (e) { + console.log('Firing notification for CA Group Update ' + e), + i.notify('CA-Group-Update', e); + }), + e.subscribe('CO-AccessBit-Update', function (e) { + i.notify('CO-AccessBit-Update', e); + }), + e.subscribe('Chg-Gov-Recents-PendingIndexed-DeletedIds', function (e) { + i.notify('Chg-Gov-Recents-PendingIndexed-DeletedIds', e); + }), + e.subscribe('Chg-Gov-Recents-RecentlyOpened-DeletedIds', function (e) { + i.notify('Chg-Gov-Recents-RecentlyOpened-DeletedIds', e); + }), + e.subscribe( + 'ENORIPE-InApp-' + widget.id + 'ChgCRImpactedItemDataGridLayout/onOK', + function (e) { + i.notify( + 'ENORIPE-InApp-' + + widget.id + + 'ChgCRImpactedItemDataGridLayout/onOK', + e, + ); + }, + ), + e.subscribe( + 'ENORIPE-InApp-' + + widget.id + + 'ChgCRAffectedItemsDataGridLayout/onOK', + function (e) { + i.notify( + 'ENORIPE-InApp-' + + widget.id + + 'ChgCRAffectedItemsDataGridLayout/onOK', + e, + ); + }, + ), + e.subscribe('Lifecycle.Modification', function (e) { + i.notify('Lifecycle.Modification', e); + }), + e.subscribe('Attachment-AccessBit-Update', function (e) { + i.notify('Attachment-AccessBit-Update', e); + }), + e.subscribe('co-update-attachment-complete', function (e) { + i.notify('co-update-attachment-complete', e); + }), + e.subscribe('update-impact-anlysis-grid', function (e) { + i.notify('update-impact-anlysis-grid', e); + }), + e.subscribe( + 'CR-ImpactAnalysis-AccessBit-Update-On-Properties-Load', + function (e) { + i.notify( + 'CR-ImpactAnalysis-AccessBit-Update-On-Properties-Load', + e, + ); + }, + ), + e.subscribe('Change-Maturity-Update', function (e) { + i.notify('Change-Maturity-Update', e); + }), + i + ); + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/recents/pendingIndexed/ChgPendingIndexedView', + [ + 'UWA/Class/View', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgServices/scripts/services/ChgDataProcess', + 'DS/ENOChgGovernanceUX/scripts/model/recents/ChgCORecentsTreeModel', + 'DS/CollectionView/ResponsiveTilesCollectionView', + 'DS/CollectionView/CollectionViewStatusBar', + 'DS/Core/PointerEvents', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/recents/util/ChgGovRecentsContextualMenu', + 'DS/CoreEvents/ModelEvents', + 'DS/Controls/Button', + 'DS/ENOChgGovernanceUX/scripts/config/ChgGovAppGlobalConfig', + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovGlobalSubscriber', + 'DS/ENOChgGovernanceUX/scripts/view/recents/util/ChgGovRecentsCustomFields', + 'DS/PlatformAPI/PlatformAPI', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p, h, m) { + 'use strict'; + var C = e.extend({ + init: function (e) { + console.log('init ChgPendingIndexedView'), + this._parent(e), + (this._modelEvents = new c()), + this.subscribeToModelEvents(), + this.globalSubscribeForPendingIndexedView(), + this.render(e); + }, + subscribeToModelEvents: function (e) { + this._modelEvents.subscribe( + { + event: 'pendingIndexedTreeEmpty', + }, + function (e) { + C.prototype.pendingIndexedTreeEmpty(); + }, + ), + this._modelEvents.subscribe( + { + event: 'pendingIndexedTreeNotEmpty', + }, + function (e) { + C.prototype.pendingIndexedTreeNotEmpty(); + }, + ); + }, + render: function (e) { + var o = this; + (e.treeDocument = new n().createTreeDocument(this._modelEvents)), + (C.prototype.ChgCORecentsTreeModel = e.treeDocument), + o.createPendingIndexedView(e), + t.getTimestamp().then(function (a) { + var r = i.processTimestampData(a); + t.getConfiguredChangeOrderList({ + indexed: !1, + simplifiedJSON: !0, + timestamp: r, + }).then(function (t) { + var a = i.processChangeOrderRecentList(t); + a.length > 0 + ? (new n().loadRecentChangeOrderData(e.treeDocument, a), + o._modelEvents.publish({ + event: 'pendingIndexedTreeNotEmpty', + })) + : o._modelEvents.publish({ + event: 'pendingIndexedTreeEmpty', + }); + }); + }), + C.prototype.ChgCORecentsTreeModel.getXSO().onAdd(function (t) { + e._applicationChannel.publish({ + event: 'load-info-panel-chg-recents', + data: { + context: t, + }, + }); + }), + C.prototype.ChgCORecentsTreeModel.getXSO().onRemove(function (t) { + e._applicationChannel.publish({ + event: 'load-info-panel-chg-recents', + data: { + context: t, + }, + }); + }); + }, + createPendingIndexedView: function (e) { + var t = this; + e.target.innerHTML = + '' + s.CHG_GOV_Recents_Pending_Indexed_Heading + ''; + var i = { + model: e.treeDocument, + height: 'inherit', + allowUnsafeHTMLContent: !1, + displayedOptionalCellProperties: [ + 'contextualMenu', + 'description', + 'propertiesList', + 'activeFlag', + 'statusbarIcons', + ], + }; + this.tileView = new o(i); + var n = e.target, + a = UWA.createElement('div', { + id: 'pendingIndexedCOEmptyTileViewDiv', + class: 'hideViewPendingIndexedCO', + }), + c = UWA.createElement('div', { + id: 'pendingIndexedCOPopulatedTileViewDiv', + class: 'hideViewPendingIndexedCO', + }), + d = UWA.createElement('div', { + class: 'pendingIndexedCOEmptyTileViewText', + }), + p = s.CHG_GOV_Recents_Pending_Indexed_Empty_View; + d.inject(a), + (d.innerText = p), + this.tileView.inject(c), + c.inject(n), + a.inject(n); + var h = { + callback: function (e) { + if (e && e.cellInfos && e.cellInfos.cellModel) { + var i = document.getElementsByClassName('secondROChildDiv')[0]; + return l + .showRMBMenuOnGrid(e, i, t.removeDeletedNodesUsingIDsAdaptor) + .then(function (e) { + return e; + }); + } + }, + }; + (this.tileView.onContextualEvent = h), + this.tileView.addEventListener(r.POINTERHIT, function (e, i) { + t.onItemClick(e, i); + }), + (this.onItemClick = function (e, t) { + if ( + t && + t.nodeModel && + t.nodeModel.options.grid && + 2 == e.multipleHitCount + ) { + var i = {}; + (i.model = t.nodeModel.options.grid), + g.navigate(u.ROUTE_CO_DETAILS, { + id: i.model.id, + name: i.model.name, + title: i.model.title, + nodeModel: i, + }), + m.publish('load-dependency' + widget.id, 'pid:' + i.model.id); + } + }); + }, + removeDeletedNodesUsingIDsAdaptor: function (e) { + var t = e; + e.deletedIDs && (t = e.deletedIDs), + e.source || + m.publish('Chg-Gov-Recents-PendingIndexed-DeletedIds', { + source: 'ChgPendingIndexedView', + deletedIDs: t, + }), + C.prototype.removeDeletedNodesUsingIDs(t); + }, + removeDeletedNodesUsingIDs: function (e) { + for (var t = 0; t < e.length; t++) { + var i = e[t]; + C.prototype.ChgCORecentsTreeModel.search({ + shouldStop: function (e) { + return ( + e.options.grid.id === i && (e.getParent().removeChild(e), !0) + ); + }, + }); + } + 0 == C.prototype.ChgCORecentsTreeModel.getChildren().length && + C.prototype.pendingIndexedTreeEmpty(); + }, + handleMoveUpdate: function (e) { + console.log('inside handleMoveUpdate'); + for ( + var t = C.prototype.ChgCORecentsTreeModel.getAllDescendants(), + i = e.data.paths, + n = 0; + n < t.length; + n++ + ) + for (var o = 0; o < i.length; o++) + if (i[o] == t[n].options.grid.id) { + var a, + r, + s, + l, + c, + d, + u, + g = t[n].options.grid.id; + if ( + ((r = (a = e.data.attributes[g]).newCollabSpace), + (s = a.newOrganization), + (l = a.newOwnerFullName), + (c = a.newOwnerId) && l) + ) { + d = t[n].options.grid.name + ' | ' + l; + var p = { + title: t[n].options.grid.title, + name: t[n].options.grid.name, + severityNLS: t[n].options.grid.severityNLS, + ownerFullName: l, + maturityNLS: t[n].options.grid.maturityNLS, + }; + (u = h.getCustomTooltip(p)), + (t[n].options.grid.owner = c), + (t[n].options.grid.ownerFullName = l), + t[n].updateOptions({ + grid: t[n].options.grid, + customTooltip: u, + subLabel: d, + }); + } + s && + ((t[n].options.grid.organization = s), + t[n].updateOptions({ + grid: t[n].options.grid, + })), + r && + ((t[n].options.grid.collabspace = r), + t[n].updateOptions({ + grid: t[n].options.grid, + })); + } + }, + handlePropertiesUpdate: function (e) { + console.log('inside handlePropertiesUpdate'); + for ( + var t = C.prototype.ChgCORecentsTreeModel.getAllDescendants(), + i = e.objectId, + n = 0; + n < t.length; + n++ + ) { + if (t[n].options.grid.id == i) { + var o = e.Title.value, + a = e.name.value, + r = e.description.value, + s = e.owner.value, + l = e.owner.valueDB, + c = e.Severity.valueDB, + d = e.Severity.value, + u = t[n].options.grid.ecm_change_on_hold, + g = a + ' | ' + s, + p = {}; + (p.name = a), + (p.title = o), + (p.ecm_change_on_hold = u), + (p.severity = c), + (p.severityNLS = d), + (p.owner = l), + (p.ownerFullName = s), + (p.maturityNLS = t[n].options.grid.maturityNLS); + var m = h.createCustomSeverity(p), + v = h.getStatusBarIcons(p), + f = h.statusbarIconsTooltips(p), + b = h.getCustomTooltip(p); + (t[n].options.grid.title = o), + (t[n].options.grid.description = r), + (t[n].options.grid.ownerFullName = s), + (t[n].options.grid.owner = l), + (t[n].options.grid.severity = c), + (t[n].options.grid.sev = m), + (t[n].options.grid.severityNLS = d), + t[n].updateOptions({ + label: e.Title.value, + grid: t[n].options.grid, + customTooltip: b, + statusbarIcons: v, + statusbarIconsTooltips: f, + subLabel: g, + }); + } + } + }, + globalSubscribeForPendingIndexedView: function () { + p.addObserver( + 'ChgPendingIndexedView', + 'ENOLC_MOVE_CMD_UPDATE', + this.handleMoveUpdate, + ), + p.addObserver( + 'ChgPendingIndexedView', + 'CO-Properties-Update', + this.handlePropertiesUpdate, + ), + p.addObserver( + 'ChgPendingIndexedView', + 'Chg-Gov-Recents-RecentlyOpened-DeletedIds', + this.removeDeletedNodesUsingIDsAdaptor, + ); + }, + pendingIndexedTreeEmpty: function () { + var e = document.getElementById('pendingIndexedCOEmptyTileViewDiv'); + e && e.removeClassName('hideViewPendingIndexedCO'); + var t = document.getElementById( + 'pendingIndexedCOPopulatedTileViewDiv', + ); + t && t.addClassName('hideViewPendingIndexedCO'); + }, + pendingIndexedTreeNotEmpty: function () { + var e = document.getElementById('pendingIndexedCOEmptyTileViewDiv'); + e && e.addClassName('hideViewPendingIndexedCO'); + var t = document.getElementById( + 'pendingIndexedCOPopulatedTileViewDiv', + ); + t && t.removeClassName('hideViewPendingIndexedCO'); + }, + }); + return C; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeAction/facets/approvals/ChgCAApprovalsView', + [ + 'DS/ENORouteMgmt/Views/RightPanelInfoView', + 'DS/ENORouteMgmt/Views/Form/TaskViewUtil', + 'DS/ENORouteMgmt/Views/Loader/ChangeTaskAssigneeChooser', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'require', + 'DS/ENORouteMgmt/Commands/RouteTaskView', + 'DS/PlatformAPI/PlatformAPI', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/UIKIT/Mask', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovBIFilter', + 'DS/ENOChgServices/scripts/services/ChgNativeInitService', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovGlobalSubscriber', + 'DS/ENORouteMgmt/Views/Loader/InitiateDocumentChooser', + 'DS/TreeModel/TreeNodeModel', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p, h, m) { + 'use strict'; + let C, v, f, b; + var w = { + createApprovalsView: function (t) { + (this.id = t.id), (this.target = t.target); + var i = document.getElementsByClassName('outerContainerTabDiv')[0]; + 'undefined' != i && null != i && c.mask(i); + var u = UWA.createElement('div', { + id: 'chg-Task-container', + styles: { + height: 'inherit', + }, + }); + let p = d.getGlobalVariable().tenant, + h = d.getGlobalVariable().getSecurityContext(); + n.getRouteBasedOnContentId(t.id).then( + function (i) { + var m = w.checkResponse(i.data), + D = t.target; + if (m) { + var S = o.getDependency('xChangeApp'), + y = o.getDependency('applicationChannel'), + _ = S.infoPanel.childNodes, + E = { + id: m.id, + renderType: 'container', + tenant: p, + securityContext: h, + }, + O = document.getElementById('viewTaskContainerExternal'), + I = document.getElementById('InitiateTaskPropertiesBody'), + G = document.getElementById('approvalViewDiv'); + null != O && O.remove(), + null != G && G.remove(), + null != I && I.remove(), + r.init(E, D); + let i = new e(u); + widget.routeMgmtMediator.subscribe( + 'route-task-open-click-view-mode', + function (e) { + i.init(e, 'taskActionMode'); + for (var t = 0; t < _.length; t++) { + var n = _[t].className; + UWA.is(n) && 'secondmainContainer-sidepanel' === n + ? (_[t].empty(), + u.inject(_[t]), + (_[t].style.display = 'block')) + : (_[t].style.display = 'none'); + } + y.publish({ + event: 'triptych-show-panel', + data: 'right', + }), + y.publish({ + event: 'information-panel-visible', + data: null, + }); + }, + ), + widget.routeMgmtMediator.subscribe( + 'route-task-open-click-edit-mode', + function (e) { + i.init(e, 'taskEditMode'); + for (var t = 0; t < _.length; t++) { + var n = _[t].className; + UWA.is(n) && 'secondmainContainer-sidepanel' === n + ? (_[t].empty(), + u.inject(_[t]), + (_[t].style.display = 'block')) + : (_[t].style.display = 'none'); + } + y.publish({ + event: 'triptych-show-panel', + data: 'right', + }), + y.publish({ + event: 'information-panel-visible', + data: null, + }); + }, + ), + widget.routeMgmtMediator.subscribe( + 'route-task-close-click-view-mode', + function (e) {}, + ), + widget.routeMgmtMediator.subscribe( + 'route-task-close-click-edit-mode', + function (e) {}, + ), + widget.routeMgmtMediator.subscribe( + 'task-action-on-save', + function (e) { + var i = e.model.taskActionButton, + r = t.id; + if ( + 'Approve' === i || + 'Reject' === i || + 'Abstain' === i + ) { + n.getChangeActionUserAccess(r).then(function (e) { + var t = { + id: e.data[0].id, + type: e.data[0].type, + accessBits: e.data[0], + }; + s.publish('CO-AccessBit-Update', t), + s.publish('idcard-header-update', t), + s.publish('idcard-header-update-maturity'), + a( + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ).onRefresh(); + }); + let e = o.getDependency('applicationChannel'); + e.publish({ + event: 'triptych-hide-panel', + data: 'right', + }), + e.publish({ + event: 'information-panel-close', + data: null, + }); + } + }, + ), + widget.routeMgmtMediator.subscribe( + 'launch-task-assignee-search', + function (e) { + if ( + (console.log('launch-task-assignee-search Event'), + d.getGlobalVariable().isNative) + ) { + (C = e.taskProperties), + (v = e.taskGraphModel), + (b = e.invokeFrom), + (f = e.routeInfo); + g.DispatchEventToWin( + 'CHG_Search_Task_Assignee', + 'Task_Assignee', + ); + } + }, + ), + widget.routeMgmtMediator.subscribe( + 'launch-add-attachment-search', + function (e) { + if ( + (console.log('launch-add-attachment-search Event'), + d.getGlobalVariable().isNative) + ) { + (C = e.taskProperties), (v = e.alreadyAttachedDocs); + g.DispatchEventToWin( + 'CHG_ADD_ATTACHMENT_SEARCH', + 'Add_Attachment_Search', + ); + } + }, + ); + var N = document.getElementsByClassName( + 'outerContainerTabDiv', + )[0]; + c.unmask(N); + } else { + null != + (O = document.getElementById('viewTaskContainerExternal')) && + O.remove(); + var A = document.getElementById('tileViewDiv'); + null != A && A.remove(); + var T = UWA.createElement('div', { + styles: { + width: '100%', + height: 'calc(100% - 235px)', + position: 'absolute', + }, + id: 'tileViewDiv', + class: 'content-approval-tile-div approvaltileView', + }), + V = UWA.createElement('div', { + class: 'showEmptyView', + id: 'approvalViewDiv', + }); + UWA.createElement('div', { + id: 'approvalContentDiv', + html: l.CHG_GOV_Approval_TaskView_PlaceHolder, + }).inject(V), + V.inject(T), + T.inject(D); + N = document.getElementsByClassName('outerContainerTabDiv')[0]; + c.unmask(N); + } + }, + function (e) { + return Promise.reject(e); + }, + ); + }, + checkResponse: function (e) { + let t, + i, + n = function (e, t) { + var i = new Date(e.dataelements.modified), + n = new Date(t.dataelements.modified); + return i.getTime() > n.getTime() ? e : t; + }; + for (var o = 0; o < e.length; o++) { + let a = e[o]; + if ('Started' == a.dataelements.routeStatus) return a; + if ('Not Started' == a.dataelements.routeStatus) return a; + 'Stopped' == a.dataelements.routeStatus + ? (t = null == t ? a : n(t, a)) + : 'Finished' == a.dataelements.routeStatus && + (i = null == i ? a : n(i, a)); + } + return null != t ? t : i; + }, + clearTags: function () { + u._cleanBIFilterProxy(); + }, + globalSubscribeForGovCAApprovalsView: function () { + p.addObserver( + 'ChgCAApprovalsView', + 'Change-Maturity-Update', + w.handleMaturityUpdate, + ); + }, + handleMaturityUpdate: function (e) { + if ((console.log('handle maturity'), e.id === w.id)) { + let e = {}; + (e.id = w.id), (e.target = w.target), w.createApprovalsView(e); + } + }, + OnSearchComplete: function (e) { + let o = e.split(','), + a = []; + a.push(o[0]), + n + .getObjectInfo(a, [ + 'name', + 'type', + 'identifier', + 'label', + 'title', + ]) + .then(function (e) { + let n = e[0], + o = [], + a = {}; + (a = + 'Person' == n.type + ? { + id: n.id, + 'ds6w:label': n.dataelements.fullname, + 'ds6w:identifier': n.dataelements.name, + 'ds6w:type_value': n.type, + 'ds6w:type': n.type, + } + : { + id: n.id, + 'ds6w:label': n.dataelements.title, + 'ds6w:identifier': n.dataelements.name, + 'ds6w:type_value': n.type, + 'ds6w:type': n.type, + }), + o.push(a), + 'form' == b + ? t.populateAssigneeField(C, v, f, o) + : 'dialog' == b && i.populateAssigneeField(C, o); + }); + }, + OnSearchCompleteForAttachment: function (e) { + let t = e.split(','), + i = [], + o = []; + o.push(t), + n + .getObjectInfo(o, [ + 'name', + 'type', + 'identifier', + 'label', + 'title', + ]) + .then(function (e) { + for (var n = 0; n < t.length; n++) { + let t = e[n], + o = {}; + (o = { + id: t.id, + 'ds6w:label': t.dataelements.title, + 'ds6w:identifier': t.dataelements.name, + 'ds6w:type_value': t.type, + 'ds6w:type': t.type, + }), + i.push(o); + } + h.populateAddExisiting(C, i); + }); + }, + }; + return w.globalSubscribeForGovCAApprovalsView(), w; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/approvals/ChgGovApprovalsView', + [ + 'DS/ENORouteMgmt/Views/RightPanelInfoView', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'require', + 'DS/ENORouteMgmt/Commands/RouteTaskView', + 'DS/PlatformAPI/PlatformAPI', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/UIKIT/Mask', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovBIFilter', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovGlobalSubscriber', + ], + function (e, t, i, n, o, a, r, s, l, c, d) { + 'use strict'; + var u = { + createApprovalsView: function (c) { + (this.id = c.id), (this.target = c.target); + var d = document.getElementsByClassName('outerContainerTabDiv')[0]; + 'undefined' != d && null != d && s.mask(d); + var g = UWA.createElement('div', { + id: 'chg-Task-container', + styles: { + height: 'inherit', + }, + }); + let p = l.getGlobalVariable().tenant, + h = l.getGlobalVariable().getSecurityContext(); + t.getRouteBasedOnContentId(c.id).then( + function (l) { + var d = u.checkResponse(l.data), + m = c.target; + if (d) { + var C = i.getDependency('xChangeApp'), + v = i.getDependency('applicationChannel'), + f = C.infoPanel.childNodes, + b = { + id: d.id, + renderType: 'container', + tenant: p, + securityContext: h, + }, + w = document.getElementById('viewTaskContainerExternal'), + D = document.getElementById('InitiateTaskPropertiesBody'), + S = document.getElementById('approvalViewDiv'); + null != w && w.remove(), + null != S && S.remove(), + null != D && D.remove(), + o.init(b, m); + let r = new e(g); + widget.routeMgmtMediator.subscribe( + 'route-task-open-click-view-mode', + function (e) { + r.init(e, 'taskActionMode'); + for (var t = 0; t < f.length; t++) { + var i = f[t].className; + UWA.is(i) && 'secondmainContainer-sidepanel' === i + ? (f[t].empty(), + g.inject(f[t]), + (f[t].style.display = 'block')) + : (f[t].style.display = 'none'); + } + v.publish({ + event: 'triptych-show-panel', + data: 'right', + }), + v.publish({ + event: 'information-panel-visible', + data: null, + }); + }, + ), + widget.routeMgmtMediator.subscribe( + 'route-task-open-click-edit-mode', + function (e) { + r.init(e, 'taskEditMode'); + for (var t = 0; t < f.length; t++) { + var i = f[t].className; + UWA.is(i) && 'secondmainContainer-sidepanel' === i + ? (f[t].empty(), + g.inject(f[t]), + (f[t].style.display = 'block')) + : (f[t].style.display = 'none'); + } + v.publish({ + event: 'triptych-show-panel', + data: 'right', + }), + v.publish({ + event: 'information-panel-visible', + data: null, + }); + }, + ), + widget.routeMgmtMediator.subscribe( + 'route-task-close-click-view-mode', + function (e) {}, + ), + widget.routeMgmtMediator.subscribe( + 'route-task-close-click-edit-mode', + function (e) {}, + ), + widget.routeMgmtMediator.subscribe( + 'task-action-on-save', + function (e) { + var i = e.model.taskActionButton, + o = c.id; + ('Approve' !== i && 'Reject' !== i && 'Abstain' !== i) || + (t.getChangeOrderUserAccess(o).then(function (e) { + var t = { + id: e.data[0].id, + type: e.data[0].type, + accessBits: e.data[0].dataelements, + }; + a.publish('CO-AccessBit-Update', t), + a.publish('idcard-header-update', t), + a.publish('idcard-header-update-maturity'), + n( + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ).onRefresh(); + }), + v.publish({ + event: 'information-panel-close', + data: null, + })); + }, + ); + var y = document.getElementsByClassName( + 'outerContainerTabDiv', + )[0]; + s.unmask(y); + } else { + null != + (w = document.getElementById('viewTaskContainerExternal')) && + w.remove(); + var _ = document.getElementById('tileViewDiv'); + null != _ && _.remove(); + var E = UWA.createElement('div', { + styles: { + width: '100%', + height: 'calc(100% - 235px)', + position: 'absolute', + }, + id: 'tileViewDiv', + class: 'content-approval-tile-div approvaltileView', + }), + O = UWA.createElement('div', { + class: 'showEmptyView', + id: 'approvalViewDiv', + }); + UWA.createElement('div', { + id: 'approvalContentDiv', + html: r.CHG_GOV_Approval_TaskView_PlaceHolder, + }).inject(O), + O.inject(E), + E.inject(m); + y = document.getElementsByClassName('outerContainerTabDiv')[0]; + s.unmask(y); + } + }, + function (e) { + return Promise.reject(e); + }, + ); + }, + checkResponse: function (e) { + let t, + i, + n = function (e, t) { + var i = new Date(e.dataelements.modified), + n = new Date(t.dataelements.modified); + return i.getTime() > n.getTime() ? e : t; + }; + for (var o = 0; o < e.length; o++) { + let a = e[o]; + if ('Started' == a.dataelements.routeStatus) return a; + if ('Not Started' == a.dataelements.routeStatus) return a; + 'Stopped' == a.dataelements.routeStatus + ? (t = null == t ? a : n(t, a)) + : 'Finished' == a.dataelements.routeStatus && + (i = null == i ? a : n(i, a)); + } + return null != t ? t : i; + }, + globalSubscribeForGovApprovalsView: function () { + d.addObserver( + 'ChgGovApprovalsView', + 'Change-Maturity-Update', + u.handleMaturityUpdate, + ); + }, + clearTags: function () { + c._cleanBIFilterProxy(); + }, + handleMaturityUpdate: function (e) { + if ((console.log('handle maturity'), e.id === u.id)) { + let e = {}; + (e.id = u.id), (e.target = u.target), u.createApprovalsView(e); + } + }, + }; + return u.globalSubscribeForGovApprovalsView(), u; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/approvals/ChgGovCRApprovalsView', + [ + 'DS/ENORouteMgmt/Views/RightPanelInfoView', + 'DS/ENOChgServices/scripts/services/ChgDataService', + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'require', + 'DS/ENORouteMgmt/Commands/RouteTaskView', + 'DS/PlatformAPI/PlatformAPI', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/UIKIT/Mask', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovBIFilter', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovGlobalSubscriber', + ], + function (e, t, i, n, o, a, r, s, l, c, d) { + 'use strict'; + var u = { + createApprovalsView: function (c) { + (this.id = c.id), (this.target = c.target); + var d = document.getElementsByClassName('outerContainerTabDiv')[0]; + 'undefined' != d && null != d && s.mask(d); + var g = UWA.createElement('div', { + id: 'chg-Task-container', + styles: { + height: 'inherit', + }, + }); + let p = l.getGlobalVariable().tenant, + h = l.getGlobalVariable().getSecurityContext(); + t.getRouteBasedOnContentId(c.id).then( + function (l) { + var d = u.checkResponse(l.data), + m = c.target; + if (d) { + var C = i.getDependency('xChangeApp'), + v = i.getDependency('applicationChannel'), + f = C.infoPanel.childNodes, + b = { + id: d.id, + renderType: 'container', + tenant: p, + securityContext: h, + }, + w = document.getElementById('viewTaskContainerExternal'), + D = document.getElementById('InitiateTaskPropertiesBody'), + S = document.getElementById('approvalViewDiv'); + null != w && w.remove(), + null != S && S.remove(), + null != D && D.remove(), + o.init(b, m); + let r = new e(g); + widget.routeMgmtMediator.subscribe( + 'route-task-open-click-view-mode', + function (e) { + r.init(e, 'taskActionMode'); + for (var t = 0; t < f.length; t++) { + var i = f[t].className; + UWA.is(i) && 'secondmainContainer-sidepanel' === i + ? (f[t].empty(), + g.inject(f[t]), + (f[t].style.display = 'block')) + : (f[t].style.display = 'none'); + } + v.publish({ + event: 'triptych-show-panel', + data: 'right', + }), + v.publish({ + event: 'information-panel-visible', + data: null, + }); + }, + ), + widget.routeMgmtMediator.subscribe( + 'route-task-open-click-edit-mode', + function (e) { + r.init(e, 'taskEditMode'); + for (var t = 0; t < f.length; t++) { + var i = f[t].className; + UWA.is(i) && 'secondmainContainer-sidepanel' === i + ? (f[t].empty(), + g.inject(f[t]), + (f[t].style.display = 'block')) + : (f[t].style.display = 'none'); + } + v.publish({ + event: 'triptych-show-panel', + data: 'right', + }), + v.publish({ + event: 'information-panel-visible', + data: null, + }); + }, + ), + widget.routeMgmtMediator.subscribe( + 'route-task-close-click-view-mode', + function (e) {}, + ), + widget.routeMgmtMediator.subscribe( + 'route-task-close-click-edit-mode', + function (e) {}, + ), + widget.routeMgmtMediator.subscribe( + 'task-action-on-save', + function (e) { + var i = e.model.taskActionButton, + o = c.id; + 'Approve' == i + ? t.getChangeRequestUserAccess(o).then(function (e) { + var t = { + id: e.data[0].id, + type: e.data[0].type, + accessBits: e.data[0].dataelements, + }; + a.publish('CO-AccessBit-Update', t), + a.publish('idcard-header-update', t), + a.publish('idcard-header-update-maturity'), + v.publish({ + event: 'information-panel-close', + data: null, + }), + n( + 'DS/ENOChgGovernanceUX/scripts/view/ChgChangeOrderHome', + ).onRefresh(); + }) + : 'Reject' == i && + (v.publish({ + event: 'information-panel-close', + data: null, + }), + a.publish('idcard-header-update-maturity')); + }, + ); + var y = document.getElementsByClassName( + 'outerContainerTabDiv', + )[0]; + s.unmask(y); + } else { + null != + (w = document.getElementById('viewTaskContainerExternal')) && + w.remove(); + var _ = document.getElementById('tileViewDiv'); + null != _ && _.remove(); + var E = UWA.createElement('div', { + styles: { + width: '100%', + height: 'calc(100% - 235px)', + position: 'absolute', + }, + id: 'tileViewDiv', + class: 'content-approval-tile-div approvaltileView', + }), + O = UWA.createElement('div', { + class: 'showEmptyView', + id: 'approvalViewDiv', + }); + UWA.createElement('div', { + id: 'approvalContentDiv', + html: r.CHG_GOV_Approval_TaskView_PlaceHolder, + }).inject(O), + O.inject(E), + E.inject(m); + y = document.getElementsByClassName('outerContainerTabDiv')[0]; + s.unmask(y); + } + }, + function (e) { + return Promise.reject(e); + }, + ); + }, + checkResponse: function (e) { + let t, + i, + n = function (e, t) { + var i = new Date(e.dataelements.modified), + n = new Date(t.dataelements.modified); + return i.getTime() > n.getTime() ? e : t; + }; + for (var o = 0; o < e.length; o++) { + let a = e[o]; + if ('Started' == a.dataelements.routeStatus) return a; + if ('Not Started' == a.dataelements.routeStatus) return a; + 'Stopped' == a.dataelements.routeStatus + ? (t = null == t ? a : n(t, a)) + : 'Finished' == a.dataelements.routeStatus && + (i = null == i ? a : n(i, a)); + } + return null != t ? t : i; + }, + clearTags: function () { + c._cleanBIFilterProxy(); + }, + globalSubscribeForGovCRApprovalsView: function () { + d.addObserver( + 'ChgGovCRApprovalsView', + 'Change-Maturity-Update', + u.handleMaturityUpdate, + ); + }, + handleMaturityUpdate: function (e) { + if ((console.log('handle maturity'), e.id === u.id)) { + let e = {}; + (e.id = u.id), (e.target = u.target), u.createApprovalsView(e); + } + }, + }; + return u.globalSubscribeForGovCRApprovalsView(), u; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/ChgCRImpactBasisTileViewLayout', + [ + 'UWA/Core', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactBasis/util/ChgCRImpactBasisGridColsUtil', + ], + function (e, t) { + 'use strict'; + return { + changeView: function (e) { + setTimeout(function () { + t.changeView('TileView'); + }, 100); + }, + showEmptyView: function () { + var e = document.getElementById('impactBasisEmptyTileViewDiv'); + e && (e.removeClassName('hideView'), e.addClassName('showEmptyView')); + }, + hideEmptyView: function () { + var e = document.getElementById('impactBasisEmptyTileViewDiv'); + e && (e.addClassName('hideView'), e.removeClassName('showEmptyView')); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/ChgRelatedScopeTileViewLayout', + [ + 'UWA/Core', + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/util/ChgRelatedScopeGridColsUtil', + ], + function (e, t) { + 'use strict'; + return { + changeView: function (e) { + setTimeout(function () { + t.changeView('TileView'); + }, 100); + }, + showEmptyView: function () { + var e = document.getElementById('COrelatedScopeEmptyTileViewDiv'); + e && (e.removeClassName('hideView'), e.addClassName('showEmptyView')); + }, + hideEmptyView: function () { + var e = document.getElementById('COrelatedScopeEmptyTileViewDiv'); + e && (e.addClassName('hideView'), e.removeClassName('showEmptyView')); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/facets/relatedScope/util/ChgRelatedScopeGridContextualMenu', + [ + 'UWA/Core', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/LifecycleCmd/MaturityCmd', + 'DS/ENOChgServices/scripts/services/ChgPropertiesServices', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgCustomAttributeService', + 'require', + 'DS/ENOChgGovernanceUX/scripts/util/ChgDataGridUtil', + ], + function (e, t, i, n, o, a, r, s) { + 'use strict'; + var l = { + showRMBMenuOnGrid: function (e) { + return new Promise(function (t, i) { + const o = []; + let a = !1; + const c = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(); + c.length > 1 && (a = !0); + const d = c.map((e) => e.options.grid.id), + u = + (c.map((e) => ({ + physicalid: e.options.grid.id, + nodeName: e.options.grid.name, + nodeTitle: e.options.grid.title, + })), + r( + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + )), + g = { + objectId: e.cellInfos.nodeModel.options.grid.id, + objectType: e.cellInfos.nodeModel.options.grid.type, + displayName: e.cellInfos.nodeModel.options.grid.name, + displayType: e.cellInfos.nodeModel.options.grid.displayType, + facetName: 'dependency', + }, + p = u.openWith(g); + a + ? (o.push(n.createPropertyPushItem(d)), + o.push(l.getRelationalExplorerMenu(d)), + o.push(s.getMaturityMenu(e)), + o.push(l.getTransferMenu(e)), + t(o)) + : (o.push(n.createPropertyPushItem(d)), + o.push(l.getRelationalExplorerMenu(d)), + p.then((i) => { + i && o.push(i), + o.push(s.getMaturityMenu(e)), + o.push(l.getTransferMenu(e)), + t(o); + })); + }); + }, + getTransferMenu: function (e) { + return { + type: 'PushItem', + title: t.CHG_GOV_Menu_Transfer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-move-to', + }, + action: { + callback: function (t) { + for ( + var i = e.cellInfos.nodeModel + .getTreeDocument() + .getSelectedNodes(), + n = [], + o = 0; + o < i.length; + o++ + ) + n.push(i[o].options.grid); + require([ + 'DS/ENOChgGovernanceUX/scripts/wrapper/ChgGovTransferWrapper', + ], function (e) { + e.launchTransferDialog(n); + }); + }, + }, + }; + }, + getRelationalExplorerMenu: function (e) { + return { + type: 'PushItem', + title: t.CHG_GOV_Menu_Relational_Explorer, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-object-related', + }, + action: { + callback: function (t) { + require([ + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ], function (t) { + t.openRelationalExplorer(e); + }); + }, + }, + }; + }, + }; + return l; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/router/ChgGovRouterConfig', + [ + 'DS/ENOChgRouter5/scripts/ChgRouter', + 'DS/ENOChgGovernanceUX/scripts/config/ChgGovAppGlobalConfig', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovPreferenceConstant', + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovApplicationPreferencesManager', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + ], + function (e, t, i, n, o, a) { + return { + initialize: function () { + e.initialize(t.ROUTE_HOME, t.PATH_HOME), + [ + { + name: t.ROUTE_RECENTY_OPENED, + path: '/' + t.PATH_RECENTY_OPENED, + }, + { + name: t.ROUTE_MY_CHANGE_ORDERS, + path: '/' + t.PATH_MY_CHANGE_ORDERS, + }, + { + name: t.ROUTE_MY_CHANGE_ACTIONS, + path: '/' + t.PATH_MY_CHANGE_ACTIONS, + }, + { + name: t.ROUTE_CO_INFO, + path: '/' + t.PATH_CO_INFO, + }, + { + name: t.ROUTE_CO_DETAILS, + path: '/' + t.PATH_CO_DETAILS, + }, + { + name: t.ROUTE_MY_CHANGE_REQUESTS, + path: '/' + t.PATH_MY_CHANGE_REQUESTS, + }, + { + name: t.ROUTE_CR_INFO, + path: '/' + t.PATH_CR_INFO, + }, + { + name: t.ROUTE_CR_DETAILS, + path: '/' + t.PATH_CR_DETAILS, + }, + { + name: t.ROUTE_CA_INFO, + path: '/' + t.PATH_CA_INFO, + }, + { + name: t.ROUTE_CA_DETAILS, + path: '/' + t.PATH_CA_DETAILS, + }, + { + name: t.ROUTE_CR_ORCHESTRATION_LEVEL1, + path: '/' + t.PATH_CR_ORCHESTRATION_LEVEL1, + }, + { + name: t.ROUTE_CR_ORCHESTRATION_LEVEL2, + path: '/' + t.PATH_CR_ORCHESTRATION_LEVEL2, + }, + { + name: t.ROUTE_CR_ORCHESTRATION_LEVEL3, + path: '/' + t.PATH_CR_ORCHESTRATION_LEVEL3, + }, + { + name: t.ROUTE_CO_ORCHESTRATION_LEVEL1, + path: '/' + t.PATH_CO_ORCHESTRATION_LEVEL1, + }, + { + name: t.ROUTE_CO_ORCHESTRATION_LEVEL2, + path: '/' + t.PATH_CO_ORCHESTRATION_LEVEL2, + }, + { + name: t.ROUTE_CO_ORCHESTRATION_LEVEL3, + path: '/' + t.PATH_CO_ORCHESTRATION_LEVEL3, + }, + ].forEach(function (t) { + e.addRoute(t); + }); + var n = {}; + for (var r in ((n[t.ROUTE_HOME] = { + activate: function () { + if (1 == a.getGlobalVariable().isNative) { + var i = { + name: t.ROUTE_MY_CHANGE_ACTIONS, + params: {}, + }; + o.setRouteInfo(i); + var n = e.getDependency('xChangeApp'); + (r = e.getDependency('applicationChannel')).publish({ + event: 'information-panel-close', + data: null, + }), + r.publish({ + event: 'welcome-panel-select-action', + data: { + id: t.PATH_MY_CHANGE_ACTIONS, + }, + }), + n.clearContent(), + n._initChangeActionContent(), + n.initializePropertyPanelwithEmptyData(); + } else { + n = e.getDependency('xChangeApp'); + var r = e.getDependency('applicationChannel'); + i = { + name: t.ROUTE_RECENTY_OPENED, + params: {}, + }; + o.setRouteInfo(i), + r.publish({ + event: 'welcome-panel-select-action', + data: { + id: t.PATH_RECENTY_OPENED, + }, + }), + n._initRecentContent(), + n.initializePropertyPanelwithEmptyData(); + } + }, + deactivate: function () { + var t = e.getDependency('xChangeApp'); + e.getDependency('applicationChannel'); + t.clearContent(), + data.params.isRefresh || + o.setRouteInfo({ + name: null, + }); + }, + }), + (n[t.ROUTE_RECENTY_OPENED] = { + activate: function (i) { + var n = { + name: t.ROUTE_RECENTY_OPENED, + params: {}, + }; + o.setRouteInfo(n); + var a = e.getDependency('xChangeApp'); + e.getDependency('applicationChannel').publish({ + event: 'welcome-panel-select-action', + data: { + id: t.PATH_RECENTY_OPENED, + }, + }), + a.clearContent(), + a._initRecentContent(), + a.initializePropertyPanelwithEmptyData(); + }, + deactivate: function (t) { + var i = e.getDependency('xChangeApp'); + e.getDependency('applicationChannel'); + i.clearContent(), + t.params.isRefresh || + o.setRouteInfo({ + name: null, + }); + }, + }), + (n[t.ROUTE_MY_CHANGE_ORDERS] = { + activate: function (i) { + applicationChannelLocal = e.getDependency('applicationChannel'); + var n = e.getDependency('xChangeApp'); + e.getDependency('applicationChannel').publish({ + event: 'information-panel-close', + data: null, + }), + n.clearContent(), + n.loadingMyChangeOrders(), + n.initializePropertyPanelwithEmptyData(); + var a = { + name: t.ROUTE_MY_CHANGE_ORDERS, + }; + o.setRouteInfo(a); + }, + deactivate: function () { + e.getDependency('xChangeApp'), + e.getDependency('applicationChannel'); + }, + }), + (n[t.ROUTE_MY_CHANGE_ACTIONS] = { + activate: function (i) { + var n = { + name: t.ROUTE_MY_CHANGE_ACTIONS, + params: {}, + }; + o.setRouteInfo(n); + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + r.publish({ + event: 'information-panel-close', + data: null, + }), + r.publish({ + event: 'welcome-panel-select-action', + data: { + id: t.PATH_MY_CHANGE_ACTIONS, + }, + }), + a.clearContent(), + a._initChangeActionContent(), + a.initializePropertyPanelwithEmptyData(); + }, + deactivate: function (t) { + var i = e.getDependency('xChangeApp'); + e.getDependency('applicationChannel'); + i.clearContent(), + t.params.isRefresh || + o.setRouteInfo({ + name: null, + }); + }, + }), + (n[t.ROUTE_MY_CHANGE_REQUESTS] = { + activate: function (i) { + var n = { + name: t.ROUTE_MY_CHANGE_REQUESTS, + params: {}, + }; + o.setRouteInfo(n); + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + r.publish({ + event: 'information-panel-close', + data: null, + }), + r.publish({ + event: 'welcome-panel-select-action', + data: { + id: t.PATH_MY_CHANGE_REQUESTS, + }, + }), + a.clearContent(), + a._initChangeRequestContent(), + a.initializePropertyPanelwithEmptyData(); + }, + deactivate: function (t) { + var i = e.getDependency('xChangeApp'); + e.getDependency('applicationChannel'); + i.clearContent(), + t.params.isRefresh || + o.setRouteInfo({ + name: null, + }); + }, + }), + (n[t.ROUTE_CO_INFO] = { + activate: function (i) { + var n = e.getDependency('xChangeApp'), + o = e.getDependency('applicationChannel'); + n.deactivateWP(i.params.isRefresh); + t.ROUTE_CO_INFO; + var a, + r = (a = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }).name, + s = { + linkID: t.ROUTE_CO_DETAILS, + linkText: r, + additionalData: a, + }; + o.publish({ + event: 'breadcrumb-add-link', + data: s, + }); + }, + deactivate: function (t) { + var i = e.getDependency('xChangeApp'); + i.reactivateWP(); + e.getDependency('applicationChannel'); + i.clearContent(); + }, + }), + (n[t.ROUTE_CO_DETAILS] = { + activate: function (n) { + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + let s = {}; + 'level1' != n.params.nodeModel.level && + 'level2' != n.params.nodeModel.level && + 'level3' != n.params.nodeModel.level + ? (a.deactivateWP(n.params.isRefresh), + a.clearContent(), + a.showIDCard(n.params.nodeModel, n.params.mode), + (s.id = n.params.id), + (s.name = n.params.name)) + : ((s.id = n.params.nodeModel.rootNode.id), + (s.name = n.params.nodeModel.rootNode.name)); + let l = [i._KEY, i._MODEL, i._ID_CARD]; + o.updatePreference(l, s); + var c, + d = { + name: t.ROUTE_CO_DETAILS, + }; + (c = { + id: s.id, + name: s.name, + version: '1', + modelName: s.name, + }), + (d.params = { + changeOrderId: c.id, + changeOrderName: c.name, + changeOrderVersion: c.version, + changeOrderName: c.modelName, + }), + o.setRouteInfo(d); + var u = c.name, + g = { + linkID: t.ROUTE_CO_DETAILS, + linkText: u, + additionalData: c, + }; + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_ORCHESTRATION_LEVEL2, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_ORCHESTRATION_LEVEL1, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CO_ORCHESTRATION_LEVEL2, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CO_ORCHESTRATION_LEVEL1, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CO_DETAILS, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CO_INFO, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_DETAILS, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_INFO, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CA_DETAILS, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CA_INFO, + }), + r.publish({ + event: 'breadcrumb-add-link', + data: g, + }); + }, + deactivate: function (e) {}, + }), + (n[t.ROUTE_CR_INFO] = { + activate: function (i) { + var n = e.getDependency('xChangeApp'), + o = e.getDependency('applicationChannel'); + n.deactivateWP(i.params.isRefresh); + t.ROUTE_CR_INFO; + var a, + r = (a = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }).name, + s = { + linkID: t.ROUTE_CR_DETAILS, + linkText: r, + additionalData: a, + }; + o.publish({ + event: 'breadcrumb-add-link', + data: s, + }); + }, + deactivate: function (t) { + var i = e.getDependency('xChangeApp'); + i.reactivateWP(); + e.getDependency('applicationChannel'); + i.clearContent(); + }, + }), + (n[t.ROUTE_CR_DETAILS] = { + activate: function (n) { + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + let s = {}; + 'level1' != n.params.nodeModel.level && + 'level2' != n.params.nodeModel.level && + 'level3' != n.params.nodeModel.level + ? (a.deactivateWP(n.params.isRefresh), + a.clearContent(), + a.showIDCard(n.params.nodeModel, n.params.mode), + (s.id = n.params.id), + (s.name = n.params.name)) + : ((s.id = n.params.nodeModel.rootNode.id), + (s.name = n.params.nodeModel.rootNode.name)); + let l = [i._KEY, i._MODEL, i._ID_CARD]; + o.updatePreference(l, s); + var c, + d = { + name: t.ROUTE_CR_DETAILS, + }; + (c = { + id: s.id, + name: s.name, + version: '1', + modelName: s.name, + }), + (d.params = { + changeRequestId: c.id, + changeRequestName: c.name, + changeRequestVersion: c.version, + changeRequestName: c.modelName, + }), + o.setRouteInfo(d); + var u = { + linkID: t.ROUTE_CR_DETAILS, + linkText: s.name, + additionalData: c, + }; + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_DETAILS, + }), + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_INFO, + }), + r.publish({ + event: 'breadcrumb-add-link', + data: u, + }); + }, + deactivate: function (e) {}, + }), + (n[t.ROUTE_CA_INFO] = { + activate: function (i) { + var n = e.getDependency('xChangeApp'), + o = e.getDependency('applicationChannel'); + n.deactivateWP(i.params.isRefresh); + t.ROUTE_CA_INFO; + var a, + r = (a = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }).name, + s = { + linkID: t.ROUTE_CA_DETAILS, + linkText: r, + additionalData: a, + }; + o.publish({ + event: 'breadcrumb-add-link', + data: s, + }); + }, + deactivate: function (t) { + var i = e.getDependency('xChangeApp'); + i.reactivateWP(); + e.getDependency('applicationChannel'); + i.clearContent(); + }, + }), + (n[t.ROUTE_CA_DETAILS] = { + activate: function (i) { + var n = e.getDependency('xChangeApp'), + a = e.getDependency('applicationChannel'); + n.deactivateWP(i.params.isRefresh), + n.clearContent(), + n.showIDCard(i.params.nodeModel, i.params.mode); + var r, + s = { + name: t.ROUTE_CA_DETAILS, + }; + (r = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }), + (s.params = { + changeRequestId: r.id, + changeRequestName: r.name, + changeRequestVersion: r.version, + changeRequestName: r.modelName, + }), + o.setRouteInfo(s); + var l = r.name, + c = { + linkID: t.ROUTE_CA_INFO, + linkText: l, + additionalData: r, + }; + a.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CA_DETAILS, + }), + a.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CA_INFO, + }), + a.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CO_DETAILS, + }), + a.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CO_INFO, + }), + a.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_DETAILS, + }), + a.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_INFO, + }), + a.publish({ + event: 'breadcrumb-add-link', + data: c, + }); + }, + deactivate: function (e) {}, + }), + (n[t.ROUTE_CR_ORCHESTRATION_LEVEL1] = { + activate: function (n) { + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + let s = n.params.nodeModel.level1Node; + n.params.nodeModel.level1Node.name + ? (s.name = n.params.nodeModel.level1Node.name) + : (s.name = n.params.name), + 'level2' != n.params.nodeModel.level && + 'level3' != n.params.nodeModel.level && + (a.clearContent(), a.openIDCard(s.id)); + let l = [i._KEY, i._MODEL, i._ORCHESTRATION_LEVEL1]; + o.updatePreference(l, s); + var c, + d = { + name: t.ROUTE_CR_ORCHESTRATION_LEVEL1, + }; + (c = { + id: s.id, + name: s.name, + version: '1', + modelName: s.name, + }), + (d.params = { + changeOrderId: c.id, + changeOrderName: c.name, + changeOrderVersion: c.version, + changeOrderName: c.modelName, + }), + o.setRouteInfo(d); + var u = c.name, + g = { + linkID: t.ROUTE_CR_ORCHESTRATION_LEVEL1, + linkText: u, + additionalData: c, + }; + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_ORCHESTRATION_LEVEL1, + }), + r.publish({ + event: 'breadcrumb-add-link', + data: g, + }); + }, + deactivate: function (i) { + if (i.name == t.ROUTE_CR_DETAILS) { + let t = e.getDependency('xChangeApp'); + t.clearContent(), t.openIDCard(i.params.id); + var n, + a = { + name: i.name, + }; + (n = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }), + (a.params = { + changeRequestId: n.id, + changeRequestName: n.name, + changeRequestVersion: n.version, + changeRequestName: n.modelName, + }), + o.setRouteInfo(a); + } + }, + }), + (n[t.ROUTE_CR_ORCHESTRATION_LEVEL2] = { + activate: function (n) { + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + let s = n.params.nodeModel.level2Node; + n.params.nodeModel.level2Node.name + ? (s.name = n.params.nodeModel.level2Node.name) + : (s.name = n.params.name), + a.deactivateWP(n.params.isRefresh), + 'level3' != n.params.nodeModel.level && + (a.clearContent(), a.openIDCard(s.id)); + let l = [i._KEY, i._MODEL, i._ORCHESTRATION_LEVEL2]; + o.updatePreference(l, s); + var c, + d = { + name: t.ROUTE_CR_ORCHESTRATION_LEVEL2, + }; + (c = { + id: s.id, + name: s.name, + version: '1', + modelName: s.name, + }), + (d.params = { + changeOrderId: c.id, + changeOrderName: c.name, + changeOrderVersion: c.version, + changeOrderName: c.modelName, + }), + o.setRouteInfo(d); + var u = c.name, + g = { + linkID: t.ROUTE_CR_ORCHESTRATION_LEVEL2, + linkText: u, + additionalData: c, + }; + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_ORCHESTRATION_LEVEL2, + }), + r.publish({ + event: 'breadcrumb-add-link', + data: g, + }); + }, + deactivate: function (i) { + if (i.name == t.ROUTE_CR_ORCHESTRATION_LEVEL1) { + let t = e.getDependency('xChangeApp'); + t.clearContent(), t.openIDCard(i.params.id); + var n, + a = { + name: i.name, + }; + (n = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }), + (a.params = { + changeOrderId: n.id, + changeOrderName: n.name, + changeOrderVersion: n.version, + changeOrderName: n.modelName, + }), + o.setRouteInfo(a); + } + }, + }), + (n[t.ROUTE_CR_ORCHESTRATION_LEVEL3] = { + activate: function (n) { + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + let s = n.params.nodeModel.level3Node; + n.params.nodeModel.level3Node.name + ? (s.name = n.params.nodeModel.level3Node.name) + : (s.name = n.params.name), + a.deactivateWP(n.params.isRefresh), + a.clearContent(), + a.openIDCard(s.id); + let l = [i._KEY, i._MODEL, i._ORCHESTRATION_LEVEL3]; + o.updatePreference(l, s); + var c, + d = { + name: t.ROUTE_CR_ORCHESTRATION_LEVEL3, + }; + (c = { + id: s.id, + name: s.name, + version: '1', + modelName: s.name, + }), + (d.params = { + changeOrderId: c.id, + changeOrderName: c.name, + changeOrderVersion: c.version, + changeOrderName: c.modelName, + }), + o.setRouteInfo(d); + var u = c.name, + g = { + linkID: t.ROUTE_CR_ORCHESTRATION_LEVEL3, + linkText: u, + additionalData: c, + }; + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CR_ORCHESTRATION_LEVEL3, + }), + r.publish({ + event: 'breadcrumb-add-link', + data: g, + }); + }, + deactivate: function (i) { + if (i.name == t.ROUTE_CR_ORCHESTRATION_LEVEL2) { + let t = e.getDependency('xChangeApp'); + t.clearContent(), t.openIDCard(i.params.id); + var n, + a = { + name: i.name, + }; + (n = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }), + (a.params = { + changeOrderId: n.id, + changeOrderName: n.name, + changeOrderVersion: n.version, + changeOrderName: n.modelName, + }), + o.setRouteInfo(a); + } + }, + }), + (n[t.ROUTE_CO_ORCHESTRATION_LEVEL1] = { + activate: function (n) { + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + let s = n.params.nodeModel.level1Node; + n.params.nodeModel.level1Node.name + ? (s.name = n.params.nodeModel.level1Node.name) + : (s.name = n.params.name), + 'level2' != n.params.nodeModel.level && + 'level3' != n.params.nodeModel.level && + (a.clearContent(), a.openIDCard(s.id)); + let l = [i._KEY, i._MODEL, i._ORCHESTRATION_LEVEL1]; + o.updatePreference(l, s); + var c, + d = { + name: t.ROUTE_CO_ORCHESTRATION_LEVEL1, + }; + (c = { + id: s.id, + name: s.name, + version: '1', + modelName: s.name, + }), + (d.params = { + changeOrderId: c.id, + changeOrderName: c.name, + changeOrderVersion: c.version, + changeOrderName: c.modelName, + }), + o.setRouteInfo(d); + var u = c.name, + g = { + linkID: t.ROUTE_CO_ORCHESTRATION_LEVEL1, + linkText: u, + additionalData: c, + }; + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CO_ORCHESTRATION_LEVEL1, + }), + r.publish({ + event: 'breadcrumb-add-link', + data: g, + }); + }, + deactivate: function (i) { + if (i.name == t.ROUTE_CO_DETAILS) { + let t = e.getDependency('xChangeApp'); + t.clearContent(), t.openIDCard(i.params.id); + var n, + a = { + name: i.name, + }; + (n = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }), + (a.params = { + changeOrderId: n.id, + changeOrderName: n.name, + changeOrderVersion: n.version, + changeOrderName: n.modelName, + }), + o.setRouteInfo(a); + } + }, + }), + (n[t.ROUTE_CO_ORCHESTRATION_LEVEL2] = { + activate: function (n) { + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + let s = n.params.nodeModel.level2Node; + n.params.nodeModel.level2Node.name + ? (s.name = n.params.nodeModel.level2Node.name) + : (s.name = n.params.name), + a.deactivateWP(n.params.isRefresh), + 'level3' != n.params.nodeModel.level && + (a.clearContent(), a.openIDCard(s.id)); + let l = [i._KEY, i._MODEL, i._ORCHESTRATION_LEVEL2]; + o.updatePreference(l, s); + var c, + d = { + name: t.ROUTE_CO_ORCHESTRATION_LEVEL2, + }; + (c = { + id: s.id, + name: s.name, + version: '1', + modelName: s.name, + }), + (d.params = { + changeOrderId: c.id, + changeOrderName: c.name, + changeOrderVersion: c.version, + changeOrderName: c.modelName, + }), + o.setRouteInfo(d); + var u = c.name, + g = { + linkID: t.ROUTE_CO_ORCHESTRATION_LEVEL2, + linkText: u, + additionalData: c, + }; + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CO_ORCHESTRATION_LEVEL2, + }), + r.publish({ + event: 'breadcrumb-add-link', + data: g, + }); + }, + deactivate: function (i) { + if (i.name == t.ROUTE_CO_ORCHESTRATION_LEVEL1) { + let t = e.getDependency('xChangeApp'); + t.clearContent(), t.openIDCard(i.params.id); + var n, + a = { + name: i.name, + }; + (n = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }), + (a.params = { + changeOrderId: n.id, + changeOrderName: n.name, + changeOrderVersion: n.version, + changeOrderName: n.modelName, + }), + o.setRouteInfo(a); + } + }, + }), + (n[t.ROUTE_CO_ORCHESTRATION_LEVEL3] = { + activate: function (n) { + var a = e.getDependency('xChangeApp'), + r = e.getDependency('applicationChannel'); + let s = n.params.nodeModel.level3Node; + n.params.nodeModel.level3Node.name + ? (s.name = n.params.nodeModel.level3Node.name) + : (s.name = n.params.name), + a.deactivateWP(n.params.isRefresh), + a.clearContent(), + a.openIDCard(s.id); + let l = [i._KEY, i._MODEL, i._ORCHESTRATION_LEVEL3]; + o.updatePreference(l, s); + var c, + d = { + name: t.ROUTE_CO_ORCHESTRATION_LEVEL3, + }; + (c = { + id: s.id, + name: s.name, + version: '1', + modelName: s.name, + }), + (d.params = { + changeOrderId: c.id, + changeOrderName: c.name, + changeOrderVersion: c.version, + changeOrderName: c.modelName, + }), + o.setRouteInfo(d); + var u = c.name, + g = { + linkID: t.ROUTE_CO_ORCHESTRATION_LEVEL3, + linkText: u, + additionalData: c, + }; + r.publish({ + event: 'breadcrumb-remove-link', + data: t.ROUTE_CO_ORCHESTRATION_LEVEL3, + }), + r.publish({ + event: 'breadcrumb-add-link', + data: g, + }); + }, + deactivate: function (i) { + if (i.name == t.ROUTE_CO_ORCHESTRATION_LEVEL2) { + let t = e.getDependency('xChangeApp'); + t.clearContent(), t.openIDCard(i.params.id); + var n, + a = { + name: i.name, + }; + (n = { + id: i.params.id, + name: i.params.name, + version: '1', + modelName: i.params.name, + }), + (a.params = { + changeOrderId: n.id, + changeOrderName: n.name, + changeOrderVersion: n.version, + changeOrderName: n.modelName, + }), + o.setRouteInfo(a); + } + }, + }), + n)) + n.hasOwnProperty(r) && e.addRouteMethods(r, n[r]); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/ChgCRImpactedItemTileViewLayout', + [ + 'UWA/Core', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/impactedItem/util/ChgCRImpactedItemGridColsUtil', + ], + function (e, t) { + 'use strict'; + return { + changeView: function (e) { + setTimeout(function () { + t.changeView('TileView'); + }, 100); + }, + showEmptyView: function () { + var e = document.getElementById('impactedItemEmptyTileViewDiv'); + e && (e.removeClassName('hideView'), e.addClassName('showEmptyView')); + }, + hideEmptyView: function () { + var e = document.getElementById('impactedItemEmptyTileViewDiv'); + e && (e.addClassName('hideView'), e.removeClassName('showEmptyView')); + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/util/ProbesRMBCommandUtil', + [ + 'DS/ENOChgProbes/scripts/ChgCloudProbeUtils', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovApplicationPreferencesManager', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovPreferenceConstant', + ], + function (e, t, i) { + 'use strict'; + return { + createProbesData: function (n, o) { + var a = {}; + let r = '', + s = '', + l = ''; + var c = t.getRouteInfo('ChgGovPreferenceConstant._LAST_ROUTE'); + if ('home.CRInfo.CRDetails' === c.name) { + let s = [i._KEY, i._VIEWS_PREFERENCES, i._CHANGE_REQUESTS_DETAILS]; + (r = t.getTab(s)), + (a.commandInfo = {}), + (a.commandInfo.type = 'Change Request'), + r && 'crAffectedItems' === r + ? ((a.commandInfo.facet = 'Affected Items'), + 'Download' === n + ? (a.commandInfo.action = 'CR>Affected Items>RMB>Download') + : 'Preview' === n + ? (a.commandInfo.action = 'CR>Affected Items>RMB>Preview') + : 'Information' === n + ? (a.commandInfo.action = + 'CR>Affected Items>RMB>Information') + : 'Maturity' === n + ? (a.commandInfo.action = 'CR>Affected Items>RMB>Maturity') + : 'OpenWith' === n && + (a.commandInfo.action = + 'CR>Affected Items>RMB>OpenWith>' + o)) + : r && 'crAssessment' === r + ? ((a.commandInfo.facet = 'Impact Analysis'), + 'Information' === n + ? (a.commandInfo.action = + 'CR>Impact Analysis>RMB>Information') + : 'Maturity' === n + ? (a.commandInfo.action = 'CR>Impact Analysis>RMB>Maturity') + : 'Copy Link' === n && + (a.commandInfo.action = + 'CR>Impact Analysis>RMB>Copy Link')) + : r && + 'crOrchestration' === r && + ((a.commandInfo.facet = 'Change Orchestration'), + 'Information' === n + ? (a.commandInfo.action = + 'CR>Change Orchestration>RMB>Information') + : 'Maturity' === n + ? (a.commandInfo.action = + 'CR>Change Orchestration>RMB>Maturity') + : 'Copy Link' === n + ? (a.commandInfo.action = + 'CR>Change Orchestration>RMB>Copy Link') + : 'OpenWith' === n && + (a.commandInfo.action = + 'CR>Change Orchestration>RMB>OpenWith>' + o)), + e.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: a, + }); + } else if ('home.COInfo.CODetails' === c.name) { + let r = [i._KEY, i._VIEWS_PREFERENCES, i._CHANGE_ORDERS_DETAILS]; + (s = t.getTab(r)), + (a.commandInfo = {}), + (a.commandInfo.type = 'Change Order'), + s && + 'ChangeOrchestration' === s && + ((a.commandInfo.facet = 'Change Orchestration'), + 'Information' === n + ? (a.commandInfo.action = + 'CO>Change Orchestration>RMB>Information') + : 'Maturity' === n + ? (a.commandInfo.action = + 'CO>Change Orchestration>RMB>Maturity') + : 'Copy Link' === n + ? (a.commandInfo.action = + 'CO>Change Orchestration>RMB>Copy Link') + : 'OpenWith' === n && + (a.commandInfo.action = + 'CO>Change Orchestration>RMB>OpenWith>' + o)), + e.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: a, + }); + } else if ('home.CAInfo.CADetails' === c.name) { + let r = [i._KEY, i._VIEWS_PREFERENCES, i._CHANGE_ACTIONS_DETAILS]; + (l = t.getTab(r)), + (a.commandInfo = {}), + (a.commandInfo.type = 'Change Action'), + l && + 'RealizedChange' === l && + ((a.commandInfo.facet = 'Realized Changes'), + 'Information' === n + ? (a.commandInfo.action = + 'CA>Realized Changes>DGV>RMB>Information') + : 'OpenWith' === n + ? (a.commandInfo.action = + 'CA>Realized Changes>DGV>RMB>OpenWith>' + o) + : 'Relations' === n && + (a.commandInfo.action = + 'CA>Realized Changes>DGV>RMB>Relations')), + e.cloudProbeUtils.genericCommandClickEventForAnalytics({ + inputJSON: a, + }); + } + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/DownloadContextualMenu', + [ + 'UWA/Core', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/util/DocumentUtils', + 'DS/ENOChgGovernanceUX/scripts/util/ProbesRMBCommandUtil', + ], + function (e, t, i, n) { + 'use strict'; + return { + getDownloadMenu: function (e) { + return { + type: 'PushItem', + title: t.CHG_GOV_Download, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x wux-ui-3ds-download', + }, + action: { + callback: function () { + n.createProbesData('Download'), i.download(e); + }, + }, + }; + }, + getPreviewMenu: function (e) { + return { + type: 'PushItem', + title: t.CHG_GOV_Preview, + fonticon: { + family: 1, + content: 'wux-ui-3ds wux-ui-3ds-1x fonticon-eye', + }, + action: { + callback: function () { + n.createProbesData('Preview'), i.preview(e); + }, + }, + }; + }, + }; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/components/attachmentView/ChgAttachmentView', + [ + 'UWA/Core', + 'UWA/Class', + 'UWA/Class/Debug', + 'UWA/Class/Events', + 'DS/ENOChgGovernanceUX/scripts/util/ChgGovGlobalSubscriber', + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'DS/ENOChgServices/scripts/services/ChgNativeInitService', + 'DS/ENOChgServices/scripts/services/ChgIDCardCommonServices', + ], + function (e, t, i, n, o, a, r, s, l) { + 'use strict'; + var c = { + create: function (e, t) { + var i = this; + i.id = e.id; + for ( + var n = r.getGlobalVariable(), + o = n.referentialsSearchForbiddenType.split(','), + a = (n.referentialsSearchType.split(','), n.tenantMappings), + s = [], + l = 0; + l < a.length; + l++ + ) + n.tenant == a[l].platformId && (s = a[l]); + var c = { + parentObject: { + parentId: e.id, + }, + connectorOptions: { + fetchSecurityContext: function () { + return n.getSecurityContext(); + }, + platformUrls: s, + }, + supportedTypes: { + excludedTypes: o, + includedTypes: ['*'], + }, + }; + 'Change Action' == e.parentType && + (c.parentObject.relationName = 'Related Item'), + (c.readonly = t), + require(['DS/ENOXAttachmentsUX/AttachmentsPane'], function (t) { + (i.attachmentsPane = new t(c)), + (i.modelEvents = i.attachmentsPane.modelEvents), + i.subscribeToEvents(), + i.attachmentsPane.inject(e.target); + }); + }, + subscribeToEvents: function () { + var e = this; + e.modelEvents.subscribe( + { + event: 'attach-attachment-complete', + }, + function (t) { + console.log('attached.....!'); + var i = t.document.dataelements; + i.id = t.document.id; + var n = { + attached: [], + }; + n.attached.push(i); + t = { + id: e.id, + referentials: n, + operation: 'CONNECT', + }; + a.publish('co-update-attachment-complete', t); + }, + ), + e.modelEvents.subscribe( + { + event: 'upload-attachment-complete', + }, + function (t) { + console.log('uploaded.....!'); + var i = {}; + let n = t.parentObject.parentId; + (e.id = n), (i.attached = []); + for (var o = 0; o < t.documents.length; o++) { + var r = t.documents[o].dataelements; + (r.id = t.documents[o].id), i.attached.push(r); + } + t = { + id: e.id, + referentials: i, + operation: 'CONNECT', + }; + a.publish('co-update-attachment-complete', t); + }, + ), + e.modelEvents.subscribe( + { + event: 'detach-attachment-complete', + }, + function (t) { + console.log('detached.....!'); + var i = t.id, + n = { + detached: [], + }; + n.detached.push(i); + t = { + id: e.id, + referentials: n, + operation: 'DISCONNECT', + }; + a.publish('co-update-attachment-complete', t); + }, + ), + r.getGlobalVariable().is3DSpace && + e.modelEvents.subscribe( + { + event: 'context-menu-requested', + }, + function (t) { + if ( + (console.log('context-menu-requested.....!'), + t.contextMenu.getItem('Relations')) + ) { + t.contextMenu.removeItem('Relations'); + var i = { + type: 'PushItem', + title: 'Relations', + text: 'Relations', + id: 'Relations', + fonticon: 'object-related', + handler: function (t) { + var i = e.attachmentsPane.getSelection(); + l.openRelationalExplorer(i); + }, + }; + t.contextMenu.addItem(i); + } + }, + ), + r.getGlobalVariable().is3DSpace && + e.modelEvents.subscribe( + { + event: 'user-clicks-attach', + }, + function (t) { + const i = 'wdg_' + new Date().getTime(); + var n = + '../common/emxFullSearch.jsp?field=TYPES!=' + + r.getGlobalVariable().referentialsSearchForbiddenType + + '&table=AEFGeneralSearchResults&selection=multiple&formName=BCform&submitAction=refreshCaller&hideHeader=true&HelpMarker=emxhelpfullsearch&submitURL=../enterprisechangemgtapp/ECMWebSearchUtil.jsp?fromOperation=searchObjects&uniqueKey=' + + i; + showChooser(n, 850, 630); + var o = function (t) { + if ( + t.storageArea === localStorage && + null != localStorage.searchedObjectDetails && + '' != localStorage.searchedObjectDetails && + localStorage.searchedObjectDetails.indexOf(i) > -1 + ) { + let t = JSON.parse(localStorage.searchedObjectDetails); + delete t.uniqueKey; + let i = []; + Object.values(t).forEach((e) => { + i.push(e[0]); + }), + e.attachmentsPane.attachAttachments(i), + localStorage.removeItem('searchedObjectDetails'), + window.removeEventListener('storage', o); + } else console.log('inside EVENT'); + }; + window.addEventListener('storage', o); + }, + ), + r.getGlobalVariable().isNative && + (e.modelEvents.subscribe( + { + event: 'user-clicks-attach', + }, + function (e) { + s.DispatchEventToWin('CHG_Add_Attachment', 'Attachment'); + }, + ), + e.modelEvents.subscribe( + { + event: 'context-menu-requested', + }, + function (e) { + var t = e.data[0].id; + (c.contextMenu = e.contextMenu), + s.DispatchEventToWin('Referential_ContextMenu', t); + }, + )); + }, + OnSearchComplete: function (e) { + for (var t = e.split(','), i = [], n = 0; n < t.length; n++) + i.push(t[n]); + c.attachmentsPane.attachAttachments(i); + }, + DisplayContextMenu: function (e) { + console.log('ChgAttachmentView: DisplayContextMenu.....!'); + for (var t = 0; t < e.length; t++) c.contextMenu.addItem(e[t]); + }, + }; + return c; + }, + ), + define( + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridView', + [ + 'UWA/Class/View', + 'DS/CoreEvents/ModelEvents', + 'DS/Core/PointerEvents', + 'DS/DataGridView/DataGridView', + 'DS/CollectionView/ResponsiveTilesCollectionView', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/ChgCROrchestrationDataGridViewToolbar', + 'DS/ENOChgServices/scripts/services/ChgInfraService', + 'DS/CollectionView/CollectionViewStatusBar', + 'DS/ENOChgGovernanceUX/scripts/view/changeRequest/facets/changeOrchestration/util/ChgCROrchestrationGridContextualMenu', + 'i18n!DS/ENOChgGovernanceUX/assets/nls/ENOChgGovernanceNLS', + 'DS/ENOChgGovernanceUX/scripts/view/ChgCreateChangeOrder', + 'DS/PlatformAPI/PlatformAPI', + 'DS/ENOChgServices/scripts/services/ChgCustomAttributeService', + 'DS/ENOChgServices/scripts/services/ChgServiceGlobalVariable', + 'require', + ], + function (e, t, i, n, o, a, r, s, l, c, d, u, g, p, h) { + 'use strict'; + return e.extend({ + init: function (e) { + this._parent(e); + var i = this; + (this._modelEvents = null), + null != e && null != e.modelEvents + ? (this._modelEvents = e.modelEvents) + : (this._modelEvents = new t()), + (this.chgOrchestrationGridView = ''), + 'undefined' != this.options.target && + null != this.options.target && + (this.render(), + this.chgOrchestrationGridView.inject(this.options.target), + this.chgOrchestrationGridView.setStyle( + 'width', + this.options.target.offsetWidth, + )), + u.subscribe('idcard-header-minified', function (e) { + e.value + ? (i.chgOrchestrationGridView + .getElement('.content-orchestration-grid-div') + .removeClassName('expanded-header-height'), + i.chgOrchestrationGridView + .getElement('.content-orchestration-grid-div') + .addClassName('minified-header-height'), + i.chgOrchestrationGridView + .getElement('.content-orchestration-tile-div') + .removeClassName('expanded-header-height'), + i.chgOrchestrationGridView + .getElement('.content-orchestration-tile-div') + .addClassName('minified-header-height')) + : (i.chgOrchestrationGridView + .getElement('.content-orchestration-grid-div') + .addClassName('expanded-header-height'), + i.chgOrchestrationGridView + .getElement('.content-orchestration-grid-div') + .removeClassName('minified-header-height'), + i.chgOrchestrationGridView + .getElement('.content-orchestration-tile-div') + .addClassName('expanded-header-height'), + i.chgOrchestrationGridView + .getElement('.content-orchestration-tile-div') + .removeClassName('minified-header-height')); + }); + }, + render: function () { + try { + var e = this.processColumns(), + t = this, + d = { + treeDocument: this.options.treeDocument, + columns: e, + cellSelection: 'none', + rowSelection: 'multiple', + cellDragEnabledFlag: !0, + showNodeKPIColorFlag: !0, + identifier: 'chgCROrchestrationGrid', + defaultColumnDef: { + width: 'auto', + resizableFlag: !0, + sortableFlag: !0, + }, + onContextualEvent: function (e) { + var i = []; + if (e && e.collectionView && e.cellInfos) { + if (e.cellInfos.rowID > -1) + return l + .showRMBMenuOnGrid(t, e, t.options.target) + .then(function (e) { + return e; + }); + e.collectionView.columns.length, e.cellInfos.columnID; + i = e.collectionView.buildDefaultContextualMenu(e, { + pin: !0, + firstColumnsVisibility: !0, + columnsManagement: !0, + sizeColumnToFit: !1, + }); + } + return i; + }, + filterBaseCAId: 'All My Active Changes', + onDragStartRowHeader: function (e, t) { + r.readyDragContent(e, t); + }, + onDragStartCell: function (e, t) { + r.readyDragContent(e, t); + }, + }; + d = UWA.merge(d, this.options); + var u = { + model: this.options.treeDocument, + height: 'inherit', + allowUnsafeHTMLContent: !1, + displayedOptionalCellProperties: [ + 'contextualMenu', + 'description', + 'propertiesList', + 'activeFlag', + 'statusbarIcons', + ], + }; + (this.chgOrchestrationGrid = new n(d)), + (this.chgOrchestrationGrid.cellSelection = 'none'), + (this.chgOrchestrationGrid.getCustomViewsManager().onCustomViewsSave = + function (e, t) { + e.map((e) => { + if (e.identifier == t) { + let t = e.columnsVisibleFlag; + if (null != t && null != t) { + let e = Object.keys(t); + p.getGlobalVariable().customeViewCOList = e; + } + } + }); + }), + (this.chgOrchestrationGrid.onDelayedModelDataRequest = function ( + e, + ) { + let i = t.chgOrchestrationGrid + .getCustomViewsManager() + .getCustomViews(), + n = + t.chgOrchestrationGrid.getCustomViewsManager() + ._currentCustomViewIdentifier; + i.map((e) => { + if (e.identifier == n) { + let t = e.columnsVisibleFlag; + if (null != t && null != t) { + let e = Object.keys(t); + p.getGlobalVariable().customeViewCOList = e; + } + } + }); + var o = e.collectionView; + let a = [], + r = [], + s = p.getGlobalVariable().customeViewCOList; + if (-1 != e.endNodeIndex && -1 != e.startNodeIndex) { + for (let t = e.startNodeIndex; t <= e.endNodeIndex; t++) { + a.push(o.model[t].options.grid.id), r.push(o.model[t]); + for (let e = 0; e < s.length; e++) + o.model[t].setAttribute(s[e], void 0); + } + g.updateAsynAttributeColumn(s, a, r); + } + }); + let b = this.chgOrchestrationGrid; + this._modelEvents.publish({ + event: 'hideEmpty-datagrid', + data: b, + }), + (this.tileView = new o(u)); + var h = { + callback: function (e) { + if (e && e.cellInfos && e.cellInfos.cellModel) + return l.showRMBMenuOnGrid(t, e, !0).then(function (e) { + return e; + }); + }, + }; + this.tileView.onContextualEvent = h; + this.chgOrchestrationGrid + .getTypeRepresentationFactory() + .registerTypeRepresentations({ + addDropdown: { + stdTemplate: 'functionMenuIcon', + semantics: { + label: 'action', + icon: 'plus', + }, + }, + }), + (a.toolbar = this.chgOrchestrationGrid.setToolbar( + a.writetoolbarDefinition(this.options), + )), + (this.toolbar = a.toolbar); + t = this; + this.chgOrchestrationGrid.addEventListener( + 'allCellsRendered', + function () { + t.chgOrchestrationGrid.buildStatusBar([ + { + type: s.STATUS.CUSTOM, + id: 'totalItems', + dataElements: { + typeRepresentation: 'string', + value: + c.CHG_GOV_StatusBar_TotalItems + + t.chgOrchestrationGrid + .getTreeDocument() + .getAllDescendants().length, + }, + }, + { + type: s.STATUS.CUSTOM, + id: 'selectedGridCount', + dataElements: { + typeRepresentation: 'string', + value: + c.CHG_GOV_StatusBar_SelectedItems + + t.chgOrchestrationGrid + .getTreeDocument() + .getSelectedNodes().length, + }, + }, + ]), + t.tileView.buildStatusBar([ + { + type: s.STATUS.CUSTOM, + id: 'totalItems', + dataElements: { + typeRepresentation: 'string', + value: + c.CHG_GOV_StatusBar_TotalItems + + t.tileView.getTreeDocument().getAllDescendants() + .length, + }, + }, + { + type: s.STATUS.CUSTOM, + id: 'selectedTileCount', + dataElements: { + typeRepresentation: 'string', + value: + c.CHG_GOV_StatusBar_SelectedItems + + t.tileView.getTreeDocument().getSelectedNodes() + .length, + }, + }, + ]); + }, + ), + t.chgOrchestrationGrid.addEventListener( + i.POINTERHIT, + function (e, i) { + t.onItemClick(e, i); + }, + ), + t.chgOrchestrationGrid + .getTreeDocument() + .getXSO() + .onAdd(function (e) { + t.chgOrchestrationGrid.elements.statusBar + .getNodeModelByID('selectedGridCount') + .updateOptions({ + grid: { + data: + c.CHG_GOV_StatusBar_SelectedItems + + e.getTreeDocument().getSelectedNodes().length, + }, + }), + t.tileView.elements.statusBar + .getNodeModelByID('selectedTileCount') + .updateOptions({ + grid: { + data: + c.CHG_GOV_StatusBar_SelectedItems + + e.getTreeDocument().getSelectedNodes().length, + }, + }), + t.onSelectionChange( + t._modelEvents, + e, + t.id, + t.options.contextDetails.isKindOfType, + 'onAdd', + ); + }), + t.chgOrchestrationGrid + .getTreeDocument() + .getXSO() + .onRemove(function (e) { + t.chgOrchestrationGrid.elements.statusBar + .getNodeModelByID('selectedGridCount') + .updateOptions({ + grid: { + data: + c.CHG_GOV_StatusBar_SelectedItems + + e.getTreeDocument().getSelectedNodes().length, + }, + }), + t.tileView.elements.statusBar + .getNodeModelByID('selectedTileCount') + .updateOptions({ + grid: { + data: + c.CHG_GOV_StatusBar_SelectedItems + + e.getTreeDocument().getSelectedNodes().length, + }, + }), + t.onSelectionChange( + t._modelEvents, + e, + t.id, + t.options.contextDetails.isKindOfType, + 'onRemove', + ); + }), + t.tileView.addEventListener(i.POINTERHIT, function (e, i) { + t.onItemClick(e, i); + }), + (this.onItemClick = function (e, i) { + if ( + i && + i.nodeModel && + i.nodeModel.options.grid && + 2 == e.multipleHitCount + ) { + console.log('CROrchestration_OnItemClcik'), + i.nodeModel.select(!0), + t._modelEvents.publish({ + event: 'update-property-panel-data', + data: { + context: i.nodeModel, + }, + }); + let e = i.nodeModel.getPath().length, + n = {}, + o = {}; + e > 1 && + ((n.id = i.nodeModel.getParent().options.grid.id), + (n.title = i.nodeModel.getParent().options.grid.title), + (n.name = i.nodeModel.getParent().options.grid.name)), + e > 2 && + ((o.id = i.nodeModel + .getParent() + .getParent().options.grid.id), + (o.title = i.nodeModel + .getParent() + .getParent().options.grid.title), + (o.name = i.nodeModel + .getParent() + .getParent().options.grid.name)), + t._modelEvents.publish({ + event: 'CROrchestration-DataGrid-on-dblclick', + data: { + model: i.nodeModel.options.grid, + pathlength: e, + parentModel: n, + gradParentModel: o, + }, + context: i.nodeModel, + }); + } + }), + (this.chgOrchestrationGridView = UWA.createElement('div', { + id: 'outer-orchestration-grid-div', + styles: { + width: '100%', + height: '100%', + display: 'inline-block', + }, + class: 'outer-orchestration-grid-div', + })); + var m = UWA.createElement('div', { + styles: { + width: '100%', + }, + class: 'toolbar-orchestration-grid-div', + }); + this.toolbar.inject(m); + var C = UWA.createElement('div', { + class: 'content-orchestration-grid-div expanded-header-height', + }), + v = UWA.createElement('div', { + class: + 'content-orchestration-tile-div orchestrationtileView expanded-header-height', + }), + f = UWA.createElement('div', { + class: 'hideView', + id: 'orchestrationEmptyTileViewDiv', + }); + UWA.createElement('div', { + html: c.CHG_GOV_ChangeOrchestration_DataGrid_PlaceHolder, + }).inject(f), + \ No newline at end of file