diff --git a/hermes-console/json-server/db.json b/hermes-console/json-server/db.json index 23dab13ee0..cb179446ae 100644 --- a/hermes-console/json-server/db.json +++ b/hermes-console/json-server/db.json @@ -662,7 +662,8 @@ } ], "offlineRetransmissionEnabled": true, - "offlineRetransmissionDescription": "Offline retransmission" + "offlineRetransmissionDescription": "Offline retransmission", + "offlineRetransmissionFromViewDocsUrl": "https://hermes-pubsub.rtfd.org" }, "subscription": { "endpointAddressResolverMetadata": { diff --git a/hermes-console/src/api/app-configuration.ts b/hermes-console/src/api/app-configuration.ts index e1eb50b32f..f158aea20b 100644 --- a/hermes-console/src/api/app-configuration.ts +++ b/hermes-console/src/api/app-configuration.ts @@ -84,6 +84,7 @@ export interface TopicViewConfiguration { retentionUnits: RetentionUnit[]; offlineRetransmissionEnabled: boolean; offlineRetransmissionDescription: string; + offlineRetransmissionFromViewDocsUrl: string; } export interface DefaultTopicViewConfiguration { diff --git a/hermes-console/src/dummy/app-config.ts b/hermes-console/src/dummy/app-config.ts index a5166433e7..99e46e85c4 100644 --- a/hermes-console/src/dummy/app-config.ts +++ b/hermes-console/src/dummy/app-config.ts @@ -88,6 +88,7 @@ export const dummyAppConfig: AppConfiguration = { offlineRetransmissionEnabled: true, offlineRetransmissionDescription: 'Offline retransmission allows retransmitting events from GCP (BigQuery) to Hermes.', + offlineRetransmissionFromViewDocsUrl: 'https://hermes-pubsub.rtfd.org', }, subscription: { endpointAddressResolverMetadata: { diff --git a/hermes-console/src/i18n/en-US/index.ts b/hermes-console/src/i18n/en-US/index.ts index 01ec3f08b8..5555dd2389 100644 --- a/hermes-console/src/i18n/en-US/index.ts +++ b/hermes-console/src/i18n/en-US/index.ts @@ -645,6 +645,7 @@ const en_US = { }, offlineRetransmission: { title: 'Offline retransmission', + titleRetransmissionFromView: 'Docs for retransmission from View', subtitle: 'Offline retransmission allows retransmitting events from GCP (BigQuery) to Hermes.', targetTopic: 'Target topic', diff --git a/hermes-console/src/views/topic/offline-retransmission/OfflineRetransmissionForm.spec.ts b/hermes-console/src/views/topic/offline-retransmission/OfflineRetransmissionForm.spec.ts index 0f18354710..77d36bab41 100644 --- a/hermes-console/src/views/topic/offline-retransmission/OfflineRetransmissionForm.spec.ts +++ b/hermes-console/src/views/topic/offline-retransmission/OfflineRetransmissionForm.spec.ts @@ -1,4 +1,6 @@ +import { createTestingPinia } from '@pinia/testing'; import { describe } from 'vitest'; +import { dummyAppConfig } from '@/dummy/app-config'; import { renderWithEmits } from '@/utils/test-utils'; import { waitFor } from '@testing-library/vue'; import OfflineRetransmissionForm from '@/views/topic/offline-retransmission/OfflineRetransmissionForm.vue'; @@ -6,7 +8,10 @@ import OfflineRetransmissionForm from '@/views/topic/offline-retransmission/Offl describe('OfflineRetransmissionForm', () => { it('should emit a cancel event when user clicks cancel button', async () => { // given - const wrapper = renderWithEmits(OfflineRetransmissionForm, {}); + const wrapper = renderWithEmits( + OfflineRetransmissionForm, + createInitialState(), + ); // when await wrapper @@ -22,7 +27,10 @@ describe('OfflineRetransmissionForm', () => { it('should emit a retransmit event when user clicks retransmit button', async () => { // given - const wrapper = renderWithEmits(OfflineRetransmissionForm, {}); + const wrapper = renderWithEmits( + OfflineRetransmissionForm, + createInitialState(), + ); // when await wrapper @@ -55,3 +63,21 @@ describe('OfflineRetransmissionForm', () => { }); }); }); + +function createInitialState() { + return { + testPinia: createTestingPinia({ + initialState: { + appConfig: { + appConfig: { + ...dummyAppConfig, + }, + loading: false, + error: { + loadConfig: null, + }, + }, + }, + }), + }; +} \ No newline at end of file diff --git a/hermes-console/src/views/topic/offline-retransmission/OfflineRetransmissionForm.vue b/hermes-console/src/views/topic/offline-retransmission/OfflineRetransmissionForm.vue index 5aea28ce69..e8f1e90224 100644 --- a/hermes-console/src/views/topic/offline-retransmission/OfflineRetransmissionForm.vue +++ b/hermes-console/src/views/topic/offline-retransmission/OfflineRetransmissionForm.vue @@ -1,11 +1,13 @@