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OAAOA,EAAS0N,cAAgB,IAAM,IAAGV,OAC7G,IAEA/J,EAAMgT,cAAgB,WAClB,IAAI7J,EAAW,CACXvM,GAAI,mCACJC,MAAO,iEACPmO,YAAa,CAAEC,YAAanL,EAAWoL,QAAQ,qBAAuBlL,EAAME,cAAcd,KAAO,iBACjGqD,SAAUzC,EAAME,cAAcuC,SAC9BC,WAAY1C,EAAME,cAAcwC,WAChCxC,cAAeF,EAAME,cACrBpD,SAAU,oEACVN,WAAY,wEACZO,SAAU,8FAEdL,EAAuBC,UAAUwM,EAAUnJ,EAC/C,CACJ,G","sources":["webpack://VirtoCommerce.Notifications/./Scripts/notifications.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/filter-detail.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notification-details.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notification-journal-details.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notification-layout-details.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notification-layouts-list.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notification-templates-list.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notifications-edit-template.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notifications-journal.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notifications-list.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notifications-menu.js","webpack://VirtoCommerce.Notifications/./Scripts/blades/notifications-template-render.js","webpack://VirtoCommerce.Notifications/./Scripts/directives/itemSearch.js","webpack://VirtoCommerce.Notifications/./Scripts/resources/notificationsModuleApi.js","webpack://VirtoCommerce.Notifications/./Scripts/services/notificationTypesResolver.js","webpack://VirtoCommerce.Notifications/./Scripts/widgets/notificationsAttachmentsWidget.js","webpack://VirtoCommerce.Notifications/./Scripts/widgets/notificationsLogWidget.js","webpack://VirtoCommerce.Notifications/./Scripts/widgets/notificationsTemplatesWidget.js"],"sourcesContent":["//Call this to register our module to main application\r\nvar moduleTemplateName = \"virtoCommerce.notificationsModule\";\r\n\r\nif (AppDependencies !== undefined) {\r\n AppDependencies.push(moduleTemplateName);\r\n}\r\n\r\nangular.module(moduleTemplateName, ['textAngular'])\r\n .config(['$stateProvider', '$urlRouterProvider',\r\n function ($stateProvider, $urlRouterProvider) {\r\n $stateProvider\r\n .state('workspace.notificationsModule', {\r\n url: '/notifications?objectId&objectTypeId',\r\n templateUrl: '$(Platform)/Scripts/common/templates/home.tpl.html',\r\n controller: ['$scope', 'platformWebApp.bladeNavigationService', function ($scope, bladeNavigationService) {\r\n var blade = {\r\n id: 'notifications',\r\n title: 'platform.menu.notifications',\r\n subtitle: 'platform.blades.notifications-menu.subtitle',\r\n controller: 'virtoCommerce.notificationsModule.notificationsMenuController',\r\n template: 'Modules/$(virtoCommerce.Notifications)/Scripts/blades/notifications-menu.tpl.html',\r\n isClosingDisabled: true\r\n };\r\n bladeNavigationService.showBlade(blade);\r\n }\r\n ]\r\n });\r\n }\r\n ])\r\n // define search filters to be accessible platform-wide\r\n .factory('virtoCommerce.notificationsModule.predefinedSearchFilters', ['$localStorage', function ($localStorage) {\r\n $localStorage.notificationsJournalSearchFilters = $localStorage.notificationsJournalSearchFilters || [];\r\n\r\n return {\r\n register: function (currentFiltersUpdateTime, currentFiltersStorageKey, newFilters) {\r\n _.each(newFilters, function (newFilter) {\r\n var found = _.find($localStorage.notificationsJournalSearchFilters, function (x) {\r\n return x.id == newFilter.id;\r\n });\r\n if (found) {\r\n if (found && (!found.lastUpdateTime || found.lastUpdateTime < currentFiltersUpdateTime)) {\r\n angular.copy(newFilter, found);\r\n }\r\n } else if (!$localStorage[currentFiltersStorageKey] || $localStorage[currentFiltersStorageKey] < currentFiltersUpdateTime) {\r\n $localStorage.notificationsJournalSearchFilters.splice(0, 0, newFilter);\r\n }\r\n });\r\n\r\n $localStorage[currentFiltersStorageKey] = currentFiltersUpdateTime;\r\n }\r\n };\r\n }])\r\n .run(['platformWebApp.mainMenuService', 'platformWebApp.widgetService', '$state', 'virtoCommerce.notificationsModule.notificationTypesResolverService', 'virtoCommerce.notificationsModule.notificationTemplatesResolverService', '$http', '$compile', 'virtoCommerce.notificationsModule.predefinedSearchFilters',\r\n function (mainMenuService, widgetService, $state, notificationTypesResolverService, notificationTemplatesResolverService, $http, $compile, predefinedSearchFilters) {\r\n //Register module in main menu\r\n var menuItem = {\r\n path: 'browse/notificationsModule',\r\n icon: 'fa fa-envelope',\r\n title: 'Notifications',\r\n priority: 7,\r\n action: function () { $state.go('workspace.notificationsModule'); },\r\n permission: 'notifications:access'\r\n };\r\n mainMenuService.addMenuItem(menuItem);\r\n\r\n widgetService.registerWidget({\r\n \t controller: 'virtoCommerce.notificationsModule.notificationsTemplatesWidgetController',\r\n \t template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/widgets/notificationsTemplatesWidget.tpl.html'\r\n \t }, 'notificationsDetail');\r\n widgetService.registerWidget({\r\n \t controller: 'virtoCommerce.notificationsModule.notificationsLogWidgetController',\r\n \t template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/widgets/notificationsLogWidget.tpl.html'\r\n \t }, 'notificationsDetail');\r\n \r\n // register types\r\n notificationTypesResolverService.registerType({\r\n type: 'EmailNotification',\r\n icon: 'fa fa-envelope',\r\n detailBlade: {\r\n template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notification-details.tpl.html',\r\n controller: 'virtoCommerce.notificationsModule.notificationsEditController'\r\n },\r\n knownChildrenTypes: ['Email', 'Sms']\r\n }); \r\n\r\n // register types\r\n notificationTypesResolverService.registerType({\r\n type: 'SmsNotification',\r\n icon: 'fa fa-comment',\r\n detailBlade: {\r\n template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notification-sms-details.tpl.html',\r\n controller: 'virtoCommerce.notificationsModule.notificationsEditController'\r\n },\r\n knownChildrenTypes: ['Email', 'Sms']\r\n }); \r\n\r\n // register templates\r\n notificationTemplatesResolverService.registerTemplate({\r\n type: 'EmailNotification',\r\n icon: 'fa fa-envelope',\r\n detailBlade: {\r\n template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notifications-edit-template.tpl.html',\r\n },\r\n knownChildrenTypes: ['Email', 'Sms']\r\n }); \r\n\r\n // register templates\r\n notificationTemplatesResolverService.registerTemplate({\r\n type: 'SmsNotification',\r\n icon: 'fa fa-comment',\r\n detailBlade: {\r\n template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notifications-edit-template.tpl.html',\r\n },\r\n knownChildrenTypes: ['Email', 'Sms']\r\n });\r\n \r\n // predefine search filters for search\r\n predefinedSearchFilters.register(1485892981, 'notificationsJournalSearchFiltersDate', [\r\n { name: 'notifications.blades.notifications-journal.labels.filter-new' },\r\n { keyword: 'isActive:true, isSuccessSend:false', id: 2, name: 'notifications.blades.notifications-journal.labels.filter-only-pending' },\r\n { keyword: 'isActive:false, isSuccessSend:false', id: 1, name: 'notifications.blades.notifications-journal.labels.filter-with-errors' }\r\n \r\n ]);\r\n \r\n $http.get('Modules/$(VirtoCommerce.Notifications)/Scripts/directives/itemSearch.tpl.html').then(function (response) {\r\n // compile the response, which will put stuff into the cache\r\n $compile(response.data);\r\n }); \r\n }]);\r\n","angular.module('virtoCommerce.notificationsModule')\n.controller('virtoCommerce.notificationsModule.filterJournalDetailController', ['$scope', '$localStorage', '$translate',\n function ($scope, $localStorage, $translate) {\n var blade = $scope.blade;\n var formScope;\n $scope.setForm = function (form) { formScope = form; };\n \n function initializeBlade(data) {\n blade.currentEntity = angular.copy(data);\n blade.origEntity = data;\n blade.isLoading = false;\n\n blade.title = blade.isNew ? 'notifications.blades.filter-detail.new-title' : data.name;\n blade.subtitle = blade.isNew ? 'notifications.blades.filter-detail.new-subtitle' : 'notifications.blades.filter-detail.subtitle';\n }\n \n $scope.saveChanges = function () {\n blade.currentEntity.lastUpdateTime = new Date().getTime();\n angular.copy(blade.currentEntity, blade.origEntity);\n if (blade.isNew) {\n $localStorage.notificationsJournalSearchFilters.splice(0, 0, blade.origEntity);\n $localStorage.notificationsJournalSearchFilterId = blade.origEntity.id;\n blade.parentBlade.filter.current = blade.origEntity;\n blade.isNew = false;\n }\n\n initializeBlade(blade.origEntity);\n blade.parentBlade.filter.change(true);\n };\n\n function isDirty() {\n return !angular.equals(blade.currentEntity, blade.origEntity);\n }\n\n blade.headIcon = 'fa fa-filter';\n\n blade.toolbarCommands = [\n {\n name: \"core.commands.apply-filter\", icon: 'fa fa-filter',\n executeMethod: function () {\n $scope.saveChanges();\n },\n canExecuteMethod: function () {\n return formScope && formScope.$valid;\n }\n },\n {\n name: \"platform.commands.reset\", icon: 'fa fa-undo',\n executeMethod: function () {\n angular.copy(blade.origEntity, blade.currentEntity);\n },\n canExecuteMethod: isDirty\n },\n {\n name: \"platform.commands.delete\", icon: 'fas fa-trash-alt',\n executeMethod: deleteEntry,\n canExecuteMethod: function () {\n return !blade.isNew;\n }\n }];\n\n\n function deleteEntry() {\n blade.parentBlade.filter.current = null;\n $localStorage.notificationsJournalSearchFilters.splice($localStorage.notificationsJournalSearchFilters.indexOf(blade.origEntity), 1);\n delete $localStorage.notificationsJournalSearchFilterId;\n blade.parentBlade.filter.change();\n }\n\n // actions on load \n if (blade.isNew) {\n $translate('notifications.blades.notifications-journal.labels.unnamed-filter').then(function (result) {\n initializeBlade({ id: new Date().getTime(), name: result });\n });\n } else {\n initializeBlade(blade.data);\n }\n }]);\n","angular.module('virtoCommerce.notificationsModule')\n .controller('virtoCommerce.notificationsModule.notificationsEditController', ['$scope', '$filter', 'virtoCommerce.notificationsModule.notificationsModuleApi', 'platformWebApp.bladeNavigationService',\n function ($scope, $filter, notifications, bladeNavigationService) {\n $scope.setForm = function (form) {\n $scope.formScope = form;\n }\n\n var blade = $scope.blade;\n blade.updatePermission = 'notifications:update';\n var codemirrorEditor;\n blade.parametersForTemplate = [];\n $scope.isValid = false;\n\n blade.initialize = function () {\n blade.isLoading = true;\n notifications.getNotificationByType({ type: blade.type, tenantId: blade.tenantId, tenantType: blade.tenantType }, function (data) {\n blade.isLoading = false;\n setNotification(data);\n })\n };\n\n function modifyEmailAddress(addresses) {\n return _.map(addresses, function (address) { return { value: address }; });\n }\n\n function setNotification(data) {\n blade.currentEntity = angular.copy(data);\n\n if (isTransient(blade.currentEntity)) {\n blade.currentEntity.tenantIdentity = { id: blade.tenantId, type: blade.tenantType };\n }\n\n blade.currentEntity.cc = modifyEmailAddress(blade.currentEntity.cc);\n blade.currentEntity.bcc = modifyEmailAddress(blade.currentEntity.bcc);\n _.map(blade.currentEntity.templates, function (template) {\n template.createdDateAsString = $filter('date')(template.createdDate, \"yyyy-MM-dd\");\n template.modifiedDateAsString = $filter('date')(template.modifiedDate, \"yyyy-MM-dd\");\n return template;\n });\n if (!blade.currentEntity.templates) blade.currentEntity.templates = [];\n\n blade.origEntity = angular.copy(blade.currentEntity);\n $scope.isValid = false;\n };\n\n function isTransient(data) {\n return data.tenantIdentity.isEmpty && blade.tenantId && blade.tenantType;\n }\n\n function pluckAddress(address) {\n if (address) {\n return _(address).pluck('value');\n }\n return address;\n }\n\n blade.updateNotification = function () {\n blade.isLoading = true;\n blade.currentEntity.cc = pluckAddress(blade.currentEntity.cc);\n blade.currentEntity.bcc = pluckAddress(blade.currentEntity.bcc);\n\n var entityToSave = angular.copy(blade.currentEntity);\n entityToSave.templates = _.filter(blade.currentEntity.templates, { isReadonly: false });\n entityToSave.templates.forEach(element => {\n // Need to set IsPredefined to false in order to save the template to the database\n if (!!element.isEdited && !!element.isPredefined) {\n element.isPredefined = false;\n }\n });\n\n notifications.updateNotification({ type: blade.type }, entityToSave, function () {\n blade.isLoading = false;\n blade.origEntity = angular.copy(blade.currentEntity);\n blade.parentBlade.refresh();\n bladeNavigationService.closeBlade(blade);\n });\n };\n\n $scope.blade.toolbarCommands = [\n {\n name: \"platform.commands.save\", icon: 'fas fa-save',\n executeMethod: blade.updateNotification,\n canExecuteMethod: canSave,\n permission: blade.updatePermission\n },\n {\n name: \"platform.commands.undo\", icon: 'fa fa-undo',\n executeMethod: function () {\n blade.currentEntity = angular.copy(blade.origEntity);\n },\n canExecuteMethod: isDirty,\n permission: blade.updatePermission\n }\n ];\n\n $scope.editorOptions = {\n lineWrapping: true,\n lineNumbers: true,\n parserfile: \"liquid.js\",\n extraKeys: { \"Ctrl-Q\": function (cm) { cm.foldCode(cm.getCursor()); } },\n foldGutter: true,\n gutters: [\"CodeMirror-linenumbers\", \"CodeMirror-foldgutter\"],\n onLoad: function (_editor) {\n codemirrorEditor = _editor;\n },\n mode: \"liquid-html\"\n };\n\n $scope.$watch(\"blade.currentEntity\", function () {\n $scope.isValid = $scope.formScope && $scope.formScope.$valid;\n }, true);\n\n function isDirty() {\n return (!angular.equals(blade.origEntity, blade.currentEntity) || blade.isNew) && blade.hasUpdatePermission();\n }\n\n function canSave() {\n return isDirty() && $scope.isValid;\n }\n\n blade.onClose = function (closeCallback) {\n bladeNavigationService.showConfirmationIfNeeded(isDirty(), canSave(), blade, blade.updateNotification, closeCallback, \"notifications.dialogs.notification-details-save.title\", \"notifications.dialogs.notification-details-save.message\");\n };\n\n blade.headIcon = 'fa fa-envelope';\n\n blade.initialize();\n }]);\n","angular.module('virtoCommerce.notificationsModule')\n .controller('virtoCommerce.notificationsModule.notificationJournalDetailsController', ['$scope', 'virtoCommerce.notificationsModule.notificationsModuleApi', 'platformWebApp.bladeNavigationService', function ($scope, notifications, bladeNavigationService) {\n\tvar blade = $scope.blade;\n\n\tblade.initialize = function () {\n\t\tnotifications.getNotificationJournalDetails({ id: blade.currentNotificationId }, function (data) {\n\t\t\tblade.currentEntity = data;\n\t\t\tblade.isLoading = false;\n\t\t}, function (error) {\n\t\t\tbladeNavigationService.setError('Error ' + error.status, $scope.blade);\n\t\t});\n\t}\n\n\tblade.initialize();\n}]);\n","angular.module('virtoCommerce.notificationsModule')\n .controller('virtoCommerce.notificationsModule.notificationLayoutController',\n ['$scope', '$timeout', 'virtoCommerce.notificationsModule.notificationLayoutsApi', 'platformWebApp.bladeNavigationService', 'FileUploader',\n function ($scope, $timeout, layouts, bladeNavigationService, FileUploader) {\n var blade = $scope.blade;\n blade.headIcon = 'fa fa-envelope';\n blade.updatePermission = 'notifications:update';\n\n // since the vc-uk-htmleditor directive doesn't fully track changes in the data source\n // force redraw editor directive on the blade after modifiying currentEntity\n function reloadEditor() {\n $scope.editorReloaded = true;\n }\n\n if (blade.isNew) {\n blade.title = 'notifications.blades.notification-layout-details.title-new';\n blade.currentEntity = {};\n } else {\n blade.subtitle = 'notifications.blades.notification-layout-details.subtitle';\n }\n\n blade.refresh = function (parentRefresh) {\n reloadEditor();\n\n if (blade.isNew) {\n blade.currentEntity = {};\n blade.isLoading = false;\n } else {\n blade.isLoading = true;\n\n layouts.getNotificationLayout({ id: blade.currentEntityId }, initializeBlade);\n\n if (parentRefresh) {\n blade.parentBlade.refresh(true);\n }\n }\n };\n\n function initializeBlade(data) {\n blade.currentEntity = angular.copy(data);\n blade.originalEntity = data;\n\n if (!blade.isNew) {\n blade.title = blade.currentEntity.name;\n }\n\n blade.isLoading = false;\n }\n\n $scope.setForm = function (form) {\n $scope.formScope = form;\n }\n\n $scope.saveChanges = function () {\n blade.isLoading = true;\n\n if (blade.isNew) {\n layouts.createNotificationLayout(blade.currentEntity,\n function () {\n blade.parentBlade.refresh(true);\n $scope.bladeClose();\n });\n } else {\n layouts.updateNotificationLayout(blade.currentEntity,\n function () {\n blade.refresh(true);\n });\n }\n };\n\n $scope.fileUploader = new FileUploader({\n url: 'api/assets?folderUrl=cms-content/layouts/assets',\n headers: { Accept: 'application/json' },\n autoUpload: true,\n removeAfterUpload: true,\n onBeforeUploadItem: function (fileItem) {\n blade.isLoading = true;\n },\n onSuccessItem: function (fileItem, response, status, headers) {\n $scope.$broadcast('filesUploaded', { items: response });\n },\n onErrorItem: function (fileItem, response, status, headers) {\n bladeNavigationService.setError(`${fileItem._file.name} failed: ${(response.message ? response.message : status)}`, blade);\n },\n onCompleteAll: function () {\n blade.isLoading = false;\n }\n });\n\n blade.toolbarCommands = [\n {\n name: \"platform.commands.save\",\n icon: 'fas fa-save',\n executeMethod: $scope.saveChanges,\n canExecuteMethod: canSave,\n permission: blade.updatePermission\n }];\n\n if (!blade.isNew) {\n blade.toolbarCommands.push(\n {\n name: \"platform.commands.reset\",\n icon: 'fa fa-undo',\n executeMethod: function () {\n angular.copy(blade.originalEntity, blade.currentEntity);\n $scope.editorReloaded = false;\n $timeout(reloadEditor, 0);\n },\n canExecuteMethod: isDirty,\n permission: blade.updatePermission\n }\n );\n }\n\n function canSave() {\n return isDirty() && $scope.formScope && $scope.formScope.$valid;\n }\n\n function isDirty() {\n return !angular.equals(blade.currentEntity, blade.originalEntity) && blade.hasUpdatePermission();\n }\n\n blade.refresh(false);\n }]);\n","angular.module('virtoCommerce.notificationsModule')\n .controller('virtoCommerce.notificationsModule.notificationLayoutsListController',\n ['$scope', 'virtoCommerce.notificationsModule.notificationLayoutsApi',\n 'platformWebApp.dialogService', 'platformWebApp.bladeUtils', 'platformWebApp.uiGridHelper', 'platformWebApp.ui-grid.extension',\n function ($scope, layouts, dialogService, bladeUtils, uiGridHelper, gridOptionExtension) {\n var blade = $scope.blade;\n\n $scope.uiGridConstants = uiGridHelper.uiGridConstants;\n var bladeNavigationService = bladeUtils.bladeNavigationService;\n\n blade.toolbarCommands = [\n {\n name: \"platform.commands.add\",\n icon: 'fas fa-plus',\n executeMethod: createLayout,\n canExecuteMethod: function () {\n return true;\n },\n permission: 'notifications:create'\n },\n {\n name: \"platform.commands.delete\",\n icon: 'fas fa-trash-alt',\n executeMethod: function () {\n deleteList($scope.gridApi.selection.getSelectedRows());\n },\n canExecuteMethod: function () {\n return $scope.gridApi && _.any($scope.gridApi.selection.getSelectedRows());\n },\n permission: 'notifications:delete'\n }\n ];\n\n // filtering\n var filter = $scope.filter = {};\n\n filter.criteriaChanged = function () {\n if ($scope.pageSettings.currentPage > 1) {\n $scope.pageSettings.currentPage = 1;\n } else {\n blade.refresh();\n }\n };\n\n function getSearchCriteria() {\n return {\n sort: uiGridHelper.getSortExpression($scope),\n skip: ($scope.pageSettings.currentPage - 1) * $scope.pageSettings.itemsPerPageCount,\n take: $scope.pageSettings.itemsPerPageCount\n };\n }\n\n blade.refresh = function () {\n var searchCriteria = getSearchCriteria();\n\n layouts.searchNotificationLayouts(searchCriteria, function (data) {\n blade.isLoading = false;\n\n $scope.pageSettings.totalItems = data.totalCount;\n $scope.listEntries = data.results ? data.results : [];\n });\n };\n\n $scope.selectNode = function (layout) {\n $scope.selectedNodeId = layout.id;\n blade.selectedLayout = layout;\n blade.editNotificationLayout(layout);\n };\n\n function createLayout() {\n var newBlade = {\n id: 'createNotificationLayout',\n isNew: true,\n controller: 'virtoCommerce.notificationsModule.notificationLayoutController',\n template: 'Modules/$(virtoCommerce.Notifications)/Scripts/blades/notification-layout-details.tpl.html'\n };\n\n bladeNavigationService.showBlade(newBlade, blade);\n }\n\n\n blade.editNotificationLayout = function (layout) {\n var newBlade = {\n id: 'editNotificationLayout',\n currentEntity: layout,\n currentEntityId: layout.id,\n controller: 'virtoCommerce.notificationsModule.notificationLayoutController',\n template: 'Modules/$(virtoCommerce.Notifications)/Scripts/blades/notification-layout-details.tpl.html'\n };\n\n bladeNavigationService.showBlade(newBlade, blade);\n };\n\n function deleteList(selection) {\n var dialog = {\n id: \"confirmDeleteLayouts\",\n title: \"notifications.dialogs.notification-layout-delete.title\",\n message: \"notifications.dialogs.notification-layout-delete.message\",\n callback: function (remove) {\n if (remove) {\n bladeNavigationService.closeChildrenBlades(blade, function () {\n var itemIds = _.pluck(selection, 'id');\n layouts.deleteNotificationLayout({ ids: itemIds }, function () {\n blade.refresh();\n },\n function (error) {\n bladeNavigationService.setError('Error ' + error.status, blade);\n });\n });\n }\n }\n };\n dialogService.showConfirmationDialog(dialog);\n }\n\n // ui-grid\n $scope.setGridOptions = function (gridId, gridOptions) {\n $scope.gridOptions = gridOptions;\n gridOptionExtension.tryExtendGridOptions(gridId, gridOptions);\n\n gridOptions.onRegisterApi = function (gridApi) {\n $scope.gridApi = gridApi;\n };\n\n bladeUtils.initializePagination($scope);\n };\n\n blade.headIcon = 'fa fa-list';\n }]);\n","angular.module('virtoCommerce.notificationsModule')\n .controller('virtoCommerce.notificationsModule.notificationTemplatesListController', ['$scope', '$translate', 'virtoCommerce.notificationsModule.notificationTemplatesResolverService', 'platformWebApp.bladeNavigationService', 'platformWebApp.dialogService', 'platformWebApp.settings', 'platformWebApp.uiGridHelper', 'platformWebApp.bladeUtils',\n function ($scope, $translate, notificationTemplatesResolverService, bladeNavigationService, dialogService, settings, uiGridHelper, bladeUtils) {\n $scope.uiGridConstants = uiGridHelper.uiGridConstants;\n var blade = $scope.blade;\n blade.selectedLanguage = null;\n\n if (!blade.languages) {\n settings.getValues({ id: 'VirtoCommerce.Notifications.General.Languages' }, function (data) {\n blade.languages = data;\n });\n }\n\n blade.initialize = function () {\n blade.currentEntities = getEffectiveTemplateListByLanguage(blade.currentEntity.templates);\n blade.isLoading = false;\n }\n\n function getEffectiveTemplateListByLanguage(templates) {\n var groups = _.groupBy(templates, function (template) { return template.languageCode || null; })\n var templatesToDisplay = _.each(groups, function (languageCodeTemplates, languageCode, originalObject) {\n var hasPredefinedTemplates = _.any(languageCodeTemplates, function (template) { return template.isPredefined });\n\n // If we have at least one predefined template in group - marking all non predefined as edited predefined\n if (hasPredefinedTemplates) {\n _.each(languageCodeTemplates, function (element) {\n if (!element.isPredefined) {\n element.isPredefined = true;\n element.isEdited = true;\n }\n });\n }\n // We want to use edited templates first\n var effectiveTemplate = _.sortBy(languageCodeTemplates, function (element) {\n return !element.isEdited;\n })[0];\n\n originalObject[languageCode] = effectiveTemplate;\n });\n return _.toArray(templatesToDisplay);\n }\n\n function resolveType(kind) {\n var foundTemplate = notificationTemplatesResolverService.resolve(kind);\n if (foundTemplate && foundTemplate.knownChildrenTypes && foundTemplate.knownChildrenTypes.length) {\n return foundTemplate;\n } else {\n dialogService.showNotificationDialog({\n id: \"error\",\n title: \"notifications.dialogs.unknown-kind.title\",\n message: \"notifications.dialogs.unknown-kind.message\",\n messageValues: { kind: kind },\n });\n }\n }\n\n blade.openTemplate = function (template) {\n var foundTemplate = resolveType(blade.currentEntity.kind);\n if (foundTemplate) {\n var newBlade = {\n id: foundTemplate.detailBlade.id,\n title: 'notifications.blades.notifications-edit-template.title',\n titleValues: { displayName: $translate.instant('notificationTypes.' + blade.currentEntity.type + '.displayName') },\n notification: blade.currentEntity,\n languageCode: template.languageCode,\n editedTemplate: template,\n isNew: false,\n isFirst: false,\n languages: blade.languages,\n tenantId: blade.tenantId,\n tenantType: blade.tenantType,\n controller: foundTemplate.detailBlade.controller,\n template: foundTemplate.detailBlade.template,\n kind: blade.currentEntity.kind\n };\n\n bladeNavigationService.showBlade(newBlade, blade);\n }\n }\n\n blade.setSelectedNode = function (listItem) {\n $scope.selectedNodeId = listItem.id;\n };\n\n $scope.selectNode = function (type) {\n blade.setSelectedNode(type);\n blade.selectedType = type;\n blade.openTemplate(type);\n };\n\n function createTemplate() {\n var foundTemplate = resolveType(blade.currentEntity.kind);\n if (foundTemplate) {\n var newBlade = {\n id: foundTemplate.detailBlade.id,\n title: 'notifications.blades.notifications-edit-template.title-new',\n titleValues: { displayName: $translate.instant('notificationTypes.' + blade.currentEntity.type + '.displayName') },\n notification: blade.currentEntity,\n tenantId: blade.tenantId,\n tenantType: blade.tenantType,\n isNew: true,\n isFirst: false,\n languages: blade.languages,\n controller: foundTemplate.detailBlade.controller,\n template: foundTemplate.detailBlade.template\n };\n\n bladeNavigationService.showBlade(newBlade, blade);\n }\n }\n\n function deleteList(selections) {\n var containsDefaultNotifications = _.any(selections, function (item) {\n return !item.languageCode || item.isPredefined;\n });\n\n if (containsDefaultNotifications) {\n dialogService.showNotificationDialog({\n id: \"error\",\n title: \"notifications.dialogs.notification-template-delete-notification.title\",\n message: \"notifications.dialogs.notification-template-delete-notification.message\"\n });\n }\n else {\n var dialog = {\n id: \"confirmDeleteItem\",\n title: \"notifications.dialogs.notification-template-delete.title\",\n message: \"notifications.dialogs.notification-template-delete.message\",\n callback: function (remove) {\n if (remove) {\n bladeNavigationService.closeChildrenBlades(blade, function () {\n _.each(selections, function (selection) {\n var index = blade.currentEntity.templates.findIndex(function (element) {\n return (element.languageCode === selection.languageCode);\n });\n\n if (index > -1) {\n blade.currentEntity.templates.splice(index, 1);\n }\n });\n\n blade.initialize();\n });\n }\n }\n };\n dialogService.showConfirmationDialog(dialog);\n }\n }\n\n blade.toolbarCommands = [\n {\n name: \"platform.commands.add\", icon: 'fas fa-plus',\n executeMethod: createTemplate,\n canExecuteMethod: function () { return true; },\n permission: 'notifications:template:create'\n },\n {\n name: \"platform.commands.delete\", icon: 'fas fa-trash-alt',\n executeMethod: function () { deleteList($scope.gridApi.selection.getSelectedRows()); },\n canExecuteMethod: function () {\n return $scope.gridApi && _.any($scope.gridApi.selection.getSelectedRows());\n },\n permission: 'notifications:template:delete'\n }\n ];\n\n // ui-grid\n $scope.setGridOptions = function (gridOptions) {\n uiGridHelper.initialize($scope, gridOptions, function (gridApi) {\n //update gridApi for current grid\n $scope.gridApi = gridApi;\n uiGridHelper.bindRefreshOnSortChanged($scope);\n });\n bladeUtils.initializePagination($scope);\n };\n\n blade.initialize();\n }]);\n","angular.module('virtoCommerce.notificationsModule')\n .controller('virtoCommerce.notificationsModule.editTemplateController', ['$rootScope', '$scope', '$timeout', '$localStorage', 'virtoCommerce.notificationsModule.notificationsModuleApi', 'virtoCommerce.notificationsModule.notificationLayoutsApi', 'FileUploader', 'platformWebApp.bladeNavigationService', 'platformWebApp.dialogService',\n function ($rootScope, $scope, $timeout, $localStorage, notifications, layouts, FileUploader, bladeNavigationService, dialogService) {\n var blade = $scope.blade;\n $scope.isValid = false;\n\n var formScope;\n $scope.setForm = function (form) {\n formScope = form;\n }\n\n var codemirrorEditor;\n blade.dynamicProperties = '';\n\n function saveTemplate() {\n var date = new Date();\n var now = date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + date.getDate()).slice(-2);\n\n if (blade.isNew) {\n blade.currentEntity.createdDateAsString = now;\n blade.currentEntity.isReadonly = false;\n blade.currentEntity.id = blade.currentEntity.languageCode ? null : blade.currentEntity.id;\n blade.origEntity = angular.copy(blade.currentEntity);\n }\n else {\n blade.currentEntity.modifiedDateAsString = now;\n blade.origEntity = angular.copy(blade.currentEntity);\n }\n\n var sameLanguageTemplate = _.filter(blade.notification.templates, function (template) { return template.languageCode == blade.currentEntity.languageCode; })\n var hasPredefinedTemplates = _.any(sameLanguageTemplate, function (template) { return template.isPredefined });\n\n if (hasPredefinedTemplates) {\n blade.currentEntity.isPredefined = true;\n blade.currentEntity.isEdited = true;\n } else {\n blade.currentEntity.isPredefined = false;\n }\n\n var ind = blade.notification.templates.findIndex(function (element) {\n return (element.languageCode == blade.currentEntity.languageCode)\n && (element.isPredefined == blade.currentEntity.isPredefined && element.isEdited == blade.currentEntity.isEdited);\n });\n\n if (ind >= 0) {\n blade.notification.templates[ind] = blade.currentEntity;\n }\n else {\n blade.notification.templates.push(blade.currentEntity);\n }\n }\n\n function restoreTemplate(template) {\n var dialog = {\n id: \"confirmResetTemplates\",\n template: template,\n callback: function (confirmed) {\n if (confirmed) {\n deleteTemplate(template);\n }\n }\n }\n dialogService.showDialog(dialog, 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notification-templates-list-reset-dialog.tpl.html', 'platformWebApp.confirmDialogController');\n }\n\n function deleteTemplate(template) {\n var index = blade.notification.templates.findIndex(function (element) {\n return (element.languageCode == template.languageCode && element.isPredefined == template.isPredefined && element.isEdited == template.isEdited);\n });\n\n if (index > -1) {\n blade.notification.templates.splice(index, 1);\n }\n\n blade.parentBlade.initialize();\n $scope.bladeClose();\n }\n\n $scope.saveChanges = function () {\n saveTemplate();\n blade.parentBlade.initialize();\n $scope.bladeClose();\n };\n\n //todo\n var contentType = 'image';//blade.contentType.substr(0, 1).toUpperCase() + blade.contentType.substr(1, blade.contentType.length - 1);\n $scope.fileUploader = new FileUploader({\n url: 'api/assets?folderUrl=cms-content/' + contentType + '/assets',\n headers: { Accept: 'application/json' },\n autoUpload: true,\n removeAfterUpload: true,\n onBeforeUploadItem: function (fileItem) {\n blade.isLoading = true;\n },\n onSuccessItem: function (fileItem, response, status, headers) {\n $scope.$broadcast('filesUploaded', { items: response });\n },\n onErrorItem: function (fileItem, response, status, headers) {\n bladeNavigationService.setError(fileItem._file.name + ' failed: ' + (response.message ? response.message : status), blade);\n },\n onCompleteAll: function () {\n blade.isLoading = false;\n }\n });\n\n function setTemplate() {\n if (!blade.currentEntity) {\n blade.currentEntity = { kind: blade.notification.kind };\n }\n\n blade.isLoading = false;\n if (blade.currentEntity && blade.currentEntity.languageCode === undefined) {\n blade.currentEntity.languageCode = null;\n }\n\n $timeout(function () {\n if (codemirrorEditor) {\n codemirrorEditor.refresh();\n codemirrorEditor.focus();\n }\n blade.origEntity = angular.copy(blade.currentEntity);\n }, 1);\n\n $scope.isValid = false;\n };\n\n blade.initialize = function () {\n blade.isLoading = true;\n var found = blade.editedTemplate || _.find(blade.notification.templates, function (templ) { return templ.languageCode === blade.languageCode });\n if (found) {\n blade.currentEntity = angular.copy(found);\n blade.origEntity = angular.copy(blade.currentEntity);\n blade.orightml = blade.currentEntity.body;\n }\n\n setTemplate();\n };\n\n blade.renderTemplate = function () {\n var newBlade = {\n id: 'renderTemplate',\n title: 'notifications.blades.notifications-template-render.title',\n subtitle: 'notifications.blades.notifications-template-render.subtitle',\n subtitleValues: { type: blade.notificationType },\n notification: blade.notification,\n tenantId: blade.tenantId,\n tenantType: blade.tenantType,\n currentEntity: blade.currentEntity,\n languageCode: blade.currentEntity.languageCode,\n controller: 'virtoCommerce.notificationsModule.templateRenderController',\n template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notifications-template-render.tpl.html'\n };\n\n bladeNavigationService.showBlade(newBlade, blade);\n }\n\n blade.isSampleValidJson = function () {\n if (blade.currentEntity.sample && blade.currentEntity.sample!=\"\") {\n try {\n JSON.parse(blade.currentEntity.sample);\n } catch (e) {\n return false;\n }\n }\n return true;\n }\n\n $scope.blade.toolbarCommands = [{\n name: \"platform.commands.preview\",\n icon: 'fa fa-eye',\n executeMethod: function () {\n blade.renderTemplate();\n },\n canExecuteMethod: canRender,\n permission: 'notifications:templates:read'\n }, {\n name: \"notifications.commands.restore\",\n icon: \"fa fa-history\",\n executeMethod: function () {\n restoreTemplate(blade.currentEntity);\n },\n canExecuteMethod: function () {\n return blade.currentEntity.isPredefined && blade.currentEntity.isEdited;\n },\n permission: 'notifications:template:delete'\n }];\n\n function isDirty() {\n return (!angular.equals(blade.origEntity, blade.currentEntity) || blade.isNew) && blade.hasUpdatePermission();\n }\n\n function canRender() {\n return formScope && formScope.$valid && blade.isSampleValidJson() && !blade.origEntity.isReadonly;\n }\n \n $scope.$watch(\"blade.currentEntity\", function () {\n $scope.isValid = isDirty() && canRender();\n }, true);\n\n $scope.searchNotificationLayouts = function (criteria) {\n return layouts.searchNotificationLayouts(criteria);\n }\n\n blade.headIcon = 'fa fa-envelope';\n\n blade.initialize();\n }]);\n","angular.module('virtoCommerce.notificationsModule')\r\n .controller('virtoCommerce.notificationsModule.notificationsJournalController', ['$scope', '$translate', 'platformWebApp.bladeNavigationService', 'virtoCommerce.notificationsModule.notificationsModuleApi', 'platformWebApp.bladeUtils', 'platformWebApp.dialogService', 'uiGridConstants', 'platformWebApp.uiGridHelper',\r\n function ($scope, $translate, bladeNavigationService, notifications, bladeUtils, dialogService, uiGridConstants, uiGridHelper) {\r\n var blade = $scope.blade;\r\n $scope.uiGridConstants = uiGridConstants;\r\n\r\n // simple and advanced filtering\r\n var filter = $scope.filter = {};\r\n\r\n filter.criteriaChanged = function () {\r\n if ($scope.pageSettings.currentPage > 1) {\r\n $scope.pageSettings.currentPage = 1;\r\n } else {\r\n blade.refresh();\r\n }\r\n };\r\n\r\n // Search Criteria\r\n function getSearchCriteria() {\r\n var searchCriteria = {\r\n objectIds: blade.objectId ? [blade.objectId] : undefined,\r\n objectType: blade.objectType,\r\n keyword: filter.keyword ? filter.keyword : undefined,\r\n sort: uiGridHelper.getSortExpression($scope),\r\n skip: ($scope.pageSettings.currentPage - 1) * $scope.pageSettings.itemsPerPageCount,\r\n take: $scope.pageSettings.itemsPerPageCount,\r\n notificationType: blade.notificationType,\r\n };\r\n return searchCriteria;\r\n }\r\n\r\n blade.refresh = function () {\r\n var searchCriteria = getSearchCriteria();\r\n notifications.getNotificationJournalList(searchCriteria, function (data) {\r\n blade.currentEntities = data.results;\r\n $scope.pageSettings.totalItems = data.totalCount;\r\n blade.isLoading = false;\r\n });\r\n };\r\n\r\n $scope.selectNode = function (data) {\r\n $scope.selectedNodeId = data.id;\r\n\r\n var newBlade = {\r\n id: 'notificationDetails',\r\n title: data.subject,\r\n subtitle: 'notifications.blades.notification-journal-details.subtitle',\r\n subtitleValues: { displayName: $translate.instant(data.displayName) },\r\n currentNotificationId: data.id,\r\n currentEntity: data,\r\n controller: 'virtoCommerce.notificationsModule.notificationJournalDetailsController',\r\n template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notification-journal-details.tpl.html'\r\n };\r\n bladeNavigationService.showBlade(newBlade, blade);\r\n };\r\n\r\n $scope.stopNotifications = function (list) {\r\n blade.isLoading = true;\r\n notifications.stopSendingNotifications(_.pluck(list, 'id'), blade.refresh);\r\n };\r\n\r\n blade.toolbarCommands = [\r\n {\r\n name: \"platform.commands.refresh\", icon: 'fa fa-refresh',\r\n executeMethod: blade.refresh,\r\n canExecuteMethod: function () { return true; }\r\n },\r\n {\r\n name: 'notifications.blades.notifications-journal.labels.resend-messages',\r\n icon: 'fa fa-repeat',\r\n executeMethod: function () {\r\n var messageIds = blade.$scope.gridApi.grid.rows\r\n .filter(x => x.isSelected)\r\n .map(x => x.entity.id);\r\n\r\n notifications.resendNotifications(messageIds, function () {\r\n blade.refresh();\r\n });\r\n },\r\n canExecuteMethod: function () {\r\n return blade.$scope.gridApi !== undefined &&\r\n blade.$scope.gridApi.grid.rows.filter(x => x.isSelected).length > 0;\r\n },\r\n permission: 'notifications:update'\r\n }\r\n ];\r\n\r\n\r\n\r\n // ui-grid\r\n $scope.setGridOptions = function (gridOptions) {\r\n uiGridHelper.initialize($scope, gridOptions, function (gridApi) {\r\n //update gridApi for current grid\r\n $scope.gridApi = gridApi;\r\n uiGridHelper.bindRefreshOnSortChanged($scope);\r\n });\r\n bladeUtils.initializePagination($scope);\r\n };\r\n }]);\r\n","angular.module('virtoCommerce.notificationsModule')\n.controller('virtoCommerce.notificationsModule.notificationsListController', ['$scope', '$translate', 'virtoCommerce.notificationsModule.notificationsModuleApi', 'virtoCommerce.notificationsModule.notificationTypesResolverService', 'platformWebApp.dialogService', 'platformWebApp.bladeUtils', 'platformWebApp.uiGridHelper', 'platformWebApp.ui-grid.extension', 'platformWebApp.settings', 'platformWebApp.i18n', 'platformWebApp.authService',\n function ($scope, $translate, notifications, notificationTypesResolverService, dialogService, bladeUtils, uiGridHelper, gridOptionExtension, settings, i18n, authService) {\n $scope.uiGridConstants = uiGridHelper.uiGridConstants;\n var blade = $scope.blade;\n blade.title = 'Notifications';\n blade.selectedType = null;\n blade.currentLanguage = i18n.getLanguage();\n var bladeNavigationService = bladeUtils.bladeNavigationService;\n \n // filtering\n var filter = $scope.filter = {};\n\n filter.criteriaChanged = function () {\n if (filter.keyword === null) {\n blade.name = undefined;\n }\n if ($scope.pageSettings.currentPage > 1) {\n $scope.pageSettings.currentPage = 1;\n } else {\n blade.refresh();\n }\n };\n \n function getSearchCriteria() {\n var searchCriteria = {\n keyword: filter.keyword ? filter.keyword : undefined,\n sort: uiGridHelper.getSortExpression($scope),\n skip: ($scope.pageSettings.currentPage - 1) * $scope.pageSettings.itemsPerPageCount,\n take: $scope.pageSettings.itemsPerPageCount,\n responseGroup: 'Default'\n };\n return searchCriteria;\n }\n\n blade.refresh = function () {\n var searchCriteria = getSearchCriteria();\n notifications.getNotificationList(searchCriteria, function (data) {\n blade.isLoading = false;\n $scope.pageSettings.totalItems = data.totalCount;\n $scope.listEntries = data.results ? data.results : [];\n _.map($scope.listEntries, function(entity) {\n var foundNotification = notificationTypesResolverService.resolve(entity.kind); \n if (foundNotification) {\n entity.icon = foundNotification.icon;\n }\n return entity; \n });\n });\n }\n\n function resolveType(kind) {\n var foundNotification = notificationTypesResolverService.resolve(kind);\n if (foundNotification && foundNotification.knownChildrenTypes && foundNotification.knownChildrenTypes.length) {\n return foundNotification;\n } else {\n dialogService.showNotificationDialog({\n id: \"error\",\n title: \"notifications.dialogs.unknown-kind.title\",\n message: \"notifications.dialogs.unknown-kind.message\",\n messageValues: { kind: kind },\n });\n }\n }\n\n if (authService.checkPermission('notifications:access')) {\n blade.editNotification = function (item) {\n var foundNotification = resolveType(item.kind);\n var newBlade = {\n id: 'editNotification',\n title: 'notifications.blades.notification-details.title',\n titleValues: { displayName: $translate.instant('notificationTypes.' + item.type + '.displayName') },\n type: item.type,\n tenantId: blade.tenantId,\n tenantType: blade.tenantType,\n controller: foundNotification.detailBlade.controller,\n template: foundNotification.detailBlade.template\n };\n\n bladeNavigationService.showBlade(newBlade, blade);\n };\n };\n\n blade.setSelectedNode = function (listItem) {\n $scope.selectedNodeId = listItem.type;\n };\n\n $scope.selectNode = function (type) {\n blade.setSelectedNode(type);\n blade.selectedType = type;\n blade.editNotification(type);\n };\n\n // ui-grid\n $scope.setGridOptions = function (gridId, gridOptions) {\n $scope.gridOptions = gridOptions;\n gridOptionExtension.tryExtendGridOptions(gridId, gridOptions);\n\n gridOptions.onRegisterApi = function (gridApi) {\n $scope.gridApi = gridApi; \n };\n\n bladeUtils.initializePagination($scope);\n };\n\n blade.headIcon = 'fa fa-list';\n //blade.refresh();\n }]);\n","angular.module('virtoCommerce.notificationsModule')\n.controller('virtoCommerce.notificationsModule.notificationsMenuController', ['$scope', '$stateParams', 'platformWebApp.bladeNavigationService', function ($scope, $stateParams, bladeNavigationService) {\n var blade = $scope.blade;\n blade.updatePermission = 'notifications:read';\n\n function initializeBlade() {\n var entities = [\n {\n id: '1',\n name: 'notifications.blades.notifications-list.title',\n subtitle: 'notifications.blades.notifications-list.subtitle',\n icon: 'fa fa-list',\n templateName: 'notifications-list',\n controllerName: 'notificationsListController'\n },\n {\n id: '2',\n name: 'notifications.blades.notification-layouts-list.title',\n subtitle: 'notifications.blades.notification-layouts-list.subtitle',\n icon: 'fa fa-list',\n templateName: 'notification-layouts-list',\n controllerName: 'notificationLayoutsListController'\n },\n {\n id: '3',\n name: 'notifications.blades.notifications-journal.title',\n subtitle: 'notifications.blades.notifications-journal.subtitle',\n icon: 'fa fa-book',\n templateName: 'notifications-journal',\n controllerName: 'notificationsJournalController'\n }];\n blade.currentEntities = entities;\n blade.isLoading = false;\n };\n\n blade.openBlade = function (data) {\n if (!blade.hasUpdatePermission()) return;\n\n $scope.selectedNodeId = data.id;\n\n var tenantId = $stateParams.objectId;\n var tenantType = $stateParams.objectTypeId;\n var newBlade = {\n id: 'notificationsList',\n title: data.name,\n tenantId: tenantId,\n tenantType: tenantType,\n subtitle: data.subtitle,\n controller: 'virtoCommerce.notificationsModule.' + data.controllerName,\n template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/' + data.templateName + '.tpl.html'\n };\n bladeNavigationService.showBlade(newBlade, blade);\n }\n\n blade.headIcon = 'fa fa-envelope';\n\n initializeBlade();\n\n}]);\n","angular.module('virtoCommerce.notificationsModule')\n .controller('virtoCommerce.notificationsModule.templateRenderController', ['$rootScope', '$scope', '$sce', '$localStorage', 'platformWebApp.bladeNavigationService', 'platformWebApp.dialogService', 'virtoCommerce.notificationsModule.notificationsModuleApi', 'platformWebApp.authService', 'platformWebApp.accounts',\n function ($rootScope, $scope, $sce, $localStorage, bladeNavigationService, dialogService, notifications, authService, accounts) {\n\n var blade = $scope.blade;\n var keyTemplateLocalStorage;\n\n blade.dynamicProperties = '';\n blade.originHtml = '';\n\n $scope.setForm = function (form) {\n $scope.formScope = form;\n }\n\n function pluckAddress(address) {\n return address ? _(address).pluck('value') : address;\n }\n\n blade.initialize = function () {\n\n blade.isLoading = true;\n\n blade.language = blade.languageCode ? blade.languageCode : 'default';\n \n blade.data = angular.copy(blade.notification);\n if (blade.currentEntity.sample && blade.currentEntity.sample!=\"\") {\n var sample = JSON.parse(blade.currentEntity.sample);\n angular.extend(blade.data, sample);\n }\n\n blade.data.cc = pluckAddress(blade.data.cc);\n blade.data.bcc = pluckAddress(blade.data.bcc);\n\n keyTemplateLocalStorage = blade.tenantType + '.' + blade.notification.type + '.' + blade.language;\n var itemFromLocalStorage = $localStorage[keyTemplateLocalStorage];\n if (itemFromLocalStorage) {\n blade.notification.context = itemFromLocalStorage;\n }\n\n notifications.renderTemplate({\n type: blade.notification.type,\n language: blade.language\n }, {\n text: blade.currentEntity.body,\n data: blade.data,\n notificationLayoutId: blade.currentEntity.notificationLayoutId\n }, function (response) {\n $('#notification_template_preview').load(function() {\n $('#notification_template_preview').height($('#notification_template_preview').contents().outerHeight());\n });\n blade.originHtml = $sce.trustAsHtml(\"\" + response.html + \"\");\n }); \n blade.isLoading = false;\n };\n\n function sharePreview(eMailTo) {\n delete blade.data.cc;\n delete blade.data.bcc;\n blade.data.languageCode = blade.language;\n blade.data.to = eMailTo;\n\n notifications.sharePreview({\n type: blade.notification.type,\n language: blade.language\n }, {\n text: blade.currentEntity.body,\n data: blade.data\n }, function (response) {\n if (response.isSuccess) {\n var dialog = {\n id: \"shareSuccess\",\n title: 'notifications.dialogs.share-success.title',\n message: 'notifications.dialogs.share-success.message'\n };\n dialogService.showSuccessDialog(dialog);\n }\n else {\n dialog = {\n id: \"shareError\",\n title: 'notifications.dialogs.share-error.title',\n message: response.errorMessage\n };\n dialogService.showErrorDialog(dialog);\n } \n });\n }\n\n\n blade.sharePreview = function () {\n var eMailTo = authService.userLogin;\n accounts.get({ id: authService.userLogin }, function (data) {\n eMailTo = data.email;\n var dialog = {\n id: \"confirmSharePreview\",\n email: eMailTo,\n setEmail: function (email) {\n sharePreview(email);\n }\n }\n dialogService.showDialog(dialog, 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notification-templates-share-preview-dialog.tpl.html', 'platformWebApp.confirmDialogController');\n });\n\n }\n\n $scope.blade.toolbarCommands = [{\n name: \"notifications.commands.share-preview\",\n icon: 'fa fa-share-alt-square',\n executeMethod: function () {\n blade.sharePreview();\n },\n canExecuteMethod: function () {\n return true;\n },\n permission: 'notifications:templates:read'\n }];\n\n\n blade.headIcon = 'fa fa-eye';\n\n blade.initialize();\n }]);\n","angular.module('virtoCommerce.notificationsModule')\n.directive('vcJournalSearch', ['$localStorage', 'platformWebApp.bladeNavigationService', 'virtoCommerce.notificationsModule.predefinedSearchFilters', function ($localStorage, bladeNavigationService, predefinedSearchFilters) {\n return {\n restrict: 'E',\n templateUrl: function (elem, attrs) {\n return attrs.templateUrl || 'notificationsJournal-itemSearch-default.html'\n },\n scope: {\n blade: '='\n },\n link: function ($scope) {\n var blade = $scope.blade;\n $scope.$localStorage = $localStorage;\n var filter = $scope.filter = blade.filter;\n\n if ($localStorage.notificationsJournalSearchFilterId && !filter.keyword && filter.keyword !== null) {\n filter.current = _.findWhere($localStorage.notificationsJournalSearchFilters, { id: $localStorage.notificationsJournalSearchFilterId });\n filter.keyword = filter.current ? filter.current.keyword : '';\n }\n \n function showFilterDetailBlade(bladeData) {\n var newBlade = {\n id: 'filterDetail',\n controller: 'virtoCommerce.notificationsModule.filterJournalDetailController',\n template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/filter-detail.tpl.html',\n };\n angular.extend(newBlade, bladeData);\n bladeNavigationService.showBlade(newBlade, blade);\n };\n\n filter.change = function (isDetailBladeOpen) {\n $localStorage.notificationsJournalSearchFilterId = filter.current ? filter.current.id : null;\n if (filter.current && !filter.current.id) {\n filter.current = null;\n showFilterDetailBlade({ isNew: true });\n } else {\n if (!isDetailBladeOpen)\n bladeNavigationService.closeBlade({ id: 'filterJournalDetail' });\n filter.keyword = filter.current ? filter.current.keyword : '';\n filter.criteriaChanged();\n }\n };\n\n filter.edit = function ($event, entry) {\n filter.current = entry;\n showFilterDetailBlade({ data: entry });\n };\n }\n }\n}]);","angular.module('virtoCommerce.notificationsModule')\n .factory('virtoCommerce.notificationsModule.notificationsModuleApi', ['$resource', function ($resource) {\n return $resource('api/notifications/:id', { id: '@Id' }, {\n getNotificationList: { method: 'POST', url: 'api/notifications' },\n getNotificationByType: { method: 'GET', url: 'api/notifications/:type', },\n updateNotification: { method: 'PUT', url: 'api/notifications/:type' },\n getTemplates: { method: 'GET', url: 'api/notifications/:type/templates', isArray: true },\n getTemplateById: { method: 'GET', url: 'api/notifications/:type/templates/:id' },\n getTemplate: { method: 'GET', url: 'api/notifications/:type/:language/templates' },\n createTemplate: { method: 'POST', url: 'api/notifications/:type/templates' },\n updateTemplate: { method: 'PUT', url: 'api/notifications/:type/templates/:id' },\n renderTemplate: { method: 'POST', url: 'api/notifications/:type/templates/:language/rendercontent' },\n sharePreview: { method: 'POST', url: 'api/notifications/:type/templates/:language/sharepreview' },\n getNotificationJournalList: { method: 'POST', url: 'api/notifications/journal' },\n getNotificationJournalDetails: { method: 'GET', url: 'api/notifications/journal/:id' },\n resendNotifications: { method: 'POST', url: 'api/notifications/scheduleresend' }\n })\n }])\n .factory('virtoCommerce.notificationsModule.notificationLayoutsApi', ['$resource', function ($resource) {\n return $resource('api/notification-layouts/', {}, {\n getNotificationLayout: { method: 'GET', url: 'api/notification-layouts/:id' },\n searchNotificationLayouts: { method: 'POST', url: 'api/notification-layouts/search' },\n createNotificationLayout: { method: 'POST' },\n updateNotificationLayout: { method: 'PUT' },\n deleteNotificationLayout: { method: 'DELETE' }\n })\n }]);\n","angular.module('virtoCommerce.notificationsModule')\n.factory('virtoCommerce.notificationsModule.notificationTypesResolverService', function () {\n return {\n objects: [],\n registerType: function (notificationTypeDefinition) {\n notificationTypeDefinition.detailBlade = angular.extend({\n id: \"editNotification\",\n metaFields: [],\n controller: notificationTypeDefinition.detailBlade.controller,\n notificationTypeDefinition: notificationTypeDefinition\n }, notificationTypeDefinition.detailBlade);\n\n notificationTypeDefinition.knownChildrenTypes = notificationTypeDefinition.knownChildrenTypes || [];\n\n this.objects.push(notificationTypeDefinition);\n },\n resolve: function (type) {\n return _.findWhere(this.objects, { type: type });\n }\n };\n})\n.factory('virtoCommerce.notificationsModule.notificationTemplatesResolverService', function () {\n return {\n objects: [],\n registerTemplate: function (notificationTypeDefinition) {\n notificationTypeDefinition.detailBlade = angular.extend({\n id: \"editTemplate\",\n metaFields: [],\n controller: 'virtoCommerce.notificationsModule.editTemplateController',\n notificationTypeDefinition: notificationTypeDefinition\n }, notificationTypeDefinition.detailBlade);\n\n notificationTypeDefinition.knownChildrenTypes = notificationTypeDefinition.knownChildrenTypes || [];\n\n this.objects.push(notificationTypeDefinition);\n },\n resolve: function (type) {\n return _.findWhere(this.objects, { type: type });\n }\n };\n});\n","angular.module('virtoCommerce.notificationsModule')\n .controller('virtoCommerce.notificationsModule.notificationsAttachmentsWidgetController', ['$scope', 'platformWebApp.bladeNavigationService', function ($scope, bladeNavigationService) {\n\tvar blade = $scope.widget.blade;\n\n\tblade.showAttachments = function () {\n // Non implemented correctly yet. Disable to avoid user confusing.\n /*\n\t\tvar objectId = blade.currentEntity.id;\n var objectTypeId = 'Notifications';\n\t\tvar newBlade = {\n\t\t\tid: 'notificationLogWidgetChild',\n title: 'notifications.widgets.notificationsAttachmentsWidget.blade-title',\n\t\t\ttitleValues: { id: blade.currentEntity.id },\n\t\t\tobjectId: objectId,\n\t\t\tobjectTypeId: objectTypeId,\n\t\t\tlanguages: blade.currentEntity.languages,\n subtitle: 'notifications.widgets.notificationsAttachmentsWidget.blade-subtitle',\n controller: 'virtoCommerce.notificationsModule.notificationsAttachmentsController',\n\t\t\ttemplate: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notifications-attachments.tpl.html'\n\t\t};\n\t\tbladeNavigationService.showBlade(newBlade, blade);\n */\n\t};\n}]);\n","angular.module('virtoCommerce.notificationsModule')\n.controller('virtoCommerce.notificationsModule.notificationsLogWidgetController', ['$scope', 'platformWebApp.bladeNavigationService', function ($scope, bladeNavigationService) {\n\tvar blade = $scope.widget.blade;\n\n\tblade.showLog = function () {\n\t\tvar newBlade = {\n id: 'notificationAttachmentsWidgetChild',\n title: 'notifications.widgets.notificationsLogWidget.blade-title',\n\t\t\ttitleValues: { id: blade.currentEntity.id },\n\t\t\tnotificationType: blade.currentEntity.type,\n\t\t\tlanguages: blade.currentEntity.languages,\n subtitle: 'notifications.widgets.notificationsLogWidget.blade-subtitle',\n controller: 'virtoCommerce.notificationsModule.notificationsJournalController',\n\t\t\ttemplate: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notifications-journal.tpl.html'\n\t\t};\n\t\tbladeNavigationService.showBlade(newBlade, blade);\n\t};\n}]);\n","angular.module('virtoCommerce.notificationsModule')\n .controller('virtoCommerce.notificationsModule.notificationsTemplatesWidgetController', ['$scope', '$translate', 'platformWebApp.bladeNavigationService', function ($scope, $translate, bladeNavigationService) {\n var blade = $scope.widget.blade;\n $scope.templatesCount = '...';\n\n $scope.$watchCollection('blade.currentEntity.templates', function (items) {\n if (items)\n $scope.templatesCount = _.uniq(items, function (template) { return template.languageCode || null; }).length;\n });\n\n blade.showTemplates = function () {\n var newBlade = {\n id: 'notificationTemplatesWidgetChild',\n title: 'notifications.widgets.notificationsTemplatesWidget.blade-title',\n titleValues: { displayName: $translate.instant('notificationTypes.' + blade.currentEntity.type + '.displayName') },\n tenantId: blade.currentEntity.tenantId,\n tenantType: blade.currentEntity.tenantType,\n currentEntity: blade.currentEntity,\n subtitle: 'notifications.widgets.notificationsTemplatesWidget.blade-subtitle',\n controller: 'virtoCommerce.notificationsModule.notificationTemplatesListController',\n template: 'Modules/$(VirtoCommerce.Notifications)/Scripts/blades/notification-templates-list.tpl.html'\n };\n bladeNavigationService.showBlade(newBlade, blade);\n };\n }]);\n"],"names":["moduleTemplateName","undefined","AppDependencies","push","angular","module","config","$stateProvider","$urlRouterProvider","state","url","templateUrl","controller","$scope","bladeNavigationService","showBlade","id","title","subtitle","template","isClosingDisabled","factory","$localStorage","notificationsJournalSearchFilters","register","currentFiltersUpdateTime","currentFiltersStorageKey","newFilters","_","each","newFilter","found","find","x","lastUpdateTime","copy","splice","run","mainMenuService","widgetService","$state","notificationTypesResolverService","notificationTemplatesResolverService","$http","$compile","predefinedSearchFilters","menuItem","path","icon","priority","action","go","permission","addMenuItem","registerWidget","registerType","type","detailBlade","knownChildrenTypes","registerTemplate","name","keyword","get","then","response","data","$translate","formScope","blade","initializeBlade","currentEntity","origEntity","isLoading","isNew","setForm","form","saveChanges","Date","getTime","notificationsJournalSearchFilterId","parentBlade","filter","current","change","headIcon","toolbarCommands","executeMethod","canExecuteMethod","$valid","equals","indexOf","result","$filter","notifications","modifyEmailAddress","addresses","map","address","value","pluckAddress","pluck","isDirty","hasUpdatePermission","canSave","isValid","updatePermission","parametersForTemplate","initialize","getNotificationByType","tenantId","tenantType","tenantIdentity","isEmpty","isTransient","cc","bcc","templates","createdDateAsString","createdDate","modifiedDateAsString","modifiedDate","setNotification","updateNotification","entityToSave","isReadonly","forEach","element","isEdited","isPredefined","refresh","closeBlade","editorOptions","lineWrapping","lineNumbers","parserfile","extraKeys","cm","foldCode","getCursor","foldGutter","gutters","onLoad","_editor","mode","$watch","onClose","closeCallback","showConfirmationIfNeeded","getNotificationJournalDetails","currentNotificationId","error","setError","status","$timeout","layouts","FileUploader","reloadEditor","editorReloaded","originalEntity","parentRefresh","getNotificationLayout","currentEntityId","createNotificationLayout","bladeClose","updateNotificationLayout","fileUploader","headers","Accept","autoUpload","removeAfterUpload","onBeforeUploadItem","fileItem","onSuccessItem","$broadcast","items","onErrorItem","_file","message","onCompleteAll","dialogService","bladeUtils","uiGridHelper","gridOptionExtension","uiGridConstants","selection","dialog","gridApi","getSelectedRows","callback","remove","closeChildrenBlades","itemIds","deleteNotificationLayout","ids","showConfirmationDialog","any","criteriaChanged","pageSettings","currentPage","searchCriteria","sort","getSortExpression","skip","itemsPerPageCount","take","searchNotificationLayouts","totalItems","totalCount","listEntries","results","selectNode","layout","selectedNodeId","selectedLayout","editNotificationLayout","newBlade","setGridOptions","gridId","gridOptions","tryExtendGridOptions","onRegisterApi","initializePagination","settings","resolveType","kind","foundTemplate","resolve","length","showNotificationDialog","messageValues","selectedLanguage","languages","getValues","groups","templatesToDisplay","currentEntities","groupBy","languageCode","languageCodeTemplates","originalObject","effectiveTemplate","sortBy","toArray","openTemplate","titleValues","displayName","instant","notification","editedTemplate","isFirst","setSelectedNode","listItem","selectedType","selections","item","index","findIndex","deleteList","bindRefreshOnSortChanged","$rootScope","canRender","isSampleValidJson","dynamicProperties","date","now","getFullYear","getMonth","slice","getDate","sameLanguageTemplate","ind","saveTemplate","templ","orightml","body","renderTemplate","subtitleValues","notificationType","sample","JSON","parse","e","confirmed","deleteTemplate","showDialog","criteria","objectIds","objectId","objectType","getNotificationJournalList","subject","stopNotifications","list","stopSendingNotifications","messageIds","grid","rows","isSelected","entity","resendNotifications","i18n","authService","currentLanguage","getLanguage","responseGroup","getNotificationList","foundNotification","checkPermission","editNotification","$stateParams","openBlade","objectTypeId","controllerName","templateName","$sce","accounts","keyTemplateLocalStorage","originHtml","language","extend","itemFromLocalStorage","context","text","notificationLayoutId","$","load","height","contents","outerHeight","trustAsHtml","html","sharePreview","userLogin","email","setEmail","eMailTo","to","isSuccess","showSuccessDialog","errorMessage","showErrorDialog","directive","restrict","elem","attrs","scope","link","showFilterDetailBlade","bladeData","findWhere","isDetailBladeOpen","edit","$event","entry","$resource","method","getTemplates","isArray","getTemplateById","getTemplate","createTemplate","updateTemplate","objects","notificationTypeDefinition","metaFields","this","widget","showAttachments","showLog","templatesCount","$watchCollection","uniq","showTemplates"],"sourceRoot":""}