diff --git a/core/app/core/src/lib/common/types/messages.ts b/core/app/core/src/lib/common/types/messages.ts
index cf016dab2..f9058d0d9 100644
--- a/core/app/core/src/lib/common/types/messages.ts
+++ b/core/app/core/src/lib/common/types/messages.ts
@@ -29,6 +29,7 @@ export interface Message {
type: MessageTypes;
text?: string;
labelKey?: string;
+ defaultText?: string;
}
export enum MessageTypes {
diff --git a/core/app/core/src/lib/components/message/message.component.html b/core/app/core/src/lib/components/message/message.component.html
index 82e26b170..0244707f1 100644
--- a/core/app/core/src/lib/components/message/message.component.html
+++ b/core/app/core/src/lib/components/message/message.component.html
@@ -33,7 +33,7 @@
class="message {{ message.type }} alert-dismissible fade show shadow"
[@fade]
role="alert">
- {{appStrings[message.labelKey] || message.labelKey || ''}}
+ {{appStrings[message?.labelKey] || message?.defaultText || message?.labelKey || ''}}
{{message.text}}
×
diff --git a/core/app/core/src/lib/services/message/message.service.ts b/core/app/core/src/lib/services/message/message.service.ts
index 1a3740eb2..b22878f17 100644
--- a/core/app/core/src/lib/services/message/message.service.ts
+++ b/core/app/core/src/lib/services/message/message.service.ts
@@ -109,11 +109,17 @@ export class MessageService {
});
}
- addSuccessMessageByKey(labelKey: string): number {
- return this.addMessage({
+ addSuccessMessageByKey(labelKey: string, defaultText:string = null): number {
+ const message = {
type: MessageTypes.success,
labelKey
- });
+ } as Message;
+
+ if (defaultText) {
+ message.defaultText = defaultText;
+ }
+
+ return this.addMessage(message);
}
addDangerMessage(text: string): number {
@@ -123,11 +129,18 @@ export class MessageService {
});
}
- addDangerMessageByKey(labelKey: string): number {
- return this.addMessage({
+ addDangerMessageByKey(labelKey: string, defaultText: string = null): number {
+
+ const message = {
type: MessageTypes.danger,
labelKey
- });
+ } as Message;
+
+ if (defaultText) {
+ message.defaultText = defaultText;
+ }
+
+ return this.addMessage(message);
}
addWarningMessage(text: string): number {
@@ -137,11 +150,17 @@ export class MessageService {
});
}
- addWarningMessageByKey(labelKey: string): number {
- return this.addMessage({
+ addWarningMessageByKey(labelKey: string, defaultText: string = null): number {
+ const message = {
type: MessageTypes.warning,
labelKey
- });
+ } as Message;
+
+ if (defaultText) {
+ message.defaultText = defaultText;
+ }
+
+ return this.addMessage(message);
}
addInfoMessage(text: string): number {