Skip to content

Commit

Permalink
CSS fixes for server, desktop & ie11 (#51) [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
006627 committed Oct 29, 2019
1 parent 411c9e4 commit 4187ff1
Show file tree
Hide file tree
Showing 15 changed files with 184 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ public void onClick(ClickEvent event) {
createSelectAllPanel();

displayScroll = new ScrollPanel(display);
displayScroll.addStyleName("ms-scroll-fix");
displayScrollWrapper = new SimplePanel(displayScroll);

add(selectAllPanel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import java.util.HashMap;
import java.util.Map;

import com.databasepreservation.common.shared.ViewerConstants;
import com.databasepreservation.common.shared.client.common.utils.ApplicationType;
import org.roda.core.data.v2.user.User;

import com.databasepreservation.common.client.BrowserService;
Expand Down Expand Up @@ -60,9 +62,10 @@ interface DatabasePanelUiBinder extends UiBinder<Widget, DatabasePanel> {
}

private static DatabasePanelUiBinder uiBinder = GWT.create(DatabasePanelUiBinder.class);
private BreadcrumbPanel breadcrumb = null;

@UiField
BreadcrumbPanel breadcrumb;
BreadcrumbPanel breadcrumbServer, breadcrumbDesktop;

@UiField(provided = true)
DatabaseSidebar sidebar;
Expand All @@ -74,7 +77,7 @@ interface DatabasePanelUiBinder extends UiBinder<Widget, DatabasePanel> {
MenuBar menu;

@UiField
FlowPanel toplevel;
FlowPanel toplevel, toolbar;

private String databaseUUID;
private ViewerDatabase database = null;
Expand All @@ -90,6 +93,16 @@ private DatabasePanel(String databaseUUID, boolean initMenu) {
initMenu();
}

if(ApplicationType.getType().equals(ViewerConstants.SERVER)){
toolbar.getElement().addClassName("filePreviewToolbar");
breadcrumb = breadcrumbServer;
breadcrumbDesktop.removeFromParent();
} else {
toolbar.removeFromParent();
breadcrumb = breadcrumbDesktop;
}
breadcrumb.setVisible(true);

if (databaseUUID == null) {
BreadcrumbManager.updateBreadcrumb(breadcrumb, BreadcrumbManager.forDatabases());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
xmlns:sb='urn:import:com.databasepreservation.common.shared.client.common.sidebar'
>

<g:FlowPanel ui:field="toplevel">
<g:FlowPanel ui:field="toplevel" addStyleNames="database">
<g:FlowPanel addStyleNames="row full_width skip_padding">
<m:BreadcrumbPanel ui:field="breadcrumbDesktop" addStyleNames="browseContentBreadcrumb"
visible="false"/>
<g:FocusPanel addStyleNames="browseContentFocusPanel">
<g:HorizontalPanel addStyleNames="browseContentPreviewPanel">
<!-- LEFT PANEL -->
Expand All @@ -15,8 +17,8 @@
<!-- RIGHT PANEL -->
<g:cell width="100%">
<g:FlowPanel addStyleNames="browseContentFilePreviewPanel">
<g:FlowPanel addStyleNames="filePreviewToolbar">
<m:BreadcrumbPanel ui:field="breadcrumb" addStyleNames="browseContentBreadcrumb"/>
<g:FlowPanel ui:field="toolbar">
<m:BreadcrumbPanel ui:field="breadcrumbServer" addStyleNames="browseContentBreadcrumb" visible="false"/>
<g:MenuBar ui:field="menu" />
<g:SimplePanel addStyleNames="clear-both" />
</g:FlowPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import com.databasepreservation.common.shared.client.tools.ViewerStringUtils;
import com.google.gwt.cell.client.SafeHtmlCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.safehtml.shared.SafeHtmlUtils;
Expand Down Expand Up @@ -70,7 +72,7 @@ interface SchemaStructurePanelUiBinder extends UiBinder<Widget, SchemaStructureP
SimpleCheckBox advancedSwitch;

@UiField
Label switchLabel;
Label switchLabel, labelForSwitch;

private SchemaStructurePanel(ViewerDatabase database, final String schemaUUID) {
this.database = database;
Expand All @@ -88,12 +90,17 @@ public void handleBreadcrumb(BreadcrumbPanel breadcrumb) {
}

private void init() {
advancedSwitch.addClickHandler(event -> {
advancedMode = !advancedMode;
contentItems.clear();
initCellTables();
labelForSwitch.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
advancedSwitch.setValue(!advancedSwitch.getValue(), true); // workaround for ie11
advancedMode = !advancedMode;
contentItems.clear();
initCellTables();
}
});


CommonClientUtils.addSchemaInfoToFlowPanel(structureInformation, schema);

Label subtitle = new Label(messages.schemaStructurePanelTextForPageSubtitle());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<g:FlowPanel addStyleNames="advancedOptionsPanel">
<g:Label ui:field="switchLabel" addStyleNames="switch-label"/>
<g:SimpleCheckBox ui:field="advancedSwitch" addStyleNames="switch"/>
<g:Label ui:field="labelForSwitch" addStyleNames="label-for-switch"/>
</g:FlowPanel>
</g:FlowPanel>
<g:FlowPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ interface TablePanelUiBinder extends UiBinder<Widget, ForeignKeyPanelOptions> {
private Map<String, Boolean> initialLoading = new HashMap<>();
private MultipleSelectionTablePanel<ViewerColumn> columnsTable;
private Button btnSelectToggle;
private Label switchLabel;
private Label switchLabel, labelForSwitch;
private SimpleCheckBox advancedSwitch;
private List<String> columnsAndValues;

Expand Down Expand Up @@ -128,10 +128,12 @@ private void init() {

private void configureTechnicalInformationSwitch() {
switchLabel = new Label();
labelForSwitch = new Label(); // workaround for ie11
switchLabel.setText(messages.schemaStructurePanelTextForAdvancedOption());

advancedSwitch = new SimpleCheckBox();
advancedSwitch.addClickHandler(event -> {

labelForSwitch.addClickHandler(event -> {
advancedSwitch.setValue(!advancedSwitch.getValue(), true); // workaround for ie11
content.clear();
refreshCellTable(advancedSwitch.getValue());
showForeignKeyInformation(advancedSwitch.getValue());
Expand Down Expand Up @@ -332,6 +334,8 @@ private FlowPanel getToggleSelectPanel() {
switchLabel.addStyleName("switch-label");
technicalInformation.add(advancedSwitch);
advancedSwitch.setStyleName("switch");
technicalInformation.add(labelForSwitch);
labelForSwitch.setStyleName("label-for-switch");

panel.add(technicalInformation);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import com.databasepreservation.common.shared.client.tools.BreadcrumbManager;
import com.databasepreservation.common.shared.client.tools.ViewerStringUtils;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.FlowPanel;
Expand Down Expand Up @@ -59,7 +61,7 @@ interface DatabaseInformationPanelUiBinder extends UiBinder<Widget, DatabaseInfo
SimpleCheckBox advancedSwitch;

@UiField
Label switchLabel;
Label switchLabel, labelForSwitch;

private DatabaseInformationPanel(ViewerDatabase database) {
this.database = database;
Expand All @@ -74,12 +76,16 @@ public void handleBreadcrumb(BreadcrumbPanel breadcrumb) {
}

private void init() {
advancedSwitch.addClickHandler(event -> {
advancedMode = !advancedMode;
metadataContent.clear();
initMetadataContent();
dataContent.clear();
initDataContent();
labelForSwitch.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
advancedSwitch.setValue(!advancedSwitch.getValue(), true); // workaround for ie11
advancedMode = !advancedMode;
metadataContent.clear();
initMetadataContent();
dataContent.clear();
initDataContent();
}
});

title.setText(messages.databaseInformationTextForTitle());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<g:FlowPanel addStyleNames="advancedOptionsPanel">
<g:Label ui:field="switchLabel" addStyleNames="switch-label"/>
<g:SimpleCheckBox ui:field="advancedSwitch" addStyleNames="switch"/>
<g:Label ui:field="labelForSwitch" addStyleNames="label-for-switch"/>
</g:FlowPanel>
</g:FlowPanel>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ interface SIARDEditMetadataPageUiBinder extends UiBinder<Widget, SIARDEditMetada
private String databaseUUID;
private ViewerDatabase database = null;
private ViewerSIARDBundle SIARDbundle = new ViewerSIARDBundle();
private BreadcrumbPanel breadcrumb = null;

public static SIARDEditMetadataPage getInstance(String databaseUUID) {

Expand All @@ -48,7 +49,7 @@ public static SIARDEditMetadataPage getInstance(String databaseUUID) {
}

@UiField
BreadcrumbPanel breadcrumb;
BreadcrumbPanel breadcrumbServer, breadcrumbDesktop;

@UiField(provided = true)
MetadataEditSidebar sidebar;
Expand All @@ -74,9 +75,13 @@ private SIARDEditMetadataPage(final String databaseUUID) {

if(ApplicationType.getType().equals(ViewerConstants.SERVER)){
toolbar.getElement().addClassName("filePreviewToolbar");
breadcrumb = breadcrumbServer;
breadcrumbDesktop.removeFromParent();
} else {
toolbar.getElement().addClassName("desktopToolbar");
toolbar.removeFromParent();
breadcrumb = breadcrumbDesktop;
}
breadcrumb.setVisible(true);
}

public void load(MetadataPanelLoad rightPanelLoader, String sidebarSelected) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
xmlns:sb='urn:import:com.databasepreservation.desktop.client.common.sidebar'
xmlns:ct='urn:import:com.databasepreservation.common.shared.client.common.visualization.browse.metadata'
xmlns:m='urn:import:com.databasepreservation.common.shared.client.breadcrumb'
xmlns:sidebar="urn:import:com.databasepreservation.common.shared.client.common.sidebar">

<ui:with field='messages' type='config.i18n.client.ClientMessages'/>
<g:FlowPanel ui:field="toplevel">
<g:FlowPanel ui:field="toplevel" addStyleNames="metadata">
<g:FlowPanel addStyleNames="row full_width skip_padding">
<m:BreadcrumbPanel ui:field="breadcrumbDesktop" addStyleNames="browseContentBreadcrumb"
visible="false"/>
<g:FocusPanel addStyleNames="browseContentFocusPanel">
<g:HorizontalPanel addStyleNames="browseContentPreviewPanel metadata">
<g:HorizontalPanel addStyleNames="browseContentPreviewPanel">
<!-- LEFT PANEL -->
<g:cell>
<sidebar:MetadataEditSidebar ui:field="sidebar" />
Expand All @@ -18,7 +19,8 @@
<g:cell width="100%">
<g:FlowPanel addStyleNames="browseContentFilePreviewPanel metadata-panel">
<g:FlowPanel ui:field="toolbar">
<m:BreadcrumbPanel ui:field="breadcrumb" addStyleNames="browseContentBreadcrumb"/>
<m:BreadcrumbPanel ui:field="breadcrumbServer" addStyleNames="browseContentBreadcrumb"
visible="false"/>
<g:MenuBar ui:field="menu" />
<g:SimplePanel addStyleNames="clear-both" />
</g:FlowPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ interface TablePanelUiBinder extends UiBinder<Widget, TablePanelOptions> {
private Map<String, Boolean> initialLoading = new HashMap<>();
private MultipleSelectionTablePanel<ViewerColumn> columnsTable;
private Button btnSelectToggle;
private Label switchLabel;
private Label switchLabel, labelForSwitch;
private SimpleCheckBox advancedSwitch;

private TablePanelOptions(ViewerDatabase viewerDatabase, final String tableUUID) {
Expand Down Expand Up @@ -123,10 +123,12 @@ private void init() {

private void configureTechnicalInformationSwitch() {
switchLabel = new Label();
labelForSwitch = new Label(); // workaround for ie11
switchLabel.setText(messages.schemaStructurePanelTextForAdvancedOption());

advancedSwitch = new SimpleCheckBox();
advancedSwitch.addClickHandler(event -> {

labelForSwitch.addClickHandler(event -> {
advancedSwitch.setValue(!advancedSwitch.getValue(), true); // workaround for ie11
content.clear();
refreshCellTable(advancedSwitch.getValue());
showForeignKeyInformation(advancedSwitch.getValue());
Expand Down Expand Up @@ -327,6 +329,8 @@ private FlowPanel getToggleSelectPanel() {
switchLabel.addStyleName("switch-label");
technicalInformation.add(advancedSwitch);
advancedSwitch.setStyleName("switch");
technicalInformation.add(labelForSwitch);
labelForSwitch.setStyleName("label-for-switch");

panel.add(technicalInformation);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'
>
<g:FlowPanel styleName="main">
<g:FlowPanel styleName="main desktop-main">
<g:FlowPanel addStyleNames="contentPanel">
<g:SimplePanel ui:field="contentPanel" />
</g:FlowPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.databasepreservation.common.shared.client.common.ContentPanel;
import com.databasepreservation.common.shared.client.common.RightPanel;
import com.databasepreservation.common.shared.client.common.utils.ContentPanelLoader;
import com.databasepreservation.common.shared.client.common.utils.JavascriptUtils;
import com.databasepreservation.common.shared.client.common.utils.RightPanelLoader;
import com.databasepreservation.common.shared.client.common.visualization.browse.*;
import com.databasepreservation.common.shared.client.common.visualization.browse.foreignKey.ForeignKeyPanel;
Expand All @@ -32,6 +33,7 @@
import com.databasepreservation.common.shared.client.common.visualization.browse.table.TableSavedSearchEditPanel;
import com.databasepreservation.common.shared.client.common.visualization.browse.table.TableSavedSearchPanel;
import com.databasepreservation.common.shared.client.common.visualization.browse.technicalInformation.ReportPanel;
import com.databasepreservation.common.shared.client.common.visualization.browse.technicalInformation.RoutinesPanel;
import com.databasepreservation.common.shared.client.common.visualization.browse.technicalInformation.UsersPanel;
import com.databasepreservation.common.shared.client.common.visualization.browse.validate.ValidatorPage;
import com.databasepreservation.common.shared.client.tools.FontAwesomeIconManager;
Expand Down Expand Up @@ -101,6 +103,7 @@ private void setContent(String databaseUUID, RightPanelLoader rightPanelLoader)
DatabasePanel databasePanel = DatabasePanel.getInstance(databaseUUID, true);
databasePanel.setTopLevelPanelCSS("browseContent wrapper skip_padding server");
contentPanel.setWidget(databasePanel);
JavascriptUtils.scrollToElement(contentPanel.getElement());
databasePanel.load(rightPanelLoader, "");
}

Expand Down Expand Up @@ -259,6 +262,16 @@ public RightPanel load(ViewerDatabase database) {
}
});

} else if (currentHistoryPath.size() == 3
&& currentHistoryPath.get(2).equals(HistoryManager.ROUTE_SCHEMA_ROUTINES)) {
// #database/<database_uuid>/routines
String databaseUUID = currentHistoryPath.get(1);
setContent(databaseUUID, new RightPanelLoader() {
@Override
public RightPanel load(ViewerDatabase database) {
return RoutinesPanel.getInstance(database);
}
});
} else {
// #database/...
handleErrorPath(currentHistoryPath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
.desktop-main .content-container .browseContentFilePreviewPanel{
height: 100vh;
}

.desktop-main .metadata .browseContentFocusPanel,
.desktop-main .database .browseContentFocusPanel{
padding-top: 40px;
}


/**********************************************
Home Page
***********************************************/
Expand Down
Loading

0 comments on commit 4187ff1

Please sign in to comment.