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

View file

@ -13,14 +13,17 @@
~ See the License for the specific language governing permissions and
~ 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`
[part="form"] {
padding: 0;
}
[part="form-title"] {
display: none;
}
`);
registerStyles("vaadin-login-form-wrapper",
// language=css
css`
[part="form"] {
padding: 0;
}
[part="form-title"] {
display: none;
}
`);

View file

@ -98,7 +98,7 @@ public class UserService implements Serializable {
}
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();
MyGrid<Version> versionGrid = new MyGrid<>(getDataService().getVersionProvider(app));
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::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);
@ -228,6 +228,7 @@ public class AdminTab extends AppTab<Div> {
Card card = new Card(content);
card.setWidth(500, HasSize.Unit.PIXEL);
card.setMaxWidth(1000, HasSize.Unit.PIXEL);
card.setMaxHeight(500, HasSize.Unit.PIXEL);
layout.add(card);
layout.expand(card);
return card;