Skip to content

Commit 90a80b9

Browse files
authored
Fix global style error for mat-dialog-container (#432)
* Fix global style error for mat-dialog-container * Refactor open(View)Settings to remove duplication
1 parent f559199 commit 90a80b9

File tree

8 files changed

+10
-38
lines changed

8 files changed

+10
-38
lines changed

scilog/src/app/app.component.scss

-7
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@
5656
height: 100vh;
5757
}
5858

59-
::ng-deep .mat-toolbar{
60-
z-index: 998;
61-
position: fixed;
62-
height: 50px;
63-
flex: 1 1 auto;
64-
}
65-
6659
.flexExpand {
6760
flex: 1 1 auto;
6861
}

scilog/src/app/core/toolbar/toolbar.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<span [ngStyle]="{'font-weight':view.id == currentView ? 'bold' : 'normal' }">{{ view.name }}</span>
4646
</button>
4747
</ng-container>
48-
<button mat-menu-item (click)="openViewSettings()">
48+
<button mat-menu-item (click)="openSettings('viewSettings')">
4949
<mat-icon>save</mat-icon>
5050
<span>Save/Edit</span>
5151
</button>
@@ -62,7 +62,7 @@
6262
</span>
6363
</button>
6464
<mat-menu #menu="matMenu">
65-
<button mat-menu-item (click)="openSettings()">
65+
<button mat-menu-item (click)="openSettings('profileSettings')">
6666
<mat-icon>settings</mat-icon>
6767
<span>Settings</span>
6868
</button>

scilog/src/app/core/toolbar/toolbar.component.ts

+3-14
Original file line numberDiff line numberDiff line change
@@ -110,29 +110,18 @@ export class ToolbarComponent implements OnInit {
110110
this.openMenu.emit();
111111
}
112112

113-
openSettings() {
113+
openSettings(settingsType: "profileSettings" | "viewSettings") {
114114
const dialogConfig = new MatDialogConfig();
115115
dialogConfig.autoFocus = false;
116116
dialogConfig.disableClose = true;
117-
dialogConfig.data = "profileSettings";
117+
dialogConfig.data = settingsType;
118+
dialogConfig.panelClass = "app-full-bleed-dialog";
118119
const dialogRef = this.dialog.open(SettingsComponent, dialogConfig);
119120
this.subscriptions.push(dialogRef.afterClosed().subscribe(data => {
120121
console.log(data);
121122
}));
122123
}
123124

124-
openViewSettings() {
125-
const dialogConfig = new MatDialogConfig();
126-
dialogConfig.autoFocus = false;
127-
dialogConfig.disableClose = true;
128-
dialogConfig.data = "viewSettings";
129-
const dialogRef = this.dialog.open(SettingsComponent, dialogConfig);
130-
this.subscriptions.push(dialogRef.afterClosed().subscribe(data => {
131-
console.log(data);
132-
console.log(this.views)
133-
}));
134-
}
135-
136125
openSearch(){
137126
this.showSearch = true;
138127
}

scilog/src/app/logbook/core/settings/settings.component.css

-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515

1616
}
1717

18-
::ng-deep .mat-dialog-container{
19-
padding: 0px;
20-
border-radius: 8px;
21-
}
22-
2318
.main-content {
2419

2520
/* padding-bottom: 60px; */

scilog/src/app/logbook/core/settings/view-settings/view-edit/view-edit.component.css

-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717

1818
}
1919

20-
::ng-deep .mat-dialog-container{
21-
padding: 0px;
22-
border-radius: 8px;
23-
}
24-
2520
.main-content {
2621

2722
/* padding-bottom: 60px; */

scilog/src/app/logbook/core/settings/view-settings/view-settings.component.css

-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717

1818
}
1919

20-
::ng-deep .mat-dialog-container{
21-
padding: 0px;
22-
border-radius: 8px;
23-
}
24-
2520
.main-content {
2621

2722
/* padding-bottom: 60px; */

scilog/src/styles.scss

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ body { height: calc(100%); margin: 0; font-family: Roboto, "Helvetica Neue", san
1010
@import "styles/roboto.scss";
1111
@import "styles/material-icons.scss";
1212
@import "prismjs/themes/prism.css";
13+
@import "styles/global";

scilog/src/styles/_global.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.app-full-bleed-dialog .mat-dialog-container {
2+
padding: 0;
3+
border-radius: 8px;
4+
}

0 commit comments

Comments
 (0)