Skip to content

Commit

Permalink
fix: resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
portikM committed Mar 20, 2024
2 parents 50d46ca + b54f470 commit 394ba84
Show file tree
Hide file tree
Showing 106 changed files with 1,472 additions and 355 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# Portal packages
/packages/portal/document-viewer/ @Kong/team-devx
/packages/portal/spec-renderer/ @Kong/team-devx
/packages/portal/swagger-ui-web-component/ @adamdehaven @davidma415 @kaiarrowood @mptap
/packages/portal/swagger-ui-web-component/ @adamdehaven @davidma415 @kaiarrowood @mptap @Kong/team-devx

# Analytics packages
/packages/analytics/analytics-chart @Kong/team-data
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.8",
"tslib": "^2.6.2",
"typedoc": "^0.25.10",
"typedoc": "^0.25.11",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "~5.3.3",
"uuid": "^9.0.1",
Expand Down
27 changes: 27 additions & 0 deletions packages/analytics/analytics-chart/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.5.3](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-20)


### Bug Fixes

* **deps:** update dependency date-fns-tz to ^2.0.1 ([#1269](https://github.com/Kong/public-ui-components/issues/1269)) ([0d727ab](https://github.com/Kong/public-ui-components/commit/0d727ab1d574a9ed63f4fe1c61c474452213d3fc))





## [2.5.2](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-19)

**Note:** Version bump only for package @kong-ui-public/analytics-chart





## [2.5.1](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-19)

**Note:** Version bump only for package @kong-ui-public/analytics-chart





# [2.5.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-15)


Expand Down
4 changes: 2 additions & 2 deletions packages/analytics/analytics-chart/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kong-ui-public/analytics-chart",
"version": "2.5.0",
"version": "2.5.3",
"type": "module",
"main": "./dist/vitals-chart.umd.js",
"module": "./dist/vitals-chart.es.js",
Expand Down Expand Up @@ -80,7 +80,7 @@
"chartjs-adapter-date-fns": "^3.0.0",
"chartjs-plugin-annotation": "^3.0.1",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
"date-fns-tz": "^2.0.1",
"pretty-bytes": "^6.1.1",
"uuid": "^9.0.1",
"vue-chartjs": "^5.3.0"
Expand Down
31 changes: 31 additions & 0 deletions packages/analytics/analytics-config-store/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,37 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.3.1](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-20)

**Note:** Version bump only for package @kong-ui-public/analytics-config-store





# [0.3.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-19)


### Features

* **analytics:** move to v2 config endpoint [MA-2730] ([#1257](https://github.com/Kong/public-ui-components/issues/1257)) ([e61e42f](https://github.com/Kong/public-ui-components/commit/e61e42fddb221a8e04f7faa18aa965bf7584d0e3))


### BREAKING CHANGES

* **analytics:** new config endpoint; types updated

The following components are updated:

- AnalyticsConfigCheck, and the associated store
- MetricsProviderInternal
- AnalyticsBridge (updates type that implementations must adhere to)
- DashboardRenderer (sandbox and tests)





# [0.2.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-14)


Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/analytics-config-store/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kong-ui-public/analytics-config-store",
"version": "0.2.0",
"version": "0.3.1",
"type": "module",
"main": "./dist/vitals-config-store.umd.js",
"module": "./dist/vitals-config-store.es.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createPinia, setActivePinia } from 'pinia'
import type { AnalyticsBridge, AnalyticsConfig } from '@kong-ui-public/analytics-utilities'
import type { AnalyticsBridge, AnalyticsConfigV2 } from '@kong-ui-public/analytics-utilities'
import AnalyticsConfigCheck from './AnalyticsConfigCheck.vue'
import { h } from 'vue'

Expand All @@ -8,29 +8,30 @@ const DEFAULT_SLOT_TEXT = 'Default slot rendered'
const FALLBACK_SLOT_TEXT = 'Fallback slot rendered'

const makeQueryBridge = (level: 'networkFail' | 'none' | 'analytics' | 'percentiles'): AnalyticsBridge => {
let config: AnalyticsConfig
let config: AnalyticsConfigV2

if (level === 'analytics') {
config = {
analytics: true,
percentiles: false,
api_requests_retention: '1d',
api_requests_retention_ms: 86400000,
api_analytics_retention: '30d',
api_analytics_retention_ms: 30 * 86400000,
analytics: {
percentiles: false,
retention_ms: 2592000000, // 30d
},
requests: null,
}
} else if (level === 'percentiles') {
config = {
analytics: true,
percentiles: true,
api_requests_retention: '1d',
api_requests_retention_ms: 86400000,
api_analytics_retention: '30d',
api_analytics_retention_ms: 30 * 86400000,
analytics: {
percentiles: true,
retention_ms: 2592000000, // 30d
},
requests: {
retention_ms: 86400000,
},
}
} else {
config = {
analytics: false,
analytics: null,
requests: null,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const analyticsConfigStore = useAnalyticsConfigStore()
const analyticsConfig: Ref<ConfigStoreState> = analyticsConfigStore.getConfig()
const loading = computed<boolean>(() => !analyticsConfig.value)
const hasAnalytics = computed<boolean>(() => !!analyticsConfig.value && analyticsConfig.value.analytics)
const hasPercentiles = computed<boolean>(() => !!analyticsConfig.value && analyticsConfig.value.analytics && analyticsConfig.value.percentiles)
const hasAnalytics = computed<boolean>(() => !!analyticsConfig.value?.analytics)
const hasPercentiles = computed<boolean>(() => !!analyticsConfig.value?.analytics?.percentiles)
const passThrough = computed<boolean>(() =>
(props.requireAnalytics ? hasAnalytics.value : true) &&
(props.requirePercentiles ? hasPercentiles.value : true),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineStore } from 'pinia'
import type { Ref } from 'vue'
import { inject, ref } from 'vue'
import type { AnalyticsBridge, AnalyticsConfig } from '@kong-ui-public/analytics-utilities'
import type { AnalyticsBridge, AnalyticsConfigV2 } from '@kong-ui-public/analytics-utilities'

const INJECT_QUERY_PROVIDER = 'analytics-query-provider'

export type ConfigStoreState = null | AnalyticsConfig
export type ConfigStoreState = null | AnalyticsConfigV2

export const useAnalyticsConfigStore = defineStore('analytics-config', () => {
let fetchedConfig = false
Expand All @@ -22,7 +22,8 @@ export const useAnalyticsConfigStore = defineStore('analytics-config', () => {
// Return a mock instance in order to prevent downstream components from waiting forever on the query.
// This allows, e.g., metric cards to show an error rather than just endlessly "loading".
configResult.value = {
analytics: false,
analytics: null,
requests: null,
}

return configResult
Expand Down
39 changes: 39 additions & 0 deletions packages/analytics/analytics-metric-provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,45 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [5.0.2](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-20)

**Note:** Version bump only for package @kong-ui-public/analytics-metric-provider





## [5.0.1](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-19)

**Note:** Version bump only for package @kong-ui-public/analytics-metric-provider





# [5.0.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-19)


### Features

* **analytics:** move to v2 config endpoint [MA-2730] ([#1257](https://github.com/Kong/public-ui-components/issues/1257)) ([e61e42f](https://github.com/Kong/public-ui-components/commit/e61e42fddb221a8e04f7faa18aa965bf7584d0e3))


### BREAKING CHANGES

* **analytics:** new config endpoint; types updated

The following components are updated:

- AnalyticsConfigCheck, and the associated store
- MetricsProviderInternal
- AnalyticsBridge (updates type that implementations must adhere to)
- DashboardRenderer (sandbox and tests)





## [4.1.7](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-14)

**Note:** Version bump only for package @kong-ui-public/analytics-metric-provider
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/analytics-metric-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kong-ui-public/analytics-metric-provider",
"version": "4.1.7",
"version": "5.0.2",
"type": "module",
"main": "./dist/vitals-metric-provider.umd.js",
"module": "./dist/vitals-metric-provider.es.js",
Expand Down
13 changes: 7 additions & 6 deletions packages/analytics/analytics-metric-provider/sandbox/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ const makeQueryBridge = (opts?: MockOptions): AnalyticsBridge => {
configFn: () => {
return Promise.resolve({
analytics: true,
percentiles: true,
api_analytics_retention: '1d',
api_analytics_retention_ms: 86400000,
api_requests_retention: '30d',
api_requests_retention_ms: 30 * 86400000,
analytics: {
percentiles: true,
retention_ms: 2592000000, // 30d
},
requests: {
retention_ms: 86400000,
},
})
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import MetricsTestHarness from './MetricsTestHarness.vue'
import { ref } from 'vue'
import type { AnalyticsBridge, AnalyticsConfig, ExploreQuery, ExploreResultV4 } from '@kong-ui-public/analytics-utilities'
import type { AnalyticsBridge, AnalyticsConfigV2, ExploreQuery, ExploreResultV4 } from '@kong-ui-public/analytics-utilities'
import type { MockOptions } from '../mockExploreResponse'
import { mockExploreResponse } from '../mockExploreResponse'
import { INJECT_QUERY_PROVIDER } from '../constants'
Expand Down Expand Up @@ -47,13 +47,14 @@ describe('<AnalyticsMetricProvider />', () => {

const hasTrendAccess = opts?.hasTrendAccess ?? true

const configFn = (): Promise<AnalyticsConfig> => Promise.resolve({
analytics: true,
percentiles: true,
api_requests_retention: '24h',
api_requests_retention_ms: 86400000,
api_analytics_retention: hasTrendAccess ? '30d' : '1d',
api_analytics_retention_ms: hasTrendAccess ? 30 * 86400000 : 86400000,
const configFn = (): Promise<AnalyticsConfigV2> => Promise.resolve({
analytics: {
percentiles: true,
retention_ms: hasTrendAccess ? 2592000000 : 86400000, // 30d | 1d
},
requests: {
retention_ms: 86400000,
},
})

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ const analyticsConfig = analyticsConfigStore.getConfig()
// Don't attempt to issue a query until we know what we can query for.
const queryReady = computed(() => analyticsConfig.value !== null && props.queryReady)
const hasTrendAccess = computed(() =>
analyticsConfig.value !== null &&
analyticsConfig.value.analytics &&
analyticsConfig.value.api_analytics_retention_ms > SEVEN_DAYS_MS,
)
// `undefined` compared with any number is false, but TS still complains.
const hasTrendAccess = computed(() => {
const retentionMs = analyticsConfig.value?.analytics?.retention_ms
return !!retentionMs && retentionMs > SEVEN_DAYS_MS
})
const tz = computed(() => {
if (props.tz) {
Expand Down
34 changes: 34 additions & 0 deletions packages/analytics/analytics-utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,40 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.0.1](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-20)


### Bug Fixes

* **deps:** update dependency date-fns-tz to ^2.0.1 ([#1269](https://github.com/Kong/public-ui-components/issues/1269)) ([0d727ab](https://github.com/Kong/public-ui-components/commit/0d727ab1d574a9ed63f4fe1c61c474452213d3fc))





# [2.0.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-19)


### Features

* **analytics:** move to v2 config endpoint [MA-2730] ([#1257](https://github.com/Kong/public-ui-components/issues/1257)) ([e61e42f](https://github.com/Kong/public-ui-components/commit/e61e42fddb221a8e04f7faa18aa965bf7584d0e3))


### BREAKING CHANGES

* **analytics:** new config endpoint; types updated

The following components are updated:

- AnalyticsConfigCheck, and the associated store
- MetricsProviderInternal
- AnalyticsBridge (updates type that implementations must adhere to)
- DashboardRenderer (sandbox and tests)





# [1.4.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-03-13)


Expand Down
4 changes: 2 additions & 2 deletions packages/analytics/analytics-utilities/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kong-ui-public/analytics-utilities",
"version": "1.4.0",
"version": "2.0.1",
"type": "module",
"main": "./dist/vitals-utilities.umd.js",
"module": "./dist/vitals-utilities.es.js",
Expand Down Expand Up @@ -58,7 +58,7 @@
},
"dependencies": {
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0"
"date-fns-tz": "^2.0.1"
},
"devDependencies": {
"@kong/design-tokens": "1.12.10"
Expand Down
Loading

0 comments on commit 394ba84

Please sign in to comment.