feat: refs #6367 new componenet
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
0d85e89dc1
commit
ccb037da06
|
@ -27,7 +27,7 @@ module.exports = Self => {
|
|||
{
|
||||
relation: 'notification',
|
||||
scope: {
|
||||
include: [{
|
||||
include: {
|
||||
relation: 'subscription',
|
||||
scope: {
|
||||
include: {
|
||||
|
@ -40,10 +40,7 @@ module.exports = Self => {
|
|||
}
|
||||
}
|
||||
},
|
||||
}, {
|
||||
relation: 'notificationTemplate',
|
||||
fields: ['id']
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
}]
|
||||
|
@ -58,7 +55,7 @@ module.exports = Self => {
|
|||
for (const notificationUser of queue.notification().subscription()) {
|
||||
try {
|
||||
const sendParams = {
|
||||
recipient: 'pablone.verdnatura@gmail.com',
|
||||
recipient: notificationUser.user().emailUser().email,
|
||||
lang: notificationUser.user().lang
|
||||
};
|
||||
|
||||
|
|
|
@ -103,9 +103,6 @@
|
|||
"NotificationSubscription": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"NotificationTemplate": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Province": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -25,11 +25,6 @@
|
|||
"type": "hasMany",
|
||||
"model": "NotificationSubscription",
|
||||
"foreignKey": "notificationFk"
|
||||
},
|
||||
"notificationTemplate": {
|
||||
"type": "belongsTo",
|
||||
"model": "NotificationTemplate",
|
||||
"foreignKey": "templateFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"name": "NotificationTemplate",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "util.notificationTemplate"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"code": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
CREATE TABLE IF NOT EXISTS `util`.`notificationTemplate` (
|
||||
`id` int unsigned auto_increment NULL,
|
||||
`code` varchar(100) NOT NULL,
|
||||
description varchar(100) NOT NULL,
|
||||
CONSTRAINT `notificationTemplate_PK` PRIMARY KEY (`id`),
|
||||
CONSTRAINT `notificationTemplate_UN` UNIQUE KEY (`code`)
|
||||
)
|
||||
ENGINE=InnoDB
|
||||
DEFAULT CHARSET=utf8mb3
|
||||
COLLATE=utf8mb3_unicode_ci;
|
||||
|
||||
ALTER TABLE `util`.`notification` ADD templateFk int unsigned NULL;
|
||||
ALTER TABLE `util`.`notification` ADD CONSTRAINT notification_notificationTemplate_FK
|
||||
FOREIGN KEY (templateFk) REFERENCES util.notificationTemplate(id);
|
||||
|
|
@ -18,7 +18,6 @@ class Email extends Component {
|
|||
}
|
||||
|
||||
async getSubject() {
|
||||
if (this.args.subject) return this.args.subject;
|
||||
return (await this.getUserLocale())['subject'];
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
const Component = require(`vn-print/core/component`);
|
||||
const emailBody = new Component('email-body');
|
||||
module.exports = {
|
||||
name: 'blank-notification',
|
||||
components: {
|
||||
'email-body': emailBody.build()
|
||||
},
|
||||
props: {
|
||||
subject: {
|
||||
type: String
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
text: {
|
||||
type: String
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,3 @@
|
|||
subject: Asunto
|
||||
title: Titulo
|
||||
text: Texto
|
Loading…
Reference in New Issue