Skip to content

Commit

Permalink
NAS-129773 / 24.10 / Remove some flex layout usages (#10254)
Browse files Browse the repository at this point in the history
  • Loading branch information
undsoft authored Jul 5, 2024
1 parent 1c52eab commit 12db9d9
Show file tree
Hide file tree
Showing 128 changed files with 213 additions and 620 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@mdi/font": "~7.4.47",
"@ngbracket/ngx-layout": "~17.0.1",
"@ngneat/reactive-forms": "~5.0.2",
"@ngneat/spectator": "~18.0.1",
"@ngneat/spectator": "~19.0.0",
"@ngneat/until-destroy": "~9.2.3",
"@ngrx/component-store": "~17.2.0",
"@ngrx/effects": "~17.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ <h1 mat-dialog-title>{{ options.title | translate }}</h1>
>
{{ options.confirmationCheckboxText | translate }}
</mat-checkbox>
<span fxFlex></span>
<button
*ngIf="!options.hideCancel"
mat-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

.confirm-checkbox {
margin-left: -10px;
margin-right: auto;
padding-right: 10px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ <h1 mat-dialog-title>
</div>
</div>
<div mat-dialog-actions>
<span fxFlex></span>
<button
*ngIf="!conf.hideCancel"
mat-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ <h1 mat-dialog-title>
</div>
<div mat-dialog-actions>
&nbsp;
<span fxFlex></span>
<button
mat-button
class="mat-mdc-button mat-button mat-accent"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<div
class="ix-slidein-title-bar"
fxLayout="row"
fxLayoutAlign="space-between center"
>
<div class="ix-slidein-title-bar">
<h3 class="ix-formtitle">
{{ title() | translate }}
<ix-readonly-badge *ngIf="requiredRoles()?.length && !(hasRequiredRoles() | async)"></ix-readonly-badge>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
align-items: center;
background-color: var(--bg2);
border-bottom: 2px solid var(--lines);
display: flex;
height: 75px;
margin: 0 -20px;
padding: 0 30px;
place-content: center space-between;
}

.ix-formtitle {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
<mat-sidenav-container
class="app-side-nav-container"
fxLayout="row"
ngClass.xs="xs"
ngClass.sm="sm"
ngClass.md="md"
ngClass.lg="lg"
ngClass.xl="xl"
>
<mat-sidenav-container class="app-side-nav-container">
<!-- Main side navigation -->
<mat-sidenav
class="sidebar-panel not-alerts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
>
<ix-icon [name]="item.icon"></ix-icon>
<span>{{ item.name | translate }}</span>
<span fxFlex></span>
<ix-icon class="menu-caret">keyboard_arrow_right</ix-icon>
</a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@
mat-nav-list {
padding-top: 0;
}

.menu-caret {
margin-left: auto;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@
<div mat-dialog-content>
<div class="help">{{ helptext.help | translate }}</div>
<div class="line-item">
<div fxFlex="10%">
<div>
<ix-icon name="assignment" class="bullet-icon"></ix-icon>
</div>
<div
fxFlex="90%"
class="medium-font"
[innerHtml]="helptext.docs | translate"
></div>
</div>

<div class="line-item">
<div fxFlex="10%"><ix-icon name="group" class="bullet-icon"></ix-icon></div>
<div><ix-icon name="group" class="bullet-icon"></ix-icon></div>
<div
fxFlex="90%"
class="medium-font"
[innerHtml]="helptext.forums | translate"
></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@
}

.line-item {
display: flex;
margin: 20px 10px;

> *:first-child {
flex: 1 1 10%;
}

> *:last-child {
flex: 1 1 90%;
}
}

.bullet-icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

<ix-global-search-trigger></ix-global-search-trigger>

<span fxFlex></span>

<a class="mobile-logo" routerLink="/" ixTest="mobile-logo">
<div class="mobile-logo-container">
<ix-icon name="ix:logo_truenas_scale_mark_color" class="logomark"></ix-icon>
Expand Down
2 changes: 2 additions & 0 deletions src/app/modules/page-header/page-header.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MatButton } from '@angular/material/button';
import { RouterModule } from '@angular/router';
import { FlexModule } from '@ngbracket/ngx-layout';
import { TranslateModule } from '@ngx-translate/core';
Expand All @@ -22,6 +23,7 @@ import { NewPageBadgeComponent } from './is-new-indicator/new-page-badge.compone
CommonDirectivesModule,
TestIdModule,
AppLoaderModule,
MatButton,
],
declarations: [
BreadcrumbComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="header-container">
<ix-breadcrumb fxFlex="100%"></ix-breadcrumb>
<ix-breadcrumb class="breadcrumbs"></ix-breadcrumb>
<div class="title-container">
<div fxLayout="row" fxLayoutAlign="center center">
<h1>{{ pageTitle ? (pageTitle | translate) : (currentTitle$ | async) | translate }}</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
}
}

ix-breadcrumb {
.breadcrumbs {
position: relative;
top: 8px;
width: 100%;
}

ix-fake-progress-bar {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<h1 mat-dialog-title>{{ title | translate }}</h1>
<div mat-dialog-content [innerHtml]="messageHtml"></div>
<div mat-dialog-actions>
<span fxFlex></span>
<button
mat-button
color="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
</div>

<div mat-dialog-actions>
<span fxFlex></span>

<button
mat-button
type="button"
Expand Down
12 changes: 6 additions & 6 deletions src/app/pages/account/users/user-form/user-form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
<ix-fieldset [title]="'Identification' | translate">
<div class="columns">
<div fxFlex="50%">
<div>
<ix-input
formControlName="full_name"
[label]="'Full Name' | translate"
Expand All @@ -25,7 +25,7 @@
></ix-input>
</div>

<div fxFlex="50%">
<div>
<ix-slide-toggle
formControlName="password_disabled"
[label]="'Disable Password' | translate"
Expand Down Expand Up @@ -55,7 +55,7 @@

<ix-fieldset [title]="'User ID and Groups' | translate">
<div class="columns">
<div fxFlex="50%">
<div>
<ix-input
formControlName="uid"
type="number"
Expand All @@ -71,7 +71,7 @@
></ix-slide-toggle>
</div>

<div fxFlex="50%">
<div>
<ix-chips
formControlName="groups"
[label]="'Auxiliary Groups' | translate"
Expand All @@ -94,7 +94,7 @@
<mat-divider></mat-divider>

<div class="columns">
<div fxFlex="50%">
<div>
<ix-fieldset [title]="'Directories and Permissions' | translate">
<ix-explorer
formControlName="home"
Expand All @@ -117,7 +117,7 @@
</ix-fieldset>
</div>

<div fxFlex="50%">
<div>
<ix-fieldset [title]="'Authentication' | translate">
<ix-textarea
formControlName="sshpubkey"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
display: flex;
flex-direction: row;

> div {
flex: 1 1 50%;
}

@media (max-width: $breakpoint-tablet) {
display: block !important;

> div {
max-width: 100% !important;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</button>
</ix-page-header>

<div class="container" fxLayoutGap="16px">
<div class="container">
<div class="table-container" [class.mobile-hidden]="showMobileDetails && dataProvider.expandedRow">
@if (!isMobileView) {
<ng-container [ngTemplateOutlet]="thead"></ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ix-empty [conf]="emptyConf()" [requiredRoles]="requiredRoles"></ix-empty>
</div>
} @else {
<div class="container" fxLayoutGap="16px">
<div class="container">
<div class="table-container">
@if (!showMobileDetails) {
<ix-fake-progress-bar
Expand All @@ -17,6 +17,7 @@
(search)="onSearch($event)"
></ix-search-input1>
</div>

<div
#ixTreeHeader
class="sticky-header"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@switch (true) {
@case (!isActiveDirectoryEnabled && !isLdapEnabled) {
<div fxLayout="column" fxLayoutAlign="center center" class="everything-disabled">
<div class="everything-disabled">
<ix-empty [conf]="noDirectoryServicesConfig"></ix-empty>
<div class="actions">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
}

.everything-disabled {
.actions {
justify-content: center;
}

button {
&:last-child {
margin-right: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h3 mat-card-title>
</a>
</mat-card-header>

<mat-card-content fxLayout="column" fxFlex="100">
<mat-card-content class="content">
<div class="details-item">
<div class="label">
{{ 'Disks temperature related alerts' | translate }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
height: 100%;
}

.content {
display: flex;
flex-direction: column;
}

.details-item {
margin: 8px 0;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<mat-card class="card" fxLayout="column" [ixUiSearch]="searchableElements.elements.usage">
<mat-card class="card" [ixUiSearch]="searchableElements.elements.usage">
<mat-card-header>
<h3 mat-card-title>
{{ 'Usage' | translate }}
Expand All @@ -14,13 +14,10 @@ <h3 mat-card-title>
</a>
</mat-card-header>

<mat-card-content
fxLayout="row"
fxFlex="100"
fxLayoutAlign="space-around center"
>
<div class="left" fxLayout="column" fxLayoutAlign="center center">
<mat-card-content class="card-content">
<div class="left">
<ix-gauge-chart
class="gauge"
[colorFill]="usedPercentage === 0 ? chartBlankColor : isLowCapacity ? chartLowCapacityColor : chartFillColor"
[colorBlank]="chartBlankColor"
[width]="150"
Expand All @@ -36,25 +33,25 @@ <h3 mat-card-title>
</div>
</div>

<div class="right" fxLayout="column" fxLayoutAlign="center center">
<div class="captions" fxLayout="column">
<span class="capacity-caption" fxLayoutAlign="start center">
<div class="right">
<div class="captions">
<div class="capacity-caption">
<b>{{ 'Usable Capacity' | translate }}:</b>
<span class="value-caption">
{{ capacity | ixFileSize }}
</span>
</span>
</div>
<ul class="list-caption">
<li class="item-caption">
<span class="used-caption" fxLayoutAlign="start center">
<span class="used-caption">
<b>{{ 'Used' | translate }}:</b>
<span class="value-caption">
{{ (rootDataset?.used.parsed | ixFileSize) || ('Unknown' | translate) }}
</span>
</span>
</li>
<li class="item-caption">
<span class="available-caption" fxLayoutAlign="start center">
<span class="available-caption">
<b>{{ 'Available' | translate }}:</b>
<span class="value-caption">
{{ (rootDataset?.available.parsed | ixFileSize) || ('Unknown' | translate) }}
Expand Down
Loading

0 comments on commit 12db9d9

Please sign in to comment.