Skip to content

Commit

Permalink
feat: Improve Default Portlet Instances List - MEED-6908 - Meeds-io/M…
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker committed Jun 4, 2024
1 parent 580efd9 commit d8c7c25
Show file tree
Hide file tree
Showing 11 changed files with 362 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.concurrent.CompletableFuture;

import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.Ordered;
Expand Down Expand Up @@ -224,8 +225,10 @@ protected void importPortletInstance(PortletInstanceDescriptor d, long oldId) {
saveNames(d, portletInstance);
LOG.info("Importing Portlet instance {} description translations", descriptorId);
saveDescriptions(d, portletInstance);
LOG.info("Importing Portlet instance {} illustration", descriptorId);
saveIllustration(portletInstance.getId(), d.getIllustrationPath());
if (StringUtils.isNotBlank(d.getIllustrationPath())) {
LOG.info("Importing Portlet instance {} illustration", descriptorId);
saveIllustration(portletInstance.getId(), d.getIllustrationPath());
}
// Mark as imported
setSettingValue(descriptorId, portletInstance.getId());
}
Expand Down
80 changes: 68 additions & 12 deletions layout-service/src/main/resources/portlet-instance-categories.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,89 @@
{
"descriptors":[
{
"nameId":"spaces",
"nameId":"content",
"names":{
"en":"layout.portletInstance.category.spaces.name"
"en":"layout.portletInstance.category.content.name"
},
"descriptions":{
"en":"layout.portletInstance.category.spaces.description"
"en":"layout.portletInstance.category.content.description"
},
"icon":"fa-braille",
"icon":"fa-newspaper",
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"content",
"nameId":"tools",
"names":{
"en":"layout.portletInstance.category.content.name"
"en":"layout.portletInstance.category.tools.name"
},
"descriptions":{
"en":"layout.portletInstance.category.content.description"
"en":"layout.portletInstance.category.tools.description"
},
"icon":"fa-newspaper",
"icon":"fa-tools",
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"tools",
"nameId":"spaceTools",
"names":{
"en":"layout.portletInstance.category.tools.name"
"en":"layout.portletInstance.category.spaceTools.name"
},
"descriptions":{
"en":"layout.portletInstance.category.tools.description"
"en":"layout.portletInstance.category.spaceTools.description"
},
"icon":"fa-users-cog",
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"profile",
"names":{
"en":"layout.portletInstance.category.profile.name"
},
"descriptions":{
"en":"layout.portletInstance.category.profile.description"
},
"icon":"fa-user",
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"spaces",
"names":{
"en":"layout.portletInstance.category.spaces.name"
},
"descriptions":{
"en":"layout.portletInstance.category.spaces.description"
},
"icon":"fa-tools",
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"userSettings",
"names":{
"en":"layout.portletInstance.category.userSettings.name"
},
"descriptions":{
"en":"layout.portletInstance.category.userSettings.description"
},
"icon":"fa-user-cog",
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"navigation",
"names":{
Expand All @@ -50,7 +92,21 @@
"descriptions":{
"en":"layout.portletInstance.category.navigation.description"
},
"icon":"fa-columns",
"icon":"fa-project-diagram",
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"others",
"names":{
"en":"layout.portletInstance.category.others.name"
},
"descriptions":{
"en":"layout.portletInstance.category.others.description"
},
"icon":"fa-ellipsis-h",
"permissions":[
"*:/platform/users"
],
Expand Down
119 changes: 115 additions & 4 deletions layout-service/src/main/resources/portlet-instances.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,24 @@
"spaceApplication":false
},
{
"nameId":"SpaceBannerPortlet",
"nameId":"GettingStarted",
"categoryNameId":"tools",
"portletName":"GettingStarted",
"names":{
"en":"layout.portletInstance.GettingStarted.name"
},
"descriptions":{
"en":"layout.portletInstance.GettingStarted.description"
},
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":false
},
{
"nameId":"SpaceBannerPortlet",
"categoryNameId":"spaceTools",
"portletName":"SpaceBannerPortlet",
"names":{
"en":"layout.portletInstance.SpaceBannerPortlet.name"
Expand Down Expand Up @@ -162,7 +178,7 @@
},
{
"nameId":"SpaceActivityStreamPortlet",
"categoryNameId":"tools",
"categoryNameId":"spaceTools",
"portletName":"SpaceActivityStreamPortlet",
"names":{
"en":"layout.portletInstance.SpaceActivityStreamPortlet.name"
Expand All @@ -178,7 +194,7 @@
"*:/platform/users"
],
"system":true,
"spaceApplication":false
"spaceApplication":true
},
{
"nameId":"SpacesOverview",
Expand Down Expand Up @@ -221,8 +237,28 @@
"spaceApplication":false
},
{
"nameId":"SpaceInfos",
"nameId":"UserActivityStreamPortlet",
"categoryNameId":"tools",
"portletName":"UserActivityStreamPortlet",
"names":{
"en":"layout.portletInstance.UserActivityStreamPortlet.name"
},
"descriptions":{
"en":"layout.portletInstance.UserActivityStreamPortlet.description"
},
"illustrationPath":"war:/../skin/DefaultSkin/portletIcons/SpaceActivityStreamPortlet.png",
"preferences":[

],
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":false
},
{
"nameId":"SpaceInfos",
"categoryNameId":"spaceTools",
"portletName":"SpaceInfos",
"names":{
"en":"layout.portletInstance.SpaceInfos.name"
Expand Down Expand Up @@ -299,6 +335,81 @@
],
"system":true,
"spaceApplication":false
},
{
"nameId":"GeneralSettings",
"categoryNameId":"userSettings",
"portletName":"GeneralSettings",
"names":{
"en":"layout.portletInstance.GeneralSettings.name"
},
"descriptions":{
"en":"layout.portletInstance.GeneralSettings.description"
},
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"ProfileAboutMe",
"categoryNameId":"profile",
"portletName":"ProfileAboutMe",
"names":{
"en":"layout.portletInstance.ProfileAboutMe.name"
},
"descriptions":{
"en":"layout.portletInstance.ProfileAboutMe.description"
},
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"ProfileContactInformation",
"categoryNameId":"profile",
"portletName":"ProfileContactInformation",
"names":{
"en":"layout.portletInstance.ProfileContactInformation.name"
},
"descriptions":{
"en":"layout.portletInstance.ProfileContactInformation.description"
},
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"ProfileHeader",
"categoryNameId":"profile",
"portletName":"ProfileHeader",
"names":{
"en":"layout.portletInstance.ProfileHeader.name"
},
"descriptions":{
"en":"layout.portletInstance.ProfileHeader.description"
},
"permissions":[
"*:/platform/users"
],
"system":true
},
{
"nameId":"ProfileWorkExperience",
"categoryNameId":"profile",
"portletName":"ProfileWorkExperience",
"names":{
"en":"layout.portletInstance.ProfileWorkExperience.name"
},
"descriptions":{
"en":"layout.portletInstance.ProfileWorkExperience.description"
},
"permissions":[
"*:/platform/users"
],
"system":true
}
]
}
Loading

0 comments on commit d8c7c25

Please sign in to comment.