Browse Source

Rate limits update styles

pull/6979/head
deaflynx 4 years ago
parent
commit
88599262da
  1. 5
      ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.html
  2. 13
      ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.ts
  3. 4
      ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.scss
  4. 3
      ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits.component.ts

5
ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.html

@ -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()"

13
ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-details-dialog.component.ts

@ -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);
}
}

4
ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits-list.component.scss

@ -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 {

3
ui-ngx/src/app/modules/home/components/profile/tenant/rate-limits/rate-limits.component.ts

@ -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();
}

Loading…
Cancel
Save