Rate limits update styles

This commit is contained in:
deaflynx 2022-07-25 17:55:15 +03:00
parent b3fdc881f4
commit 88599262da
4 changed files with 11 additions and 14 deletions

View File

@ -20,7 +20,7 @@
<h2>{{ title | translate }}</h2>
<span fxFlex></span>
<button mat-icon-button
(click)="cancel()"
[matDialogClose]="undefined"
type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
@ -37,7 +37,8 @@
<div mat-dialog-actions fxLayoutAlign="end center">
<button mat-button color="primary"
type="button"
(click)="cancel()" cdkFocusInitial>
[matDialogClose]="undefined"
cdkFocusInitial>
{{ 'action.cancel' | translate }}
</button>
<button *ngIf="!data.readonly" mat-raised-button color="primary" (click)="save()"

View File

@ -14,7 +14,7 @@
/// limitations under the License.
///
import { Component, Inject, OnInit, SkipSelf } from '@angular/core';
import { Component, Inject, SkipSelf } from '@angular/core';
import { ErrorStateMatcher } from '@angular/material/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { Store } from '@ngrx/store';
@ -33,7 +33,7 @@ export interface RateLimitsDetailsDialogData {
@Component({
templateUrl: './rate-limits-details-dialog.component.html'
})
export class RateLimitsDetailsDialogComponent extends DialogComponent<RateLimitsDetailsDialogComponent> implements OnInit {
export class RateLimitsDetailsDialogComponent extends DialogComponent<RateLimitsDetailsDialogComponent> {
editDetailsFormGroup: FormGroup;
@ -49,7 +49,6 @@ export class RateLimitsDetailsDialogComponent extends DialogComponent<RateLimits
private fb: FormBuilder,
public translate: TranslateService) {
super(store, router, dialogRef);
this.editDetailsFormGroup = this.fb.group({
rateLimits: [this.rateLimits, []]
});
@ -58,15 +57,7 @@ export class RateLimitsDetailsDialogComponent extends DialogComponent<RateLimits
}
}
ngOnInit(): void {
}
cancel(): void {
this.dialogRef.close(undefined);
}
save(): void {
this.dialogRef.close(this.editDetailsFormGroup.get('rateLimits').value);
}
}

View File

@ -14,6 +14,10 @@
* limitations under the License.
*/
:host {
@media screen and (min-width: 800px) {
min-width: 600px;
}
.tb-rate-limits-preview {
margin-top: 1.5em;
span {

View File

@ -35,6 +35,7 @@ import {
RateLimitsType,
stringToRateLimitsArray
} from './rate-limits.models';
import { isDefined } from '@core/utils';
@Component({
selector: 'tb-rate-limits',
@ -120,7 +121,7 @@ export class RateLimitsComponent implements ControlValueAccessor, OnInit, Valida
readonly: this.disabled
}
}).afterClosed().subscribe((result) => {
if (result || result === null) {
if (isDefined(result)) {
this.modelValue = result;
this.updateModel();
}