diff --git a/lib/notification/adapter/telegram.js b/lib/notification/adapter/telegram.js index 03c489d..8e1ecf5 100644 --- a/lib/notification/adapter/telegram.js +++ b/lib/notification/adapter/telegram.js @@ -22,16 +22,18 @@ export const send = ({ serviceName, newListings, notificationConfig, jobKey }) = const { token, chatId } = notificationConfig.find((adapter) => adapter.id === config.id).fields; const job = getJob(jobKey); const jobName = job == null ? jobKey : job.name; - //we have to split messages into chunk, because otherwise messages are going to become too big and will fail + // we have to split messages into chunks, because otherwise messages are going to become too big and will fail const chunks = arrayChunks(newListings, MAX_ENTITIES_PER_CHUNK); const promises = chunks.map((chunk) => { - let message = `${jobName} (${serviceName}) found ${newListings.length} new listings:\n\n`; - message += chunk.map( + const messageParagraphs = []; + + messageParagraphs.push(`${jobName} (${serviceName}) found ${newListings.length} new listings:`); + messageParagraphs.push(...chunk.map( (o) => `${shorten(o.title.replace(/\*/g, ''), 45).trim()}\n` + - [o.address, o.price, o.size].join(' | ') + - '\n\n', - ); + [o.address, o.price, o.size].join(' | ') + )); + /** * This is to not break the rate limit. It is to only send 1 message per second */ @@ -41,7 +43,7 @@ export const send = ({ serviceName, newListings, notificationConfig, jobKey }) = method: 'post', body: JSON.stringify({ chat_id: chatId, - text: message, + text: messageParagraphs.join('\n\n'), parse_mode: 'HTML', disable_web_page_preview: true, }), diff --git a/ui/src/App.less b/ui/src/App.less index 58dde4c..eafea75 100644 --- a/ui/src/App.less +++ b/ui/src/App.less @@ -40,4 +40,8 @@ a:active { color: #54a9ff; background-color: transparent; text-decoration: underline; -} \ No newline at end of file +} + +.semi-icon { + vertical-align: middle; +} diff --git a/ui/src/views/jobs/ProcessingTimes.jsx b/ui/src/views/jobs/ProcessingTimes.jsx index 224df44..f67ffa8 100644 --- a/ui/src/views/jobs/ProcessingTimes.jsx +++ b/ui/src/views/jobs/ProcessingTimes.jsx @@ -1,6 +1,6 @@ import React from 'react'; import {format} from '../../services/time/timeService'; -import {Banner, Descriptions} from '@douyinfe/semi-ui'; +import {Descriptions} from '@douyinfe/semi-ui'; export default function ProcessingTimes({processingTimes = {}}) { if (Object.keys(processingTimes).length === 0) { diff --git a/ui/src/views/jobs/mutation/components/provider/ProviderMutator.jsx b/ui/src/views/jobs/mutation/components/provider/ProviderMutator.jsx index 846b5af..3e78c50 100644 --- a/ui/src/views/jobs/mutation/components/provider/ProviderMutator.jsx +++ b/ui/src/views/jobs/mutation/components/provider/ProviderMutator.jsx @@ -101,7 +101,7 @@ export default function ProviderMutator({ onVisibilityChanged, visible = false, description={

- Currently, our Immoscout implementation does not drawing shapes on a map. Use a radius instead. + Currently, our Immoscout implementation does not support drawing shapes on a map. Use a radius instead.

}