Browse Source

Unified spacing between tabs and content across tabbed pages (#16476)

* Fixed inconsistent spacing between tabs and content when switching tabs on Settings and Mobile center pages

* PR comments fixes

* Unified tab-to-content spacing via shared tb-content-card class and spacing variables

* Fixed PR comments

* Fixed license headers

* Fixed License page key card width and spacing

---------

Co-authored-by: Vladyslav_Prykhodko <vprykhodko@thingsboard.io>
pull/16641/head
Maksym Tsymbarov 3 weeks ago
committed by GitHub
parent
commit
5c435dc468
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      ui-ngx/src/app/modules/home/components/entity/entity-details-page.component.scss
  2. 3
      ui-ngx/src/app/modules/home/components/pe-pack/request-pe-pack.component.scss
  3. 4
      ui-ngx/src/app/modules/home/components/vc/auto-commit-settings.component.scss
  4. 8
      ui-ngx/src/app/modules/home/pages/admin/license-management.component.html
  5. 20
      ui-ngx/src/app/modules/home/pages/admin/license-management.component.scss
  6. 8
      ui-ngx/src/app/modules/home/pages/admin/settings-card.scss
  7. 50
      ui-ngx/src/app/modules/home/pages/agent/agent-app-profiles-page.component.scss
  8. 44
      ui-ngx/src/app/modules/home/pages/agent/agent-app-profiles-page.component.ts
  9. 17
      ui-ngx/src/app/modules/home/pages/custom-menu/custom-menu-config.component.scss
  10. 10
      ui-ngx/src/app/modules/home/pages/custom-menu/custom-menu-table.component.scss
  11. 12
      ui-ngx/src/app/modules/home/pages/custom-translation/translation-table.component.scss
  12. 3
      ui-ngx/src/app/modules/home/pages/custom-translation/translation-table.component.ts
  13. 2
      ui-ngx/src/app/modules/home/pages/profile/profile.component.html
  14. 5
      ui-ngx/src/app/modules/home/pages/profile/profile.component.scss
  15. 10
      ui-ngx/src/app/modules/home/pages/security/security.component.html
  16. 10
      ui-ngx/src/app/modules/home/pages/security/security.component.scss
  17. 2
      ui-ngx/src/app/modules/home/pages/trendz-settings/trendz-settings.component.html
  18. 4
      ui-ngx/src/scss/constants.scss
  19. 11
      ui-ngx/src/scss/mixins.scss
  20. 8
      ui-ngx/src/styles.scss

12
ui-ngx/src/app/modules/home/components/entity/entity-details-page.component.scss

@ -1,5 +1,6 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
@import "../../../../../scss/constants";
:host {
@ -10,10 +11,13 @@
overflow: hidden;
.settings-card {
margin: 8px;
margin: $tb-content-spacing;
@media #{$mat-gt-sm} {
margin: $tb-content-spacing-gt-sm;
}
padding: 0;
width: 100%;
height: 100%;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;

3
ui-ngx/src/app/modules/home/components/pe-pack/request-pe-pack.component.scss

@ -4,9 +4,10 @@
:host {
width: 100%;
padding-top: 16px;
padding-top: $tb-content-spacing;
padding-bottom: 48px;
@media #{$mat-gt-sm} {
padding-top: $tb-content-spacing-gt-sm;
padding-left: 16px;
padding-right: 16px;
}

4
ui-ngx/src/app/modules/home/components/vc/auto-commit-settings.component.scss

@ -1,8 +1,8 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
:host {
.mat-mdc-card.auto-commit-settings {
margin: 8px;
.mat-divider {
position: relative;
}

8
ui-ngx/src/app/modules/home/pages/admin/license-management.component.html

@ -115,7 +115,7 @@
@switch (manageLicenseState) {
@case (ManageLicenseState.MANAGE) {
@if (newLicenseApplied) {
<mat-card appearance="outlined" class="license-management applied">
<mat-card appearance="outlined" class="license-management tb-content-card applied">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"></path></svg>
<span>{{ 'subscription.new-license-applied' | translate }}</span>
<button mat-icon-button class="tb-mat-32" (click)="newLicenseApplied = false" style="color: var(--tb-ink-3);">
@ -123,7 +123,7 @@
</button>
</mat-card>
}
<mat-card appearance="outlined" class="license-management">
<mat-card appearance="outlined" class="license-management tb-content-card">
<div class="license-header">
<span class="license-mark" [class.with-hue]="planWithHue" [class]="planHueClass">
<img src="/assets/license/tb-license-mark.svg" alt width="84" height="84">
@ -284,7 +284,7 @@
}
</mat-card>
<mat-card appearance="outlined" class="license-management keycard">
<mat-card appearance="outlined" class="license-management tb-content-card keycard">
<span class="keydisc">
<svg width="22" height="22" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12.65 10C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H17v4h4v-4h2v-4H12.65zM7 14c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"></path></svg>
</span>
@ -300,7 +300,7 @@
</mat-card>
}
@case (ManageLicenseState.ENTER_KEY) {
<mat-card appearance="outlined" class="license-management">
<mat-card appearance="outlined" class="license-management tb-content-card">
<button mat-stroked-button class="mb-4.5 self-start" (click)="gotoManageLicense()">
<mat-icon>chevron_left</mat-icon>
{{ 'action.back' | translate }}

20
ui-ngx/src/app/modules/home/pages/admin/license-management.component.scss

@ -5,15 +5,9 @@
:host {
.mat-mdc-card.license-management {
margin: 16px;
padding: 24px;
display: block;
@media #{$mat-gt-sm} {
width: 720px;
margin: 16px auto;
}
::ng-deep {
button {
&.mat-mdc-outlined-button:not(:disabled) {
@ -466,15 +460,9 @@
padding: 12px 16px;
font-size: 15px;
color: var(--tb-ink);
margin: 16px auto 8px;
@media #{$mat-gt-sm} {
margin: 16px auto 8px;
}
margin-bottom: $tb-content-spacing;
+ .mat-mdc-card.license-management {
margin: 8px auto 16px;
@media #{$mat-gt-sm} {
margin: 8px auto 16px;
}
margin-top: $tb-content-spacing;
}
> svg {
flex: none;
@ -493,10 +481,6 @@
align-items: center;
gap: 16px;
padding: 16px 20px;
margin: 34px 16px 16px;
@media #{$mat-gt-sm} {
margin: 34px auto 16px;
}
.keydisc {
flex: none;

8
ui-ngx/src/app/modules/home/pages/admin/settings-card.scss

@ -2,15 +2,11 @@
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
@import "constants";
@import "mixins";
:host {
.mat-mdc-card.settings-card {
margin: 8px;
@media #{$mat-gt-sm} {
width: 700px;
margin: 8px auto;
}
@include tb-content-card;
mat-card-header.mat-mdc-card-header {
align-items: center;

50
ui-ngx/src/app/modules/home/pages/agent/agent-app-profiles-page.component.scss

@ -0,0 +1,50 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@import "constants";
:host {
display: block;
height: 100%;
width: 100%;
}
.tb-app-profiles-page {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
}
.tb-app-profiles-page-quick-start {
flex: 0 0 auto;
display: grid;
grid-template-rows: 1fr;
margin: $tb-content-spacing $tb-content-spacing 0;
opacity: 1;
visibility: visible;
transition: grid-template-rows 400ms cubic-bezier(0.25, 0.8, 0.25, 1),
margin 400ms cubic-bezier(0.25, 0.8, 0.25, 1),
opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1),
visibility 0s linear 0s;
}
@media #{$mat-gt-sm} {
.tb-app-profiles-page-quick-start {
margin: $tb-content-spacing-gt-sm $tb-content-spacing-gt-sm 0;
}
}
.tb-app-profiles-page-quick-start.collapsed {
grid-template-rows: 0fr;
margin-top: 0;
opacity: 0;
pointer-events: none;
visibility: hidden;
transition: none;
}
.tb-app-profiles-page-quick-start-inner {
min-height: 0;
overflow: hidden;
}
.tb-app-profiles-page-table {
flex: 1 1 auto;
min-height: 0;
display: block;
position: relative;
}

44
ui-ngx/src/app/modules/home/pages/agent/agent-app-profiles-page.component.ts

@ -33,49 +33,7 @@ import { AgentAppProfile } from '@shared/models/agent.models';
}
</div>
`,
styles: [`
:host {
display: block;
height: 100%;
width: 100%;
}
.tb-app-profiles-page {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
}
.tb-app-profiles-page-quick-start {
flex: 0 0 auto;
display: grid;
grid-template-rows: 1fr;
margin: 16px 16px 0;
opacity: 1;
visibility: visible;
transition: grid-template-rows 400ms cubic-bezier(0.25, 0.8, 0.25, 1),
margin 400ms cubic-bezier(0.25, 0.8, 0.25, 1),
opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1),
visibility 0s linear 0s;
}
.tb-app-profiles-page-quick-start.collapsed {
grid-template-rows: 0fr;
margin-top: 0;
opacity: 0;
pointer-events: none;
visibility: hidden;
transition: none;
}
.tb-app-profiles-page-quick-start-inner {
min-height: 0;
overflow: hidden;
}
.tb-app-profiles-page-table {
flex: 1 1 auto;
min-height: 0;
display: block;
position: relative;
}
`],
styleUrls: ['./agent-app-profiles-page.component.scss'],
standalone: false
})
export class AgentAppProfilesPageComponent implements OnInit, OnDestroy {

17
ui-ngx/src/app/modules/home/pages/custom-menu/custom-menu-config.component.scss

@ -1,21 +1,20 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@import "constants";
@import "mixins";
tb-custom-menu-config {
height: 100%;
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
.tb-custom-menu-config-card {
@include tb-content-card;
padding: 0;
margin: 8px;
height: calc(100% - 16px);
@media #{$mat-gt-sm} {
width: 700px;
margin: 8px auto;
}
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;

10
ui-ngx/src/app/modules/home/pages/custom-menu/custom-menu-table.component.scss

@ -4,14 +4,10 @@
@import "mixins";
:host {
@include tb-content-card;
position: relative;
height: 100%;
margin: 8px;
@media #{$mat-gt-sm} {
width: 700px;
margin: 8px auto;
}
flex: 1;
min-height: 0;
}
:host ::ng-deep {

12
ui-ngx/src/app/modules/home/pages/custom-translation/translation-table.component.scss

@ -1,17 +1,11 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@import "constants";
:host {
position: relative;
height: 100%;
height: auto;
width: auto;
margin: 8px;
@media #{$mat-gt-sm} {
width: 700px;
margin: 8px auto;
}
flex: 1;
min-height: 0;
.tb-entity-table {
.tb-entity-table-content {

3
ui-ngx/src/app/modules/home/pages/custom-translation/translation-table.component.ts

@ -27,6 +27,9 @@ import { UserPermissionsService } from '@core/http/user-permissions.service';
selector: 'tb-translation-table',
templateUrl: './translation-table.component.html',
styleUrls: ['../../components/entity/entities-table.component.scss', './translation-table.component.scss'],
host: {
'class': 'tb-content-card'
},
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: false
})

2
ui-ngx/src/app/modules/home/pages/profile/profile.component.html

@ -6,7 +6,7 @@
-->
<div>
<mat-card appearance="outlined" class="profile-card">
<mat-card appearance="outlined" class="profile-card tb-content-card">
<mat-card-header>
<div class="flex flex-1 flex-row items-start justify-between xs:flex-col xs:justify-start xs:gap-2">
<div class="flex flex-1 flex-col">

5
ui-ngx/src/app/modules/home/pages/profile/profile.component.scss

@ -5,11 +5,6 @@
:host {
.mat-mdc-card.profile-card {
margin: 8px;
@media #{$mat-gt-sm} {
width: 700px;
margin: 8px auto;
}
.mat-headline-5 {
margin: 0;
}

10
ui-ngx/src/app/modules/home/pages/security/security.component.html

@ -5,8 +5,8 @@
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
<div class="profile-container flex flex-col gap-2">
<mat-card appearance="outlined" class="profile-card flex flex-col">
<div>
<mat-card appearance="outlined" class="profile-card tb-content-card flex flex-col">
<mat-card-title style="margin-bottom: 8px;">
<span class="mat-headline-5 card-title" translate>profile.jwt-token</span>
</mat-card-title>
@ -21,7 +21,7 @@
</div>
</mat-card>
@if (resource.API_KEY | hasGenericPermission: operation.READ) {
<mat-card appearance="outlined" class="profile-card flex flex-col">
<mat-card appearance="outlined" class="profile-card tb-content-card flex flex-col">
<div class="flex flex-row items-center justify-between">
<mat-card-title>
<span class="mat-headline-5 card-title" translate>api-key.api-keys</span>
@ -37,7 +37,7 @@
</mat-card>
}
@if (resource.PROFILE | hasGenericPermission: operation.WRITE) {
<mat-card appearance="outlined" class="profile-card flex flex-col">
<mat-card appearance="outlined" class="profile-card tb-content-card flex flex-col">
<mat-card-content class="change-password" tb-toast toastTarget="changePassword">
<form #changePasswordForm="ngForm" [formGroup]="changePassword" (ngSubmit)="onChangePassword(changePasswordForm)">
<div class="flex flex-row gap-6.25 xs:flex-col xs:gap-0">
@ -176,7 +176,7 @@
</mat-card>
}
@if (allowTwoFactorProviders.length && (resource.PROFILE | hasGenericPermission: operation.WRITE)) {
<mat-card appearance="outlined" class="profile-card">
<mat-card appearance="outlined" class="profile-card tb-content-card">
<mat-card-title style="margin-bottom: 20px;">
<span class="mat-headline-5 card-title" translate>admin.2fa.2fa</span>
</mat-card-title>

10
ui-ngx/src/app/modules/home/pages/security/security.component.scss

@ -1,17 +1,7 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
@import "constants";
:host {
.profile-container {
margin: 8px;
@media #{$mat-gt-sm} {
width: 700px;
margin: 8px auto;
}
}
.mat-mdc-card.profile-card {
padding: 24px;

2
ui-ngx/src/app/modules/home/pages/trendz-settings/trendz-settings.component.html

@ -4,7 +4,7 @@
SPDX-License-Identifier: BUSL-1.1
-->
<div class="flex flex-col">
<div>
<mat-card appearance="outlined" class="settings-card service-connection">
<div class="tb-form-panel no-border">
<div class="tb-form-panel-title flex items-center">

4
ui-ngx/src/scss/constants.scss

@ -22,4 +22,8 @@ $mat-md-lg: "screen and (min-width: 960px) and (max-width: 1819px)";
$popover-bg: #fff;
$tb-content-spacing: 8px;
$tb-content-spacing-gt-sm: 16px;
$tb-content-card-width: 700px;
$sidenav-anim-timing: 400ms cubic-bezier(0.25, 0.8, 0.25, 1);

11
ui-ngx/src/scss/mixins.scss

@ -1,5 +1,6 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
@use "sass:math";
@mixin tb-mat-icon-size($size) {
@ -54,3 +55,11 @@
@return $x1;
}
@mixin tb-content-card() {
margin: $tb-content-spacing;
@media #{$mat-gt-sm} {
width: $tb-content-card-width;
margin: $tb-content-spacing-gt-sm auto;
}
}

8
ui-ngx/src/styles.scss

@ -693,12 +693,16 @@ pre.tb-highlight {
}
.mat-padding {
padding: 8px;
padding: $tb-content-spacing;
@media #{$mat-gt-sm} {
padding: 16px;
padding: $tb-content-spacing-gt-sm;
}
}
.tb-content-card {
@include tb-content-card;
}
.mat-content {
position: relative;
overflow: auto;

Loading…
Cancel
Save