Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IVYPORTAL-16887 Task/Case widget in edit mode column align not correctly #834

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<cc:attribute name="isReadOnlyMode" default="false"/>
<cc:attribute name="isPreviewMode" default="false"/>
<cc:attribute name="onCompleteLoadWidget" />
<cc:attribute name="caseWidgetVar" default="dashboard-cases" />


</cc:interface>

<cc:implementation>
Expand All @@ -19,8 +22,8 @@

<p:remoteCommand id="rcLoadCaseFirstTime" autoRun="true" actionListener="#{caseWidget.dataModel.loadFirstTime()}"
update="dashboard-cases-container" global="false" async="true" process="@this"
oncomplete="loadCaseAndTaskWidgetFirstTime('js-loading-#{caseWidget.id}', 'js-dashboard-cases-container-#{caseWidget.id}'); #{cc.attrs.onCompleteLoadWidget} #{cc.attrs.isPreviewMode ? 'calculateFilterPaneltPosition();' : ''}" />
<p:inputText type="hidden" value="dashboard-cases-#{caseWidget.id}" styleClass="js-table-widget-var" rendered="#{!isPreviewMode}" />
oncomplete="loadCaseAndTaskWidgetFirstTime('js-loading-#{caseWidget.id}', 'js-dashboard-cases-container-#{caseWidget.id}'); #{cc.attrs.onCompleteLoadWidget}; #{cc.attrs.isPreviewMode ? 'calculateFilterPaneltPosition();' : ''}" />
<p:inputText type="hidden" value="#{cc.attrs.caseWidgetVar}-#{caseWidget.id}" styleClass="js-table-widget-var" rendered="#{!isPreviewMode}" />
<div class="ui-g">
<h:panelGroup layout="block"
styleClass="js-loading-#{caseWidget.id} case-dashboard-widget__loading-message ui-g-12">
Expand All @@ -40,7 +43,7 @@
</p:commandLink>
</h:panelGroup>

<p:dataTable id="dashboard-cases" widgetVar="dashboard-cases-#{caseWidget.id}" value="#{caseWidget.dataModel}" var="caseItem"
<p:dataTable id="dashboard-cases" widgetVar="#{cc.attrs.caseWidgetVar}-#{caseWidget.id}" value="#{caseWidget.dataModel}" var="caseItem"
lazy="true" scrollRows="25"
liveScroll="true" scrollable="true" sortBy="#{caseWidget.sortBy}"
rowIndexVar="rowIndex" rowHover="#{isReadOnlyMode}" selectionMode="single"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
<ic:ch.ivy.addon.portal.generic.dashboard.component.ColumnManagement id="column-management-component" widget="#{widget}"
componentToUpdate="#{cc.attrs.componentToUpdate}" />
<ic:ch.ivy.addon.portal.generic.dashboard.component.CaseWidget id="case-widget-preview" isReadOnlyMode="#{cc.attrs.isReadOnlyMode}"
caseWidget="#{widget}" renderColumnConfiguration="false" isPreviewMode="true"
onCompleteLoadWidget="setTimeout(function() { PF('new-widget-configuration-dialog').initPosition(); }, 100);"/>
caseWidget="#{widget}" renderColumnConfiguration="false" isPreviewMode="true" caseWidgetVar="dashboard-cases-configuration" componentToUpdateCaseWidget="@widgetVar(dashboard-cases-configuration-#{widget.id})"
onCompleteLoadWidget="setTimeout(function() { PF('new-widget-configuration-dialog').initPosition(); }, 100); initTableWidget(PF('dashboard-cases-configuration-#{widget.id}'))"/>
</ui:define>

<ui:define name="multiLanguageDialog">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<cc:interface componentType="IvyComponent">
<cc:attribute name="taskWidget" type="ch.ivy.addon.portalkit.dto.dashboard.TaskDashboardWidget" required="true" />
<cc:attribute name="renderColumnConfiguration" default="false" />
<cc:attribute name="taskWidgetVar" default="dashboard-tasks" />
<cc:attribute name="isReadOnlyMode" default="false" />
<cc:attribute name="isPreviewMode" default="false"/>
<cc:attribute name="onCompleteLoadWidget" />
Expand All @@ -23,7 +24,7 @@
<p:remoteCommand id="rcLoadTaskFirstTime" autoRun="true" actionListener="#{taskWidget.dataModel.loadFirstTime()}"
update="dashboard-tasks-container" global="false" async="true" process="@this"
oncomplete="loadCaseAndTaskWidgetFirstTime('js-loading-#{taskWidget.id}', 'js-dashboard-tasks-container-#{taskWidget.id}'); #{cc.attrs.onCompleteLoadWidget}; #{cc.attrs.isPreviewMode ? 'calculateFilterPaneltPosition();' : ''}" />
<p:inputText type="hidden" value="dashboard-tasks-#{taskWidget.id}" styleClass="js-table-widget-var" rendered="#{!isPreviewMode}" />
<p:inputText type="hidden" value="#{cc.attrs.taskWidgetVar}-#{taskWidget.id}" styleClass="js-table-widget-var" rendered="#{!isPreviewMode}" />
<div class="ui-g">
<h:panelGroup layout="block"
styleClass="js-loading-#{taskWidget.id} task-dashboard-widget__loading-message ui-g-12">
Expand All @@ -40,7 +41,7 @@
<p:resetInput target="#{p:resolveFirstComponentWithId('column-management-dialog', view).clientId}" />
</p:commandLink>
</h:panelGroup>
<p:dataTable id="dashboard-tasks" widgetVar="dashboard-tasks-#{taskWidget.id}" value="#{taskWidget.dataModel}" var="task"
<p:dataTable id="dashboard-tasks" widgetVar="#{cc.attrs.taskWidgetVar}-#{taskWidget.id}" value="#{taskWidget.dataModel}" var="task"
lazy="true" scrollRows="25"
disabledSelection="#{isPreviewMode}"
liveScroll="true" scrollable="true" sortBy="#{taskWidget.sortBy}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<ic:ch.ivy.addon.portal.generic.dashboard.component.ColumnManagement id="column-management-component" widget="#{widget}"
componentToUpdate="#{cc.attrs.componentToUpdate}" />
<ic:ch.ivy.addon.portal.generic.dashboard.component.TaskWidget id="task-widget-preview" isReadOnlyMode="#{cc.attrs.isReadOnlyMode}"
taskWidget="#{widget}" renderColumnConfiguration="false" isPreviewMode="true"
onCompleteLoadWidget="setTimeout(function() { PF('new-widget-configuration-dialog').initPosition(); }, 100);"/>
taskWidget="#{widget}" renderColumnConfiguration="false" isPreviewMode="true" taskWidgetVar="dashboard-tasks-configuration" componentToUpdateTaskWidget="@widgetVar(dashboard-tasks-configuration-#{widget.id})"
onCompleteLoadWidget="setTimeout(function() { PF('new-widget-configuration-dialog').initPosition(); }, 100); initTableWidget(PF('dashboard-tasks-configuration-#{widget.id}'))"/>
</ui:define>

<ui:define name="multiLanguageDialog">
Expand Down
12 changes: 12 additions & 0 deletions AxonIvyPortal/portal/webContent/resources/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,18 @@ function loadCaseAndTaskWidgetFirstTime(loadingClass, widgetClass) {
}, 50);
}

function initTableWidget(table) {
if (table === undefined || table.cfg === undefined) {
return;
}

setTimeout(function(){
var $table = $(document.getElementById(table.id));
table.cfg.scrollHeight = $table.height().toString();
table.init(table.cfg);
}, 500);
}

function hideAllDashboardOverlayPanels() {
var openingOverlayPanel = $(".js-dashboard-overlay-panel");
if (openingOverlayPanel.length > 0) {
Expand Down
Loading