limit size of card in AdminTab

This commit is contained in:
f43nd1r 2019-12-04 03:26:25 +01:00
parent c710f9c82b
commit e556461f73
5 changed files with 21 additions and 15 deletions

View file

@ -8,6 +8,7 @@ class AcrariumBox extends PolymerElement {
:host { :host {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center;
} }
.acrarium-box-title { .acrarium-box-title {

View file

@ -9,8 +9,8 @@ class AcrariumCard extends PolymerElement {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
border-radius: 2px; border-radius: 2px;
margin: 1rem; margin: 1rem;
display: inline-block; display: inline-flex;
align-items: center; flex-direction: column;
} }
.acrarium-card-header { .acrarium-card-header {
@ -27,7 +27,8 @@ class AcrariumCard extends PolymerElement {
box-sizing: border-box; box-sizing: border-box;
display: inline-block; display: inline-block;
width: 100%; width: 100%;
height: 100%; flex: 1;
min-height: 0;
} }
.acrarium-card-content.collapse { .acrarium-card-content.collapse {
@ -45,7 +46,7 @@ class AcrariumCard extends PolymerElement {
getContentClass(collapse, divider) { getContentClass(collapse, divider) {
let classes = "acrarium-card-content"; let classes = "acrarium-card-content";
if (collapse) classes += "collapse"; if (collapse) classes += " collapse";
if (divider) classes += " divider"; if (divider) classes += " divider";
return classes; return classes;
} }

View file

@ -13,14 +13,17 @@
~ See the License for the specific language governing permissions and ~ See the License for the specific language governing permissions and
~ limitations under the License. ~ limitations under the License.
*/ */
import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js'; import {registerStyles, css} from '@vaadin/vaadin-themable-mixin/register-styles.js';
registerStyles("vaadin-login-form-wrapper", css` registerStyles("vaadin-login-form-wrapper",
[part="form"] { // language=css
padding: 0; css`
} [part="form"] {
[part="form-title"] { padding: 0;
display: none; }
}
`); [part="form-title"] {
display: none;
}
`);

View file

@ -98,7 +98,7 @@ public class UserService implements Serializable {
} }
public boolean hasAdmin() { public boolean hasAdmin() {
return new JPAQuery<>(entityManager).from(USER).where(USER.roles.contains(User.Role.ADMIN)).select(Expressions.ONE).fetchOne() != null; return new JPAQuery<>(entityManager).from(USER).where(USER.roles.contains(User.Role.ADMIN)).select(Expressions.ONE).fetchFirst() != null;
} }

View file

@ -97,7 +97,7 @@ public class AdminTab extends AppTab<Div> {
layout.removeAll(); layout.removeAll();
MyGrid<Version> versionGrid = new MyGrid<>(getDataService().getVersionProvider(app)); MyGrid<Version> versionGrid = new MyGrid<>(getDataService().getVersionProvider(app));
versionGrid.setHeightToRows(); versionGrid.setHeightToRows();
versionGrid.setHeight(""); versionGrid.setMaxHeight(100, HasSize.Unit.PERCENTAGE);
versionGrid.addColumn(Version::getCode, QVersion.version.code, Messages.VERSION_CODE).setFlexGrow(1); versionGrid.addColumn(Version::getCode, QVersion.version.code, Messages.VERSION_CODE).setFlexGrow(1);
versionGrid.addColumn(Version::getName, QVersion.version.name, Messages.VERSION).setFlexGrow(1); versionGrid.addColumn(Version::getName, QVersion.version.name, Messages.VERSION).setFlexGrow(1);
versionGrid.addColumn(new IconRenderer<>(v -> new Icon(v.getMappings() != null ? VaadinIcon.CHECK : VaadinIcon.CLOSE), v -> ""), QVersion.version.mappings.isNotNull(), Messages.PROGUARD_MAPPINGS); versionGrid.addColumn(new IconRenderer<>(v -> new Icon(v.getMappings() != null ? VaadinIcon.CHECK : VaadinIcon.CLOSE), v -> ""), QVersion.version.mappings.isNotNull(), Messages.PROGUARD_MAPPINGS);
@ -228,6 +228,7 @@ public class AdminTab extends AppTab<Div> {
Card card = new Card(content); Card card = new Card(content);
card.setWidth(500, HasSize.Unit.PIXEL); card.setWidth(500, HasSize.Unit.PIXEL);
card.setMaxWidth(1000, HasSize.Unit.PIXEL); card.setMaxWidth(1000, HasSize.Unit.PIXEL);
card.setMaxHeight(500, HasSize.Unit.PIXEL);
layout.add(card); layout.add(card);
layout.expand(card); layout.expand(card);
return card; return card;