Skip to content

Commit

Permalink
schema cleanup: AdminGuiConfigurationType.userDashboard usage removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Kateryna Honchar committed Jun 7, 2023
1 parent 315f30a commit 819d69f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
<a:operation>removed</a:operation>
<a:comment>Use panel configuration instead.</a:comment>
</a:schemaMigration>
<a:schemaMigration>
<a:element>tns:userDashboard</a:element>
<a:version>4.8</a:version>
<a:operation>removed</a:operation>
<a:comment>Use homePage/widget instead</a:comment>
</a:schemaMigration>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
Expand Down Expand Up @@ -121,25 +127,6 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="userDashboard" type="tns:DashboardLayoutType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
<p>
Specifies the layout of the user dashboard (home screen):
it defines which boxes should be visible, which should be hidden, etc.

DEPRECATED, use homePage configuration instead
</p>
</xsd:documentation>
<xsd:appinfo>
<a:since>3.6</a:since>
<a:displayName>AdminGuiConfigurationType.userDashboard</a:displayName>
<a:deprecated/>
<a:deprecatedSince>4.6</a:deprecatedSince>
<a:plannedRemoval>4.8</a:plannedRemoval>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="configurableUserDashboard" type="tns:ConfigurableUserDashboardType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,6 @@ private void applyAdminGuiConfiguration(CompiledGuiProfile composite, AdminGuiCo
joinResourceDetails(composite.getObjectDetails(), resourceDetails, detailForAllResources, result);
}
}
if (adminGuiConfiguration.getUserDashboard() != null) {
if (composite.getUserDashboard() == null) {
composite.setUserDashboard(adminGuiConfiguration.getUserDashboard().clone());
} else {
for (DashboardWidgetType widget : adminGuiConfiguration.getUserDashboard().getWidget()) {
mergeWidget(composite, widget);
}
}
}

if (!adminGuiConfiguration.getConfigurableUserDashboard().isEmpty()) {
for (ConfigurableUserDashboardType configurableUserDashboard : adminGuiConfiguration.getConfigurableUserDashboard()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3793,8 +3793,8 @@ public void test991ChangeInsideNonPersistedContainerWorksOk()

given("delta with widget addition for user 1 using container add modification");
ObjectDelta<UserType> delta = prismContext.deltaFor(UserType.class)
.item(UserType.F_ADMIN_GUI_CONFIGURATION, AdminGuiConfigurationType.F_USER_DASHBOARD,
DashboardLayoutType.F_WIDGET).add(new DashboardWidgetType())
.item(UserType.F_ADMIN_GUI_CONFIGURATION, AdminGuiConfigurationType.F_HOME_PAGE,
HomePageType.F_WIDGET).add(new PreviewContainerPanelConfigurationType())
.asObjectDelta(user1Oid);

when("modifyObject is called");
Expand All @@ -3807,7 +3807,8 @@ public void test991ChangeInsideNonPersistedContainerWorksOk()
UserType userObject = repositoryService.getObject(UserType.class, user1Oid, null, result)
.asObjectable();
assertThat(userObject.getVersion()).isEqualTo(String.valueOf(originalRow.version + 1));
assertThat(userObject.getAdminGuiConfiguration().getUserDashboard().getWidget()).isNotEmpty();
assertThat(userObject.getAdminGuiConfiguration().getHomePage()).isNotEmpty();
assertThat(userObject.getAdminGuiConfiguration().getHomePage().get(0).getWidget()).isNotEmpty();

and("externalized version is updated");
MUser row = selectObjectByOid(QUser.class, user1Oid);
Expand Down

0 comments on commit 819d69f

Please sign in to comment.