Skip to content

Commit

Permalink
Merge branch 'release/3.807.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
vc-ci committed Jun 4, 2024
2 parents ad0fd4e + 7d0a503 commit 9eaa384
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<!-- These properties will be shared for all projects -->
<PropertyGroup>
<VersionPrefix>3.806.0</VersionPrefix>
<VersionPrefix>3.807.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ namespace VirtoCommerce.NotificationsModule.Core.Model
//The special type for handle cases when the system have stored the notification objects with unregistered types.
public class UnregisteredNotification : Notification
{
public UnregisteredNotification(string type) : base(type)
{

}

public UnregisteredNotification() : base(nameof(UnregisteredNotification))
{
Templates = new List<NotificationTemplate>();
}
public override string Kind => "undef";


public override void SetFromToMembers(string from, string to)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ public NotificationBuilder OverrideNotificationType<TOldNotificationType, TNewNo

return builder;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private static Notification ToModel(NotificationEntity entity)
entity.ToModel(result);
}

return result ?? new UnregisteredNotification();
return result ?? new UnregisteredNotification(typeName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
"dialogs": {
"unknown-kind": {
"title": "Error",
"message": "Unable to edit template of an unknown type: '{{kind}}'."
"message": "Unable to open '{{type}}' notification. Please contact your Site Administrator(s) for information."
},
"notification-details-save": {
"title": "Save changes",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
"dialogs": {
"unknown-kind": {
"title": "Ошибка",
"message": "Невозможно изменить шаблон неопределенного типа:: '{{kind}}'."
"message": "Невозможно открыть уведомление '{{type}}'. Обратитесь к администратору(ам) вашего сайта за информацией."
},
"notification-details-save": {
"title": "Сохранить изменения",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ angular.module('virtoCommerce.notificationsModule')
return _.toArray(templatesToDisplay);
}

function resolveType(kind) {
function resolveType(kind, type) {
var foundTemplate = notificationTemplatesResolverService.resolve(kind);
if (foundTemplate && foundTemplate.knownChildrenTypes && foundTemplate.knownChildrenTypes.length) {
return foundTemplate;
Expand All @@ -49,13 +49,14 @@ angular.module('virtoCommerce.notificationsModule')
id: "error",
title: "notifications.dialogs.unknown-kind.title",
message: "notifications.dialogs.unknown-kind.message",
messageValues: { kind: kind },
messageValues: { kind: kind, type: type },
});
return null;
}
}

blade.openTemplate = function (template) {
var foundTemplate = resolveType(blade.currentEntity.kind);
var foundTemplate = resolveType(blade.currentEntity.kind, blade.currentEntity.type);
if (foundTemplate) {
var newBlade = {
id: foundTemplate.detailBlade.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ angular.module('virtoCommerce.notificationsModule')
});
}

function resolveType(kind) {
function resolveType(kind, type) {
var foundNotification = notificationTypesResolverService.resolve(kind);
if (foundNotification && foundNotification.knownChildrenTypes && foundNotification.knownChildrenTypes.length) {
return foundNotification;
Expand All @@ -58,14 +58,15 @@ angular.module('virtoCommerce.notificationsModule')
id: "error",
title: "notifications.dialogs.unknown-kind.title",
message: "notifications.dialogs.unknown-kind.message",
messageValues: { kind: kind },
});
messageValues: { kind: kind, type: type },
});
return null;
}
}

if (authService.checkPermission('notifications:access')) {
blade.editNotification = function (item) {
var foundNotification = resolveType(item.kind);
var foundNotification = resolveType(item.kind, item.type);
var newBlade = {
id: 'editNotification',
title: 'notifications.blades.notification-details.title',
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.NotificationsModule.Web/module.manifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<id>VirtoCommerce.Notifications</id>
<version>3.806.0</version>
<version>3.807.0</version>
<version-tag />
<platformVersion>3.825.0</platformVersion>
<dependencies>
Expand Down

0 comments on commit 9eaa384

Please sign in to comment.