Skip to content

Commit

Permalink
Merge pull request #17 from jazz-community/fix/print-dialog
Browse files Browse the repository at this point in the history
fix: Update dialog access for Jazz Version 7+
  • Loading branch information
dave007700 authored Feb 27, 2023
2 parents df3e2aa + 8f9a052 commit 0871311
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.siemens.bt.jazz.viewlet.printableworkitems",
"version": "1.0.3",
"version": "1.0.7",
"description": "The 'My Teams' widget shows the teams one is member of in the selected/active project area. It also provides the same functionality as the Teams widget.",
"scripts": {
"build": "npm run babel-compile && webpack --config ./webpack.config.js --mode production",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ dojo.require("com.siemens.bt.jazz.viewlet.printableworkitems.jazzUtilities.modul
// Create the dialog
this._dialog = new Dialog({
contentNode: this.domNode,
primaryTitle: _primaryTitle,
heading: _primaryTitle,
width: _width,
isClosable: true,
onClose: function () {
Expand Down Expand Up @@ -131,7 +131,7 @@ dojo.require("com.siemens.bt.jazz.viewlet.printableworkitems.jazzUtilities.modul
}
this._styledBox = new jazz.ui.StyledBox({
closable: false,
primaryTitle: reportParam.getDisplayLabel(),
heading: reportParam.getDisplayLabel(),
secondaryTitle: (reportParam.isRequired() ? "<span class=\"requiredMarker\">*</span>" : ""),
contentNode: reportParam.domNode,
"class": "box-single",
Expand All @@ -149,10 +149,10 @@ dojo.require("com.siemens.bt.jazz.viewlet.printableworkitems.jazzUtilities.modul
},

/*
* @param Boolean show
*
* @return void
*/
* @param Boolean show
*
* @return void
*/
showPreviewPane: function (show) {

if (show) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@ define([
}

});

this._printableWorkitemPanelDialog._dialog.updatePosition();

},

/**
Expand Down Expand Up @@ -624,8 +621,6 @@ define([
* @override PrintableWorkItemDraw._updateTitle
*/
_updateTitle: function () {
this._printableWorkitemPanelDialog._dialog.updatePosition();

this._updateTypes();

this._bindEventsToTable();
Expand Down Expand Up @@ -1046,10 +1041,6 @@ define([


domClass.toggle(tableElement, "hidden");

self._printableWorkitemPanelDialog._dialog.updatePosition();


});

on(this.getTemplateDOMElementByID("toggle\\.grid"), "click", (evt) => {
Expand Down
6 changes: 2 additions & 4 deletions resources/jazzUtilities/modules/src/WorkItemPlanDialog.es6
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define([
'require',
'./../DojoSweetAlert',
'com.ibm.team.apt.web.ui.internal.editor.config.PlanModeClient',
'com.ibm.team.apt.web.ui.internal.viewlet.PlanChooserWidget'
'com.ibm.team.apt.web.ui.internal.viewlet.PlanChooserWidget',
], function (declare, require, DojoSweetAlert, PlanModeClient, PlanChooserWidget) {

var DojoSweetAlert = com.siemens.bt.jazz.viewlet.printableworkitems.jazzUtilities.modules.DojoSweetAlert;
Expand Down Expand Up @@ -35,7 +35,6 @@ define([

new PlanChooserWidget().createChooser(
function (result1, result2) {

var team = com.ibm.team;
var apt = team.apt;
var web = apt.web;
Expand All @@ -50,8 +49,7 @@ define([
var client2 = web.client;
var PlanningClient2 = client2.PlanningClient2;

var shared = apt.shared;
var Future = shared.client.internal.util.Future;
var Future = client2.internal.util.Future;

var onPlanModes = new Future();
onPlanModes.setErrCallback(function (error) {
Expand Down
29 changes: 14 additions & 15 deletions resources/jazzUtilities/modules/src/WorkItemPrintProvider.es6
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,11 @@ define([

new WorkItemPlanDialog().getListFromPlan().then(
function (data) {

mainContainer._printableWorkitemPanelDialog._dialog._primaryHeaderText.innerText = `${mainContainer._globalDialogPrimaryTitle}, Plan is selected`;
mainContainer._updateDialogHeader(`${mainContainer._globalDialogPrimaryTitle}, Plan is selected`);

mainContainer._handleFoundItemList(
data
);

}, function (error) {
console.warn(error);
}
Expand Down Expand Up @@ -364,6 +362,17 @@ define([

},

/**
* Update the header of the current dialogbox
*
* @param {String} content The text which should be displayed as the header
*/
_updateDialogHeader: function (content) {
if (this._printableWorkitemPanelDialog && this._printableWorkitemPanelDialog._dialog && this._printableWorkitemPanelDialog._dialog._heading) {
this._printableWorkitemPanelDialog._dialog._heading.innerText = content;
}
},

/**
* Create a configuration as table, and places it in the printing queue
*
Expand Down Expand Up @@ -396,9 +405,6 @@ define([
// Custom Attribute
_customAttribute
);

this._printableWorkitemPanelDialog._dialog.updatePosition();

},

/**
Expand All @@ -411,7 +417,7 @@ define([

this._globalLastQueryDto = queryDto;

this._printableWorkitemPanelDialog._dialog._primaryHeaderText.innerText = `${this._globalDialogPrimaryTitle}, Query: ${queryDto.name}`;
this._updateDialogHeader(`${this._globalDialogPrimaryTitle}, Query: ${queryDto.name}`);

window.scrollTo(0, 0);

Expand Down Expand Up @@ -459,7 +465,6 @@ define([
swal.close();
window.scrollTo(0, 0);
holdElement.innerHTML = "No Items found with this Query";
mainContainer._printableWorkitemPanelDialog._dialog.updatePosition();
mainContainer.getTemplateDOMElementByID("holder\\.table").innerHTML = "";
}, 100);
}
Expand All @@ -475,7 +480,6 @@ define([
window.scrollTo(0, 0);
mainContainer.getTemplateDOMElementByID("query\\.select").innerHTML = "Can't resolve Query";
mainContainer.getTemplateDOMElementByID("holder\\.table").innerHTML = "";
mainContainer._printableWorkitemPanelDialog._dialog.updatePosition();
}, 100);
}
}
Expand Down Expand Up @@ -641,8 +645,6 @@ define([
element.checked ? "inline-table" : "none";

});

this._printableWorkitemPanelDialog._dialog.updatePosition();
},

/**
Expand Down Expand Up @@ -853,9 +855,7 @@ define([
* @override PrintableWorkItemDraw._updateTitle
*/
_updateTitle: function () {
if (this._queryList.length === 0) {
this._printableWorkitemPanelDialog._dialog.updatePosition();
} else {
if (this._queryList.length !== 0) {
this._queryListID++;

if (this._queryList.length > this._queryListID) {
Expand All @@ -875,7 +875,6 @@ define([
}
} else {
swal.close();
this._printableWorkitemPanelDialog._dialog.updatePosition();
this._queryList = [];
this._queryListID = 0;
}
Expand Down

0 comments on commit 0871311

Please sign in to comment.