Skip to content

Commit 13d0842

Browse files
committed
fix: initial tab values, menu alignment, grid header padding
1 parent 428fccc commit 13d0842

6 files changed

Lines changed: 31 additions & 22 deletions

File tree

frontend/src/app/modules/policy-engine/dialogs/math-editor-dialog/math-editor-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
<ng-container *ngIf="step === 'step_2'" >
232232
<div class="step-container {{codeTab === 'general' ? 'pages' : ''}}">
233233
<div class="tabs-nav">
234-
<p-tabs (valueChange)="onCodeChangeTab($event)" class="guardian-header-tabs">
234+
<p-tabs [value]="0" (valueChange)="onCodeChangeTab($event)" class="guardian-header-tabs">
235235
<p-tablist>
236236
<p-tab [value]="0"><div class="tabview-label">General</div></p-tab>
237237
<p-tab [value]="1"><div class="tabview-label">Advanced (Optional)</div></p-tab>

frontend/src/app/modules/policy-engine/policies/policies.component.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,15 @@
310310
font-size: 14px;
311311
font-style: normal;
312312
font-weight: 500;
313-
min-height: 40px;
313+
height: 48px;
314314
border: none !important;
315315
border-radius: 8px;
316316
width: 100%;
317-
display: grid;
318-
grid-template-columns: 40px auto;
319-
text-align: left;
317+
display: flex;
318+
align-items: center;
319+
justify-content: flex-start;
320+
gap: 8px;
321+
padding: 0 12px;
320322
}
321323

322324
::ng-deep .accent-color-red {

frontend/src/app/modules/schema-engine/schema-dialog/schema-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="guardian-loading-image"></div>
1515
</div>
1616
<div class="g-dialog-header">
17-
<p-tabs class="guardian-tabs action-tabs" [(value)]="tab">
17+
<p-tabs class="guardian-tabs action-tabs" [value]="tab" (valueChange)="onTabChange($event)">
1818
<p-tablist>
1919
<p-tab *ngFor="let tab of items; let i = index" [value]="i"><div class="tabview-label">{{ tab.label }}</div></p-tab>
2020
</p-tablist>

frontend/src/app/modules/schema-engine/schema-dialog/schema-dialog.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ export class SchemaDialog {
203203
}
204204

205205

206-
public onChangeTab($event: any, order: number): void {
207-
$event.stopPropagation();
206+
public onTabChange(order: string | number | undefined): void {
207+
if (typeof order !== 'number') { return; }
208208
this.error = null;
209209
if (this.tab === order) {
210210
return;

frontend/src/app/views/schemas/schemas.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<div class="actions">
55
<div class="tabs-nav">
6-
<p-tabs >
6+
<p-tabs [value]="0">
77
<p-tablist>
88
<p-tab *ngFor="let tab of schemasTypes; let i = index" [value]="i" (click)="onChangeType(tab.value)"><div class="tabview-label">{{ tab.label }}</div></p-tab>
99
</p-tablist>

frontend/src/app/views/schemas/schemas.component.scss

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -582,13 +582,15 @@ a {
582582
font-style: normal;
583583
font-weight: 500;
584584
background-color: #ffffff;
585-
min-height: 40px;
585+
height: 48px;
586586
border: none !important;
587587
border-radius: 8px;
588588
width: 100%;
589-
display: grid;
590-
grid-template-columns: 40px auto;
591-
text-align: left;
589+
display: flex;
590+
align-items: center;
591+
justify-content: flex-start;
592+
gap: 8px;
593+
padding: 0 12px;
592594
}
593595

594596
::ng-deep .accent-color-red {
@@ -626,31 +628,32 @@ a {
626628
.menu-options {
627629
.schema-menu-btn {
628630
display: block;
629-
line-height: 48px;
630-
width: 100%
631+
width: 100%;
631632
}
632633

633634
.schema-menu-btn button {
634635
border: none;
635-
overflow: hidden;
636636
height: 48px;
637637
font-size: 14px;
638638
color: var(--color-grey-black-1);
639639
width: 100%;
640-
display: grid;
641-
grid-template-columns: 40px 1fr;
642-
padding: 12px;
643-
column-gap: 5px;
640+
display: flex;
641+
align-items: center;
642+
justify-content: flex-start;
643+
gap: 8px;
644+
padding: 0 12px;
644645
}
645646

646647
.p-button-icon {
647648
font-size: 20px;
649+
width: 24px;
650+
text-align: center;
651+
flex-shrink: 0;
648652
color: var(--primary-color);
649653
}
650654

651655
.p-button-label {
652-
display: grid;
653-
justify-self: start;
656+
text-align: left;
654657
}
655658
}
656659
}
@@ -837,6 +840,10 @@ a {
837840

838841
.guardian-grid-header th {
839842
padding: 0.5rem 1rem;
843+
844+
&:first-child {
845+
padding-left: 24px;
846+
}
840847
}
841848

842849
::ng-deep .guardian-grid-table {

0 commit comments

Comments
 (0)