diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.scss b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.scss
index 8e0889aa08..db7ae7a402 100644
--- a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.scss
+++ b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.scss
@@ -13,29 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-::ng-deep {
- .template-option {
- .mat-option-text {
- display: flex;
- flex-direction: row;
- align-items: center;
- margin-bottom: 4px;
- }
-
- .template-option-name {
- margin-right: 8px;
- }
+.template-option {
+ .mdc-list-item__primary-text {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ }
- .mat-chip {
- &.mat-standard-chip {
- padding: 4px 8px;
- border-radius: 14px;
- min-height: 28px;
+ .template-option-name {
+ margin-right: 8px;
+ }
- &.mat-chip-disabled {
- opacity: 1;
- }
- }
- }
+ .mat-mdc-standard-chip.mdc-evolution-chip--disabled {
+ opacity: 1;
}
}
diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.ts b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.ts
index 4b3a864875..5155c53b36 100644
--- a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.ts
+++ b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-autocomplete.component.ts
@@ -14,7 +14,7 @@
/// limitations under the License.
///
-import { Component, ElementRef, forwardRef, Input, OnInit, ViewChild } from '@angular/core';
+import { Component, ElementRef, forwardRef, Input, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms';
import { Observable, of } from 'rxjs';
import { catchError, debounceTime, distinctUntilChanged, map, share, switchMap, tap } from 'rxjs/operators';
@@ -46,6 +46,7 @@ import { coerceBoolean } from '@shared/decorators/coerce-boolean';
selector: 'tb-template-autocomplete',
templateUrl: './template-autocomplete.component.html',
styleUrls: ['./template-autocomplete.component.scss'],
+ encapsulation: ViewEncapsulation.None,
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => TemplateAutocompleteComponent),
diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-configuration.ts b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-configuration.ts
index 1b7bfa7fd1..62b0289d75 100644
--- a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-configuration.ts
+++ b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-configuration.ts
@@ -136,14 +136,17 @@ export abstract class TemplateConfiguration
extends DialogComponent<
this.pushTemplateForm.get('additionalConfig.actionButtonConfig.linkType').valueChanges.pipe(
takeUntil(this.destroy$)
).subscribe((value) => {
- if (value === ActionButtonLinkType.LINK) {
- this.pushTemplateForm.get('additionalConfig.actionButtonConfig.link').enable({emitEvent: false});
- this.pushTemplateForm.get('additionalConfig.actionButtonConfig.dashboardId').disable({emitEvent: false});
- this.pushTemplateForm.get('additionalConfig.actionButtonConfig.dashboardState').disable({emitEvent: false});
- } else {
- this.pushTemplateForm.get('additionalConfig.actionButtonConfig.link').disable({emitEvent: false});
- this.pushTemplateForm.get('additionalConfig.actionButtonConfig.dashboardId').enable({emitEvent: false});
- this.pushTemplateForm.get('additionalConfig.actionButtonConfig.dashboardState').enable({emitEvent: false});
+ const isEnabled = this.pushTemplateForm.get('additionalConfig.actionButtonConfig.enabled').value;
+ if (isEnabled) {
+ if (value === ActionButtonLinkType.LINK) {
+ this.pushTemplateForm.get('additionalConfig.actionButtonConfig.link').enable({emitEvent: false});
+ this.pushTemplateForm.get('additionalConfig.actionButtonConfig.dashboardId').disable({emitEvent: false});
+ this.pushTemplateForm.get('additionalConfig.actionButtonConfig.dashboardState').disable({emitEvent: false});
+ } else {
+ this.pushTemplateForm.get('additionalConfig.actionButtonConfig.link').disable({emitEvent: false});
+ this.pushTemplateForm.get('additionalConfig.actionButtonConfig.dashboardId').enable({emitEvent: false});
+ this.pushTemplateForm.get('additionalConfig.actionButtonConfig.dashboardState').enable({emitEvent: false});
+ }
}
});
diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.html b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.html
index 09fbc6897c..ab7d29f589 100644
--- a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.html
+++ b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.html
@@ -52,7 +52,7 @@
-
+
notification.subject
@@ -60,7 +60,7 @@
{{ notificationTemplateTypeTranslateMap.get(templateNotificationForm.get('notificationType').value).hint | translate }}
-
+
notification.message
@@ -110,7 +110,8 @@
{{ 'icon.icon' | translate }}
-
+
@@ -122,7 +123,7 @@
{{ 'notification.action-button' | translate }}
-
+
notification.button-text
@@ -133,8 +134,8 @@
-
-
+
+
notification.action-type
@@ -152,11 +153,11 @@
-
diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.scss b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.scss
index adb451b170..4b96d57a12 100644
--- a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.scss
+++ b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.scss
@@ -16,9 +16,13 @@
@import "../../../../../../scss/constants";
@import "../../../../../../theme";
-:host-context(.tb-fullscreen-dialog .mat-dialog-container) {
+:host-context(.tb-fullscreen-dialog .mat-mdc-dialog-container) {
width: 830px;
+ height: 100%;
+ max-width: 100%;
max-height: 100vh;
+ display: flex;
+ flex-direction: column;
.tb-form-fields {
margin-bottom: 8px;
@@ -66,16 +70,10 @@
margin-bottom: 12px;
}
}
-
- @media #{$mat-gt-xs} {
- .mat-dialog-content {
- max-height: 75vh;
- }
- }
}
:host ::ng-deep {
- .mat-dialog-content {
+ .mat-mdc-dialog-content {
display: flex;
flex-direction: column;
height: 100%;
@@ -90,15 +88,6 @@
flex: 1 1 100%;
}
- @media #{$mat-lt-sm} {
- .mat-step-label {
- white-space: normal;
- overflow: visible;
- .mat-step-text-label {
- overflow: visible;
- }
- }
- }
.mat-horizontal-content-container {
height: 550px;
max-height: 100%;
@@ -109,58 +98,6 @@
min-width: 500px;
}
}
- .mat-horizontal-stepper-content[aria-expanded=true] {
- height: 100%;
- position: relative;
- }
- }
- }
-
- .mat-radio-group {
- display: flex;
- flex-direction: row;
- margin-bottom: 8px;
-
- .mat-radio-button {
- flex: 1 1 100%;
- padding: 14px;
- border: 1px solid rgba(0, 0, 0, 0.12);
- border-radius: 6px;
-
- .mat-radio-label {
- white-space: break-spaces;
- align-items: start;
- }
-
- &:not(:last-child){
- margin-bottom: 8px;
- }
-
- &.mat-radio-checked {
- border-color: map_get($tb-accent, 500);
- }
- }
- }
-
- .mat-form-field {
- .mat-form-field-wrapper {
- padding-bottom: 0px;
-
- .mat-form-field-underline {
- position: initial !important;
- display: block;
- margin-top: -1px;
- }
-
- .mat-form-field-subscript-wrapper,
- .mat-form-field-ripple {
- position: initial !important;
- display: table;
- }
-
- .mat-form-field-subscript-wrapper {
- min-height: calc(1em + 1px);
- }
}
}
}
diff --git a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.ts b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.ts
index 1aebb16434..1306942a09 100644
--- a/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.ts
+++ b/ui-ngx/src/app/modules/home/pages/notification-center/template-table/template-notification-dialog.component.ts
@@ -36,6 +36,10 @@ import { BreakpointObserver } from '@angular/cdk/layout';
import { MediaBreakpoints } from '@shared/models/constants';
import { TranslateService } from '@ngx-translate/core';
import { TemplateConfiguration } from '@home/pages/notification-center/template-table/template-configuration';
+import { AuthState } from '@core/auth/auth.models';
+import { getCurrentAuthState } from '@core/auth/auth.selectors';
+import { AuthUser } from '@shared/models/user.model';
+import { Authority } from '@shared/models/authority.enum';
export interface TemplateNotificationDialogData {
template?: NotificationTemplate;
@@ -56,21 +60,16 @@ export class TemplateNotificationDialogComponent
stepperOrientation: Observable;
- templateNotificationForm: FormGroup;
- pushTemplateForm: FormGroup;
- emailTemplateForm: FormGroup;
- smsTemplateForm: FormGroup;
- slackTemplateForm: FormGroup;
dialogTitle = 'notification.edit-notification-template';
notificationTypes = Object.keys(NotificationType) as NotificationType[];
- notificationDeliveryMethods = Object.keys(NotificationDeliveryMethod) as NotificationDeliveryMethod[];
- notificationDeliveryMethodTranslateMap = NotificationDeliveryMethodTranslateMap;
selectedIndex = 0;
hideSelectType = false;
private readonly templateNotification: NotificationTemplate;
+ private authState: AuthState = getCurrentAuthState(this.store);
+ private authUser: AuthUser = this.authState.authUser;
constructor(protected store: Store,
protected router: Router,
@@ -82,7 +81,7 @@ export class TemplateNotificationDialogComponent
private translate: TranslateService) {
super(store, router, dialogRef, fb);
- this.stepperOrientation = this.breakpointObserver.observe(MediaBreakpoints['gt-xs'])
+ this.stepperOrientation = this.breakpointObserver.observe(MediaBreakpoints['gt-sm'])
.pipe(map(({matches}) => matches ? 'horizontal' : 'vertical'));
if (isDefinedAndNotNull(this.data?.predefinedType)) {
@@ -90,6 +89,10 @@ export class TemplateNotificationDialogComponent
this.templateNotificationForm.get('notificationType').setValue(this.data.predefinedType, {emitEvents: false});
}
+ if (this.isSysAdmin()) {
+ this.hideSelectType = true;
+ }
+
if (data.isAdd || data.isCopy) {
this.dialogTitle = 'notification.add-notification-template';
}
@@ -172,4 +175,8 @@ export class TemplateNotificationDialogComponent
}
});
}
+
+ private isSysAdmin(): boolean {
+ return this.authUser.authority === Authority.SYS_ADMIN;
+ }
}
diff --git a/ui-ngx/src/app/shared/components/entity/entity-list.component.html b/ui-ngx/src/app/shared/components/entity/entity-list.component.html
index a42cb7c7cd..80b051e75c 100644
--- a/ui-ngx/src/app/shared/components/entity/entity-list.component.html
+++ b/ui-ngx/src/app/shared/components/entity/entity-list.component.html
@@ -15,7 +15,7 @@
limitations under the License.
-->
-
+
{{ labelText }}
close
+
+ {{ hint }}
+
{{ requiredText }}
diff --git a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts
index bc8f2d1fe9..bca00951c4 100644
--- a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts
+++ b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts
@@ -38,6 +38,7 @@ import { EntityService } from '@core/http/entity.service';
import { MatAutocomplete } from '@angular/material/autocomplete';
import { MatChipGrid } from '@angular/material/chips';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
+import { SubscriptSizing } from '@angular/material/form-field';
@Component({
selector: 'tb-entity-list',
@@ -88,6 +89,12 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV
@Input()
disabled: boolean;
+ @Input()
+ subscriptSizing: SubscriptSizing = 'fixed'
+
+ @Input()
+ hint: string
+
@ViewChild('entityInput') entityInput: ElementRef;
@ViewChild('entityAutocomplete') matAutocomplete: MatAutocomplete;
@ViewChild('chipList', {static: true}) chipList: MatChipGrid;
diff --git a/ui-ngx/src/app/shared/components/time/timeinterval.component.html b/ui-ngx/src/app/shared/components/time/timeinterval.component.html
index 2e211fc52f..6841398bb1 100644
--- a/ui-ngx/src/app/shared/components/time/timeinterval.component.html
+++ b/ui-ngx/src/app/shared/components/time/timeinterval.component.html
@@ -40,9 +40,9 @@
-
-
- {{ predefinedName }}
+
+
+ {{ predefinedName }}
{{ interval.name | translate:interval.translateParams }}
diff --git a/ui-ngx/src/app/shared/components/time/timeinterval.component.scss b/ui-ngx/src/app/shared/components/time/timeinterval.component.scss
index 809093ce39..ba9cc67433 100644
--- a/ui-ngx/src/app/shared/components/time/timeinterval.component.scss
+++ b/ui-ngx/src/app/shared/components/time/timeinterval.component.scss
@@ -31,10 +31,6 @@
margin-right: 5px;
}
- .interval-section {
- min-height: 66px;
- }
-
@media #{$mat-xs} {
min-width: 0;
width: 100%;
diff --git a/ui-ngx/src/app/shared/components/time/timeinterval.component.ts b/ui-ngx/src/app/shared/components/time/timeinterval.component.ts
index 61a3df68d2..be2c449eaa 100644
--- a/ui-ngx/src/app/shared/components/time/timeinterval.component.ts
+++ b/ui-ngx/src/app/shared/components/time/timeinterval.component.ts
@@ -18,6 +18,7 @@ import { Component, EventEmitter, forwardRef, Input, OnInit, Output } from '@ang
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { TimeInterval, TimeService } from '@core/services/time.service';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
+import { SubscriptSizing } from '@angular/material/form-field';
@Component({
selector: 'tb-timeinterval',
@@ -93,6 +94,9 @@ export class TimeintervalComponent implements OnInit, ControlValueAccessor {
@Input() disabled: boolean;
+ @Input()
+ subscriptSizing: SubscriptSizing = 'fixed';
+
days = 0;
hours = 0;
mins = 1;
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json
index 770304cfe6..f076d64196 100644
--- a/ui-ngx/src/assets/locale/locale.constant-en_US.json
+++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json
@@ -2786,7 +2786,7 @@
"platform-users": "Platform users",
"recipient": "Recipient",
"recipient-type": "Recipient type",
- "recipients-count": "{ count, plural, 1 {1 Recipient} other {# Recipients} }",
+ "recipients-count": "{ count, plural, =1 {1 Recipient} other {# Recipients} }",
"request-status": {
"processing": "Processing",
"scheduled": "Scheduled",