100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
New secondary navigation
Christian Bauerfac8abcee8df
diff --git a/keycloak/theme/account/account.ftl b/keycloak/theme/account/account.ftlindex 5080dd1b8..f00c32e95 100755--- a/keycloak/theme/account/account.ftl+++ b/keycloak/theme/account/account.ftl@@ -56,7 +56,7 @@</div></div>- <div class="layout horizontal center-center or-FormGroup theme-FormGroup">+ <div class="layout horizontal or-FormGroup theme-FormGroup"><div class="or-FormField theme-FormField"><#if url.referrerURI??><a href="${url.referrerURI}">${msg("backToApplication")}/a></#if><button type="submit"diff --git a/keycloak/theme/account/password.ftl b/keycloak/theme/account/password.ftlindex bc727d8b7..68349dbac 100755--- a/keycloak/theme/account/password.ftl+++ b/keycloak/theme/account/password.ftl@@ -46,7 +46,7 @@</div></div>- <div class="layout horizontal center-center or-FormGroup theme-FormGroup">+ <div class="layout horizontal or-FormGroup theme-FormGroup"><div class="or-FormField theme-FormField"><button type="submit" class="or-FormControl theme-FormControl or-FormButtonPrimary theme-FormButtonPrimary or-PushButton theme-PushButton"name="submitAction" value="Save">diff --git a/keycloak/theme/account/template.ftl b/keycloak/theme/account/template.ftlindex 388b2b8c5..b08f34d6c 100644--- a/keycloak/theme/account/template.ftl+++ b/keycloak/theme/account/template.ftl@@ -40,24 +40,21 @@</head><body class="layout vertical">- <div class="flex layout horizontal">- <div class="or-SidebarContent theme-SidebarContent">- <ul class="or-UnorderedList theme-UnorderedList">- <li><div class="or-Hyperlink theme-Hyperlink <#if active=='account'>active</#if>"><a href="${url.accountUrl}">${msg("account")}</a></div></li>- <#if features.passwordUpdateSupported><li><div class="or-Hyperlink theme-Hyperlink <#if active=='password'>active</#if>"><a href="${url.passwordUrl}">${msg("password")}</a></div></li></#if>- </ul>- </div>- <div class="or-MainContent theme-MainContent">- <#if message?has_content>- <div class="layout horizontal or-FormMessages theme-FormMessages ${message.type}">- <#if message.type=='success' ><div class="or-MessagesIcon theme-MessagesIcon fa fa-check"></div></#if>- <#if message.type=='error' ><div class="or-MessagesIcon theme-MessagesIcon fa fa-warning"></div></#if>- ${message.summary}- </div>- </#if>+ <div class="layout horizontal end-justified or-SecondaryNav theme-SecondaryNav">+ <div style="margin: 0 1em;" class="or-SecondaryNavItem theme-SecondaryNavItem <#if active=='account'>active</#if>"><a href="${url.accountUrl}">${msg("account")}</a></div>+ <#if features.passwordUpdateSupported><div style="margin: 0 1em;" class="or-SecondaryNavItem theme-SecondaryNavItem <#if active=='password'>active</#if>"><a href="${url.passwordUrl}">${msg("password")}</a></div></#if>+ </div>++ <div class="or-MainContent theme-MainContent">+ <#if message?has_content>+ <div style="max-width: 30em;" class="layout horizontal or-FormMessages theme-FormMessages ${message.type}">+ <#if message.type=='success' ><div class="or-MessagesIcon theme-MessagesIcon fa fa-check"></div></#if>+ <#if message.type=='error' ><div class="or-MessagesIcon theme-MessagesIcon fa fa-warning"></div></#if>+ ${message.summary}+ </div>+ </#if>- <#nested "content">- </div>+ <#nested "content"></div></body>diff --git a/manager/client/src/main/java/org/openremote/manager/client/ManagerActivityMapper.java b/manager/client/src/main/java/org/openremote/manager/client/ManagerActivityMapper.javaindex 4293a2953..23039b64f 100644--- a/manager/client/src/main/java/org/openremote/manager/client/ManagerActivityMapper.java+++ b/manager/client/src/main/java/org/openremote/manager/client/ManagerActivityMapper.java@@ -32,7 +32,7 @@ import org.openremote.manager.client.admin.users.AdminUserActivity;import org.openremote.manager.client.admin.users.AdminUserPlace;import org.openremote.manager.client.admin.users.AdminUsersActivity;import org.openremote.manager.client.admin.users.AdminUsersPlace;-import org.openremote.manager.client.assets.AssetDetailActivity;+import org.openremote.manager.client.assets.AssetsActivity;import org.openremote.manager.client.assets.AssetsPlace;import org.openremote.manager.client.event.bus.EventBus;import org.openremote.manager.client.flows.FlowsActivity;@@ -57,7 +57,7 @@ public class ManagerActivityMapper implements AppActivityMapper {protected final SecurityService securityService;protected final EventBus eventBus;protected final ManagerMessages managerMessages;- protected final Provider<AssetDetailActivity> assetsActivityProvider;+ protected final Provider<AssetsActivity> assetsActivityProvider;protected final Provider<MapActivity> mapActivityProvider;protected final Provider<FlowsActivity> flowsActivityProvider;protected final Provider<AdminOverviewActivity> adminOverviewActivityProvider;@@ -71,7 +71,7 @@ public class ManagerActivityMapper implements AppActivityMapper {public ManagerActivityMapper(SecurityService securityService,EventBus eventBus,ManagerMessages managerMessages,- Provider<AssetDetailActivity> assetsActivityProvider,+ Provider<AssetsActivity> assetsActivityProvider,Provider<MapActivity> mapActivityProvider,Provider<FlowsActivity> flowsActivityProvider,Provider<AdminOverviewActivity> adminOverviewActivityProvider,diff --git a/manager/client/src/main/java/org/openremote/manager/client/admin/AdminViewImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/admin/AdminViewImpl.ui.xmlindex 433c6ec1f..b7a9d07b6 100644--- a/manager/client/src/main/java/org/openremote/manager/client/admin/AdminViewImpl.ui.xml+++ b/manager/client/src/main/java/org/openremote/manager/client/admin/AdminViewImpl.ui.xml@@ -7,7 +7,7 @@<ui:with field="widgetStyle" type="org.openremote.manager.client.style.WidgetStyle"/><ui:with field="themeStyle" type="org.openremote.manager.client.style.ThemeStyle"/>- <g:HTMLPanel styleName="flex layout horizontal">+ <g:HTMLPanel styleName="flex layout vertical"><an:AdminNavigation ui:field="adminNavigation"/>diff --git a/manager/client/src/main/java/org/openremote/manager/client/admin/navigation/AdminNavigationImpl.java b/manager/client/src/main/java/org/openremote/manager/client/admin/navigation/AdminNavigationImpl.javaindex a411a9833..7ea7b9f81 100644--- a/manager/client/src/main/java/org/openremote/manager/client/admin/navigation/AdminNavigationImpl.java+++ b/manager/client/src/main/java/org/openremote/manager/client/admin/navigation/AdminNavigationImpl.java@@ -20,17 +20,17 @@package org.openremote.manager.client.admin.navigation;import com.google.gwt.core.client.GWT;-import com.google.gwt.dom.client.LIElement;+import com.google.gwt.dom.client.DivElement;import com.google.gwt.uibinder.client.UiBinder;import com.google.gwt.uibinder.client.UiField;import com.google.gwt.user.client.ui.Composite;import com.google.gwt.user.client.ui.HTMLPanel;+import com.google.gwt.user.client.ui.Hyperlink;import org.openremote.manager.client.admin.AdminPlace;import org.openremote.manager.client.admin.tenant.AdminTenantPlace;import org.openremote.manager.client.admin.tenant.AdminTenantsPlace;import org.openremote.manager.client.admin.users.AdminUserPlace;import org.openremote.manager.client.admin.users.AdminUsersPlace;-import org.openremote.manager.client.widget.Hyperlink;import javax.inject.Inject;@@ -41,18 +41,12 @@ public class AdminNavigationImpl extends Composite implements AdminNavigation {Presenter presenter;- @UiField- LIElement overview;@UiFieldHyperlink overviewLink;- @UiField- LIElement tenantsItem;@UiFieldHyperlink tenantsLink;- @UiField- LIElement usersItem;@UiFieldHyperlink usersLink;diff --git a/manager/client/src/main/java/org/openremote/manager/client/admin/navigation/AdminNavigationImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/admin/navigation/AdminNavigationImpl.ui.xmlindex 5d6f80790..7c6b4e957 100644--- a/manager/client/src/main/java/org/openremote/manager/client/admin/navigation/AdminNavigationImpl.ui.xml+++ b/manager/client/src/main/java/org/openremote/manager/client/admin/navigation/AdminNavigationImpl.ui.xml@@ -6,28 +6,24 @@<ui:with field="widgetStyle" type="org.openremote.manager.client.style.WidgetStyle"/><ui:with field="themeStyle" type="org.openremote.manager.client.style.ThemeStyle"/>- <g:HTMLPanel styleName="layout vertical {widgetStyle.SidebarContent} {themeStyle.SidebarContent}">- <ul class="{widgetStyle.UnorderedList} {themeStyle.UnorderedList}">+ <ui:style>+ .navItem {+ margin: 0 1em;+ }+ </ui:style>- <li ui:field="overview">- <w:Hyperlink ui:field="overviewLink"- addStyleNames="{themeStyle.Hyperlink}"- text="{managerMessages.overview}"/>- </li>+ <g:HTMLPanel styleName="layout horizontal end-justified {widgetStyle.SecondaryNav} {themeStyle.SecondaryNav}">+ <g:Hyperlink ui:field="overviewLink"+ addStyleNames="{style.navItem} {widgetStyle.SecondaryNavItem} {themeStyle.SecondaryNavItem}"+ text="{managerMessages.overview}"/>- <li ui:field="tenantsItem">- <w:Hyperlink ui:field="tenantsLink"- addStyleNames="{themeStyle.Hyperlink}"- text="{managerMessages.manageTenants}"/>- </li>+ <g:Hyperlink ui:field="tenantsLink"+ addStyleNames="{style.navItem} {widgetStyle.SecondaryNavItem} {themeStyle.SecondaryNavItem}"+ text="{managerMessages.manageTenants}"/>- <li ui:field="usersItem">- <w:Hyperlink ui:field="usersLink"- addStyleNames="{themeStyle.Hyperlink}"- text="{managerMessages.manageUsers}"/>- </li>-- </ul>+ <g:Hyperlink ui:field="usersLink"+ addStyleNames="{style.navItem} {widgetStyle.SecondaryNavItem} {themeStyle.SecondaryNavItem}"+ text="{managerMessages.manageUsers}"/></g:HTMLPanel></ui:UiBinder>\ No newline at end of filediff --git a/manager/client/src/main/java/org/openremote/manager/client/app/AppViewImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/app/AppViewImpl.ui.xmlindex 807fef2b4..be0b229e5 100644--- a/manager/client/src/main/java/org/openremote/manager/client/app/AppViewImpl.ui.xml+++ b/manager/client/src/main/java/org/openremote/manager/client/app/AppViewImpl.ui.xml@@ -1,26 +1,13 @@<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'xmlns:g='urn:import:com.google.gwt.user.client.ui'>- <ui:style>- .viewport {- width: 100%;- height: 100vh;- min-height: 100%;- margin: 0;- }-- .content {- overflow: auto;- }- </ui:style>-<ui:with field="managerMessages" type="org.openremote.manager.client.i18n.ManagerMessages"/><ui:with field="widgetStyle" type="org.openremote.manager.client.style.WidgetStyle"/><ui:with field="themeStyle" type="org.openremote.manager.client.style.ThemeStyle"/>- <g:FlowPanel styleName="layout vertical" addStyleNames="{style.viewport}">+ <g:FlowPanel styleName="layout vertical" addStyleNames="{widgetStyle.Viewport} {themeStyle.Viewport}"><g:SimplePanel ui:field="header" styleName="layout horizontal"/>- <g:SimplePanel ui:field="content" styleName="flex layout vertical" addStyleNames="{style.content}"/>+ <g:SimplePanel ui:field="content" styleName="flex layout vertical"/><g:SimplePanel ui:field="footer" styleName="layout horizontal"/></g:FlowPanel>diff --git a/manager/client/src/main/java/org/openremote/manager/client/app/HeaderViewImpl.java b/manager/client/src/main/java/org/openremote/manager/client/app/HeaderViewImpl.javaindex 173ea5eeb..0bfa3ee7b 100644--- a/manager/client/src/main/java/org/openremote/manager/client/app/HeaderViewImpl.java+++ b/manager/client/src/main/java/org/openremote/manager/client/app/HeaderViewImpl.java@@ -87,26 +87,26 @@ public class HeaderViewImpl extends Composite implements HeaderView {@Overridepublic void onPlaceChange(Place place) {- mapButton.removeStyleName(themeStyle.NavItemActive());- assetsButton.removeStyleName(themeStyle.NavItemActive());- flowsButton.removeStyleName(themeStyle.NavItemActive());- adminButton.removeStyleName(themeStyle.NavItemActive());- userButton.removeStyleName(themeStyle.NavItemActive());+ mapButton.removeStyleName("active");+ assetsButton.removeStyleName("active");+ flowsButton.removeStyleName("active");+ adminButton.removeStyleName("active");+ userButton.removeStyleName("active");if (place instanceof MapPlace) {- mapButton.addStyleName(themeStyle.NavItemActive());+ mapButton.addStyleName("active");}if (place instanceof AssetsPlace) {- assetsButton.addStyleName(themeStyle.NavItemActive());+ assetsButton.addStyleName("active");}if (place instanceof FlowsPlace) {- flowsButton.addStyleName(themeStyle.NavItemActive());+ flowsButton.addStyleName("active");}if (place instanceof AdminPlace) {- adminButton.addStyleName(themeStyle.NavItemActive());+ adminButton.addStyleName("active");}if (place instanceof UserAccountPlace) {- userButton.addStyleName(themeStyle.NavItemActive());+ userButton.addStyleName("active");}}diff --git a/manager/client/src/main/java/org/openremote/manager/client/app/HeaderViewImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/app/HeaderViewImpl.ui.xmlindex cf8cdbafb..10746cbc8 100644--- a/manager/client/src/main/java/org/openremote/manager/client/app/HeaderViewImpl.ui.xml+++ b/manager/client/src/main/java/org/openremote/manager/client/app/HeaderViewImpl.ui.xml@@ -3,19 +3,10 @@xmlns:w="urn:import:org.openremote.manager.client.widget"><ui:style>- .header {- height: 4em;- }-.logoButton {height: 36px;}- .navItem {- margin: 0 1.6em;- font-size: larger;- }-.navItemFirst {margin-left: 0.4em;}@@ -30,10 +21,10 @@<ui:with field="widgetStyle" type="org.openremote.manager.client.style.WidgetStyle"/><ui:with field="themeStyle" type="org.openremote.manager.client.style.ThemeStyle"/>- <g:HTMLPanel styleName="flex layout horizontal center {style.header} {widgetStyle.Header} {themeStyle.Header}">+ <g:HTMLPanel styleName="flex layout horizontal center {widgetStyle.Header} {themeStyle.Header}"><g:HTMLPanel ui:field="quickAccess"- styleName="{style.navItem} {style.navItemFirst} {widgetStyle.NavItem} {themeStyle.NavItem}">+ styleName="{style.navItemFirst} {widgetStyle.NavItem} {themeStyle.NavItem}"><g:HTMLPanel styleName="layout horizontal center {style.logoButton}"><svg style="pointer-events: none; display: block; height: 100%; margin-right: 8px;" viewBox="0 0 24 24"preserveAspectRatio="xMidYMid meet">@@ -49,35 +40,35 @@</g:HTMLPanel><w:PushButton ui:field="mapButton"- addStyleNames="{style.navItem} {widgetStyle.NavItem} {themeStyle.NavItem}"+ addStyleNames="{widgetStyle.NavItem} {themeStyle.NavItem}"icon="map"text="{managerMessages.map}"/><w:PushButton ui:field="assetsButton"- addStyleNames="{style.navItem} {widgetStyle.NavItem} {themeStyle.NavItem}"+ addStyleNames="{widgetStyle.NavItem} {themeStyle.NavItem}"icon="cubes"text="{managerMessages.assets}"/><w:PushButton ui:field="rulesButton"- addStyleNames="{style.navItem} {widgetStyle.NavItem} {themeStyle.NavItem}"+ addStyleNames="{widgetStyle.NavItem} {themeStyle.NavItem}"icon="chain"text="{managerMessages.rules}"/><w:PushButton ui:field="flowsButton"- addStyleNames="{style.navItem} {widgetStyle.NavItem} {themeStyle.NavItem}"+ addStyleNames="{widgetStyle.NavItem} {themeStyle.NavItem}"icon="connectdevelop"text="{managerMessages.flows}"/><g:HTMLPanel styleName="flex"/><w:PushButton ui:field="adminButton"- addStyleNames="{style.navItem} {widgetStyle.NavItem} {themeStyle.NavItem}"+ addStyleNames="{widgetStyle.NavItem} {themeStyle.NavItem}"icon="gears"text="{managerMessages.admin}"/><w:PushButton ui:field="userButton"icon="user"- addStyleNames="{style.navItem} {style.navItemLast} {widgetStyle.NavItem} {themeStyle.NavItem}"/>+ addStyleNames="{style.navItemLast} {widgetStyle.NavItem} {themeStyle.NavItem}"/></g:HTMLPanel>diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailActivity.java b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailActivity.javadeleted file mode 100644index acf116a2c..000000000--- a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailActivity.java+++ /dev/null@@ -1,103 +0,0 @@-/*- * Copyright 2016, OpenRemote Inc.- *- * See the CONTRIBUTORS.txt file in the distribution for a- * full listing of individual contributors.- *- * This program is free software: you can redistribute it and/or modify- * it under the terms of the GNU Affero 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 Affero General Public License for more details.- *- * You should have received a copy of the GNU Affero General Public License- * along with this program. If not, see <http://www.gnu.org/licenses/>.- */-package org.openremote.manager.client.assets;--import com.google.gwt.place.shared.Place;-import com.google.gwt.place.shared.PlaceController;-import com.google.gwt.user.client.ui.AcceptsOneWidget;-import org.openremote.manager.client.event.MessageReceivedEvent;-import org.openremote.manager.client.event.ServerSendEvent;-import org.openremote.manager.client.event.bus.EventBus;-import org.openremote.manager.client.event.bus.EventRegistration;-import org.openremote.manager.client.mvp.AppActivity;-import org.openremote.manager.shared.event.Message;-import org.openremote.manager.shared.event.ui.ShowFailureEvent;-import org.openremote.manager.shared.event.ui.ShowInfoEvent;--import javax.inject.Inject;-import java.util.Collection;-import java.util.logging.Logger;--public class AssetDetailActivity- extends AppActivity<AssetsPlace>- implements AssetDetailView.Presenter {-- private static final Logger LOG = Logger.getLogger(AssetDetailActivity.class.getName());-- final AssetDetailView view;- final PlaceController placeController;- final EventBus eventBus;-- @Inject- public AssetDetailActivity(AssetDetailView view,- PlaceController placeController,- EventBus eventBus) {- this.view = view;- this.placeController = placeController;- this.eventBus = eventBus;- }-- @Override- protected AppActivity<AssetsPlace> init(AssetsPlace place) {- return this;- }-- @Override- protected String[] getRequiredRoles() {- return new String[]{"read:assets"};- }-- @Override- public void start(AcceptsOneWidget container, EventBus eventBus, Collection<EventRegistration> registrations) {- view.setPresenter(this);- container.setWidget(view.asWidget());-- registrations.add(eventBus.register(MessageReceivedEvent.class, event -> {- view.setMessageText(event.getMessage().getBody());- }));- }-- @Override- public void goTo(Place place) {- placeController.goTo(place);- }-- @Override- public void sendMessage() {- eventBus.dispatch(new ServerSendEvent(- new Message("Hello from client!")- ));- }-- @Override- public void showInfo() {- eventBus.dispatch(new ShowInfoEvent("Hello World!"));- }-- @Override- public void showTempFailure() {- eventBus.dispatch(new ShowFailureEvent("A temporary error. This will disappear in a few seconds.", 5000));- }-- @Override- public void showDurableFailure() {- eventBus.dispatch(new ShowFailureEvent("The application crashed. This is a durable error."));- }-}diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailView.java b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailView.javadeleted file mode 100644index 3ab420d44..000000000--- a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailView.java+++ /dev/null@@ -1,42 +0,0 @@-/*- * Copyright 2016, OpenRemote Inc.- *- * See the CONTRIBUTORS.txt file in the distribution for a- * full listing of individual contributors.- *- * This program is free software: you can redistribute it and/or modify- * it under the terms of the GNU Affero 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 Affero General Public License for more details.- *- * You should have received a copy of the GNU Affero General Public License- * along with this program. If not, see <http://www.gnu.org/licenses/>.- */-package org.openremote.manager.client.assets;--import com.google.gwt.place.shared.Place;-import com.google.gwt.user.client.ui.IsWidget;--public interface AssetDetailView extends IsWidget {-- interface Presenter {- void goTo(Place place);-- void sendMessage();-- void showInfo();-- void showTempFailure();-- void showDurableFailure();- }-- void setPresenter(Presenter presenter);-- void setMessageText(String text);-}diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailViewImpl.java b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailViewImpl.javadeleted file mode 100644index a89d5175f..000000000--- a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailViewImpl.java+++ /dev/null@@ -1,92 +0,0 @@-/*- * Copyright 2016, OpenRemote Inc.- *- * See the CONTRIBUTORS.txt file in the distribution for a- * full listing of individual contributors.- *- * This program is free software: you can redistribute it and/or modify- * it under the terms of the GNU Affero 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 Affero General Public License for more details.- *- * You should have received a copy of the GNU Affero General Public License- * along with this program. If not, see <http://www.gnu.org/licenses/>.- */-package org.openremote.manager.client.assets;--import com.google.gwt.core.client.GWT;-import com.google.gwt.event.dom.client.ClickEvent;-import com.google.gwt.uibinder.client.UiBinder;-import com.google.gwt.uibinder.client.UiField;-import com.google.gwt.uibinder.client.UiHandler;-import com.google.gwt.user.client.ui.Composite;-import com.google.gwt.user.client.ui.HTMLPanel;-import com.google.gwt.user.client.ui.Label;-import org.openremote.manager.client.widget.PushButton;--import javax.inject.Inject;--public class AssetDetailViewImpl extends Composite implements AssetDetailView {-- interface UI extends UiBinder<HTMLPanel, AssetDetailViewImpl> {- }-- private UI ui = GWT.create(UI.class);-- Presenter presenter;-- @UiField- com.google.gwt.user.client.ui.PushButton sendMessageButton;-- @UiField- Label messageLabel;-- @UiField- PushButton showInfo;-- @UiField- PushButton showTempFailure;-- @UiField- PushButton showDurableFailure;-- @Inject- public AssetDetailViewImpl() {- initWidget(ui.createAndBindUi(this));- }-- @Override- public void setPresenter(Presenter presenter) {- this.presenter = presenter;- }-- @UiHandler("sendMessageButton")- public void onButtonClick(final ClickEvent event) {- presenter.sendMessage();- }-- @UiHandler("showInfo")- public void onShowInfo(final ClickEvent event) {- presenter.showInfo();- }-- @UiHandler("showTempFailure")- public void onShowTempFailure(final ClickEvent event) {- presenter.showTempFailure();- }-- @UiHandler("showDurableFailure")- public void onShowDurableFailure(final ClickEvent event) {- presenter.showDurableFailure();- }-- @Override- public void setMessageText(String text) {- messageLabel.setText(text);- }-}diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailViewImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailViewImpl.ui.xmldeleted file mode 100644index 03851ff38..000000000--- a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetDetailViewImpl.ui.xml+++ /dev/null@@ -1,32 +0,0 @@-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"- xmlns:g="urn:import:com.google.gwt.user.client.ui"- xmlns:w="urn:import:org.openremote.manager.client.widget">-- <ui:with field="managerMessages" type="org.openremote.manager.client.i18n.ManagerMessages"/>- <ui:with field="widgetStyle" type="org.openremote.manager.client.style.WidgetStyle"/>- <ui:with field="themeStyle" type="org.openremote.manager.client.style.ThemeStyle"/>-- <g:HTMLPanel styleName="flex layout vertical {widgetStyle.MainContent} {themeStyle.MainContent}">-- <div style="padding: 1em;">- <w:PushButton ui:field="showInfo"- addStyleNames="{widgetStyle.PushButton} {themeStyle.PushButton}"- text="Show INFO message"/>- <w:PushButton ui:field="showTempFailure"- addStyleNames="{widgetStyle.PushButton} {themeStyle.PushButton}"- text="Show temporary ERROR message"/>- <w:PushButton ui:field="showDurableFailure"- addStyleNames="{widgetStyle.PushButton} {themeStyle.PushButton}"- text="Show durable ERROR message"/>- </div>-- <div style="padding: 1em;">- <w:PushButton ui:field="sendMessageButton"- addStyleNames="{widgetStyle.PushButton} {themeStyle.PushButton}"- text="Send message to server"/>- <g:Label ui:field="messageLabel" text="Waiting for response..."/>- </div>-- </g:HTMLPanel>--</ui:UiBinder>\ No newline at end of filediff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListViewImpl.java b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListViewImpl.javadeleted file mode 100644index 2e704eec3..000000000--- a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListViewImpl.java+++ /dev/null@@ -1,47 +0,0 @@-/*- * Copyright 2016, OpenRemote Inc.- *- * See the CONTRIBUTORS.txt file in the distribution for a- * full listing of individual contributors.- *- * This program is free software: you can redistribute it and/or modify- * it under the terms of the GNU Affero 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 Affero General Public License for more details.- *- * You should have received a copy of the GNU Affero General Public License- * along with this program. If not, see <http://www.gnu.org/licenses/>.- */-package org.openremote.manager.client.assets;--import com.google.gwt.core.client.GWT;-import com.google.gwt.uibinder.client.UiBinder;-import com.google.gwt.user.client.ui.Composite;-import com.google.gwt.user.client.ui.ScrollPanel;--import javax.inject.Inject;--public class AssetListViewImpl extends Composite implements AssetListView {-- interface UI extends UiBinder<ScrollPanel, AssetListViewImpl> {- }-- private UI ui = GWT.create(UI.class);-- Presenter presenter;-- @Inject- public AssetListViewImpl() {- initWidget(ui.createAndBindUi(this));- }-- @Override- public void setPresenter(Presenter presenter) {- this.presenter = presenter;- }-}diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListViewImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListViewImpl.ui.xmldeleted file mode 100644index 82e891d8d..000000000--- a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListViewImpl.ui.xml+++ /dev/null@@ -1,14 +0,0 @@-<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'- xmlns:g="urn:import:com.google.gwt.user.client.ui">-- <ui:with field="managerMessages" type="org.openremote.manager.client.i18n.ManagerMessages"/>- <ui:with field="widgetStyle" type="org.openremote.manager.client.style.WidgetStyle"/>- <ui:with field="themeStyle" type="org.openremote.manager.client.style.ThemeStyle"/>-- <g:ScrollPanel>- <g:VerticalPanel>-- </g:VerticalPanel>- </g:ScrollPanel>--</ui:UiBinder>\ No newline at end of filediff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListActivity.java b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsActivity.javasimilarity index 55%rename from manager/client/src/main/java/org/openremote/manager/client/assets/AssetListActivity.javarename to manager/client/src/main/java/org/openremote/manager/client/assets/AssetsActivity.javaindex 8102436af..bf77f9f98 100644--- a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListActivity.java+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsActivity.java@@ -19,7 +19,6 @@*/package org.openremote.manager.client.assets;-import com.google.gwt.place.shared.Place;import com.google.gwt.place.shared.PlaceController;import com.google.gwt.user.client.ui.AcceptsOneWidget;import org.openremote.manager.client.event.bus.EventBus;@@ -28,22 +27,25 @@ import org.openremote.manager.client.mvp.AppActivity;import javax.inject.Inject;import java.util.Collection;+import java.util.logging.Logger;-/**- * Activity for Asset Manager- */-public class AssetListActivity+public class AssetsActivityextends AppActivity<AssetsPlace>- implements AssetListView.Presenter {+ implements AssetsView.Presenter {++ private static final Logger LOG = Logger.getLogger(AssetsActivity.class.getName());- final AssetListView view;+ final AssetsView view;final PlaceController placeController;+ final EventBus eventBus;@Inject- public AssetListActivity(AssetListView view,- PlaceController placeController) {+ public AssetsActivity(AssetsView view,+ PlaceController placeController,+ EventBus eventBus) {this.view = view;this.placeController = placeController;+ this.eventBus = eventBus;}@Override@@ -52,49 +54,13 @@ public class AssetListActivity}@Override- public void start(AcceptsOneWidget container, EventBus eventBus, Collection<EventRegistration> registrations) {- view.setPresenter(this);- container.setWidget(view.asWidget());+ protected String[] getRequiredRoles() {+ return new String[]{"read:assets"};}@Override- public void goTo(Place place) {- placeController.goTo(place);- }-- @Override- public void getHelloText() {-// resource("hello").get().send(new TextCallback() {-// @Override-// public void onSuccess(Method method, String response) {-// view.setHelloText(response);-// }-//-// @Override-// public void onFailure(Method method, Throwable exception) {-// view.setHelloText("Request failed!");-// }-// });- }-- /* TODO outdated- protected static String hostname() {- return Window.Location.getHostName();- }-- protected static String port() {- return Window.Location.getPort();- }-- protected Resource resource(String... pathElement) {- StringBuilder sb = new StringBuilder();- sb.append("http://").append(hostname()).append(":").append(port());- if (pathElement != null) {- for (String pe : pathElement) {- sb.append("/").append(pe);- }- }- return new Resource(sb.toString());+ public void start(AcceptsOneWidget container, EventBus eventBus, Collection<EventRegistration> registrations) {+ view.setPresenter(this);+ container.setWidget(view.asWidget());}- */}diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsModule.java b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsModule.javaindex 674596205..7e5856f45 100644--- a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsModule.java+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsModule.java@@ -26,9 +26,8 @@ public class AssetsModule extends AbstractGinModule {@Overrideprotected void configure() {- bind(AssetListView.class).to(AssetListViewImpl.class).in(Singleton.class);- bind(AssetDetailView.class).to(AssetDetailViewImpl.class).in(Singleton.class);- bind(AssetDetailActivity.class);+ bind(AssetsView.class).to(AssetsViewImpl.class).in(Singleton.class);+ bind(AssetsActivity.class);}}diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListView.java b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsView.javasimilarity index 86%rename from manager/client/src/main/java/org/openremote/manager/client/assets/AssetListView.javarename to manager/client/src/main/java/org/openremote/manager/client/assets/AssetsView.javaindex 925c05dd6..e501ffc04 100644--- a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetListView.java+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsView.java@@ -19,15 +19,11 @@*/package org.openremote.manager.client.assets;-import com.google.gwt.place.shared.Place;import com.google.gwt.user.client.ui.IsWidget;-public interface AssetListView extends IsWidget {+public interface AssetsView extends IsWidget {interface Presenter {- void goTo(Place place);-- void getHelloText();}void setPresenter(Presenter presenter);diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsViewImpl.java b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsViewImpl.javanew file mode 100644index 000000000..db65f8b62--- /dev/null+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsViewImpl.java@@ -0,0 +1,111 @@+/*+ * Copyright 2016, OpenRemote Inc.+ *+ * See the CONTRIBUTORS.txt file in the distribution for a+ * full listing of individual contributors.+ *+ * This program is free software: you can redistribute it and/or modify+ * it under the terms of the GNU Affero 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 Affero General Public License for more details.+ *+ * You should have received a copy of the GNU Affero General Public License+ * along with this program. If not, see <http://www.gnu.org/licenses/>.+ */+package org.openremote.manager.client.assets;++import com.google.gwt.cell.client.TextCell;+import com.google.gwt.core.client.GWT;+import com.google.gwt.uibinder.client.UiBinder;+import com.google.gwt.uibinder.client.UiField;+import com.google.gwt.user.cellview.client.CellTree;+import com.google.gwt.user.client.ui.Composite;+import com.google.gwt.user.client.ui.HTMLPanel;+import com.google.gwt.user.client.ui.Label;+import com.google.gwt.user.client.ui.SimplePanel;+import com.google.gwt.view.client.ListDataProvider;+import com.google.gwt.view.client.SingleSelectionModel;+import com.google.gwt.view.client.TreeViewModel;++import javax.inject.Inject;+import java.util.logging.Logger;++public class AssetsViewImpl extends Composite implements AssetsView {++ private static final Logger LOG = Logger.getLogger(AssetsViewImpl.class.getName());++ interface UI extends UiBinder<HTMLPanel, AssetsViewImpl> {+ }++ private static class CustomTreeModel implements TreeViewModel {++ private final SingleSelectionModel<String> selectionModel = new SingleSelectionModel<>();++ /**+ * Get the {@link NodeInfo} that provides the children of the specified+ * value.+ */+ public <T> NodeInfo<?> getNodeInfo(T value) {+ /*+ * Create some data in a data provider. Use the parent value as a prefix+ * for the next level.+ */+ ListDataProvider<String> dataProvider = new ListDataProvider<String>();+ for (int i = 0; i < 2; i++) {+ dataProvider.getList().add(value + "." + String.valueOf(i));+ }++ // Return a node info that pairs the data with a cell.+ DefaultNodeInfo<String> nodeInfo = new DefaultNodeInfo<>(dataProvider, new TextCell(), selectionModel, null);++ selectionModel.addSelectionChangeHandler(selectionChangeEvent -> {++ LOG.info("### SELECT: " +selectionModel.getSelectedObject());+ });++ return nodeInfo;+ }++ /**+ * Check if the specified value represents a leaf node. Leaf nodes cannot be+ * opened.+ */+ public boolean isLeaf(Object value) {+ // The maximum length of a value is ten characters.+ return value.toString().length() > 10;+ }+ }++ @UiField+ SimplePanel assetTreeContainer;++ @UiField+ SimplePanel assetsContentContainer;++ Presenter presenter;++ @Inject+ public AssetsViewImpl() {+ UI ui = GWT.create(UI.class);+ initWidget(ui.createAndBindUi(this));++ assetsContentContainer.add(new Label("CONTENT"));++ TreeViewModel treeModel = new CustomTreeModel();+ CellTree tree = new CellTree(treeModel, "Item 1");++ assetTreeContainer.add(tree);++ }++ @Override+ public void setPresenter(Presenter presenter) {+ this.presenter = presenter;+ }++}diff --git a/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsViewImpl.ui.xml b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsViewImpl.ui.xmlnew file mode 100644index 000000000..d1207ec75--- /dev/null+++ b/manager/client/src/main/java/org/openremote/manager/client/assets/AssetsViewImpl.ui.xml@@ -0,0 +1,26 @@+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"+ xmlns:g="urn:import:com.google.gwt.user.client.ui"+ xmlns:w="urn:import:org.openremote.manager.client.widget">++ <ui:with field="managerMessages" type="org.openremote.manager.client.i18n.ManagerMessages"/>+ <ui:with field="widgetStyle" type="org.openremote.manager.client.style.WidgetStyle"/>+ <ui:with field="themeStyle" type="org.openremote.manager.client.style.ThemeStyle"/>++ <ui:style>+ .sidebarContent {+ width: 20em;+ }+ </ui:style>++ <g:HTMLPanel styleName="flex layout horizontal">++ <g:SimplePanel ui:field="assetTreeContainer"+ addStyleNames="{style.sidebarContent} {widgetStyle.SidebarContent} {themeStyle.SidebarContent}"/>++ <div class="flex {widgetStyle.MainContent} {themeStyle.MainContent}">+ <g:SimplePanel ui:field="assetsContentContainer"/>+ </div>++ </g:HTMLPanel>++</ui:UiBinder>\ No newline at end of filediff --git a/manager/client/src/main/java/org/openremote/manager/client/style/AbstractStyle.java b/manager/client/src/main/java/org/openremote/manager/client/style/AbstractStyle.javaindex c01de9249..bc15184e4 100644--- a/manager/client/src/main/java/org/openremote/manager/client/style/AbstractStyle.java+++ b/manager/client/src/main/java/org/openremote/manager/client/style/AbstractStyle.java@@ -23,6 +23,10 @@ public abstract class AbstractStyle {abstract String getPrefix();+ public String Viewport() {+ return getPrefix() + "Viewport";+ }+public String Header() {return getPrefix() + "Header";}@@ -35,8 +39,12 @@ public abstract class AbstractStyle {return getPrefix() + "NavItem";}- public String NavItemActive() {- return getPrefix() + "NavItemActive";+ public String SecondaryNav() {+ return getPrefix() + "SecondaryNav";+ }++ public String SecondaryNavItem() {+ return getPrefix() + "SecondaryNavItem";}public String SidebarContent() {diff --git a/manager/client/src/main/webapp/css/style.html b/manager/client/src/main/webapp/css/style.htmlindex 9f6ec805d..03a2dba78 100644--- a/manager/client/src/main/webapp/css/style.html+++ b/manager/client/src/main/webapp/css/style.html@@ -23,11 +23,54 @@outline: 0;}- .or-MainContent {- padding: 1em;+ .or-Viewport {+ width: 100%;+ height: 100vh;+ min-height: 100%;+ margin: 0;+ }++ .or-NavItem {+ margin: 0.4em 1.6em 0 1.6em;+ font-size: larger;+ border-radius: 0 !important;+ border-bottom: 0.4em solid transparent;+ }++ .or-SecondaryNav {+ padding: 0.4em;+ height: 2em;+ min-height: 2em;+ }++ .or-SecondaryNavItem {+ user-select: none;+ -webkit-user-select: none; /* Chrome/Safari/Opera */+ -moz-user-select: none; /* Firefox */+ -ms-user-select: none; /* IE/Edge */+ -webkit-touch-callout: none; /* iOS Safari */+ cursor: pointer;+ padding: 0.4em;+ border-radius: 0.15em;+ font-weight: 600;+ display: inline-block;+ }++ .or-SecondaryNavItem a {+ text-decoration: none;+ }++ .or-SecondaryNavItem:hover,+ .or-SecondaryNavItem:focus {+ opacity: .8;}.or-SidebarContent {+ overflow: auto;+ }++ .or-MainContent {+ overflow: auto;padding: 1em;}diff --git a/manager/client/src/main/webapp/css/theme.html b/manager/client/src/main/webapp/css/theme.htmlindex a537f268b..8b34aaea5 100644--- a/manager/client/src/main/webapp/css/theme.html+++ b/manager/client/src/main/webapp/css/theme.html@@ -22,27 +22,42 @@color: var(--theme-white);}- .theme-MainContent {+ .theme-NavItem {+ background: transparent;+ color: var(--theme-white) !important;+ }+ .theme-NavItem.active {+ background: var(--theme-black) !important;+ color: var(--theme-lightgreen) !important;}- .theme-SidebarContent {- background-color: var(--theme-brightgrey);+ .theme-SecondaryNav {+ background-color: var(--theme-black);+ color: var(--theme-white);}- .theme-NavItem {+ .theme-SecondaryNavItem {background: transparent;+ }++ .theme-SecondaryNavItem a {color: var(--theme-white) !important;}- .theme-NavItemActive {- background: var(--theme-lightgreen) !important;- color: var(--theme-black) !important;+ .theme-SecondaryNavItem.active {}- .theme-NavItemBadge {- background: var(--theme-blue) !important;- color: var(--theme-white) !important;+ .theme-SecondaryNavItem.active a {+ color: var(--theme-lightgreen) !important;+ }++ .theme-SidebarContent {+ background-color: var(--theme-brightgrey);+ }++ .theme-MainContent {+}.theme-PushButton {@@ -178,8 +193,8 @@}.theme-PopupPanelHeader {- background-color: var(--theme-black);- color: var(--theme-white);+ background-color: var(--theme-lightgreen);+ color: var(--theme-black);}.theme-PopupPanelContent {diff --git a/test/src/test/groovy/org/openremote/test/assets/AssetDetailActivityTest.groovy b/test/src/test/groovy/org/openremote/test/assets/AssetsActivityTest.groovysimilarity index 89%rename from test/src/test/groovy/org/openremote/test/assets/AssetDetailActivityTest.groovyrename to test/src/test/groovy/org/openremote/test/assets/AssetsActivityTest.groovyindex 4817ab0a0..de47fe203 100644--- a/test/src/test/groovy/org/openremote/test/assets/AssetDetailActivityTest.groovy+++ b/test/src/test/groovy/org/openremote/test/assets/AssetsActivityTest.groovy@@ -3,8 +3,8 @@ package org.openremote.test.assetsimport com.google.gwt.place.shared.PlaceControllerimport com.google.gwt.user.client.ui.AcceptsOneWidgetimport org.openremote.container.web.WebClient-import org.openremote.manager.client.assets.AssetDetailActivity-import org.openremote.manager.client.assets.AssetDetailView+import org.openremote.manager.client.assets.AssetsActivity+import org.openremote.manager.client.assets.AssetsViewimport org.openremote.manager.client.event.bus.EventBusimport org.openremote.manager.server.event.EventServiceimport org.openremote.test.ContainerTrait@@ -14,8 +14,9 @@ import spock.util.concurrent.BlockingVariablesimport static org.openremote.manager.shared.Constants.MANAGER_CLIENT_IDimport static org.openremote.manager.shared.Constants.MASTER_REALM-class AssetDetailActivityTest extends Specification implements ContainerTrait {+class AssetsActivityTest extends Specification implements ContainerTrait {+/* TODO remove outdated testdef "Send/receive hello messages"() {given: "The fake client environment"def placeController = Mock(PlaceController)@@ -50,13 +51,13 @@ class AssetDetailActivityTest extends Specification implements ContainerTrait {)and: "the view, resource, and activity"- def assetDetailView = Mock(AssetDetailView) {+ def assetDetailView = Mock(AssetsView) {setMessageText(_) >> { String value ->result.messageText = value;}}- def assetDetailActivity = new AssetDetailActivity(+ def assetDetailActivity = new AssetsActivity(assetDetailView, placeController, activityBus)@@ -78,4 +79,5 @@ class AssetDetailActivityTest extends Specification implements ContainerTrait {and: "the server should be stopped"stopContainer(container);}+*/}