Skip to content

Commit

Permalink
IKC-405 Dialog modals
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Belke authored and Piotr Belke committed Oct 14, 2024
1 parent 3f753e6 commit 5da5478
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use '../../../../../apps/kouncil/src/styles/buttons';
@import '../../../../../apps/kouncil/src/styles/palette';
@import "../../../../../apps/kouncil/src/styles/spaces";

:host {
.topic-form {
Expand All @@ -10,18 +11,16 @@
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-bottom: 20px;
width: 100%;

.topic-form-field {
width: 100%;
padding-bottom: 10px;
padding-bottom: $space-4;
}
}

.actions {
float: right;
margin-top: 20px;
margin-top: $space-6;

.action-button-blue {
@include buttons.button-blue;
Expand All @@ -33,7 +32,7 @@

.action-button-white {
@include buttons.button-white;
margin-right: 10px;
margin-right: $space-4;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,47 @@ import {SnackBarComponent, SnackBarData, ViewMode} from '@app/common-utils';
@Component({
selector: 'app-topic-form',
template: `
<mat-dialog-content>
<form [formGroup]="topicForm" (ngSubmit)="save()" class="form topic-form">
<div class="drawer-header">
<div class="drawer-title">
{{ header }}
</div>
<div class="spacer"></div>
<mat-icon mat-dialog-close class="material-symbols-outlined close">close</mat-icon>
</div>
<div class="topic-info">
<div class="topic-form-field">
<app-common-text-field [form]="topicForm" [controlName]="'name'"
[readonly]="ViewMode.CREATE !== viewMode"
[label]="'Name'" [required]="true"></app-common-text-field>
</div>
<div mat-dialog-title class="drawer-header">
<div class="drawer-title">
{{ header }}
</div>
<div class="spacer"></div>
<mat-icon mat-dialog-close class="material-symbols-outlined close">close</mat-icon>
</div>
<div class="topic-form-field">
<app-common-number-field [form]="topicForm" [controlName]="'partitions'"
[label]="'Partitions'"
[required]="true"></app-common-number-field>
</div>
<form [formGroup]="topicForm" (ngSubmit)="save()" class="form topic-form">
<div mat-dialog-content class="topic-info">
<div class="topic-form-field">
<app-common-text-field [form]="topicForm" [controlName]="'name'"
[readonly]="ViewMode.CREATE !== viewMode"
[label]="'Name'" [required]="true"></app-common-text-field>
</div>
<div class="topic-form-field">
<app-common-number-field [form]="topicForm" [controlName]="'replicationFactor'"
[label]="'Replication Factor'"
[readonly]="ViewMode.CREATE !== viewMode"
[required]="true"></app-common-number-field>
</div>
<div class="topic-form-field">
<app-common-number-field [form]="topicForm" [controlName]="'partitions'"
[label]="'Partitions'"
[required]="true"></app-common-number-field>
</div>
<div class="actions">
<button type="button" mat-dialog-close mat-button [disableRipple]="true"
class="action-button-white">
Cancel
</button>
<button mat-button [disableRipple]="true"
class="action-button-blue" type="submit" [disabled]="!topicForm.valid">
Save
</button>
<div class="topic-form-field">
<app-common-number-field [form]="topicForm" [controlName]="'replicationFactor'"
[label]="'Replication Factor'"
[readonly]="ViewMode.CREATE !== viewMode"
[required]="true"></app-common-number-field>
</div>
</form>
</mat-dialog-content>
</div>
</form>
<div mat-dialog-actions class="actions">
<button type="button" mat-dialog-close mat-button [disableRipple]="true"
class="action-button-white">
Cancel
</button>
<button mat-button [disableRipple]="true"
class="action-button-blue" type="submit" [disabled]="!topicForm.valid">
Save
</button>
</div>
`,
styleUrls: ['./topic-form.component.scss']
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin-bottom: $space-6;
width: 100%;

.user-group-form-field {
Expand All @@ -20,7 +19,6 @@
}

.actions {
float: right;
margin-top: $space-6;

.action-button-blue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,38 @@ import {UserGroup} from '../../user-groups-functions-matrix/user-groups.model';
@Component({
selector: 'app-user-group-form',
template: `
<mat-dialog-content>
<form [formGroup]="userGroupForm" (ngSubmit)="save()" class="form user-group-form">
<div class="drawer-header">
<div class="drawer-title">
{{ header }}
</div>
<div class="spacer"></div>
<mat-icon mat-dialog-close class="material-symbols-outlined close">close</mat-icon>
</div>
<div class="user-group-info">
<div class="user-group-form-field">
<app-common-text-field [form]="userGroupForm" [controlName]="'code'"
[label]="'Code'" [required]="true"></app-common-text-field>
</div>
<div mat-dialog-title class="drawer-header">
<div class="drawer-title">
{{ header }}
</div>
<div class="spacer"></div>
<mat-icon mat-dialog-close class="material-symbols-outlined close">close</mat-icon>
</div>
<div class="user-group-form-field">
<app-common-text-field [form]="userGroupForm" [controlName]="'name'"
[label]="'Name'" [required]="true"></app-common-text-field>
</div>
<form [formGroup]="userGroupForm" (ngSubmit)="save()" class="form user-group-form">
<div mat-dialog-content class="user-group-info">
<div class="user-group-form-field">
<app-common-text-field [form]="userGroupForm" [controlName]="'code'"
[label]="'Code'" [required]="true"></app-common-text-field>
</div>
<div class="actions">
<button type="button" mat-dialog-close mat-button [disableRipple]="true"
class="action-button-white">
Cancel
</button>
<button mat-button [disableRipple]="true"
class="action-button-blue" type="submit" [disabled]="!userGroupForm.valid">
Save
</button>
<div class="user-group-form-field">
<app-common-text-field [form]="userGroupForm" [controlName]="'name'"
[label]="'Name'" [required]="true"></app-common-text-field>
</div>
</form>
</mat-dialog-content>
</div>
</form>
<div mat-dialog-actions class="actions">
<button type="button" mat-dialog-close mat-button [disableRipple]="true"
class="action-button-white">
Cancel
</button>
<button mat-button [disableRipple]="true"
class="action-button-blue" type="submit" [disabled]="!userGroupForm.valid">
Save
</button>
</div>
`,
styleUrls: ['./user-group-form.component.scss']
})
Expand Down

0 comments on commit 5da5478

Please sign in to comment.