diff --git a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml index 0ebe4ce6..2d3c456e 100644 --- a/.github/workflows/dashboards-notifications-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-notifications-test-and-build-workflow.yml @@ -153,7 +153,7 @@ jobs: uses: actions/cache@v2 with: path: ${{ matrix.cypress_cache_folder }} - key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('**/package.json') }} + key: cypress-cache-v2-${{ runner.os }}-${{ hashFiles('OpenSearch-Dashboards/plugins/dashboards-notifications/package.json') }} - name: Reset npm's script shell if: ${{ matrix.os == 'windows-latest' }} diff --git a/notifications/core-spi/src/main/kotlin/org/opensearch/notifications/spi/model/MessageContent.kt b/notifications/core-spi/src/main/kotlin/org/opensearch/notifications/spi/model/MessageContent.kt index f10b6ccc..f577ad6a 100644 --- a/notifications/core-spi/src/main/kotlin/org/opensearch/notifications/spi/model/MessageContent.kt +++ b/notifications/core-spi/src/main/kotlin/org/opensearch/notifications/spi/model/MessageContent.kt @@ -23,10 +23,16 @@ class MessageContent( init { require(!Strings.isNullOrEmpty(title)) { "title is null or empty" } - require(!Strings.isNullOrEmpty(textDescription)) { "text message part is null or empty" } + require(!Strings.isNullOrEmpty(textDescription) || !Strings.isNullOrEmpty(htmlDescription)) { + "text message part and html message part are both null or empty" + } } fun buildMessageWithTitle(): String { - return "$title\n\n$textDescription" + return if (htmlDescription != null) { + htmlDescription + } else { + "$title\n\n$textDescription" + } } } diff --git a/notifications/core-spi/src/main/kotlin/org/opensearch/notifications/spi/model/destination/DestinationType.kt b/notifications/core-spi/src/main/kotlin/org/opensearch/notifications/spi/model/destination/DestinationType.kt index f915e174..a989144e 100644 --- a/notifications/core-spi/src/main/kotlin/org/opensearch/notifications/spi/model/destination/DestinationType.kt +++ b/notifications/core-spi/src/main/kotlin/org/opensearch/notifications/spi/model/destination/DestinationType.kt @@ -8,5 +8,5 @@ package org.opensearch.notifications.spi.model.destination * Supported notification destinations */ enum class DestinationType { - CHIME, SLACK, CUSTOM_WEBHOOK, SMTP, SES, SNS + CHIME, SLACK, CUSTOM_WEBHOOK, SMTP, SES, SNS, TELEGRAM }