diff --git a/.github/workflows/ci-console.yml b/.github/workflows/ci-console.yml index ac68d0a521..3431872abe 100644 --- a/.github/workflows/ci-console.yml +++ b/.github/workflows/ci-console.yml @@ -16,7 +16,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Run frontend tests run: yarn && yarn test:unit - name: Run linter diff --git a/hermes-console-vue/.eslintrc.cjs b/hermes-console-vue/.eslintrc.cjs index 379c5bd2da..5fde39b3b2 100644 --- a/hermes-console-vue/.eslintrc.cjs +++ b/hermes-console-vue/.eslintrc.cjs @@ -43,5 +43,7 @@ module.exports = { memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], }, ], + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['error'], }, }; diff --git a/hermes-console-vue/json-server/db.json b/hermes-console-vue/json-server/db.json index d93c334615..06ed60aa9f 100644 --- a/hermes-console-vue/json-server/db.json +++ b/hermes-console-vue/json-server/db.json @@ -1,4 +1,28 @@ { + "groups": [ + "pl.allegro.public.offer", + "pl.allegro.public.offer.product", + "pl.allegro.public.order", + "pl.allegro.public.user", + "pl.allegro.public.group", + "pl.allegro.public.admin" + ], + "topicNames": [ + "pl.allegro.public.offer.product.ProductEventV1", + "pl.allegro.public.offer.product.ProductEventV2", + "pl.allegro.public.offer.product.ProductEventV3", + "pl.allegro.public.offer.product.ProductEventV4", + "pl.allegro.public.offer.OfferEventV1", + "pl.allegro.public.offer.OfferEventV2", + "pl.allegro.public.offer.OfferEventV3", + "pl.allegro.public.order.OrderEventV1", + "pl.allegro.public.order.OrderEventV2", + "pl.allegro.public.user.UserCreatedEvent", + "pl.allegro.public.user.UserChangedEvent", + "pl.allegro.public.group.DummyEvent", + "pl.allegro.public.admin.AdminOfferActionEvent", + "pl.allegro.public.admin.AdminOrderActionEvent" + ], "offlineClientsSource": { "source": "https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&layer=mapnik" }, diff --git a/hermes-console-vue/json-server/routes.json b/hermes-console-vue/json-server/routes.json index 8a0bf70a46..cf76245007 100644 --- a/hermes-console-vue/json-server/routes.json +++ b/hermes-console-vue/json-server/routes.json @@ -1,7 +1,9 @@ { - "/readiness/datacenters": "/readinessDatacenters", - "/workload-constraints": "/constraints", "/consistency/inconsistencies/topics": "/inconsistentTopics", + "/groups": "/groups", + "/owners/sources/Service%20Catalog/:id": "/topicsOwners/:id", + "/readiness/datacenters": "/readinessDatacenters", + "/topics": "/topicNames", "/topics/:id/metrics": "/topicsMetrics/:id", "/topics/:id/preview": "/topicPreview", "/topics/:id/offline-clients-source": "/offlineClientsSource", @@ -12,5 +14,5 @@ "/topics/:topicName/subscriptions/:id/metrics": "/subscriptionsMetrics/:id", "/topics/:topicName/subscriptions/:id/undelivered": "/subscriptionUndeliveredMessages", "/topics/:topicName/subscriptions/:id/undelivered/last": "/subscriptionUndeliveredMessages/:id", - "/owners/sources/Service%20Catalog/:id": "/topicsOwners/:id" + "/workload-constraints": "/constraints" } diff --git a/hermes-console-vue/package.json b/hermes-console-vue/package.json index 599898e838..c92657b99c 100644 --- a/hermes-console-vue/package.json +++ b/hermes-console-vue/package.json @@ -2,6 +2,9 @@ "name": "hermes-console-vue", "description": "Console for Hermes Management", "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + }, "scripts": { "dev": "vite", "build": "run-p type-check build-only", diff --git a/hermes-console-vue/src/api/hermes-client/index.ts b/hermes-console-vue/src/api/hermes-client/index.ts index d779f8b2e1..74c6205187 100644 --- a/hermes-console-vue/src/api/hermes-client/index.ts +++ b/hermes-console-vue/src/api/hermes-client/index.ts @@ -1,5 +1,8 @@ import axios from 'axios'; import type { AppConfiguration } from '@/api/app-configuration'; +import type { ConstraintsConfig } from '@/api/constraints'; +import type { ConsumerGroup } from '@/api/consumer-group'; +import type { DatacenterReadiness } from '@/api/datacenter-readiness'; import type { MessagePreview, TopicMetrics, @@ -60,3 +63,31 @@ export function fetchOfflineClientsSource( `/topics/${topicName}/offline-clients-source`, ); } + +export function fetchConstraints(): ResponsePromise { + return axios.get('/workload-constraints'); +} + +export function fetchReadiness(): ResponsePromise { + return axios.get('/readiness/datacenters'); +} + +export function fetchConsumerGroups( + topicName: string, + subscription: string, +): ResponsePromise { + return axios.get( + `/topics/${topicName}/subscriptions/${subscription}/consumer-groups`, + ); +} + +export function fetchInconsistentTopics(): ResponsePromise { + return axios.get('/consistency/inconsistencies/topics'); +} + +export function fetchTopicNames(): ResponsePromise { + return axios.get('/topics'); +} +export function fetchGroupNames(): ResponsePromise { + return axios.get('/groups'); +} diff --git a/hermes-console-vue/src/api/topic.ts b/hermes-console-vue/src/api/topic.ts index 6695c9d9e7..0f8f9da1e1 100644 --- a/hermes-console-vue/src/api/topic.ts +++ b/hermes-console-vue/src/api/topic.ts @@ -40,7 +40,7 @@ export enum Ack { } export interface PublishingAuth { - publishers: string[]; + publishers?: string[]; enabled: boolean; unauthenticatedAccessEnabled: boolean; } diff --git a/hermes-console-vue/src/components/console-alert/ConsoleAlert.vue b/hermes-console-vue/src/components/console-alert/ConsoleAlert.vue index 4d1a19ee80..98ab23e19e 100644 --- a/hermes-console-vue/src/components/console-alert/ConsoleAlert.vue +++ b/hermes-console-vue/src/components/console-alert/ConsoleAlert.vue @@ -9,7 +9,7 @@