Commit eb4f4baafb174067b8e68f39a3636b5cc4151431
1 parent
d2f63c76
UI: Update Tenant Profile - add max emails and sms
Showing
4 changed files
with
39 additions
and
3 deletions
@@ -161,6 +161,30 @@ | @@ -161,6 +161,30 @@ | ||
161 | </mat-error> | 161 | </mat-error> |
162 | </mat-form-field> | 162 | </mat-form-field> |
163 | <mat-form-field class="mat-block"> | 163 | <mat-form-field class="mat-block"> |
164 | + <mat-label translate>tenant-profile.max-emails</mat-label> | ||
165 | + <input matInput required min="0" step="1" | ||
166 | + formControlName="maxEmails" | ||
167 | + type="number"> | ||
168 | + <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxEmails').hasError('required')"> | ||
169 | + {{ 'tenant-profile.max-emails-required' | translate}} | ||
170 | + </mat-error> | ||
171 | + <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxEmails').hasError('min')"> | ||
172 | + {{ 'tenant-profile.max-emails-range' | translate}} | ||
173 | + </mat-error> | ||
174 | + </mat-form-field> | ||
175 | + <mat-form-field class="mat-block"> | ||
176 | + <mat-label translate>tenant-profile.max-sms</mat-label> | ||
177 | + <input matInput required min="0" step="1" | ||
178 | + formControlName="maxSms" | ||
179 | + type="number"> | ||
180 | + <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxSms').hasError('required')"> | ||
181 | + {{ 'tenant-profile.max-sms-required' | translate}} | ||
182 | + </mat-error> | ||
183 | + <mat-error *ngIf="defaultTenantProfileConfigurationFormGroup.get('maxSms').hasError('min')"> | ||
184 | + {{ 'tenant-profile.max-sms-range' | translate}} | ||
185 | + </mat-error> | ||
186 | + </mat-form-field> | ||
187 | + <mat-form-field class="mat-block"> | ||
164 | <mat-label translate>tenant-profile.transport-tenant-msg-rate-limit</mat-label> | 188 | <mat-label translate>tenant-profile.transport-tenant-msg-rate-limit</mat-label> |
165 | <input matInput formControlName="transportTenantMsgRateLimit"> | 189 | <input matInput formControlName="transportTenantMsgRateLimit"> |
166 | </mat-form-field> | 190 | </mat-form-field> |
@@ -70,7 +70,9 @@ export class DefaultTenantProfileConfigurationComponent implements ControlValueA | @@ -70,7 +70,9 @@ export class DefaultTenantProfileConfigurationComponent implements ControlValueA | ||
70 | maxREExecutions: [null, [Validators.required, Validators.min(0)]], | 70 | maxREExecutions: [null, [Validators.required, Validators.min(0)]], |
71 | maxJSExecutions: [null, [Validators.required, Validators.min(0)]], | 71 | maxJSExecutions: [null, [Validators.required, Validators.min(0)]], |
72 | maxDPStorageDays: [null, [Validators.required, Validators.min(0)]], | 72 | maxDPStorageDays: [null, [Validators.required, Validators.min(0)]], |
73 | - maxRuleNodeExecutionsPerMessage: [null, [Validators.required, Validators.min(0)]] | 73 | + maxRuleNodeExecutionsPerMessage: [null, [Validators.required, Validators.min(0)]], |
74 | + maxEmails: [null, [Validators.required, Validators.min(0)]], | ||
75 | + maxSms: [null, [Validators.required, Validators.min(0)]] | ||
74 | }); | 76 | }); |
75 | this.defaultTenantProfileConfigurationFormGroup.valueChanges.subscribe(() => { | 77 | this.defaultTenantProfileConfigurationFormGroup.valueChanges.subscribe(() => { |
76 | this.updateModel(); | 78 | this.updateModel(); |
@@ -44,6 +44,8 @@ export interface DefaultTenantProfileConfiguration { | @@ -44,6 +44,8 @@ export interface DefaultTenantProfileConfiguration { | ||
44 | maxJSExecutions: number; | 44 | maxJSExecutions: number; |
45 | maxDPStorageDays: number; | 45 | maxDPStorageDays: number; |
46 | maxRuleNodeExecutionsPerMessage: number; | 46 | maxRuleNodeExecutionsPerMessage: number; |
47 | + maxEmails: number; | ||
48 | + maxSms: number; | ||
47 | } | 49 | } |
48 | 50 | ||
49 | export type TenantProfileConfigurations = DefaultTenantProfileConfiguration; | 51 | export type TenantProfileConfigurations = DefaultTenantProfileConfiguration; |
@@ -69,7 +71,9 @@ export function createTenantProfileConfiguration(type: TenantProfileType): Tenan | @@ -69,7 +71,9 @@ export function createTenantProfileConfiguration(type: TenantProfileType): Tenan | ||
69 | maxREExecutions: 0, | 71 | maxREExecutions: 0, |
70 | maxJSExecutions: 0, | 72 | maxJSExecutions: 0, |
71 | maxDPStorageDays: 0, | 73 | maxDPStorageDays: 0, |
72 | - maxRuleNodeExecutionsPerMessage: 0 | 74 | + maxRuleNodeExecutionsPerMessage: 0, |
75 | + maxEmails: 0, | ||
76 | + maxSms: 0 | ||
73 | }; | 77 | }; |
74 | configuration = {...defaultConfiguration, type: TenantProfileType.DEFAULT}; | 78 | configuration = {...defaultConfiguration, type: TenantProfileType.DEFAULT}; |
75 | break; | 79 | break; |
@@ -2017,7 +2017,13 @@ | @@ -2017,7 +2017,13 @@ | ||
2017 | "max-d-p-storage-days-range": "Minimum number of data points storage days can't be negative", | 2017 | "max-d-p-storage-days-range": "Minimum number of data points storage days can't be negative", |
2018 | "max-rule-node-executions-per-message": "Maximum number of rule node executions per message (0 - unlimited)", | 2018 | "max-rule-node-executions-per-message": "Maximum number of rule node executions per message (0 - unlimited)", |
2019 | "max-rule-node-executions-per-message-required": "Maximum number of rule node executions per message is required.", | 2019 | "max-rule-node-executions-per-message-required": "Maximum number of rule node executions per message is required.", |
2020 | - "max-rule-node-executions-per-message-range": "Minimum number of rule node executions per message can't be negative" | 2020 | + "max-rule-node-executions-per-message-range": "Minimum number of rule node executions per message can't be negative", |
2021 | + "max-emails": "Maximum number of emails sent (0 - unlimited)", | ||
2022 | + "max-emails-required": "Maximum number of emails sent is required.", | ||
2023 | + "max-emails-range": "Maximum number of emails sent can't be negative", | ||
2024 | + "max-sms": "Maximum number of SMS sent (0 - unlimited)", | ||
2025 | + "max-sms-required": "Maximum number of SMS sent is required.", | ||
2026 | + "max-sms-range": "Maximum number of SMS sent can't be negative" | ||
2021 | }, | 2027 | }, |
2022 | "timeinterval": { | 2028 | "timeinterval": { |
2023 | "seconds-interval": "{ seconds, plural, 1 {1 second} other {# seconds} }", | 2029 | "seconds-interval": "{ seconds, plural, 1 {1 second} other {# seconds} }", |