Skip to content

Commit

Permalink
Fixed scrolling of tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasBrazi06 committed Apr 8, 2022
1 parent 4426f4a commit 19e3ae1
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 83 deletions.
7 changes: 3 additions & 4 deletions src/app/pages/assets/asset/asset.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
</mat-tab>
</mat-tab-group>
<div class="tabs-actions">
<button mat-button *ngIf="!readOnly" (click)="saveAsset(formGroup.value)"
[disabled]="!formGroup.valid || !formGroup.dirty">
<button mat-icon-button *ngIf="!readOnly" (click)="saveAsset(formGroup.value)" title="{{'general.save' | translate}}"
[disabled]="!formGroup.valid || !formGroup.dirty">
<mat-icon>save</mat-icon>
<span>{{'general.save' | translate}}</span>
</button>
<button mat-icon-button *ngIf="dialogRef" (click)="close()">
<button mat-icon-button *ngIf="dialogRef" (click)="close()" title="{{'general.close' | translate}}">
<mat-icon>close</mat-icon>
</button>
</div>
Expand Down
5 changes: 2 additions & 3 deletions src/app/pages/cars/car/car.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
</mat-tab>
</mat-tab-group>
<div class="tabs-actions">
<button mat-button *ngIf="!readOnly" (click)="saveCar(formGroup.getRawValue())"
<button mat-icon-button *ngIf="!readOnly" (click)="saveCar(formGroup.getRawValue())" title="{{'general.save' | translate}}"
[disabled]="!formGroup.valid || !formGroup.dirty" >
<mat-icon>save</mat-icon>
<span>{{ "general.save" | translate }}</span>
</button>
<button mat-icon-button *ngIf="dialogRef" (click)="close()">
<button mat-icon-button *ngIf="dialogRef" (click)="close()" title="{{'general.close' | translate}}">
<mat-icon>close</mat-icon>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@
</ng-container>
</mat-tab-group>
<div class="tabs-actions">
<button mat-button *ngIf="!readOnly" (click)="saveChargingStation(formGroup.getRawValue())"
<button mat-icon-button *ngIf="!readOnly" (click)="saveChargingStation(formGroup.getRawValue())" title="{{'general.save' | translate}}"
[disabled]="!formGroup.valid || !formGroup.dirty" [hidden]="!this.isAdmin || activeTabIndex !== 0">
<mat-icon>save</mat-icon>
<span>{{'chargers.save_charger' | translate}}</span>
</button>
<button mat-icon-button *ngIf="dialogRef" (click)="close()">
<button mat-icon-button *ngIf="dialogRef" (click)="close()" title="{{'general.close' | translate}}">
<mat-icon>close</mat-icon>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { MatTabChangeEvent } from '@angular/material/tabs';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { UtilsService } from 'services/utils.service';
import { DialogMode } from 'types/Authorization';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</mat-tab>
</mat-tab-group>
<div class="tabs-actions">
<button mat-button *ngIf="!readOnly" (click)="saveCompany(formGroup.value)" [disabled]="!formGroup.valid || !formGroup.dirty">
<button mat-icon-button *ngIf="!readOnly" (click)="saveCompany(formGroup.value)" title="{{'general.save' | translate}}"
[disabled]="!formGroup.valid || !formGroup.dirty">
<mat-icon>save</mat-icon>
<span>{{'general.save' | translate}}</span>
</button>
<button mat-icon-button *ngIf="dialogRef" (click)="close()">
<button mat-icon-button *ngIf="dialogRef" (click)="close()" title="{{'general.close' | translate}}">
<mat-icon>close</mat-icon>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
</mat-tab>
</mat-tab-group>
<div class="tabs-actions">
<button mat-button *ngIf="!readOnly" (click)="saveSiteArea(formGroup.getRawValue())"
[disabled]="!formGroup.valid || !formGroup.dirty">
<button mat-icon-button *ngIf="!readOnly" (click)="saveSiteArea(formGroup.getRawValue())" title="{{'general.save' | translate}}"
[disabled]="!formGroup.valid || !formGroup.dirty">
<mat-icon>save</mat-icon>
<span>{{'general.save' | translate}}</span>
</button>
<button mat-icon-button *ngIf="dialogRef" (click)="close()">
<button mat-icon-button *ngIf="dialogRef" (click)="close()" title="{{'general.close' | translate}}">
<mat-icon>close</mat-icon>
</button>
</div>
Expand Down
7 changes: 3 additions & 4 deletions src/app/pages/organization/sites/site/site.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@
</mat-tab>
</mat-tab-group>
<div class="tabs-actions">
<button mat-button *ngIf="!readOnly" (click)="saveSite(formGroup.value)"
[disabled]="!formGroup.valid || !formGroup.dirty">
<button mat-icon-button *ngIf="!readOnly" (click)="saveSite(formGroup.value)" title="{{'general.save' | translate}}"
[disabled]="!formGroup.valid || !formGroup.dirty">
<mat-icon>save</mat-icon>
<span>{{'general.save' | translate}}</span>
</button>
<button mat-icon-button *ngIf="dialogRef" (click)="close()">
<button mat-icon-button *ngIf="dialogRef" (click)="close()" title="{{'general.close' | translate}}">
<mat-icon>close</mat-icon>
</button>
</div>
Expand Down
5 changes: 2 additions & 3 deletions src/app/pages/tags/tag/tag.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
</mat-tab>
</mat-tab-group>
<div class="tabs-actions">
<button mat-button *ngIf="!readOnly" (click)="saveTag(formGroup.getRawValue())"
<button mat-icon-button *ngIf="!readOnly" (click)="saveTag(formGroup.getRawValue())" title="{{'general.save' | translate}}"
[disabled]="!formGroup.valid || !formGroup.dirty">
<mat-icon>save</mat-icon>
<span>{{'general.save' | translate}}</span>
</button>
<button mat-icon-button *ngIf="dialogRef" (click)="close()">
<button mat-icon-button *ngIf="dialogRef" (click)="close()" title="{{'general.close' | translate}}">
<mat-icon>close</mat-icon>
</button>
</div>
Expand Down
53 changes: 43 additions & 10 deletions src/app/pages/template/buttons/buttons-template.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,49 @@ <h3 class="card-title">Example of buttons within tabs</h3>
</div>
<div class="card-body">
<mat-tab-group class="mat-tab-info">
<mat-tab>
<ng-template mat-tab-label>
Tab 1
</ng-template>
</mat-tab>
<mat-tab>
<ng-template mat-tab-label>
Tab 2
</ng-template>
</mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab><ng-template mat-tab-label>Tab</ng-template></mat-tab>
<mat-tab disabled>
<ng-template mat-tab-label>
<button mat-button>
Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/tenants/tenant/tenant.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
</mat-tab>
</mat-tab-group>
<div class="tabs-actions">
<button mat-button (click)="saveTenant(formGroup.value)" [disabled]="!formGroup.valid || !formGroup.dirty">
<button mat-icon-button (click)="saveTenant(formGroup.value)" title="{{'general.save' | translate}}"
[disabled]="!formGroup.valid || !formGroup.dirty">
<mat-icon>save</mat-icon>
<span>{{'general.save' | translate}}</span>
</button>
<button mat-icon-button *ngIf="inDialog" (click)="close()">
<button mat-icon-button *ngIf="inDialog" (click)="close()" title="{{'general.close' | translate}}">
<mat-icon>close</mat-icon>
</button>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/app/pages/users/user/user.component.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="main-content" [ngClass]="{'vh-lg-50 vw-lg-80 vw-xxl-60 vh-3xl-40 vw-3xl-35' : dialogRef}">
<div class="main-content vh-lg-50 vw-lg-80 vw-xxl-60 vh-3xl-40 vw-3xl-35">
<div class="card card-profile card-testimonial">
<form [formGroup]="formGroup" class="form">
<mat-tab-group (selectedIndexChange)="updateRoute($event)" [selectedIndex]="activeTabIndex"
animationDuration="0ms" disableRipple="true" class="h-100 mat-tab-info mat-tabs-with-actions">
animationDuration="0ms" disableRipple="true" class="h-100 mat-tab-info" [class]="dialogRef ? 'mat-tabs-with-actions' : 'mat-tabs-with-close-action'">
<mat-tab>
<ng-template mat-tab-label>
<mat-icon>portrait</mat-icon>
Expand Down Expand Up @@ -79,11 +79,11 @@
</mat-tab>
</mat-tab-group>
<div [class]="dialogRef ? 'tabs-actions' : 'tabs-actions-embedded'">
<button mat-button (click)="saveUser(formGroup.getRawValue())" [disabled]="!formGroup.valid || !formGroup.dirty">
<button mat-icon-button (click)="saveUser(formGroup.getRawValue())" title="{{'general.save' | translate}}"
[disabled]="!formGroup.valid || !formGroup.dirty">
<mat-icon>save</mat-icon>
<span>{{'general.save' | translate}}</span>
</button>
<button mat-icon-button *ngIf="dialogRef" (click)="close()">
<button mat-icon-button *ngIf="dialogRef" (click)="close()" title="{{'general.close' | translate}}">
<mat-icon>close</mat-icon>
</button>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/app/release-notes/release-notes.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class ReleaseNotesComponent {
this.releaseNotes = [
{
version: '2.6.4',
date: new Date('2022-04-04'),
date: new Date('2022-04-08'),
componentChanges: [
{
name: 'Dashboard',
Expand All @@ -35,6 +35,7 @@ export class ReleaseNotesComponent {
`Updated German translation`,
`Aligned Charging Profile's amperage floating points with OCPP specifications`,
`Fixed new OCPI authorization is requested during Start Transaction when IOP sends a Remote Start`,
`Fixed cannot scroll tabs in User pop-up`,
],
},
],
Expand Down
38 changes: 0 additions & 38 deletions src/assets/scss/core/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,44 +196,6 @@
}
}

.transparent-dialog-container {
.mat-dialog-container {
background: none;
box-shadow: none;
overflow: hidden;
}

.mat-tab-group {
margin-top: -20px;
}

.mat-tab-header {
margin-left: 15px;
margin-right: 15px;
background: $brand-primary;
}

.mat-tabs-with-actions {
.mat-tab-header {
padding-right: 125px !important;
}
}

.mat-tabs-with-close-action {
.mat-tab-header {
padding-right: 40px !important;
}
}

.mat-tab-labels {
padding: 11px 7px 7px 7px;
}

.mat-dialog-content {
margin: 0;
}
}

.mat-dialog-container {
border-radius: 0 !important;
}
Expand Down
53 changes: 52 additions & 1 deletion src/assets/scss/core/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
top: 0px;
right: 15px;
z-index: 999999999;
height: 58px;
height: 59px;
padding-top: 7px;
padding-right: 8px;
background: $brand-primary;
Expand Down Expand Up @@ -132,10 +132,61 @@
box-shadow: initial !important;
}

.mat-dialog-container {
.mat-tab-header-pagination {
padding-top: 4px;
}
}

.mat-tab-labels {
padding: 7px;
color: $brand-background !important;
}

.mat-tabs-with-close-action {
.mat-tab-header {
margin-right: 55px !important;
}
}

.transparent-dialog-container {
.mat-dialog-container {
background: none;
box-shadow: none;
overflow: hidden;
}

.mat-tab-group {
margin-top: -20px;
}

.mat-tab-header {
margin-left: 15px;
margin-right: 15px;
background: $brand-primary;
}

.mat-tabs-with-actions {
.mat-tab-header {
margin-right: 90px !important;
}
}

.mat-tabs-with-close-action {
.mat-tab-header {
margin-right: 40px !important;
}
}

.mat-tab-labels {
padding: 11px 7px 7px 7px;
}

.mat-dialog-content {
margin: 0;
}
}

.mat-tab-info .mat-tab-labels {
background: $brand-primary;
}
Expand Down

0 comments on commit 19e3ae1

Please sign in to comment.