Skip to content

Commit f4bef45

Browse files
authored
Merge pull request #88 from aisa-it/fix/BUGS-1169
fix BUGS-1169
2 parents ef5bf8b + 9b55be4 commit f4bef45

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

aiplan.go/cmd/aiplan/triggers.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ BEGIN
276276
'name', i.name,
277277
'sequence_id', i.sequence_id,
278278
'project', i.project_id,
279+
'workspace', i.workspace_id,
279280
'created_by', i.created_by_id
280281
) END
281282
) INTO payload

aiplan.go/internal/aiplan/notifications/email-service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ func (es *EmailService) MessageNotify(notification dao.DeferredNotifications, ms
480480
}
481481

482482
func (es *EmailService) DeadlineMessageNotify(user dao.User, notification dao.DeferredNotifications, nd notifyDeadline) error {
483-
subject := fmt.Sprintf("Уведомление об истечении срока выполнения задачи: %s-%d", notification.Issue.Project.Identifier, notification.Issue.SequenceId)
483+
subject := fmt.Sprintf("Уведомление об истечении срока выполнения задачи: %s-%d", notification.Project.Identifier, notification.Issue.SequenceId)
484484

485485
loc := time.Location(user.UserTimezone)
486486
date := nd.Deadline.In(&loc)

aiplan.go/internal/aiplan/notifications/notification_processor.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ func (nd *notifyDeadline) getUserNotification() *dao.UserNotifications {
415415
func (nd *notifyDeadline) toTelegram(notification *dao.DeferredNotifications, author *dao.User) (tgId int64, format string, any []any) {
416416
formatMsg := "❗Срок выполнения задачи\n[%s](%s)\nистекает *%s*"
417417
var out []interface{}
418-
418+
notification.Issue.Project = notification.Project
419+
notification.Issue.SetUrl()
419420
date, err := FormatDate(nd.Deadline.Format("02.01.2006 15:04 MST"), "02.01.2006 15:04 MST", &notification.User.UserTimezone)
420421
if err != nil {
421422
return 0, "", nil
@@ -429,6 +430,8 @@ func (nd *notifyDeadline) toTelegram(notification *dao.DeferredNotifications, au
429430
}
430431

431432
func (nd *notifyDeadline) toEmail(emailService *EmailService, notification *dao.DeferredNotifications, author *dao.User) bool {
433+
notification.Issue.Workspace = notification.Workspace
434+
notification.Issue.SetUrl()
432435
err := emailService.DeadlineMessageNotify(*notification.User, *notification, *nd)
433436
if err != nil {
434437
return false

aiplan.go/internal/aiplan/notifications/tg/tg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func isReplyMessage(update *models.Update) bool {
149149

150150
func (t *TgService) SendMessage(tgId int64, format string, anyStr []any) bool {
151151
msg := NewTgMsg()
152-
msg.title = Stelegramf(format, anyStr)
152+
msg.title = Stelegramf(format, anyStr...)
153153
_, err := t.Send(tgId, msg)
154154
if err != nil {
155155
slog.Error("Sending message to Telegram:", "error", err)

0 commit comments

Comments
 (0)