Compare commits
No commits in common. "9c8d1aa1dc96095eea378ede407bd77ab12da157" and "c477eb5460bd908bd535f365ee2bb9a72ed89632" have entirely different histories.
9c8d1aa1dc
...
c477eb5460
|
@ -276,7 +276,7 @@ const appRoutes: Routes = [
|
|||
},
|
||||
{
|
||||
path: 'notifications',
|
||||
loadChildren: () => import('@notification-service/ui/admin/notification/notification.module').then(m => m.NotificationModule),
|
||||
loadChildren: () => import('./ui/admin/notification/notification.module').then(m => m.NotificationModule),
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.ViewNotificationPage]
|
||||
|
@ -288,7 +288,7 @@ const appRoutes: Routes = [
|
|||
},
|
||||
{
|
||||
path: 'notification-templates',
|
||||
loadChildren: () => import('@notification-service/ui/admin/notification-template/notification-template.module').then(m => m.NotificationTemplateModule),
|
||||
loadChildren: () => import('./ui/admin/notification-template/notification-template.module').then(m => m.NotificationTemplateModule),
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.ViewNotificationTemplatePage]
|
||||
|
@ -300,7 +300,7 @@ const appRoutes: Routes = [
|
|||
},
|
||||
{
|
||||
path: 'mine-notifications',
|
||||
loadChildren: () => import('@notification-service/ui/inapp-notification/mine-inapp-notification.module').then(m => m.MineInAppNotificationModule),
|
||||
loadChildren: () => import('./ui/inapp-notification/mine-inapp-notification.module').then(m => m.MineInAppNotificationModule),
|
||||
data: {
|
||||
authContext: {
|
||||
permissions: [AppPermission.ViewMineInAppNotificationPage]
|
||||
|
|
|
@ -121,7 +121,6 @@ export function InstallationConfigurationFactory(appConfig: ConfigurationService
|
|||
KeycloakAngularModule,
|
||||
CoreServiceModule.forRoot(),
|
||||
CoreAnnotationServiceModule.forRoot(),
|
||||
CoreNotificationServiceModule.forRoot(),
|
||||
AppRoutingModule,
|
||||
CommonUiModule,
|
||||
TranslateModule.forRoot({
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
export enum ContactInfoType {
|
||||
Email = 0
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
export enum EmailOverrideMode {
|
||||
NotOverride = 0,
|
||||
Additive = 1,
|
||||
Replace = 2
|
||||
Replace = 2
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
export enum NotificationContactType {
|
||||
EMAIL = 0,
|
||||
EMAIL = 0,
|
||||
IN_APP = 3,
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
export enum NotificationInAppTracking {
|
||||
Stored = 0,
|
||||
Delivered = 1
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
export enum NotificationNotifyState {
|
||||
PENDING = 0,
|
||||
PROCESSING = 1,
|
||||
SUCCESSFUL = 2,
|
||||
ERROR = 3,
|
||||
OMITTED = 4
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
export enum NotificationTemplateChannel {
|
||||
Email = 0,
|
||||
InApp = 1,
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
export enum NotificationTemplateKind {
|
||||
Draft = 0,
|
||||
Secondary = 1,
|
||||
Primary = 2,
|
||||
Default = 3
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
export enum NotificationTrackingProcess {
|
||||
PENDING = 0,
|
||||
PROCESSING = 1,
|
||||
SUCCESSFUL = 2,
|
||||
ERROR = 3,
|
||||
OMITTED = 4
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
export enum NotificationTrackingState {
|
||||
UNDEFINED = 0,
|
||||
NA = 1,
|
||||
QUEUED = 2,
|
||||
SENT = 3,
|
||||
DELIVERED = 4,
|
||||
UNDELIVERED = 5,
|
||||
FAILED = 6,
|
||||
UNSENT = 7
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
export enum NotificationType {
|
||||
dmpInvitationExternalUserType = '065deecd-21bb-44af-9983-e660fdf24bc4',
|
||||
dmpInvitationExistingUserType = '4904dea2-5079-46d3-83be-3a19c9ab45dc',
|
||||
dmpModifiedType = '4542262a-22f8-4baa-9db6-1c8e70ac1dbb',
|
||||
dmpFinalisedType = '90db0b46-42de-bd89-aebf-6f27efeb256e',
|
||||
descriptionModifiedType = '4fdbfa80-7a71-4a69-b854-67cbb70648f1',
|
||||
descriptionFinalisedType = '33790bad-94d4-488a-8ee2-7f6295ca18ea',
|
||||
mergeAccountConfirmationType = 'bfe68845-cb05-4c5a-a03d-29161a7c9660',
|
||||
removeCredentialConfirmationType = 'c9bc3f16-057e-4bba-8a5f-36bd835e5604',
|
||||
dmpDepositType = '55736f7a-83ab-4190-af43-9d031a6f9612',
|
||||
descriptionTemplateInvitationType = '223bb607-efa1-4ce7-99ec-4beabfef9a8b',
|
||||
contactSupportType = '5b1d6c52-88f9-418b-9b8a-6f1f963d9ead',
|
||||
publicContactSupportType = 'b542b606-acc6-4629-adef-4d8ee2f01222'
|
||||
|
||||
}
|
|
@ -31,6 +31,7 @@ import { FileTransformerService } from './services/file-transformer/file-transfo
|
|||
import { PrincipalService } from './services/http/principal.service';
|
||||
import { LanguageHttpService } from './services/language/language.http.service';
|
||||
import { MaintenanceService } from './services/maintenance/maintenance.service';
|
||||
import { NotificationTemplateService } from './services/notification-template/notification-template.service';
|
||||
import { ReferenceTypeService } from './services/reference-type/reference-type.service';
|
||||
import { ReferenceService } from './services/reference/reference.service';
|
||||
import { SupportiveMaterialService } from './services/supportive-material/supportive-material.service';
|
||||
|
@ -42,6 +43,8 @@ import { UserService } from './services/user/user.service';
|
|||
import { FileUtils } from './services/utilities/file-utils.service';
|
||||
import { QueryParamsService } from './services/utilities/query-params.service';
|
||||
import { FileTransformerHttpService } from './services/file-transformer/file-transformer.http.service';
|
||||
import { InAppNotificationService } from './services/inapp-notification/inapp-notification.service';
|
||||
import { NotificationService } from './services/notification/notification-service';
|
||||
import { SemanticsService } from './services/semantic/semantics.service';
|
||||
import { PrefillingSourceService } from './services/prefilling-source/prefilling-source.service';
|
||||
import { VisibilityRulesService } from '@app/ui/description/editor/description-form/visibility-rules/visibility-rules.service';
|
||||
|
@ -103,10 +106,13 @@ export class CoreServiceModule {
|
|||
DmpService,
|
||||
DescriptionService,
|
||||
MaintenanceService,
|
||||
NotificationTemplateService,
|
||||
TagService,
|
||||
CanDeactivateGuard,
|
||||
FileTransformerService,
|
||||
FileTransformerHttpService,
|
||||
InAppNotificationService,
|
||||
NotificationService,
|
||||
SemanticsService,
|
||||
PrefillingSourceService,
|
||||
VisibilityRulesService,
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import { Guid } from '@common/types/guid';
|
||||
import { User } from '../user/user';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { NotificationInAppTracking } from '@app/core/common/enum/notification-inapp-tracking.enum';
|
||||
|
||||
export interface InAppNotification {
|
||||
id: Guid;
|
||||
user: User;
|
||||
isActive: IsActive;
|
||||
type: Guid;
|
||||
trackingState: NotificationInAppTracking;
|
||||
subject: string;
|
||||
body: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
hash: string;
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
import { NotificationTemplateChannel } from "@app/core/common/enum/notification-template-channel";
|
||||
import { NotificationTemplateKind } from "@app/core/common/enum/notification-template-kind";
|
||||
import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model";
|
||||
import { Guid } from "@common/types/guid";
|
||||
import { NotificationDataType } from "@app/core/common/enum/notification-data-type";
|
||||
import { EmailOverrideMode } from "@app/core/common/enum/email-override-mode";
|
||||
import { NotificationType } from "@app/core/common/enum/notification-type";
|
||||
|
||||
export interface NotificationTemplate extends BaseEntity{
|
||||
channel: NotificationTemplateChannel;
|
||||
notificationType: NotificationType;
|
||||
kind: NotificationTemplateKind;
|
||||
languageCode: string;
|
||||
value: NotificationTemplateValue;
|
||||
}
|
||||
|
||||
export interface NotificationTemplateValue {
|
||||
subjectText: string;
|
||||
subjectKey: string;
|
||||
subjectFieldOptions: NotificationFieldOptions;
|
||||
bodyText: string;
|
||||
bodyKey: string;
|
||||
priorityKey: string;
|
||||
allowAttachments: Boolean;
|
||||
cc: string[];
|
||||
ccMode: EmailOverrideMode;
|
||||
bcc: string[];
|
||||
bccMode: EmailOverrideMode;
|
||||
extraDataKeys: string[];
|
||||
bodyFieldOptions: NotificationFieldOptions;
|
||||
}
|
||||
|
||||
export interface NotificationFieldOptions {
|
||||
mandatory?: string[];
|
||||
optional?: NotificationFieldInfo[];
|
||||
formatting?: { [key: string]: string };
|
||||
}
|
||||
|
||||
export interface NotificationFieldInfo {
|
||||
key: string;
|
||||
type: NotificationDataType,
|
||||
value: string;
|
||||
}
|
||||
|
||||
// Persist
|
||||
|
||||
export interface NotificationTemplatePersist extends BaseEntityPersist{
|
||||
channel: NotificationTemplateChannel;
|
||||
notificationType: NotificationType;
|
||||
kind: NotificationTemplateKind;
|
||||
languageCode: string;
|
||||
value: NotificationTemplateValuePersist;
|
||||
}
|
||||
|
||||
export interface NotificationTemplateValuePersist {
|
||||
subjectText: string;
|
||||
subjectKey: string;
|
||||
subjectFieldOptions: NotificationFieldOptionsPersist;
|
||||
bodyText: string;
|
||||
bodyKey: string;
|
||||
priorityKey: string;
|
||||
allowAttachments: Boolean;
|
||||
cc: string[];
|
||||
ccMode: EmailOverrideMode;
|
||||
bcc: string[];
|
||||
bccMode: EmailOverrideMode;
|
||||
extraDataKeys: string[];
|
||||
bodyFieldOptions: NotificationFieldOptionsPersist;
|
||||
}
|
||||
|
||||
export interface NotificationFieldOptionsPersist {
|
||||
mandatory?: string[];
|
||||
optional?: NotificationFieldInfoPersist[];
|
||||
formatting?: { [key: string]: string };
|
||||
}
|
||||
|
||||
export interface NotificationFieldInfoPersist {
|
||||
key: string;
|
||||
type: NotificationDataType,
|
||||
value: string;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
import { NotificationContactType } from '@app/core/common/enum/notification-contact-type';
|
||||
import { User } from '../user/user';
|
||||
import { NotificationType } from '@app/core/common/enum/notification-type';
|
||||
import { BaseEntity } from '@common/base/base-entity.model';
|
||||
import { NotificationNotifyState } from '@app/core/common/enum/notification-notify-state';
|
||||
import { NotificationTrackingProcess } from '@app/core/common/enum/notification-tracking-process';
|
||||
import { NotificationTrackingState } from '@app/core/common/enum/notification-tracking-state';
|
||||
|
||||
export interface Notification extends BaseEntity{
|
||||
user: User;
|
||||
type: NotificationType;
|
||||
contactTypeHint: NotificationContactType;
|
||||
contactHint: string;
|
||||
data: string;
|
||||
notifyState: NotificationNotifyState;
|
||||
notifiedWith: NotificationContactType;
|
||||
notifiedAt: Date;
|
||||
retryCount: number;
|
||||
trackingState: NotificationTrackingState;
|
||||
trackingProcess: NotificationTrackingProcess;
|
||||
trackingData: string;
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
import { ContactInfoType } from "@app/core/common/enum/contact-info-type";
|
||||
import { RoleOrganizationType } from "@app/core/common/enum/role-organization-type";
|
||||
import { BaseEntity, BaseEntityPersist } from "@common/base/base-entity.model";
|
||||
import { Guid } from "@common/types/guid";
|
||||
import { Reference } from "../reference/reference";
|
||||
import { ContactInfoType } from "@notification-service/core/enum/contact-info-type.enum";
|
||||
|
||||
export interface User extends BaseEntity {
|
||||
name: string;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Lookup } from '@common/model/lookup';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { NotificationInAppTracking } from '@notification-service/core/enum/notification-inapp-tracking.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { NotificationType } from '../common/enum/notification-type';
|
||||
import { NotificationInAppTracking } from '../common/enum/notification-inapp-tracking.enum';
|
||||
import { IsActive } from '../common/enum/is-active.enum';
|
||||
|
||||
export class InAppNotificationLookup extends Lookup implements InAppNotificationFilter {
|
||||
like: string;
|
|
@ -1,9 +1,9 @@
|
|||
import { Lookup } from "@common/model/lookup";
|
||||
import { Guid } from "@common/types/guid";
|
||||
import { IsActive } from "@notification-service/core/enum/is-active.enum";
|
||||
import { NotificationTemplateChannel } from "@notification-service/core/enum/notification-template-channel.enum";
|
||||
import { NotificationTemplateKind } from "@notification-service/core/enum/notification-template-kind.enum";
|
||||
import { NotificationType } from "@notification-service/core/enum/notification-type.enum";
|
||||
import { IsActive } from "../common/enum/is-active.enum";
|
||||
import { NotificationTemplateKind } from "../common/enum/notification-template-kind";
|
||||
import { NotificationTemplateChannel } from "../common/enum/notification-template-channel";
|
||||
import { NotificationType } from "../common/enum/notification-type";
|
||||
|
||||
export class NotificationTemplateLookup extends Lookup implements NotificationTemplateFilter {
|
||||
ids: Guid[];
|
|
@ -1,11 +1,11 @@
|
|||
import { Lookup } from "@common/model/lookup";
|
||||
import { Guid } from "@common/types/guid";
|
||||
import { IsActive } from "@notification-service/core/enum/is-active.enum";
|
||||
import { NotificationContactType } from "@notification-service/core/enum/notification-contact-type";
|
||||
import { NotificationNotifyState } from "@notification-service/core/enum/notification-notify-state.enum";
|
||||
import { NotificationTrackingProcess } from "@notification-service/core/enum/notification-tracking-process.enum";
|
||||
import { NotificationTrackingState } from "@notification-service/core/enum/notification-tracking-state.enum";
|
||||
import { NotificationType } from "@notification-service/core/enum/notification-type.enum";
|
||||
import { IsActive } from "../common/enum/is-active.enum";
|
||||
import { NotificationType } from "../common/enum/notification-type";
|
||||
import { NotificationNotifyState } from "../common/enum/notification-notify-state";
|
||||
import { NotificationContactType } from "../common/enum/notification-contact-type";
|
||||
import { NotificationTrackingState } from "../common/enum/notification-tracking-state";
|
||||
import { NotificationTrackingProcess } from "../common/enum/notification-tracking-process";
|
||||
|
||||
export class NotificationLookup extends Lookup implements NotificationFilter {
|
||||
ids: Guid[];
|
|
@ -1,14 +1,14 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { InAppNotification } from '@app/core/model/inapp-notification/inapp-notification.model';
|
||||
import { InAppNotificationLookup } from '@app/core/query/inapp-notification.lookup';
|
||||
import { BaseHttpParams } from '@common/http/base-http-params';
|
||||
import { InterceptorType } from '@common/http/interceptors/interceptor-type';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { InAppNotification } from '@notification-service/core/model/inapp-notification.model';
|
||||
import { InAppNotificationLookup } from '@notification-service/core/query/inapp-notification.lookup';
|
||||
import { BaseHttpV2Service } from '@app/core/services/http/base-http-v2.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { BaseHttpV2Service } from '../http/base-http-v2.service';
|
||||
import { ConfigurationService } from '../configuration/configuration.service';
|
||||
|
||||
@Injectable()
|
||||
export class InAppNotificationService {
|
|
@ -1,13 +1,13 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { NotificationTemplateLookup } from '@notification-service/core/query/notification-template.lookup';
|
||||
import { NotificationTemplate, NotificationTemplatePersist } from '@notification-service/core/model/notification-template.model';
|
||||
import { NotificationTemplateKind } from '@notification-service/core/enum/notification-template-kind.enum';
|
||||
import { BaseHttpV2Service } from '@app/core/services/http/base-http-v2.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { NotificationTemplateKind } from '@app/core/common/enum/notification-template-kind';
|
||||
import { NotificationTemplateLookup } from '@app/core/query/notification-template.lookup';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { NotificationTemplate, NotificationTemplatePersist } from '@app/core/model/notification-template/notification-template';
|
||||
import { BaseHttpV2Service } from '../http/base-http-v2.service';
|
||||
import { ConfigurationService } from '../configuration/configuration.service';
|
||||
|
||||
@Injectable()
|
||||
export class NotificationTemplateService {
|
|
@ -1,12 +1,12 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { NotificationLookup } from '@app/core/query/notification.lookup';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { NotificationLookup } from '@notification-service/core/query/notification.lookup';
|
||||
import { Notification } from '@notification-service/core/model/notification.model';
|
||||
import { BaseHttpV2Service } from '@app/core/services/http/base-http-v2.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { Notification } from '@app/core/model/notification/notification.model';
|
||||
import { BaseHttpV2Service } from '../http/base-http-v2.service';
|
||||
import { ConfigurationService } from '../configuration/configuration.service';
|
||||
|
||||
@Injectable()
|
||||
export class NotificationService {
|
|
@ -10,7 +10,17 @@ import { DmpBlueprintStatus } from '@app/core/common/enum/dmp-blueprint-status';
|
|||
import { DmpBlueprintSystemFieldType } from '@app/core/common/enum/dmp-blueprint-system-field-type';
|
||||
import { DmpContactType } from '@app/core/common/enum/dmp-contact-type';
|
||||
import { DmpUserRole } from '@app/core/common/enum/dmp-user-role';
|
||||
import { EmailOverrideMode } from '@app/core/common/enum/email-override-mode';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { NotificationContactType } from '@app/core/common/enum/notification-contact-type';
|
||||
import { NotificationDataType } from '@app/core/common/enum/notification-data-type';
|
||||
import { NotificationInAppTracking } from '@app/core/common/enum/notification-inapp-tracking.enum';
|
||||
import { NotificationNotifyState } from '@app/core/common/enum/notification-notify-state';
|
||||
import { NotificationTemplateChannel } from '@app/core/common/enum/notification-template-channel';
|
||||
import { NotificationTemplateKind } from '@app/core/common/enum/notification-template-kind';
|
||||
import { NotificationTrackingProcess } from '@app/core/common/enum/notification-tracking-process';
|
||||
import { NotificationTrackingState } from '@app/core/common/enum/notification-tracking-state';
|
||||
import { NotificationType } from '@app/core/common/enum/notification-type';
|
||||
import { RecentActivityOrder } from '@app/core/common/enum/recent-activity-order';
|
||||
import { ReferenceFieldDataType } from '@app/core/common/enum/reference-field-data-type';
|
||||
import { ReferenceSourceType } from '@app/core/common/enum/reference-source-type';
|
||||
|
@ -224,6 +234,40 @@ export class EnumUtils {
|
|||
}
|
||||
}
|
||||
|
||||
toNotificationTemplateKindString(status: NotificationTemplateKind): string {
|
||||
switch (status) {
|
||||
case NotificationTemplateKind.Draft: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-KIND.DRAFT');
|
||||
case NotificationTemplateKind.Secondary: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-KIND.SECONDARY');
|
||||
case NotificationTemplateKind.Primary: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-KIND.PRIMARY');
|
||||
case NotificationTemplateKind.Default: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-KIND.DEFAULT');
|
||||
}
|
||||
}
|
||||
|
||||
toNotificationTemplateChannelString(status: NotificationTemplateChannel): string {
|
||||
switch (status) {
|
||||
case NotificationTemplateChannel.Email: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-CHANNEL.EMAIL');
|
||||
case NotificationTemplateChannel.InApp: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-CHANNEL.INAPP');
|
||||
}
|
||||
}
|
||||
|
||||
toNotificationTemplateDataTypeString(status: NotificationDataType): string {
|
||||
switch (status) {
|
||||
case NotificationDataType.Integer: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.INTEGER');
|
||||
case NotificationDataType.Demical: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.DEMICAL');
|
||||
case NotificationDataType.Double: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.DOUBLE');
|
||||
case NotificationDataType.DateTime: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.DATE-TIME');
|
||||
case NotificationDataType.String: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.STRING');
|
||||
}
|
||||
}
|
||||
|
||||
toEmailOverrideModeString(status: EmailOverrideMode): string {
|
||||
switch (status) {
|
||||
case EmailOverrideMode.NotOverride: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-EMAIL-OVERRIDE-MODE.NOT');
|
||||
case EmailOverrideMode.Additive: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-EMAIL-OVERRIDE-MODE.ADDITIVE');
|
||||
case EmailOverrideMode.Replace: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-EMAIL-OVERRIDE-MODE.REPLACE');
|
||||
}
|
||||
}
|
||||
|
||||
toRecentActivityOrderString(status: RecentActivityOrder): string {
|
||||
switch (status) {
|
||||
// case RecentActivityOrder.CREATED: return this.language.instant('TYPES.RECENT-ACTIVITY-ORDER.CREATED');
|
||||
|
@ -236,6 +280,70 @@ export class EnumUtils {
|
|||
}
|
||||
}
|
||||
|
||||
toNotificationTypeString(status: NotificationType): string {
|
||||
switch (status) {
|
||||
case NotificationType.dmpInvitationExternalUserType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-INVITATION-EXTERNAL-USER');
|
||||
case NotificationType.dmpInvitationExistingUserType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-INVITATION-EXISTING-USER');
|
||||
case NotificationType.dmpModifiedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-MODIFIED');
|
||||
case NotificationType.dmpFinalisedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-FINALISED');
|
||||
case NotificationType.descriptionModifiedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-MODIFIED');
|
||||
case NotificationType.descriptionFinalisedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-FINALISED');
|
||||
case NotificationType.mergeAccountConfirmationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.MERGE-ACCOUNT-CONFIRMATION');
|
||||
case NotificationType.removeCredentialConfirmationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.REMOVE-CREDENTIAL-CONFIRMATION');
|
||||
case NotificationType.dmpDepositType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-DEPOSIT');
|
||||
case NotificationType.descriptionTemplateInvitationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-TEMPLATE-INVITATION');
|
||||
case NotificationType.contactSupportType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.CONTACT-SUPPORT');
|
||||
case NotificationType.publicContactSupportType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PUBLIC-CONTACT-SUPPORT');
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationInAppTrackingString(value: NotificationInAppTracking): string {
|
||||
switch (value) {
|
||||
case NotificationInAppTracking.Delivered: return this.language.instant('TYPES.NOTIFICATION-INAPP-TRACKING.DELIVERED');
|
||||
case NotificationInAppTracking.Stored: return this.language.instant('TYPES.NOTIFICATION-INAPP-TRACKING.STORED');
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationContactTypeString(value: NotificationContactType): string {
|
||||
switch (value) {
|
||||
case NotificationContactType.EMAIL: return this.language.instant('TYPES.NOTIFICATION-CONTACT-TYPE.EMAIL');
|
||||
case NotificationContactType.IN_APP: return this.language.instant('TYPES.NOTIFICATION-CONTACT-TYPE.INAPP');
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationNotifyStateString(value: NotificationNotifyState): string {
|
||||
switch (value) {
|
||||
case NotificationNotifyState.PENDING: return this.language.instant('TYPES.NOTIFICATION-NOTIFY-STATE.PENDING');
|
||||
case NotificationNotifyState.PROCESSING: return this.language.instant('TYPES.NOTIFICATION-NOTIFY-STATE.PROCESSING');
|
||||
case NotificationNotifyState.SUCCESSFUL: return this.language.instant('TYPES.NOTIFICATION-NOTIFY-STATE.SUCCESSFUL');
|
||||
case NotificationNotifyState.ERROR: return this.language.instant('TYPES.NOTIFICATION-NOTIFY-STATE.ERROR');
|
||||
case NotificationNotifyState.OMITTED: return this.language.instant('TYPES.NOTIFICATION-NOTIFY-STATE.OMITTED');
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationTrackingStateString(value: NotificationTrackingState): string {
|
||||
switch (value) {
|
||||
case NotificationTrackingState.UNDEFINED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.UNDEFINED');
|
||||
case NotificationTrackingState.NA: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.NA');
|
||||
case NotificationTrackingState.QUEUED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.QUEUED');
|
||||
case NotificationTrackingState.SENT: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.SENT');
|
||||
case NotificationTrackingState.DELIVERED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.DELIVERED');
|
||||
case NotificationTrackingState.UNDELIVERED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.UNDELIVERED');
|
||||
case NotificationTrackingState.FAILED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.FAILED');
|
||||
case NotificationTrackingState.UNSENT: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.UNSENT');
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationTrackingProcessString(value: NotificationTrackingProcess): string {
|
||||
switch (value) {
|
||||
case NotificationTrackingProcess.PENDING: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.PENDING');
|
||||
case NotificationTrackingProcess.PROCESSING: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.PROCESSING');
|
||||
case NotificationTrackingProcess.SUCCESSFUL: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.SUCCESSFUL');
|
||||
case NotificationTrackingProcess.ERROR: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.ERROR');
|
||||
case NotificationTrackingProcess.OMITTED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.OMITTED');
|
||||
}
|
||||
}
|
||||
|
||||
public toDmpAccessTypeString(value: DmpAccessType): string {
|
||||
switch (value) {
|
||||
case DmpAccessType.Public: return this.language.instant('TYPES.DMP-ACCESS-TYPE.PUBLIC');
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { UntypedFormArray } from '@angular/forms';
|
||||
import { NotificationDataType } from '@app/core/common/enum/notification-data-type';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||
import { NotificationFieldInfoEditorModel, NotificationFieldOptionsEditorModel } from '../notification-template-editor.model';
|
||||
import { MatChipEditedEvent, MatChipInputEvent } from '@angular/material/chips';
|
||||
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
||||
import { NotificationDataType } from '@notification-service/core/enum/notification-data-type';
|
||||
|
||||
@Component({
|
||||
selector: 'app-notification-template-field-options-component',
|
|
@ -7,9 +7,10 @@ import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog
|
|||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { NotificationTemplateKind } from '@app/core/common/enum/notification-template-kind';
|
||||
import { AppPermission } from '@app/core/common/enum/permission.enum';
|
||||
import { NotificationTemplate, NotificationTemplatePersist } from '@notification-service/core/model/notification-template.model';
|
||||
import { NotificationTemplateService } from '@notification-service/services/http/notification-template.service';
|
||||
import { NotificationTemplate, NotificationTemplatePersist } from '@app/core/model/notification-template/notification-template';
|
||||
import { NotificationTemplateService } from '@app/core/services/notification-template/notification-template.service';
|
||||
import { NotificationFieldInfoEditorModel, NotificationFieldOptionsEditorModel, NotificationTemplateEditorModel } from './notification-template-editor.model';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { BaseEditor } from '@common/base/base-editor';
|
||||
|
@ -17,25 +18,24 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||
import { FilterService } from '@common/modules/text-filter/filter-service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
||||
import { NotificationTemplateEditorService } from './notification-template-editor.service';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { NotificationTemplateEditorResolver } from './notification-template-editor.resolver';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { LoggingService } from '@app/core/services/logging/logging-service';
|
||||
import { LanguageHttpService } from '@app/core/services/language/language.http.service';
|
||||
import { Language } from '@app/core/model/language/language';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { NotificationTemplateChannel } from '@app/core/common/enum/notification-template-channel';
|
||||
import { MatChipEditedEvent, MatChipInputEvent } from '@angular/material/chips';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { NotificationDataType } from '@app/core/common/enum/notification-data-type';
|
||||
import { EmailOverrideMode } from '@app/core/common/enum/email-override-mode';
|
||||
import { NotificationType } from '@app/core/common/enum/notification-type';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { NotificationTemplateChannel } from '@notification-service/core/enum/notification-template-channel.enum';
|
||||
import { NotificationTemplateKind } from '@notification-service/core/enum/notification-template-kind.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { EmailOverrideMode } from '@notification-service/core/enum/email-override-mode';
|
||||
import { NotificationDataType } from '@notification-service/core/enum/notification-data-type';
|
||||
|
||||
@Component({
|
||||
selector: 'app-notification-template-editor',
|
||||
|
@ -93,7 +93,7 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
|
|||
protected authService: AuthService,
|
||||
protected configurationService: ConfigurationService,
|
||||
// Rest dependencies. Inject any other needed deps here:
|
||||
public enumUtils: NotificationServiceEnumUtils,
|
||||
public enumUtils: EnumUtils,
|
||||
private languageHttpService: LanguageHttpService,
|
||||
private notificationTemplateService: NotificationTemplateService,
|
||||
private notificationTemplateEditorService: NotificationTemplateEditorService,
|
|
@ -1,15 +1,15 @@
|
|||
import { FormArray, FormControl, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { NotificationFieldInfo, NotificationFieldInfoPersist, NotificationFieldOptions, NotificationFieldOptionsPersist, NotificationTemplate, NotificationTemplatePersist, NotificationTemplateValue, NotificationTemplateValuePersist } from '@notification-service/core/model/notification-template.model';
|
||||
import { NotificationFieldInfo, NotificationFieldInfoPersist, NotificationFieldOptions, NotificationFieldOptionsPersist, NotificationTemplate, NotificationTemplatePersist, NotificationTemplateValue, NotificationTemplateValuePersist } from '@app/core/model/notification-template/notification-template';
|
||||
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||
import { Validation, ValidationContext } from '@common/forms/validation/validation-context';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { NotificationTemplateChannel } from '@app/core/common/enum/notification-template-channel';
|
||||
import { NotificationTemplateKind } from '@app/core/common/enum/notification-template-kind';
|
||||
import { NotificationDataType } from '@app/core/common/enum/notification-data-type';
|
||||
import { EmailOverrideMode } from '@app/core/common/enum/email-override-mode';
|
||||
import { BaseEditorModel } from '@common/base/base-form-editor-model';
|
||||
import { NotificationTemplateChannel } from '@notification-service/core/enum/notification-template-channel.enum';
|
||||
import { NotificationTemplateKind } from '@notification-service/core/enum/notification-template-kind.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { EmailOverrideMode } from '@notification-service/core/enum/email-override-mode';
|
||||
import { NotificationDataType } from '@notification-service/core/enum/notification-data-type';
|
||||
import { NotificationType } from '@app/core/common/enum/notification-type';
|
||||
|
||||
export class NotificationTemplateEditorModel extends BaseEditorModel implements NotificationTemplatePersist {
|
||||
channel: NotificationTemplateChannel;
|
|
@ -1,8 +1,8 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
||||
import { Language } from '@app/core/model/language/language';
|
||||
import { NotificationFieldInfo, NotificationFieldOptions, NotificationTemplate, NotificationTemplateValue } from '@notification-service/core/model/notification-template.model';
|
||||
import { NotificationTemplateService } from '@notification-service/services/http/notification-template.service';
|
||||
import { NotificationFieldInfo, NotificationFieldOptions, NotificationTemplate, NotificationTemplateValue } from '@app/core/model/notification-template/notification-template';
|
||||
import { NotificationTemplateService } from '@app/core/services/notification-template/notification-template.service';
|
||||
import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service';
|
||||
import { BaseEditorResolver } from '@common/base/base-editor.resolver';
|
||||
import { Guid } from '@common/types/guid';
|
|
@ -1,11 +1,11 @@
|
|||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { NotificationTemplateFilter } from '@notification-service/core/query/notification-template.lookup';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { NotificationTemplateChannel } from '@app/core/common/enum/notification-template-channel';
|
||||
import { NotificationTemplateKind } from '@app/core/common/enum/notification-template-kind';
|
||||
import { NotificationType } from '@app/core/common/enum/notification-type';
|
||||
import { NotificationTemplateFilter } from '@app/core/query/notification-template.lookup';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { NotificationTemplateChannel } from '@notification-service/core/enum/notification-template-channel.enum';
|
||||
import { NotificationTemplateKind } from '@notification-service/core/enum/notification-template-kind.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
|
||||
@Component({
|
||||
|
@ -26,7 +26,7 @@ export class NotificationTemplateListingFiltersComponent extends BaseComponent i
|
|||
|
||||
protected appliedFilterCount: number = 0;
|
||||
constructor(
|
||||
public enumUtils: NotificationServiceEnumUtils,
|
||||
public enumUtils: EnumUtils,
|
||||
) { super(); }
|
||||
|
||||
ngOnInit() {
|
|
@ -1,9 +1,10 @@
|
|||
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { QueryParamsService } from '@app/core/services/utilities/query-params.service';
|
||||
import { BaseListingComponent } from '@common/base/base-listing-component';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
|
@ -18,14 +19,13 @@ import { Observable } from 'rxjs';
|
|||
import { takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { NotificationTemplate } from '@notification-service/core/model/notification-template.model';
|
||||
import { NotificationTemplateLookup } from '@notification-service/core/query/notification-template.lookup';
|
||||
import { NotificationTemplateService } from '@notification-service/services/http/notification-template.service';
|
||||
import { NotificationTemplate } from '@app/core/model/notification-template/notification-template';
|
||||
import { NotificationTemplateLookup } from '@app/core/query/notification-template.lookup';
|
||||
import { NotificationTemplateService } from '@app/core/services/notification-template/notification-template.service';
|
||||
import { NotificationTemplateChannelPipe } from '@common/formatting/pipes/notification-template-channel.pipe';
|
||||
import { NotificationTemplateKindPipe } from '@common/formatting/pipes/notification-template-kind.pipe';
|
||||
import { Language } from '@app/core/model/language/language';
|
||||
import { NotificationTypePipe } from '@common/formatting/pipes/notification-type.pipe';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
|
||||
@Component({
|
||||
templateUrl: './notification-template-listing.component.html',
|
||||
|
@ -61,7 +61,7 @@ export class NotificationTemplateListingComponent extends BaseListingComponent<N
|
|||
private notificationTemplateService: NotificationTemplateService,
|
||||
public authService: AuthService,
|
||||
private pipeService: PipeService,
|
||||
public enumUtils: NotificationServiceEnumUtils,
|
||||
public enumUtils: EnumUtils,
|
||||
private language: TranslateService,
|
||||
private dialog: MatDialog
|
||||
) {
|
|
@ -17,7 +17,6 @@ import { NotificationTemplateListingFiltersComponent } from './listing/filters/n
|
|||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||
import { NotificationTemplateFieldOptionsComponent } from './editor/field-options/notification-template-field-options.component';
|
||||
import { NotificationServiceFormattingModule } from '@notification-service/core/formatting/formatting.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -34,8 +33,7 @@ import { NotificationServiceFormattingModule } from '@notification-service/core/
|
|||
CommonFormattingModule,
|
||||
RichTextEditorModule,
|
||||
MatIconModule,
|
||||
EditorModule,
|
||||
NotificationServiceFormattingModule
|
||||
EditorModule
|
||||
],
|
||||
declarations: [
|
||||
NotificationTemplateEditorComponent,
|
|
@ -0,0 +1,21 @@
|
|||
::ng-deep.mat-mdc-menu-panel {
|
||||
max-width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
|
||||
:host::ng-deep.mat-mdc-menu-content:not(:empty) {
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
.filter-button{
|
||||
padding-top: .6rem;
|
||||
padding-bottom: .6rem;
|
||||
// .mat-icon{
|
||||
// font-size: 1.5em;
|
||||
// width: 1.2em;
|
||||
// height: 1.2em;
|
||||
// }
|
||||
}
|
||||
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
import { COMMA, ENTER } from '@angular/cdk/keycodes';
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { NotificationFilter } from '@notification-service/core/query/notification.lookup';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { NotificationContactType } from '@app/core/common/enum/notification-contact-type';
|
||||
import { NotificationNotifyState } from '@app/core/common/enum/notification-notify-state';
|
||||
import { NotificationTrackingProcess } from '@app/core/common/enum/notification-tracking-process';
|
||||
import { NotificationTrackingState } from '@app/core/common/enum/notification-tracking-state';
|
||||
import { NotificationType } from '@app/core/common/enum/notification-type';
|
||||
import { NotificationFilter } from '@app/core/query/notification.lookup';
|
||||
import { UserService } from '@app/core/services/user/user.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { NotificationContactType } from '@notification-service/core/enum/notification-contact-type';
|
||||
import { NotificationNotifyState } from '@notification-service/core/enum/notification-notify-state.enum';
|
||||
import { NotificationTrackingProcess } from '@notification-service/core/enum/notification-tracking-process.enum';
|
||||
import { NotificationTrackingState } from '@notification-service/core/enum/notification-tracking-state.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
|
||||
@Component({
|
|
@ -1,6 +1,7 @@
|
|||
import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
@ -18,15 +19,14 @@ import { Observable } from 'rxjs';
|
|||
import { takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { IsActiveTypePipe } from '@common/formatting/pipes/is-active-type.pipe';
|
||||
import { Notification } from '@notification-service/core/model/notification.model';
|
||||
import { NotificationLookup } from '@notification-service/core/query/notification.lookup';
|
||||
import { NotificationService } from '@notification-service/services/http/notification-service';
|
||||
import { Notification } from '@app/core/model/notification/notification.model';
|
||||
import { NotificationLookup } from '@app/core/query/notification.lookup';
|
||||
import { NotificationService } from '@app/core/services/notification/notification-service';
|
||||
import { NotificationTypePipe } from '@common/formatting/pipes/notification-type.pipe';
|
||||
import { NotificationContactTypePipe } from '@common/formatting/pipes/notification-contact-type.pipe';
|
||||
import { NotificationNotifyStatePipe } from '@common/formatting/pipes/notification-notify-state.pipe';
|
||||
import { NotificationTrackingStatePipe } from '@common/formatting/pipes/notification-tracking-state.pipe';
|
||||
import { NotificationTrackingProcessPipe } from '@common/formatting/pipes/notification-tracking-process.pipe';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
|
||||
@Component({
|
||||
templateUrl: './notification-listing.component.html',
|
|
@ -15,7 +15,6 @@ import { NotificationRoutingModule } from './notification.routing';
|
|||
import { NotificationListingFiltersComponent } from './filters/notification-listing-filters.component';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { EditorModule } from '@tinymce/tinymce-angular';
|
||||
import { NotificationServiceFormattingModule } from '@notification-service/core/formatting/formatting.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -23,14 +22,16 @@ import { NotificationServiceFormattingModule } from '@notification-service/core/
|
|||
CommonFormsModule,
|
||||
ConfirmationDialogModule,
|
||||
NotificationRoutingModule,
|
||||
NgxDropzoneModule,
|
||||
DragDropModule,
|
||||
AutoCompleteModule,
|
||||
HybridListingModule,
|
||||
TextFilterModule,
|
||||
UserSettingsModule,
|
||||
CommonFormattingModule,
|
||||
RichTextEditorModule,
|
||||
MatIconModule,
|
||||
EditorModule,
|
||||
NotificationServiceFormattingModule
|
||||
EditorModule
|
||||
],
|
||||
declarations: [
|
||||
NotificationListingComponent,
|
|
@ -14,10 +14,10 @@ import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
|||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { AuthService } from '@app/core/services/auth/auth.service';
|
||||
import { InAppNotificationService } from '@notification-service/services/http/inapp-notification.service';
|
||||
import { InAppNotification } from '@app/core/model/inapp-notification/inapp-notification.model';
|
||||
import { InAppNotificationService } from '@app/core/services/inapp-notification/inapp-notification.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { NotificationInAppTracking } from '@notification-service/core/enum/notification-inapp-tracking.enum';
|
||||
import { InAppNotification } from '@notification-service/core/model/inapp-notification.model';
|
||||
import { NotificationInAppTracking } from '@app/core/common/enum/notification-inapp-tracking.enum';
|
||||
|
||||
@Component({
|
||||
selector: 'app-inapp-notification-editor',
|
|
@ -7,13 +7,13 @@ import { AuthService } from '@app/core/services/auth/auth.service';
|
|||
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { InAppNotificationLookup } from '@notification-service/core/query/inapp-notification.lookup';
|
||||
import { InAppNotificationService } from '@notification-service/services/http/inapp-notification.service';
|
||||
import { NotificationInAppTracking } from '@app/core/common/enum/notification-inapp-tracking.enum';
|
||||
import { InAppNotification } from '@app/core/model/inapp-notification/inapp-notification.model';
|
||||
import { InAppNotificationLookup } from '@app/core/query/inapp-notification.lookup';
|
||||
import { InAppNotificationService } from '@app/core/services/inapp-notification/inapp-notification.service';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { NotificationInAppTracking } from "@notification-service/core/enum/notification-inapp-tracking.enum";
|
||||
import { InAppNotification } from "@notification-service/core/model/inapp-notification.model";
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
|
||||
@Component({
|
||||
selector: 'app-mine-inapp-notification-listing-dialog',
|
|
@ -1,10 +1,11 @@
|
|||
import { Component, EventEmitter, Input, OnInit, Output, SimpleChanges, OnChanges } from '@angular/core';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { InAppNotificationFilter } from '@notification-service/core/query/inapp-notification.lookup';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { NotificationInAppTracking } from '@app/core/common/enum/notification-inapp-tracking.enum';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { InAppNotificationFilter } from '@app/core/query/inapp-notification.lookup';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { NotificationInAppTracking } from '@notification-service/core/enum/notification-inapp-tracking.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { NotificationType } from '@app/core/common/enum/notification-type';
|
||||
@Component({
|
||||
selector: 'app-mine-inapp-notification-listing-filters',
|
||||
templateUrl: './mine-inapp-notification-listing-filters.component.html',
|
||||
|
@ -23,7 +24,7 @@ export class MineInAppNotificationListingFiltersComponent extends BaseComponent
|
|||
|
||||
protected appliedFilterCount: number = 0;
|
||||
constructor(
|
||||
public enumUtils: NotificationServiceEnumUtils,
|
||||
public enumUtils: EnumUtils,
|
||||
) { super(); }
|
||||
|
||||
ngOnInit() {
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
<ng-template #listItemTemplate let-item="item" let-isColumnSelected="isColumnSelected">
|
||||
|
||||
|
||||
<div class="d-flex align-items-center p-3 gap-1-rem">
|
||||
<div class="row">
|
||||
<ng-container *ngIf="isColumnSelected('trackingState')">
|
|
@ -8,21 +8,21 @@ import { DataTableDateTimeFormatPipe } from '@common/formatting/pipes/date-time-
|
|||
import { HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
import { ColumnDefinition, ColumnsChangedEvent, HybridListingComponent, PageLoadEvent } from '@common/modules/hybrid-listing/hybrid-listing.component';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { InAppNotificationLookup } from '@notification-service/core/query/inapp-notification.lookup';
|
||||
import { InAppNotificationService } from '@notification-service/services/http/inapp-notification.service';
|
||||
import { InAppNotification } from '@app/core/model/inapp-notification/inapp-notification.model';
|
||||
import { InAppNotificationLookup } from '@app/core/query/inapp-notification.lookup';
|
||||
import { InAppNotificationService } from '@app/core/services/inapp-notification/inapp-notification.service';
|
||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
import { Observable } from 'rxjs';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { NotificationInAppTracking } from '@app/core/common/enum/notification-inapp-tracking.enum';
|
||||
import { NotificationTypePipe } from '@common/formatting/pipes/notification-type.pipe';
|
||||
import { NotificationInAppTracking } from '@notification-service/core/enum/notification-inapp-tracking.enum';
|
||||
import { InAppNotification } from '@notification-service/core/model/inapp-notification.model';
|
||||
|
||||
@Component({
|
||||
selector: 'app-mine-inapp-notification-listing',
|
||||
|
@ -59,7 +59,7 @@ export class MineInAppNotificationListingComponent extends BaseListingComponent<
|
|||
private inAppNotificationService: InAppNotificationService,
|
||||
public authService: AuthService,
|
||||
private pipeService: PipeService,
|
||||
public enumUtils: NotificationServiceEnumUtils,
|
||||
public enumUtils: EnumUtils,
|
||||
private language: TranslateService,
|
||||
private dialog: MatDialog
|
||||
) {
|
||||
|
@ -74,9 +74,6 @@ export class MineInAppNotificationListingComponent extends BaseListingComponent<
|
|||
}
|
||||
|
||||
protected initializeLookup(): InAppNotificationLookup {
|
||||
console.log('this.enumUtils');
|
||||
console.log(this.enumUtils);
|
||||
console.log(this.inAppNotificationService);
|
||||
const lookup = new InAppNotificationLookup();
|
||||
lookup.metadata = { countAll: true };
|
||||
lookup.page = { offset: 0, size: this.ITEMS_PER_PAGE };
|
|
@ -12,7 +12,6 @@ import { MineInAppNotificationListingFiltersComponent } from './listing/filters/
|
|||
import { MineInAppNotificationListingDialogComponent } from './listing-dialog/mine-inapp-notification-listing-dialog.component';
|
||||
import { CommonFormattingModule } from '@common/formatting/common-formatting.module';
|
||||
import { FormattingModule } from '@app/core/formatting.module';
|
||||
import { NotificationServiceFormattingModule } from '@notification-service/core/formatting/formatting.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -24,8 +23,7 @@ import { NotificationServiceFormattingModule } from '@notification-service/core/
|
|||
MineInAppNotificationRoutingModule,
|
||||
UserSettingsModule,
|
||||
CommonFormattingModule,
|
||||
// FormattingModule,
|
||||
NotificationServiceFormattingModule
|
||||
FormattingModule
|
||||
],
|
||||
declarations: [
|
||||
MineInAppNotificationListingComponent,
|
|
@ -15,8 +15,8 @@ import { takeUntil } from 'rxjs/operators';
|
|||
import { StartNewDmpDialogComponent } from '../dmp/new/start-new-dmp-dialogue/start-new-dmp-dialog.component';
|
||||
import { FaqDialogComponent } from '../faq/dialog/faq-dialog.component';
|
||||
import { UserDialogComponent } from './user-dialog/user-dialog.component';
|
||||
import { MineInAppNotificationListingDialogComponent } from '@notification-service/ui/inapp-notification/listing-dialog/mine-inapp-notification-listing-dialog.component';
|
||||
import { InAppNotificationService } from '@notification-service/services/http/inapp-notification.service';
|
||||
import { MineInAppNotificationListingDialogComponent } from '../inapp-notification/listing-dialog/mine-inapp-notification-listing-dialog.component';
|
||||
import { InAppNotificationService } from '@app/core/services/inapp-notification/inapp-notification.service';
|
||||
import { timer } from 'rxjs';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
|
||||
|
|
|
@ -1130,18 +1130,16 @@
|
|||
"INACTIVE": "Inactive"
|
||||
},
|
||||
"NOTIFICATION-TYPE": {
|
||||
"DMP-INVITATION-EXISTING-USER-TYPE": "DMP invitation on existing user",
|
||||
"DMP-INVITATION-EXTERNAL-USER-TYPE": "DMP invitation on external user",
|
||||
"DMP-MODIFIED-TYPE": "Modified a DMP",
|
||||
"DMP-FINALISED-TYPE": "Finalised a DMP",
|
||||
"DESCRIPTION-MODIFIED-TYPE": "Modified a Description",
|
||||
"DESCRIPTION-FINALISED-TYPE": "Finalised a Description",
|
||||
"MERGE-ACCOUNT-CONFIRMATION-TYPE": "Confirmation to merge an account",
|
||||
"REMOVE-CREDENTIAL-CONFIRMATION-TYPE": "Confirmation to remove an account",
|
||||
"DMP-DEPOSIT-TYPE": "Deposit a DMP",
|
||||
"DESCRIPTION-TEMPLATE-INVITATION-TYPE": "Description Template invitation",
|
||||
"CONTACT-SUPPORT-TYPE": "Contact Support",
|
||||
"PUBLIC-CONTACT-SUPPORT-TYPE": "Public Contact Support"
|
||||
"REGISTRATION-INVITATION": "Registration Invitation",
|
||||
"TOTP-OVERRIDE-USED": "TOPT Override Used",
|
||||
"CREDENTIAL-RESET": "Credential Reset",
|
||||
"DIRECT-LINK": "Direct Link",
|
||||
"FORGET-ME-REQUEST": "Forget me Request",
|
||||
"WHAT-YOU-KNOW-ABOUT-ME-REQUEST": "'What you Know about me' request",
|
||||
"WHAT-YOU-KNOW-ABOUT-ME-REQUEST-COMPLETED": "Completion of 'what you Know about me' request",
|
||||
"EMAIL-RESET-REQUEST": "Email reset request",
|
||||
"EMAIL-RESET-AWARENESS": "Awareness of 'email reset' request",
|
||||
"EMAIL-RESET-REMOVE": "Remove email reset request"
|
||||
}
|
||||
},
|
||||
"USER-PROFILE": {
|
||||
|
@ -1712,7 +1710,7 @@
|
|||
"INTERNAL": "Internal",
|
||||
"EXTERNAL": "External"
|
||||
},
|
||||
"NOTIFICATION-TEMPLATE-KIND - HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!": {
|
||||
"NOTIFICATION-TEMPLATE-KIND": {
|
||||
"DRAFT": "Draft",
|
||||
"SECONDARY": "Secondary",
|
||||
"PRIMARY": "Primary",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
||||
@Pipe({ name: 'NotificationContactTypeFormat' })
|
||||
export class NotificationContactTypePipe implements PipeTransform {
|
||||
constructor(private enumUtils: NotificationServiceEnumUtils) { }
|
||||
constructor(private enumUtils: EnumUtils) { }
|
||||
|
||||
public transform(value): any {
|
||||
return this.enumUtils.toNotificationContactTypeString(value);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
||||
@Pipe({ name: 'NotificationNotifyStateFormat' })
|
||||
export class NotificationNotifyStatePipe implements PipeTransform {
|
||||
constructor(private enumUtils: NotificationServiceEnumUtils) { }
|
||||
constructor(private enumUtils: EnumUtils) { }
|
||||
|
||||
public transform(value): any {
|
||||
return this.enumUtils.toNotificationNotifyStateString(value);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
||||
@Pipe({ name: 'NotificationTemplateChannelFormat' })
|
||||
export class NotificationTemplateChannelPipe implements PipeTransform {
|
||||
constructor(private enumUtils: NotificationServiceEnumUtils) { }
|
||||
constructor(private enumUtils: EnumUtils) { }
|
||||
|
||||
public transform(value): any {
|
||||
return this.enumUtils.toNotificationTemplateChannelString(value);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
||||
@Pipe({ name: 'NotificationTemplateKindFormat' })
|
||||
export class NotificationTemplateKindPipe implements PipeTransform {
|
||||
constructor(private enumUtils: NotificationServiceEnumUtils) { }
|
||||
constructor(private enumUtils: EnumUtils) { }
|
||||
|
||||
public transform(value): any {
|
||||
return this.enumUtils.toNotificationTemplateKindString(value);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
||||
@Pipe({ name: 'NotificationTrackingProcessFormat' })
|
||||
export class NotificationTrackingProcessPipe implements PipeTransform {
|
||||
constructor(private enumUtils: NotificationServiceEnumUtils) { }
|
||||
constructor(private enumUtils: EnumUtils) { }
|
||||
|
||||
public transform(value): any {
|
||||
return this.enumUtils.toNotificationTrackingProcessString(value);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
||||
@Pipe({ name: 'NotificationTrackingStateFormat' })
|
||||
export class NotificationTrackingStatePipe implements PipeTransform {
|
||||
constructor(private enumUtils: NotificationServiceEnumUtils) { }
|
||||
constructor(private enumUtils: EnumUtils) { }
|
||||
|
||||
public transform(value): any {
|
||||
return this.enumUtils.toNotificationTrackingStateString(value);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
||||
|
||||
@Pipe({ name: 'NotificationTypeFormat' })
|
||||
export class NotificationTypePipe implements PipeTransform {
|
||||
constructor(private enumUtils: NotificationServiceEnumUtils) { }
|
||||
constructor(private enumUtils: EnumUtils) { }
|
||||
|
||||
public transform(value): any {
|
||||
return this.enumUtils.toNotificationTypeString(value);
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
export enum ContactInfoType {
|
||||
Email = 0,
|
||||
MobilePhone = 1,
|
||||
LandLinePhone = 2,
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
export enum ContactType {
|
||||
Email = 0,
|
||||
SlackBroadcast = 1,
|
||||
Sms = 2,
|
||||
InApp = 3,
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
export enum NotificationNotifyState {
|
||||
PENDING = 0,
|
||||
PROCESSING = 1,
|
||||
SUCCESSFUL = 2,
|
||||
ERROR = 3,
|
||||
OMITTED = 4
|
||||
}
|
||||
Pending = 0,
|
||||
Processing = 1,
|
||||
Successful = 2,
|
||||
Error = 3,
|
||||
Omitted = 4
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export enum NotificationTemplateChannel {
|
||||
Email = 0,
|
||||
InApp = 1,
|
||||
SlackBroadcast = 1,
|
||||
Sms = 2,
|
||||
InApp = 3,
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export enum NotificationTrackingProcess {
|
||||
PENDING = 0,
|
||||
PROCESSING = 1,
|
||||
SUCCESSFUL = 2,
|
||||
ERROR = 3,
|
||||
OMITTED = 4
|
||||
Pending = 0,
|
||||
Processing = 1,
|
||||
Completed = 2,
|
||||
Error = 3,
|
||||
Omitted = 4
|
||||
}
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
export enum NotificationTrackingState {
|
||||
UNDEFINED = 0,
|
||||
/// <summary>
|
||||
/// Initial state
|
||||
/// </summary>
|
||||
Undefined = 0,
|
||||
/// <summary>
|
||||
/// Final for notifiers that do not provide any kind of tracking
|
||||
/// </summary>
|
||||
NA = 1,
|
||||
QUEUED = 2,
|
||||
SENT = 3,
|
||||
DELIVERED = 4,
|
||||
UNDELIVERED = 5,
|
||||
FAILED = 6,
|
||||
UNSENT = 7
|
||||
Queued = 2,
|
||||
Sent = 3,
|
||||
Delivered = 4,
|
||||
Undelivered = 5,
|
||||
Failed = 6,
|
||||
Unsent = 7
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
export enum NotificationType {
|
||||
dmpInvitationExternalUserType = '065deecd-21bb-44af-9983-e660fdf24bc4',
|
||||
dmpInvitationExistingUserType = '4904dea2-5079-46d3-83be-3a19c9ab45dc',
|
||||
dmpModifiedType = '4542262a-22f8-4baa-9db6-1c8e70ac1dbb',
|
||||
dmpFinalisedType = '90db0b46-42de-bd89-aebf-6f27efeb256e',
|
||||
descriptionModifiedType = '4fdbfa80-7a71-4a69-b854-67cbb70648f1',
|
||||
descriptionFinalisedType = '33790bad-94d4-488a-8ee2-7f6295ca18ea',
|
||||
mergeAccountConfirmationType = 'bfe68845-cb05-4c5a-a03d-29161a7c9660',
|
||||
removeCredentialConfirmationType = 'c9bc3f16-057e-4bba-8a5f-36bd835e5604',
|
||||
dmpDepositType = '55736f7a-83ab-4190-af43-9d031a6f9612',
|
||||
descriptionTemplateInvitationType = '223bb607-efa1-4ce7-99ec-4beabfef9a8b',
|
||||
contactSupportType = '5b1d6c52-88f9-418b-9b8a-6f1f963d9ead',
|
||||
publicContactSupportType = 'b542b606-acc6-4629-adef-4d8ee2f01222'
|
||||
RegistrationInvitation = '4fdbfa80-7a71-4a69-b854-67cbb70648f1',
|
||||
TotpOverrideUsed = '065deecd-21bb-44af-9983-e660fdf24bc4',
|
||||
CredentialReset = '90db0b46-42de-bd89-aebf-6f27efeb256e',
|
||||
DirectLink = 'bfe68845-cb05-4c5a-a03d-29161a7c9660',
|
||||
ForgetMeRequest = '4542262a-22f8-4baa-9db6-1c8e70ac1dbb',
|
||||
WhatYouKnowAboutMeRequest = 'd3cd55fe-8da2-42e7-a501-3795ee4f16d3',
|
||||
WhatYouKnowAboutMeRequestCompleted = '55736f7a-83ab-4190-af43-9d031a6f9612',
|
||||
EmailResetRequest = '223bb607-efa1-4ce7-99ec-4beabfef9a8b',
|
||||
EmailResetAwareness = 'c9bc3f16-057e-4bba-8a5f-36bd835e5604',
|
||||
EmailResetRemove = '1aeb49e8-c817-4088-8b45-08e0a5155796',
|
||||
Unknown1 = "5b1d6c52-88f9-418b-9b8a-6f1f963d9ead",
|
||||
Unknown2 = "b542b606-acc6-4629-adef-4d8ee2f01222",
|
||||
Unknown3 = "33790bad-94d4-488a-8ee2-7f6295ca18ea",
|
||||
Unknown4 = "4904dea2-5079-46d3-83be-3a19c9ab45dc",
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
export enum TenantConfigurationType {
|
||||
SlackBroadcast = 0,
|
||||
EmailClientConfiguration = 1,
|
||||
SmsClientConfiguration = 2,
|
||||
DefaultUserLocale = 3,
|
||||
NotifierList = 4
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { BaseEnumUtilsService } from '@common/base/base-enum-utils.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { ContactType } from '@notification-service/core/enum/contact-type.enum';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { NotificationInAppTracking } from '@notification-service/core/enum/notification-inapp-tracking.enum';
|
||||
import { NotificationNotifyState } from '@notification-service/core/enum/notification-notify-state.enum';
|
||||
|
@ -9,9 +10,6 @@ import { NotificationTemplateKind } from '@notification-service/core/enum/notifi
|
|||
import { NotificationTrackingProcess } from '@notification-service/core/enum/notification-tracking-process.enum';
|
||||
import { NotificationTrackingState } from '@notification-service/core/enum/notification-tracking-state.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { NotificationDataType } from '../enum/notification-data-type';
|
||||
import { EmailOverrideMode } from '../enum/email-override-mode';
|
||||
import { NotificationContactType } from '../enum/notification-contact-type';
|
||||
|
||||
@Injectable()
|
||||
export class NotificationServiceEnumUtils extends BaseEnumUtilsService {
|
||||
|
@ -28,70 +26,74 @@ export class NotificationServiceEnumUtils extends BaseEnumUtilsService {
|
|||
|
||||
public toNotificationTypeString(value: NotificationType): string {
|
||||
switch (value) {
|
||||
case NotificationType.dmpInvitationExternalUserType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-INVITATION-EXTERNAL-USER');
|
||||
case NotificationType.dmpInvitationExistingUserType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-INVITATION-EXISTING-USER');
|
||||
case NotificationType.dmpModifiedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-MODIFIED');
|
||||
case NotificationType.dmpFinalisedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-FINALISED');
|
||||
case NotificationType.descriptionModifiedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-MODIFIED');
|
||||
case NotificationType.descriptionFinalisedType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-FINALISED');
|
||||
case NotificationType.mergeAccountConfirmationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.MERGE-ACCOUNT-CONFIRMATION');
|
||||
case NotificationType.removeCredentialConfirmationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.REMOVE-CREDENTIAL-CONFIRMATION');
|
||||
case NotificationType.dmpDepositType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DMP-DEPOSIT');
|
||||
case NotificationType.descriptionTemplateInvitationType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.DESCRIPTION-TEMPLATE-INVITATION');
|
||||
case NotificationType.contactSupportType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.CONTACT-SUPPORT');
|
||||
case NotificationType.publicContactSupportType: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-NOTIFICATION-TYPE.PUBLIC-CONTACT-SUPPORT');
|
||||
case NotificationType.RegistrationInvitation: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.REGISTRATION-INVITATION');
|
||||
case NotificationType.TotpOverrideUsed: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.TOTP-OVERRIDE-USED');
|
||||
case NotificationType.CredentialReset: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.CREDENTIAL-RESET');
|
||||
case NotificationType.DirectLink: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.DIRECT-LINK');
|
||||
case NotificationType.ForgetMeRequest: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.FORGET-ME-REQUEST');
|
||||
case NotificationType.WhatYouKnowAboutMeRequest: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.WHAT-YOU-KNOW-ABOUT-ME-REQUEST');
|
||||
case NotificationType.WhatYouKnowAboutMeRequestCompleted: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.WHAT-YOU-KNOW-ABOUT-ME-REQUEST-COMPLETED');
|
||||
case NotificationType.EmailResetRequest: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.EMAIL-RESET-REQUEST');
|
||||
case NotificationType.EmailResetAwareness: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.EMAIL-RESET-AWARENESS');
|
||||
case NotificationType.EmailResetRemove: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.EMAIL-RESET-REMOVE');
|
||||
case NotificationType.Unknown1: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.UNKOWN1');
|
||||
case NotificationType.Unknown2: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.UNKOWN2');
|
||||
case NotificationType.Unknown3: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.UNKOWN3');
|
||||
case NotificationType.Unknown4: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TYPE.UNKOWN4');
|
||||
default: return '';
|
||||
}
|
||||
}
|
||||
|
||||
public toContactTypeString(value: NotificationContactType): string {
|
||||
public toContactTypeString(value: ContactType): string {
|
||||
switch (value) {
|
||||
case NotificationContactType.EMAIL: return this.language.instant('NOTIFICATION-SERVICE.TYPES.CONTACT-TYPE.EMAIL');
|
||||
case NotificationContactType.IN_APP: return this.language.instant('NOTIFICATION-SERVICE.TYPES.CONTACT-TYPE.IN-APP');
|
||||
case ContactType.Email: return this.language.instant('NOTIFICATION-SERVICE.TYPES.CONTACT-TYPE.EMAIL');
|
||||
case ContactType.SlackBroadcast: return this.language.instant('NOTIFICATION-SERVICE.TYPES.CONTACT-TYPE.SLACK-BROADCAST');
|
||||
case ContactType.Sms: return this.language.instant('NOTIFICATION-SERVICE.TYPES.CONTACT-TYPE.SMS');
|
||||
case ContactType.InApp: return this.language.instant('NOTIFICATION-SERVICE.TYPES.CONTACT-TYPE.IN-APP');
|
||||
default: return '';
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationNotifyStateString(value: NotificationNotifyState): string {
|
||||
switch (value) {
|
||||
case NotificationNotifyState.PENDING: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.PENDING');
|
||||
case NotificationNotifyState.PROCESSING: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.PROCESSING');
|
||||
case NotificationNotifyState.SUCCESSFUL: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.SUCCESSFUL');
|
||||
case NotificationNotifyState.ERROR: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.ERROR');
|
||||
case NotificationNotifyState.OMITTED: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.OMITTED');
|
||||
case NotificationNotifyState.Pending: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.PENDING');
|
||||
case NotificationNotifyState.Processing: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.PROCESSING');
|
||||
case NotificationNotifyState.Successful: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.SUCCESSFUL');
|
||||
case NotificationNotifyState.Error: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.ERROR');
|
||||
case NotificationNotifyState.Omitted: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-NOTIFY-STATE.OMITTED');
|
||||
default: return '';
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationTrackingStateString(value: NotificationTrackingState): string {
|
||||
switch (value) {
|
||||
case NotificationTrackingState.UNDEFINED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.UNDEFINED');
|
||||
case NotificationTrackingState.NA: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.NA');
|
||||
case NotificationTrackingState.QUEUED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.QUEUED');
|
||||
case NotificationTrackingState.SENT: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.SENT');
|
||||
case NotificationTrackingState.DELIVERED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.DELIVERED');
|
||||
case NotificationTrackingState.UNDELIVERED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.UNDELIVERED');
|
||||
case NotificationTrackingState.FAILED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.FAILED');
|
||||
case NotificationTrackingState.UNSENT: return this.language.instant('TYPES.NOTIFICATION-TRACKING-STATE.UNSENT');
|
||||
case NotificationTrackingState.Undefined: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-STATE.UNDEFINED');
|
||||
case NotificationTrackingState.NA: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-STATE.NA');
|
||||
case NotificationTrackingState.Queued: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-STATE.QUEUED');
|
||||
case NotificationTrackingState.Sent: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-STATE.SENT');
|
||||
case NotificationTrackingState.Delivered: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-STATE.DELIVERED');
|
||||
case NotificationTrackingState.Undelivered: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-STATE.UNDELIVERED');
|
||||
case NotificationTrackingState.Failed: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-STATE.FAILED');
|
||||
case NotificationTrackingState.Unsent: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-STATE.UNSENT');
|
||||
default: return '';
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationTrackingProcessString(value: NotificationTrackingProcess): string {
|
||||
switch (value) {
|
||||
case NotificationTrackingProcess.PENDING: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.PENDING');
|
||||
case NotificationTrackingProcess.PROCESSING: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.PROCESSING');
|
||||
case NotificationTrackingProcess.SUCCESSFUL: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.SUCCESSFUL');
|
||||
case NotificationTrackingProcess.ERROR: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.ERROR');
|
||||
case NotificationTrackingProcess.OMITTED: return this.language.instant('TYPES.NOTIFICATION-TRACKING-PROCESS.OMITTED');
|
||||
case NotificationTrackingProcess.Pending: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-PROCESS.PENDING');
|
||||
case NotificationTrackingProcess.Processing: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-PROCESS.PROCESSING');
|
||||
case NotificationTrackingProcess.Completed: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-PROCESS.COMPLETED');
|
||||
case NotificationTrackingProcess.Error: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-PROCESS.ERROR');
|
||||
case NotificationTrackingProcess.Omitted: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TRACKING-PROCESS.OMITTED');
|
||||
default: return '';
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationInAppTrackingString(value: NotificationInAppTracking): string {
|
||||
switch (value) {
|
||||
case NotificationInAppTracking.Delivered: return this.language.instant('TYPES.NOTIFICATION-INAPP-TRACKING.DELIVERED');
|
||||
case NotificationInAppTracking.Stored: return this.language.instant('TYPES.NOTIFICATION-INAPP-TRACKING.STORED');
|
||||
case NotificationInAppTracking.Delivered: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-INAPP-TRACKING.DELIVERED');
|
||||
case NotificationInAppTracking.Stored: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-INAPP-TRACKING.STORED');
|
||||
default: return '';
|
||||
}
|
||||
}
|
||||
|
@ -99,6 +101,8 @@ export class NotificationServiceEnumUtils extends BaseEnumUtilsService {
|
|||
public toNotificationChannelString(value: NotificationTemplateChannel): string {
|
||||
switch (value) {
|
||||
case NotificationTemplateChannel.Email: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TEMPLATE-CHANNEL.EMAIL');
|
||||
case NotificationTemplateChannel.SlackBroadcast: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TEMPLATE-CHANNEL.SLACK-BROADCAST');
|
||||
case NotificationTemplateChannel.Sms: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TEMPLATE-CHANNEL.SMS');
|
||||
case NotificationTemplateChannel.InApp: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TEMPLATE-CHANNEL.IN-APP');
|
||||
default: return '';
|
||||
}
|
||||
|
@ -106,43 +110,11 @@ export class NotificationServiceEnumUtils extends BaseEnumUtilsService {
|
|||
|
||||
public toNotificationTemplateKindString(value: NotificationTemplateKind): string {
|
||||
switch (value) {
|
||||
case NotificationTemplateKind.Draft: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-KIND.DRAFT');
|
||||
case NotificationTemplateKind.Secondary: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-KIND.SECONDARY');
|
||||
case NotificationTemplateKind.Primary: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-KIND.PRIMARY');
|
||||
case NotificationTemplateKind.Default: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-KIND.DEFAULT');
|
||||
case NotificationTemplateKind.Default: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TEMPLATE-KIND.DEFAULT');
|
||||
case NotificationTemplateKind.Primary: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TEMPLATE-KIND.PRIMARY');
|
||||
case NotificationTemplateKind.Secondary: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TEMPLATE-KIND.SECONDARY');
|
||||
case NotificationTemplateKind.Draft: return this.language.instant('NOTIFICATION-SERVICE.TYPES.NOTIFICATION-TEMPLATE-KIND.DRAFT');
|
||||
default: return '';
|
||||
}
|
||||
}
|
||||
|
||||
toNotificationTemplateChannelString(status: NotificationTemplateChannel): string {
|
||||
switch (status) {
|
||||
case NotificationTemplateChannel.Email: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-CHANNEL.EMAIL');
|
||||
case NotificationTemplateChannel.InApp: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-CHANNEL.INAPP');
|
||||
}
|
||||
}
|
||||
|
||||
toNotificationTemplateDataTypeString(status: NotificationDataType): string {
|
||||
switch (status) {
|
||||
case NotificationDataType.Integer: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.INTEGER');
|
||||
case NotificationDataType.Demical: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.DEMICAL');
|
||||
case NotificationDataType.Double: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.DOUBLE');
|
||||
case NotificationDataType.DateTime: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.DATE-TIME');
|
||||
case NotificationDataType.String: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-DATA-TYPE.STRING');
|
||||
}
|
||||
}
|
||||
|
||||
toEmailOverrideModeString(status: EmailOverrideMode): string {
|
||||
switch (status) {
|
||||
case EmailOverrideMode.NotOverride: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-EMAIL-OVERRIDE-MODE.NOT');
|
||||
case EmailOverrideMode.Additive: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-EMAIL-OVERRIDE-MODE.ADDITIVE');
|
||||
case EmailOverrideMode.Replace: return this.language.instant('TYPES.NOTIFICATION-TEMPLATE-EMAIL-OVERRIDE-MODE.REPLACE');
|
||||
}
|
||||
}
|
||||
|
||||
public toNotificationContactTypeString(value: NotificationContactType): string {
|
||||
switch (value) {
|
||||
case NotificationContactType.EMAIL: return this.language.instant('TYPES.NOTIFICATION-CONTACT-TYPE.EMAIL');
|
||||
case NotificationContactType.IN_APP: return this.language.instant('TYPES.NOTIFICATION-CONTACT-TYPE.INAPP');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonFormattingModule } from '@common/formatting/common-formatting.module';
|
||||
import { PipeService } from '@common/formatting/pipe.service';
|
||||
import { IsActiveTypePipe } from '@notification-service/core/formatting/pipes/is-active-type.pipe';
|
||||
import { NotificationInAppTrackingTypePipe } from '@notification-service/core/formatting/pipes/notification-inapp-tracking-type.pipe';
|
||||
import { NotificationServiceEnumUtils } from './enum-utils.service';
|
||||
|
||||
//
|
||||
//
|
||||
|
@ -12,7 +12,7 @@ import { NotificationServiceEnumUtils } from './enum-utils.service';
|
|||
//
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonFormattingModule,
|
||||
CommonFormattingModule
|
||||
],
|
||||
declarations: [
|
||||
IsActiveTypePipe,
|
||||
|
@ -21,13 +21,13 @@ import { NotificationServiceEnumUtils } from './enum-utils.service';
|
|||
exports: [
|
||||
CommonFormattingModule,
|
||||
IsActiveTypePipe,
|
||||
NotificationInAppTrackingTypePipe,
|
||||
NotificationInAppTrackingTypePipe
|
||||
],
|
||||
providers: [
|
||||
PipeService,
|
||||
DatePipe,
|
||||
IsActiveTypePipe,
|
||||
NotificationInAppTrackingTypePipe,
|
||||
NotificationServiceEnumUtils
|
||||
NotificationInAppTrackingTypePipe
|
||||
]
|
||||
})
|
||||
export class NotificationServiceFormattingModule { }
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { User } from '@app/core/model/user/user';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { NotificationInAppTracking } from '@notification-service/core/enum/notification-inapp-tracking.enum';
|
||||
import { NotificationServiceUser } from '@notification-service/core/model/user.model';
|
||||
|
||||
export interface InAppNotification {
|
||||
id: Guid;
|
||||
user: User;
|
||||
user: NotificationServiceUser;
|
||||
isActive: IsActive;
|
||||
type: Guid;
|
||||
trackingState: NotificationInAppTracking;
|
||||
|
|
|
@ -3,87 +3,46 @@ import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
|||
import { NotificationTemplateChannel } from '@notification-service/core/enum/notification-template-channel.enum';
|
||||
import { NotificationTemplateKind } from '@notification-service/core/enum/notification-template-kind.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { EmailOverrideMode } from '../enum/email-override-mode';
|
||||
import { NotificationDataType } from '../enum/notification-data-type';
|
||||
|
||||
export interface NotificationTemplate {
|
||||
id?: Guid;
|
||||
id: Guid;
|
||||
channel: NotificationTemplateChannel;
|
||||
notificationType: NotificationType;
|
||||
kind: NotificationTemplateKind;
|
||||
languageCode: string;
|
||||
language: string;
|
||||
description: string;
|
||||
value: NotificationTemplateValue;
|
||||
isActive?: IsActive;
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
hash?: string;
|
||||
belongsToCurrentTenant?: boolean;
|
||||
isActive: IsActive;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
hash: string;
|
||||
}
|
||||
|
||||
export interface NotificationTemplateValue {
|
||||
subjectText: string;
|
||||
subjectKey: string;
|
||||
subjectFieldOptions: NotificationFieldOptions;
|
||||
bodyText: string;
|
||||
bodyKey: string;
|
||||
priorityKey: string;
|
||||
allowAttachments: Boolean;
|
||||
cc: string[];
|
||||
ccMode: EmailOverrideMode;
|
||||
bcc: string[];
|
||||
bccMode: EmailOverrideMode;
|
||||
extraDataKeys: string[];
|
||||
bodyFieldOptions: NotificationFieldOptions;
|
||||
}
|
||||
|
||||
export interface NotificationFieldOptions {
|
||||
mandatory?: string[];
|
||||
optional?: NotificationFieldInfo[];
|
||||
options?: NotificationFieldInfo[];
|
||||
formatting?: { [key: string]: string };
|
||||
}
|
||||
|
||||
export interface NotificationFieldInfo {
|
||||
key: string;
|
||||
type: NotificationDataType,
|
||||
value: string;
|
||||
}
|
||||
|
||||
// Persist
|
||||
|
||||
export interface NotificationTemplatePersist {
|
||||
id?: Guid;
|
||||
channel: NotificationTemplateChannel;
|
||||
notificationType: NotificationType;
|
||||
kind: NotificationTemplateKind;
|
||||
languageCode: string;
|
||||
value: NotificationTemplateValuePersist;
|
||||
language: string;
|
||||
description: string;
|
||||
value: NotificationTemplateValue;
|
||||
hash?: string;
|
||||
}
|
||||
|
||||
export interface NotificationTemplateValuePersist {
|
||||
subjectText: string;
|
||||
subjectKey: string;
|
||||
subjectFieldOptions: NotificationFieldOptionsPersist;
|
||||
bodyText: string;
|
||||
bodyKey: string;
|
||||
priorityKey: string;
|
||||
allowAttachments: Boolean;
|
||||
cc: string[];
|
||||
ccMode: EmailOverrideMode;
|
||||
bcc: string[];
|
||||
bccMode: EmailOverrideMode;
|
||||
extraDataKeys: string[];
|
||||
bodyFieldOptions: NotificationFieldOptionsPersist;
|
||||
}
|
||||
|
||||
export interface NotificationFieldOptionsPersist {
|
||||
mandatory?: string[];
|
||||
optional?: NotificationFieldInfoPersist[];
|
||||
formatting?: { [key: string]: string };
|
||||
}
|
||||
|
||||
export interface NotificationFieldInfoPersist {
|
||||
key: string;
|
||||
type: NotificationDataType,
|
||||
value: string;
|
||||
}
|
||||
|
|
|
@ -1,29 +1,30 @@
|
|||
import { User } from '@app/core/model/user/user';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { ContactType } from '@notification-service/core/enum/contact-type.enum';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { NotificationNotifyState } from '@notification-service/core/enum/notification-notify-state.enum';
|
||||
import { NotificationTrackingProcess } from '@notification-service/core/enum/notification-tracking-process.enum';
|
||||
import { NotificationTrackingState } from '@notification-service/core/enum/notification-tracking-state.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { NotificationContactType } from '../enum/notification-contact-type';
|
||||
import { NotificationServiceUser } from '@notification-service/core/model/user.model';
|
||||
|
||||
export interface Notification {
|
||||
id?: Guid;
|
||||
user: User;
|
||||
id: Guid;
|
||||
user: NotificationServiceUser;
|
||||
isActive: IsActive;
|
||||
type: NotificationType;
|
||||
contactTypeHint: NotificationContactType;
|
||||
contactType: ContactType;
|
||||
contactHint: string;
|
||||
data: string;
|
||||
notifyState: NotificationNotifyState;
|
||||
notifiedWith: NotificationContactType;
|
||||
notifiedWith: ContactType;
|
||||
notifiedAt: Date;
|
||||
retryCount: number;
|
||||
trackingState: NotificationTrackingState;
|
||||
trackingProcess: NotificationTrackingProcess;
|
||||
trackingData: string;
|
||||
isActive?: IsActive;
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
hash?: string;
|
||||
belongsToCurrentTenant?: boolean;
|
||||
provenanceType: NotificationType;
|
||||
provenanceRef: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
hash: string;
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
import { NotificationContactType } from '@notification-service/core/enum/notification-contact-type';
|
||||
|
||||
export interface NotifierListConfigurationDataContainer {
|
||||
notifiers: { [key: string]: NotificationContactType[] };
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
import { Guid } from '@common/types/guid';
|
||||
import { ContactType } from '@notification-service/core/enum/contact-type.enum';
|
||||
import { TenantConfigurationType } from '@notification-service/core/enum/tenant-configuration-type.enum';
|
||||
|
||||
export interface TenantConfiguration {
|
||||
id?: Guid;
|
||||
type: TenantConfigurationType;
|
||||
value: string;
|
||||
slackBroadcastData: SlackBroadcastDataContainer;
|
||||
emailClientData: EmailClientConfigurationDataContainer;
|
||||
smsClientData: SmsClientConfigurationDataContainer;
|
||||
notifierListData: NotifierListConfigurationDataContainer;
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
hash: string;
|
||||
}
|
||||
|
||||
//
|
||||
// Slack Broadcast
|
||||
//
|
||||
export interface SlackBroadcastDataContainer {
|
||||
webhooks: SlackBroadcastWebhookInfo[];
|
||||
}
|
||||
|
||||
export interface TenantConfigurationSlackBroadcastPersist {
|
||||
id?: Guid;
|
||||
hash?: string;
|
||||
webhooks: SlackBroadcastWebhookInfo[];
|
||||
}
|
||||
|
||||
export interface SlackBroadcastWebhookInfo {
|
||||
id: Guid;
|
||||
name: string;
|
||||
webhook: string;
|
||||
}
|
||||
|
||||
//
|
||||
// Email Client Configuration
|
||||
//
|
||||
export interface EmailClientConfigurationDataContainer {
|
||||
requiresCredentials: boolean;
|
||||
enableSSL: boolean;
|
||||
hostServer: string;
|
||||
hostPortNo: number;
|
||||
emailAddress: string;
|
||||
emailUsername: string;
|
||||
emailPassword: string;
|
||||
}
|
||||
|
||||
export interface TenantConfigurationEmailClientPersist {
|
||||
id?: Guid;
|
||||
hash?: string;
|
||||
requiresCredentials: boolean;
|
||||
enableSSL: boolean;
|
||||
hostServer: string;
|
||||
hostPortNo: number;
|
||||
emailAddress: string;
|
||||
emailUsername: string;
|
||||
emailPassword: string;
|
||||
}
|
||||
|
||||
//
|
||||
// Sms Client
|
||||
//
|
||||
export interface SmsClientConfigurationDataContainer {
|
||||
applicationId: string;
|
||||
applicationSecret: string;
|
||||
sendAsName: string;
|
||||
}
|
||||
|
||||
export interface TenantConfigurationSmsClientPersist {
|
||||
id?: Guid;
|
||||
hash?: string;
|
||||
applicationId: string;
|
||||
applicationSecret: string;
|
||||
sendAsName: string;
|
||||
}
|
||||
|
||||
//
|
||||
// Notifier List
|
||||
//
|
||||
export interface NotifierListConfigurationDataContainer {
|
||||
notifiers: { [key: string]: ContactType[] };
|
||||
}
|
||||
|
||||
export interface TenantConfigurationNotifierListPersist {
|
||||
id?: Guid;
|
||||
hash?: string;
|
||||
notifiers: { [key: string]: ContactType[] };
|
||||
}
|
||||
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
import { Guid } from '@common/types/guid';
|
||||
import { ContactType } from '@notification-service/core/enum/contact-type.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { NotificationContactType } from '../enum/notification-contact-type';
|
||||
|
||||
export interface UserNotificationPreference {
|
||||
userId?: Guid;
|
||||
type: NotificationType;
|
||||
channel: NotificationContactType;
|
||||
channel: ContactType;
|
||||
ordinal: number;
|
||||
createdAt?: Date;
|
||||
}
|
||||
|
||||
export interface UserNotificationPreferencePersist {
|
||||
userId?: Guid;
|
||||
notificationPreferences: { [key: string]: NotificationContactType[] };
|
||||
notificationPreferences: { [key: string]: ContactType[] };
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
import { Guid } from '@common/types/guid';
|
||||
import { ContactInfoType } from '@notification-service/core/enum/contact-info-type.enum';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
|
||||
export interface NotificationServiceUser {
|
||||
id: Guid;
|
||||
isActive?: IsActive;
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
hash: string;
|
||||
contacts: NotificationServiceContactInfo[];
|
||||
profile: NotificationServiceUserProfile;
|
||||
}
|
||||
|
||||
export interface NotificationServiceContactInfo {
|
||||
id: Guid;
|
||||
user: NotificationServiceUser;
|
||||
type?: ContactInfoType;
|
||||
isActive?: IsActive;
|
||||
value: string;
|
||||
ordinal: number;
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
hash: string;
|
||||
}
|
||||
|
||||
export interface NotificationServiceUserProfile {
|
||||
id: Guid;
|
||||
timezone: string;
|
||||
culture?: string;
|
||||
language: string;
|
||||
createdAt?: Date;
|
||||
updatedAt?: Date;
|
||||
hash: string;
|
||||
users: NotificationServiceUser[];
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
import { Lookup } from '@common/model/lookup';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { IsActive } from '@notification-service/core/enum/is-active.enum';
|
||||
import { TenantConfigurationType } from '@notification-service/core/enum/tenant-configuration-type.enum';
|
||||
|
||||
export class TenantConfigurationLookup extends Lookup implements TenantConfigurationFilter {
|
||||
ids?: Guid[];
|
||||
excludedIds?: Guid[];
|
||||
isActive?: IsActive[];
|
||||
type?: TenantConfigurationType[];
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
export interface TenantConfigurationFilter {
|
||||
ids?: Guid[];
|
||||
excludedIds?: Guid[];
|
||||
isActive?: IsActive[];
|
||||
type?: TenantConfigurationType[];
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
import { Lookup } from '@common/model/lookup';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { ContactType } from '@notification-service/core/enum/contact-type.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { NotificationContactType } from '../enum/notification-contact-type';
|
||||
|
||||
export class UserNotificationPreferenceLookup extends Lookup implements UserNotificationPreferenceFilter {
|
||||
userIds?: Guid[];
|
||||
type?: NotificationType[];
|
||||
channel?: NotificationContactType[];
|
||||
channel?: ContactType[];
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
@ -16,5 +16,5 @@ export class UserNotificationPreferenceLookup extends Lookup implements UserNoti
|
|||
export interface UserNotificationPreferenceFilter {
|
||||
userIds?: Guid[];
|
||||
type?: NotificationType[];
|
||||
channel?: NotificationContactType[];
|
||||
channel?: ContactType[];
|
||||
}
|
||||
|
|
|
@ -7,9 +7,6 @@ import { LoggingService } from '@app/core/services/logging/logging-service';
|
|||
import { FilterService } from '@common/modules/text-filter/filter-service';
|
||||
import { PrincipalService } from '@app/core/services/http/principal.service';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { InAppNotificationService } from './http/inapp-notification.service';
|
||||
import { NotificationService } from './http/notification-service';
|
||||
import { NotificationTemplateService } from './http/notification-template.service';
|
||||
|
||||
//
|
||||
//
|
||||
|
@ -35,9 +32,6 @@ export class CoreNotificationServiceModule {
|
|||
FilterService,
|
||||
LoggingService,
|
||||
PrincipalService,
|
||||
NotificationService,
|
||||
InAppNotificationService,
|
||||
NotificationTemplateService,
|
||||
UserNotificationPreferenceService
|
||||
],
|
||||
};
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
import { HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { BaseHttpV2Service } from '@app/core/services/http/base-http-v2.service';
|
||||
import { QueryResult } from '@common/model/query-result';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { NotifierListConfigurationDataContainer } from '@notification-service/core/model/tenant-configuration.model';
|
||||
import { UserNotificationPreference, UserNotificationPreferencePersist } from '@notification-service/core/model/user-notification-preference.model';
|
||||
import { NotifierListLookup } from '@notification-service/core/query/notifier-list.lookup';
|
||||
import { UserNotificationPreferenceLookup } from '@notification-service/core/query/user-notification-preference.lookup';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { NotifierListLookup } from '@notification-service/core/query/notifier-list.lookup';
|
||||
import { NotifierListConfigurationDataContainer } from '@notification-service/core/model/notifier-configuration.model';
|
||||
import { UserNotificationPreference, UserNotificationPreferencePersist } from '@notification-service/core/model/user-notification-preference.model';
|
||||
import { BaseHttpV2Service } from '@app/core/services/http/base-http-v2.service';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
|
||||
@Injectable()
|
||||
export class UserNotificationPreferenceService {
|
||||
|
@ -18,6 +21,13 @@ export class UserNotificationPreferenceService {
|
|||
private http: BaseHttpV2Service
|
||||
) { }
|
||||
|
||||
query(q: UserNotificationPreferenceLookup): Observable<QueryResult<UserNotificationPreference>> {
|
||||
const url = `${this.apiBase}/query`;
|
||||
return this.http
|
||||
.post<QueryResult<UserNotificationPreference>>(url, q).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
}
|
||||
|
||||
current(id: Guid, reqFields: string[] = []): Observable<UserNotificationPreference[]> {
|
||||
const url = `${this.apiBase}/user/${id}/current`;
|
||||
const options = { params: { f: reqFields } };
|
||||
|
@ -37,9 +47,11 @@ export class UserNotificationPreferenceService {
|
|||
|
||||
persist(item: UserNotificationPreferencePersist, totp?: string): Observable<UserNotificationPreference> {
|
||||
const url = `${this.apiBase}/persist`;
|
||||
let headers = new HttpHeaders();
|
||||
// if (totp) { headers = headers.set(this.configurationService.authTotpHeader, totp); }
|
||||
|
||||
return this.http
|
||||
.post<UserNotificationPreference>(url, item).pipe(
|
||||
.post<UserNotificationPreference>(url, item, headers ? { headers: headers } : undefined).pipe(
|
||||
catchError((error: any) => throwError(error)));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
// ::ng-deep.mat-mdc-menu-panel {
|
||||
// max-width: 100% !important;
|
||||
// height: 100% !important;
|
||||
// }
|
||||
|
||||
// :host::ng-deep.mat-mdc-menu-content:not(:empty) {
|
||||
// padding-top: 0 !important;
|
||||
// }
|
||||
|
||||
|
||||
.filter-button{
|
||||
padding-top: .6rem;
|
||||
padding-bottom: .6rem;
|
||||
// .mat-icon{
|
||||
// font-size: 1.5em;
|
||||
// width: 1.2em;
|
||||
// height: 1.2em;
|
||||
// }
|
||||
}
|
||||
|
||||
|
|
@ -8,15 +8,17 @@ import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/serv
|
|||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { FormService } from '@common/forms/form-service';
|
||||
import { HttpError, HttpErrorHandlingService } from '@common/modules/errors/error-handling/http-error-handling.service';
|
||||
// import { TotpService } from '@idp-service/ui/totp/totp.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { NotificationContactType } from '@notification-service/core/enum/notification-contact-type';
|
||||
import { ContactType } from '@notification-service/core/enum/contact-type.enum';
|
||||
import { NotificationTrackingProcess } from '@notification-service/core/enum/notification-tracking-process.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { NotificationServiceEnumUtils } from '@notification-service/core/formatting/enum-utils.service';
|
||||
import { UserNotificationPreference } from '@notification-service/core/model/user-notification-preference.model';
|
||||
import { NotifierListLookup } from '@notification-service/core/query/notifier-list.lookup';
|
||||
import { UserNotificationPreferenceService } from '@notification-service/services/http/user-notification-preference.service';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { UserProfileNotifierListEditorModel } from '@notification-service/ui/user-profile/notifier-list/user-profile-notifier-list-editor.model';
|
||||
import { delay, takeUntil } from 'rxjs/operators';
|
||||
import { nameof } from 'ts-simple-nameof';
|
||||
|
||||
@Component({
|
||||
|
@ -26,10 +28,12 @@ import { nameof } from 'ts-simple-nameof';
|
|||
})
|
||||
export class UserProfileNotifierListEditorComponent extends BaseComponent implements OnInit {
|
||||
|
||||
availableNotifiers: { [key: string]: NotificationContactType[] } = {};
|
||||
formGroup: FormGroup;
|
||||
editorModel: UserProfileNotifierListEditorModel;
|
||||
availableNotifiers: { [key: string]: ContactType[] } = {};
|
||||
availableNotifiersKeys: NotificationType[];
|
||||
|
||||
notificationTrackingProcess: NotificationTrackingProcess = NotificationTrackingProcess.PENDING;
|
||||
notificationTrackingProcess: NotificationTrackingProcess = NotificationTrackingProcess.Pending;
|
||||
|
||||
constructor(
|
||||
private userNotificationPreferenceService: UserNotificationPreferenceService,
|
||||
|
@ -50,6 +54,7 @@ export class UserProfileNotifierListEditorComponent extends BaseComponent implem
|
|||
}
|
||||
|
||||
getConfiguration() {
|
||||
this.formGroup = null;
|
||||
this.userNotificationPreferenceService.getNotifierList(new NotifierListLookup())
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
|
@ -59,7 +64,7 @@ export class UserProfileNotifierListEditorComponent extends BaseComponent implem
|
|||
this.availableNotifiersKeys = Object.keys(this.availableNotifiers) as NotificationType[];
|
||||
this.getExistingSelections();
|
||||
} catch {
|
||||
this.notificationTrackingProcess = NotificationTrackingProcess.ERROR;
|
||||
this.notificationTrackingProcess = NotificationTrackingProcess.Error;
|
||||
this.logger.error('Could not parse Dataset: ' + data);
|
||||
this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error);
|
||||
}
|
||||
|
@ -81,9 +86,9 @@ export class UserProfileNotifierListEditorComponent extends BaseComponent implem
|
|||
if (data.length > 0) {
|
||||
this.orderAvailableItemsbasedOnExistingSelections(data);
|
||||
}
|
||||
this.notificationTrackingProcess = NotificationTrackingProcess.SUCCESSFUL;
|
||||
this.notificationTrackingProcess = NotificationTrackingProcess.Completed;
|
||||
} catch {
|
||||
this.notificationTrackingProcess = NotificationTrackingProcess.ERROR;
|
||||
this.notificationTrackingProcess = NotificationTrackingProcess.Error;
|
||||
this.logger.error('Could not parse Dataset: ' + data);
|
||||
this.uiNotificationService.snackBarNotification(this.language.instant('COMMONS.ERRORS.DEFAULT'), SnackBarNotificationLevel.Error);
|
||||
}
|
||||
|
@ -123,7 +128,7 @@ export class UserProfileNotifierListEditorComponent extends BaseComponent implem
|
|||
}
|
||||
|
||||
onCallbackError(errorResponse: HttpErrorResponse) {
|
||||
this.notificationTrackingProcess = NotificationTrackingProcess.ERROR;
|
||||
this.notificationTrackingProcess = NotificationTrackingProcess.Error;
|
||||
|
||||
const error: HttpError = this.httpErrorHandlingService.getError(errorResponse);
|
||||
if (error.statusCode === 400) {
|
||||
|
@ -132,17 +137,22 @@ export class UserProfileNotifierListEditorComponent extends BaseComponent implem
|
|||
}
|
||||
}
|
||||
|
||||
clearErrorModel() {
|
||||
this.editorModel.validationErrorModel.clear();
|
||||
this.formService.validateAllFormFields(this.formGroup);
|
||||
}
|
||||
|
||||
dropped(event: CdkDragDrop<string[]>, type: NotificationType) {
|
||||
moveItemInArray(this.availableNotifiers[type], event.previousIndex, event.currentIndex);
|
||||
}
|
||||
|
||||
preferencesNotPending(): boolean {
|
||||
return ! (this.notificationTrackingProcess === NotificationTrackingProcess.PENDING);
|
||||
return ! (this.notificationTrackingProcess === NotificationTrackingProcess.Pending);
|
||||
}
|
||||
preferencesNotCompleted(): boolean {
|
||||
return ! (this.notificationTrackingProcess === NotificationTrackingProcess.SUCCESSFUL);
|
||||
return ! (this.notificationTrackingProcess === NotificationTrackingProcess.Completed);
|
||||
}
|
||||
preferencesNotWithErrors(): boolean {
|
||||
return ! (this.notificationTrackingProcess === NotificationTrackingProcess.ERROR);
|
||||
return ! (this.notificationTrackingProcess === NotificationTrackingProcess.Error);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
|
||||
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
|
||||
import { Validation, ValidationContext } from '@common/forms/validation/validation-context';
|
||||
import { Guid } from '@common/types/guid';
|
||||
import { ContactType } from '@notification-service/core/enum/contact-type.enum';
|
||||
import { NotificationType } from '@notification-service/core/enum/notification-type.enum';
|
||||
import { UserNotificationPreferencePersist } from '@notification-service/core/model/user-notification-preference.model';
|
||||
|
||||
export class UserProfileNotifierListEditorModel implements UserNotificationPreferencePersist {
|
||||
userId?: Guid;
|
||||
notificationPreferences: { [key: string]: ContactType[] };
|
||||
|
||||
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel();
|
||||
protected formBuilder: FormBuilder = new FormBuilder();
|
||||
|
||||
constructor() { }
|
||||
|
||||
public fromModel(userId: Guid, notificationPreferences: { [key: string]: ContactType[] }): UserProfileNotifierListEditorModel {
|
||||
this.userId = userId;
|
||||
this.notificationPreferences = notificationPreferences;
|
||||
return this;
|
||||
}
|
||||
|
||||
buildForm(context: ValidationContext = null, disabled: boolean = false, availableNotificationTypes: NotificationType[]): FormGroup {
|
||||
if (context == null) { context = this.createValidationContext(); }
|
||||
|
||||
const notificationPreferencesFormGroup = this.formBuilder.group({});
|
||||
availableNotificationTypes.forEach(type => {
|
||||
notificationPreferencesFormGroup.addControl(type, new FormControl(this.notificationPreferences ? this.notificationPreferences[type] : undefined));
|
||||
});
|
||||
|
||||
return this.formBuilder.group({
|
||||
userId: [{ value: this.userId, disabled: disabled }, context.getValidation('userId').validators],
|
||||
notificationPreferences: notificationPreferencesFormGroup,
|
||||
});
|
||||
}
|
||||
|
||||
createValidationContext(): ValidationContext {
|
||||
const baseContext: ValidationContext = new ValidationContext();
|
||||
const baseValidationArray: Validation[] = new Array<Validation>();
|
||||
|
||||
baseValidationArray.push({ key: 'userId', validators: [BackendErrorValidator(this.validationErrorModel, 'UserId')] });
|
||||
|
||||
baseContext.validation = baseValidationArray;
|
||||
return baseContext;
|
||||
}
|
||||
}
|
|
@ -11,6 +11,8 @@ import { UserProfileNotifierListEditorComponent } from '@notification-service/ui
|
|||
CommonUiModule,
|
||||
CommonFormsModule,
|
||||
DragDropModule,
|
||||
CoreNotificationServiceModule.forRoot(),
|
||||
// TotpModule,
|
||||
],
|
||||
declarations: [
|
||||
UserProfileNotifierListEditorComponent
|
||||
|
|
Loading…
Reference in New Issue