-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Sidebar and Topbar Review - Meeds-io/MIPs#159 (#4250)
- Loading branch information
Showing
239 changed files
with
10,811 additions
and
3,127 deletions.
There are no files selected for viewing
21 changes: 9 additions & 12 deletions
21
...n/webapp/vue-apps/spaces-list/services.js → .../navigation/constant/SidebarItemType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,23 @@ | ||
/* | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.navigation.constant; | ||
|
||
import * as spaceTemplateService from '../space-templates-management/js/SpaceTemplateService.js'; | ||
|
||
if (!Vue.prototype.$spaceTemplateService) { | ||
window.Object.defineProperty(Vue.prototype, '$spaceTemplateService', { | ||
value: spaceTemplateService, | ||
}); | ||
public enum SidebarItemType { | ||
PAGE, SITE, SEPARATOR, SPACES, SPACE_TEMPLATE, SPACE, LINK; | ||
} |
23 changes: 23 additions & 0 deletions
23
component/api/src/main/java/io/meeds/social/navigation/constant/SidebarMode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.navigation.constant; | ||
|
||
public enum SidebarMode { | ||
HIDDEN, ICON, STICKY; | ||
} |
23 changes: 23 additions & 0 deletions
23
component/api/src/main/java/io/meeds/social/navigation/constant/TopbarItemType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.navigation.constant; | ||
|
||
public enum TopbarItemType { | ||
APP, LINK; | ||
} |
57 changes: 57 additions & 0 deletions
57
component/api/src/main/java/io/meeds/social/navigation/model/NavigationConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.navigation.model; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class NavigationConfiguration implements Cloneable { | ||
|
||
private TopbarConfiguration topbar; | ||
|
||
private SidebarConfiguration sidebar; | ||
|
||
private final long lastModified; | ||
|
||
public NavigationConfiguration() { | ||
this.lastModified = System.currentTimeMillis(); | ||
} | ||
|
||
public NavigationConfiguration(TopbarConfiguration topbar, SidebarConfiguration sidebar) { | ||
this.topbar = topbar; | ||
this.sidebar = sidebar; | ||
this.lastModified = System.currentTimeMillis(); | ||
} | ||
|
||
public NavigationConfiguration(TopbarConfiguration topbar, | ||
SidebarConfiguration sidebar, | ||
long lastModified) { | ||
this.topbar = topbar; | ||
this.sidebar = sidebar; | ||
this.lastModified = lastModified; | ||
} | ||
|
||
@Override | ||
public NavigationConfiguration clone() { // NOSONAR | ||
return new NavigationConfiguration(topbar == null ? null : topbar.clone(), | ||
sidebar == null ? null : sidebar.clone(), | ||
lastModified); | ||
} | ||
|
||
} |
54 changes: 54 additions & 0 deletions
54
component/api/src/main/java/io/meeds/social/navigation/model/SidebarConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.navigation.model; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import io.meeds.social.navigation.constant.SidebarMode; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class SidebarConfiguration implements Cloneable { | ||
|
||
private boolean allowUserCustomHome; | ||
|
||
private SidebarMode defaultMode; | ||
|
||
private SidebarMode userMode; | ||
|
||
private List<SidebarMode> allowedModes; | ||
|
||
private List<SidebarItem> items; | ||
|
||
@Override | ||
public SidebarConfiguration clone() { // NOSONAR | ||
return new SidebarConfiguration(allowUserCustomHome, | ||
defaultMode, | ||
userMode, | ||
allowedModes == null ? null : new ArrayList<>(allowedModes), | ||
items == null ? null : items.stream().map(SidebarItem::clone).toList()); | ||
} | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
component/api/src/main/java/io/meeds/social/navigation/model/SidebarItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.navigation.model; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import io.meeds.social.navigation.constant.SidebarItemType; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class SidebarItem implements Cloneable { | ||
|
||
private String name; | ||
|
||
private String url; | ||
|
||
private String target; | ||
|
||
private String avatar; | ||
|
||
private String icon; | ||
|
||
private SidebarItemType type; | ||
|
||
private List<SidebarItem> items; | ||
|
||
private Map<String, String> properties; | ||
|
||
public SidebarItem(SidebarItemType type) { | ||
this.type = type; | ||
} | ||
|
||
@Override | ||
public SidebarItem clone() { // NOSONAR | ||
return new SidebarItem(name, | ||
url, | ||
target, | ||
avatar, | ||
icon, | ||
type, | ||
items == null ? null : items.stream().map(SidebarItem::clone).toList(), | ||
properties == null ? null : new HashMap<>(properties)); | ||
} | ||
|
||
} |
75 changes: 75 additions & 0 deletions
75
component/api/src/main/java/io/meeds/social/navigation/model/TopbarApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.navigation.model; | ||
|
||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
|
||
import io.meeds.social.navigation.constant.TopbarItemType; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class TopbarApplication { | ||
|
||
public static final String CONTENT_ID_PROP_NAME = "contentId"; | ||
|
||
private String id; | ||
|
||
private String name; | ||
|
||
private String description; | ||
|
||
private String icon; | ||
|
||
private TopbarItemType type; | ||
|
||
private boolean enabled; | ||
|
||
private boolean mobile; | ||
|
||
private Map<String, String> properties; | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (!(o instanceof TopbarApplication app)) { | ||
return false; | ||
} else if (StringUtils.equals(id, app.getId())) { | ||
return true; | ||
} else if (properties == null || app.getProperties() == null) { | ||
return false; | ||
} else { | ||
return StringUtils.equals(properties.get(CONTENT_ID_PROP_NAME), | ||
app.getProperties().get(CONTENT_ID_PROP_NAME)); | ||
} | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(properties == null ? id : | ||
StringUtils.firstNonBlank(properties.get(CONTENT_ID_PROP_NAME), id)); | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
component/api/src/main/java/io/meeds/social/navigation/model/TopbarConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 3 of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
package io.meeds.social.navigation.model; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class TopbarConfiguration implements Cloneable { | ||
|
||
private boolean displayCompanyName; | ||
|
||
private boolean displaySiteName; | ||
|
||
private boolean displayMobileCompanyLogo; | ||
|
||
private List<TopbarApplication> applications; | ||
|
||
@Override | ||
public TopbarConfiguration clone() { // NOSONAR | ||
return new TopbarConfiguration(displayCompanyName, | ||
displaySiteName, | ||
displayMobileCompanyLogo, | ||
new ArrayList<>(applications)); | ||
} | ||
|
||
} |
Oops, something went wrong.