Skip to content

Commit

Permalink
IVYPORTAL-17304: Hide FullScreen and Widget Info icon
Browse files Browse the repository at this point in the history
  • Loading branch information
pvthai-axonivy committed Sep 10, 2024
1 parent 3617587 commit 49b0996
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ public class ClientStatisticDashboardWidget extends DashboardWidget {

private static final long serialVersionUID = 1L;
private String chartId;
private boolean showFullscreenMode;

public ClientStatisticDashboardWidget() {}
public ClientStatisticDashboardWidget() {
setShowFullscreenMode(true);
}

@JsonIgnore
@Override
Expand All @@ -35,4 +38,12 @@ public void setChartId(String chartId) {
public void cancelUserFilter() {
}

public boolean isShowFullscreenMode() {
return showFullscreenMode;
}

public void setShowFullscreenMode(boolean showFullscreenMode) {
this.showFullscreenMode = showFullscreenMode;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ public boolean canShowWidgetInfoOption() {

public boolean canShowFullscreenModeOption() {
return this == TASK || this == CASE || this == PROCESS || this == NEWS || this == CUSTOM || this == PROCESS_VIEWER
|| this == STATISTIC;
|| this == CLIENT_STATISTIC || this == NOTIFICATION;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ public class NotificationDashboardWidget extends DashboardWidget {
@JsonIgnore
private long countUnread;
private boolean onlyUnread;
private boolean showFullscreenMode;

public NotificationDashboardWidget() {
this.webNotifications = WebNotifications.current();
this.countAll = webNotifications.countAll();
this.countUnread = webNotifications.countUnread();
setShowFullscreenMode(true);
}

@JsonIgnore
Expand Down Expand Up @@ -93,4 +95,12 @@ public void goToTaskDetail(NotificationDto dto) {
PortalNavigator.redirect(dto.getInfoAction().getLink().getRelative());
}

public boolean isShowFullscreenMode() {
return showFullscreenMode;
}

public void setShowFullscreenMode(boolean showFullscreenMode) {
this.showFullscreenMode = showFullscreenMode;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,6 @@
</div>
</h:panelGroup>

<div class="ui-g-12 u-padding-0">
<div class="ui-g-4">
<p:outputLabel
value="#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/dashboard/widgetType')}"
for="custom-widget-type" />
</div>
<div class="ui-g-8 ui-fluid">
<p:selectOneMenu id="custom-widget-type"
value="#{widget.data.type}">
<f:selectItems
value="#{dashboardCustomWidgetBean.customWidgetTypes}"
var="type" itemLabel="#{type.label}" itemValue="#{type}" />
<p:ajax event="itemSelect" process="@this widget-title"
partialSubmit="true" update="user-filter"
listener="#{dashboardCustomWidgetBean.onChangeType(widget)}" />
</p:selectOneMenu>
</div>
</div>
<c:set var="isIvyProcess" value="#{widget.data.type == 'PROCESS'}" />
<h:panelGroup id="external-url-panel"
styleClass="ui-g-12 u-padding-0" rendered="#{!isIvyProcess}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,6 @@
<p:messages id="statistic-widget-validation-messages" closable="true" styleClass="ui-g-12"/>
</div>
</h:panelGroup>

<h:panelGroup id="fullscreen-mode-group" rendered="#{managedBean.displayFullscreenModeOption()}"
styleClass="ui-g ui-g-12 u-padding-0 ui-fluid">
<div class="ui-g-4">
<p:outputLabel for="fullscreen-option"
value="#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/dashboard/fullscreenMode')}"
styleClass="u-mar-right-5" />
</div>
<div class="ui-g-6 ui-inputgroup">
<p:selectBooleanCheckbox id="fullscreen-option"
value="#{widget.showFullscreenMode}">
<p:ajax process="fullscreen-mode-group"
update="fullscreen-mode-group" partialSubmit="true"/>
</p:selectBooleanCheckbox>
</div>
</h:panelGroup>

</div>
</h:panelGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<ui:param name="isReadOnlyMode" value="#{isReadOnlyMode or isPreviewMode}" />
<ui:param name="isRenderInfo" value="false" />
<ui:param name="isRenderEdit" value="false" />
<ui:param name="isRenderExpandCollapse" value="#{widget.isShowFullscreenMode()}" />
<ui:param name="widgetContentStyleClass" value="client-statistic" />

<ui:define name="widgetContent">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<ui:param name="panelId" value="notification-widget-#{widget.id}-panel" />
<ui:param name="isReadOnlyMode" value="#{cc.attrs.isReadOnlyMode}" />
<ui:param name="isRenderInfo" value="false" />
<ui:param name="isRenderExpandCollapse" value="#{widget.isShowFullscreenMode()}" />
<ui:param name="widgetContentStyleClass" value="notification-widget__content-panel" />
<ui:param name="unreadNotificationsId" value="#{p:resolveFirstComponentWithId('topbar-unread-notifications-container', view).clientId}" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@
</p:selectBooleanCheckbox>
</div>
</h:panelGroup>
<h:panelGroup id="fullscreen-mode-group" rendered="#{managedBean.displayFullscreenModeOption()}"
styleClass="ui-g-12 u-padding-0 ui-fluid w-full display-inline-flex-center">
<div class="ui-g-4">
<p:outputLabel for="fullscreen-option"
value="#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/dashboard/fullscreenMode')}"
styleClass="u-mar-right-5" />
</div>
<div class="ui-g-8 ui-inputgroup">
<p:selectBooleanCheckbox id="fullscreen-option"
value="#{widget.showFullscreenMode}">
<p:ajax process="fullscreen-mode-group"
update="fullscreen-mode-group" partialSubmit="true"/>
</p:selectBooleanCheckbox>
</div>
</h:panelGroup>
</div>
</h:panelGroup>
<!-- Multi language dialog-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Below is a sample JSON definition of a news widget in the Portal dashboard
"h": 6,
"x": 0,
"y": 0
}
},
"showFullscreenMode": true
}
..
Expand All @@ -48,4 +49,6 @@ The basic JSON structure of a news widget

``styleClass`` (optional): add CSS Classes to HTML DOM of the widget

``style`` (optional): add inline style to HTML DOM of the widget
``style`` (optional): add inline style to HTML DOM of the widget

``showFullscreenMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Below is a sample JSON definition of the case widget in the Portal dashboard.
"sortField": "name",
"rowsPerPage": 20,
"showWidgetInfo": true,
"showExpandMode": true,
"showFullscreenMode": true,
"columns": [
{
"field": "start"
Expand Down Expand Up @@ -103,7 +103,7 @@ The basic JSON structure of the case widget

- ``showWidgetInfo``: visibility of the widget information icon. The default value is ``true``, set to ``false`` to hide the icon

- ``showExpandMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon
- ``showFullscreenMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon

- ``columns``: column configurations for each column in the case widget. You
can predefine filters, styles, visibility,... of columns and define custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Below is a standard JSON definition of the custom widget in the Portal dashboard
{
"type": "custom",
"id": "custom-widget",
"showFullscreenMode": true,
"names": [
{
"locale": "en",
Expand Down Expand Up @@ -88,6 +89,8 @@ The basic JSON structure of the custom widget
``data``: data for customization. Please refer to the following sections to
understand how to use this field.

``showFullscreenMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon

Define Ivy Process
------------------

Expand All @@ -100,6 +103,7 @@ JSON structure
{
"type": "custom",
"id": "custom-widget",
"showFullscreenMode": true,
"names": [
{
"locale": "en",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Now users can interact with multiple systems from the Portal dashboard.

``External URL``: External page link

``showFullscreenMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon

Define An External Page Widget Using JSON
-----------------------------------------

Expand All @@ -28,6 +30,7 @@ The JSON structure is the following:
{
"type": "custom",
"id": "custom-widget",
"showFullscreenMode": true,
"names": [
{
"locale": "en",
Expand All @@ -47,6 +50,8 @@ Attribute explanation:

``url``: the URL of the external webpage you want to show.

``showFullscreenMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon

.. warning::
Some external websites do not allow to be loaded in IFrames. You have to make sure
that their security policy allows the embedding if you want to use these pages in your custom widget.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Below is a sample JSON definition of a notification widget in the Portal dashboa
"style": "text-color: blue;",
"styleClass": "your-widget-class"
},
"onlyUnread": true
"onlyUnread": true,
"showFullscreenMode": true
}
..
Expand All @@ -69,3 +70,5 @@ The basic JSON structure of a Notifications widget
``style`` (optional): add inline style to HTML DOM of the widget

``onlyUnread``: filter only unread notifications. The default value is "false"

``showFullscreenMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Below is a sample JSON definition of a process viewer widget in the Portal dashb
"layout": {
"x": 0, "y": 0, "w": 12, "h": 6
},
"processPath": "designer/portal-developer-examples/Start Processes/Request/createNewRequest.ivp"
"processPath": "designer/portal-developer-examples/Start Processes/Request/createNewRequest.ivp",
"showFullscreenMode": true
}

The basic JSON structure of a process viewer widget
Expand All @@ -50,3 +51,5 @@ The basic JSON structure of a process viewer widget
``style`` (optional): add inline style to HTML DOM of the widget

``processPath``: the :dev-url:`|ivy| IWebStartable </doc/|version|/public-api/ch/ivyteam/ivy/workflow/start/IWebStartable.html>` identifier of the process you want to display

``showFullscreenMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ Below is a standard JSON definition of a Process widget in compact mode
"processPaths": ["designer/portal-developer-examples/Start Processes/Request/createNewRequest.ivp", "designer/portal-developer-examples/Start Processes/Request/collectDataRequest.ivp"],
"categories": ["/Categories/Showcase/Customized", "/Categories/Showcase/PortalDialogExample"],
"sorting": "SORTING_INDEX",
"enableQuickSearch": true
"enableQuickSearch": true,
"showFullscreenMode" : true,
"showWidgetInfo" : true
}
..
Expand Down Expand Up @@ -135,7 +137,9 @@ Below is a standard JSON definition of a Process widget in combined mode
"x": 10, "y": 0, "w": 2, "h": 4
},
"processPath": "designer/portal-developer-examples/Start Processes/Request/createNewRequest.ivp",
"rowsPerPage": 5
"rowsPerPage": 5,
"showFullscreenMode" : true,
"showWidgetInfo" : true
}
..
Expand Down Expand Up @@ -164,7 +168,9 @@ Below is a standard JSON definition of a Process widget in full mode
"layout": {
"x": 10, "y": 0, "w": 2, "h": 4
},
"processPath": "designer/portal-developer-examples/Start Processes/Request/createNewRequest.ivp"
"processPath": "designer/portal-developer-examples/Start Processes/Request/createNewRequest.ivp",
"showFullscreenMode" : true,
"showWidgetInfo" : true
}
..
Expand All @@ -187,7 +193,9 @@ Below is a standard JSON definition of the Process widget in image mode
"layout": {
"x": 10, "y": 0, "w": 2, "h": 4
},
"processPath": "designer/portal-developer-examples/Start Processes/Request/createNewRequest.ivp"
"processPath": "designer/portal-developer-examples/Start Processes/Request/createNewRequest.ivp",
"showFullscreenMode" : true,
"showWidgetInfo" : true
}
..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ Below is a sample JSON definition of a statistic widget in the Portal dashboard
"x" : 8,
"y" : 2
},
"chartId": "10"
"chartId": "10",
"showFullscreenMode": true
}
..
Expand All @@ -43,4 +44,6 @@ The basic JSON structure of a statistic widget

- ``h``: HTML DOM Style ``height`` is calculated as formula ``60 * h + 20 * (h - 1)``

``chartId``: ID of the standard client statistic chart. For more information, please refer to :ref:`Portal.StatisticCharts <portal-statistic-charts>`.
``chartId``: ID of the standard client statistic chart. For more information, please refer to :ref:`Portal.StatisticCharts <portal-statistic-charts>`.

``showFullscreenMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Below is a sample JSON definition of a task widget in the Portal dashboard
"sortField": "name",
"rowsPerPage": 20,
"showWidgetInfo": true,
"showExpandMode": true,
"showFullscreenMode": true,
"columns": [
{
"field": "start"
Expand Down Expand Up @@ -99,7 +99,7 @@ The basic JSON structure of a Task widget

``showWidgetInfo``: visibility of the widget information icon. The default value is ``true``, set to ``false`` to hide the icon

``showExpandMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon
``showFullscreenMode``: visibility of the fullscreen mode icon. The default value is ``true``, set to ``false`` to hide the icon

``columns``: column configurations for each of the columns in the widget. You
can predefine filters, styles, visibility,... of columns and define custom
Expand Down

0 comments on commit 49b0996

Please sign in to comment.