Skip to content

Commit

Permalink
Merge branch 'main' into renovate/patch-all-minor-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
mihai-peteu committed Sep 11, 2024
2 parents 60facf3 + f211ac4 commit ff75014
Show file tree
Hide file tree
Showing 28 changed files with 659 additions and 320 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@kong/design-tokens": "1.17.2",
"@kong/eslint-config-kong-ui": "^1.1.1",
"@kong/kongponents": "9.5.5",
"@stylistic/stylelint-plugin": "^2.1.3",
"@stylistic/stylelint-plugin": "^3.0.1",
"@types/flat": "^5.0.5",
"@types/js-yaml": "^4.0.9",
"@types/jsdom": "^21.1.7",
Expand All @@ -48,10 +48,10 @@
"jsdom": "^24.0.0",
"lerna": "^8.1.8",
"npm-run-all2": "^6.1.2",
"postcss": "^8.4.42",
"postcss-custom-properties": "^13.3.12",
"postcss": "^8.4.39",
"postcss-custom-properties": "^14.0.1",
"postcss-html": "^1.6.0",
"rimraf": "^5.0.10",
"rimraf": "^6.0.1",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.77.8",
"stylelint": "^16.2.1",
Expand All @@ -63,7 +63,7 @@
"tsc-alias": "^1.8.10",
"tslib": "^2.6.3",
"typedoc": "^0.26.6",
"typedoc-plugin-markdown": "^3.17.1",
"typedoc-plugin-markdown": "^4.2.6",
"typescript": "~5.3.3",
"uuid": "^9.0.1",
"vite": "^5.3.2",
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.

## [4.6.1](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





# [4.6.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)


### Features

* **analytics-utilities:** date-fns warning fix ([#1604](https://github.com/Kong/public-ui-components/issues/1604)) ([a195e2c](https://github.com/Kong/public-ui-components/commit/a195e2cb8294e71e3c11fd8469f66a7a3b91d260))





## [4.5.2](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





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

**Note:** Version bump only for package @kong-ui-public/analytics-chart
Expand Down
2 changes: 1 addition & 1 deletion 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": "4.5.1",
"version": "4.6.1",
"type": "module",
"main": "./dist/vitals-chart.umd.js",
"module": "./dist/vitals-chart.es.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,12 @@ import { verticalLinePlugin } from '../chart-plugins/VerticalLinePlugin'
import { highlightPlugin } from '../chart-plugins/HighlightPlugin'
import ToolTip from '../chart-plugins/ChartTooltip.vue'
import ChartLegend from '../chart-plugins/ChartLegend.vue'
import {
formatTime,
} from '../../utils'
import { v4 as uuidv4 } from 'uuid'
import { Line, Bar } from 'vue-chartjs'
import composables from '../../composables'
import type { ChartLegendSortFn, ChartTooltipSortFn, EnhancedLegendItem, KChartData, LegendValues, TooltipEntry, TooltipState } from '../../types'
import type { GranularityValues } from '@kong-ui-public/analytics-utilities'
import { formatTime } from '@kong-ui-public/analytics-utilities'
import type { Chart, LegendItem } from 'chart.js'
import { ChartLegendPosition, ChartTypes } from '../../enums'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Ref } from 'vue'
import { computed } from 'vue'
import type { ExploreResultV4 } from '@kong-ui-public/analytics-utilities'
import { formatTime } from '../utils'
import { formatTime } from '@kong-ui-public/analytics-utilities'

export default function useChartSelectedRange(chartData: Ref<ExploreResultV4>): Ref<string> {
const formattedTimeRange = computed(() => {
Expand Down
36 changes: 0 additions & 36 deletions packages/analytics/analytics-chart/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,8 @@
import { formatInTimeZone } from 'date-fns-tz'
import type { TimeFormatOptions } from '@kong-ui-public/analytics-utilities'

export const DECIMAL_DISPLAY = 2
export const FONT_SIZE_SMALL = 10
export const FONT_SIZE_REGULAR = 12

const numberFormatter = new Intl.NumberFormat(document?.documentElement?.lang || 'en-US')

export { numberFormatter }

// TODO: import `formatTime` from `analytics-utilities`; update Konnect + MFE imports as well
export function formatTime(ts: number, options: TimeFormatOptions = {}) {
if (!ts) {
return ts
}

const tz = options.tz || Intl.DateTimeFormat().resolvedOptions().timeZone

try {
let timeFormat = 'MMM dd, YYY hh:mm a'
if (options.short) {
timeFormat = 'MMM dd, YYY'
}

if (options.includeTZ) {
timeFormat += ' (z)'
}

const date = new Date(ts)

// Note: We always need to use `formatInTimeZone` (rather than plain `format`)
// in order to achieve consistent results based on the tz of the current computer.
// Otherwise, unit tests can fail depending on the tz of the dev's computer (or in CI), etc.
// Even if we don't care about timezones, timezones care about us. :/
return formatInTimeZone(date, tz, timeFormat)
} catch (exc) {
console.error('Invalid value passed to formatTime', ts)

return '(invalid date)'
}
}

export const MAX_LABEL_LENGTH = 10
24 changes: 24 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,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.8.4](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





## [0.8.3](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





## [0.8.2](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





## [0.8.1](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-06)

**Note:** Version bump only for package @kong-ui-public/analytics-config-store
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.8.1",
"version": "0.8.4",
"type": "module",
"main": "./dist/vitals-config-store.umd.js",
"module": "./dist/vitals-config-store.es.js",
Expand Down
24 changes: 24 additions & 0 deletions packages/analytics/analytics-geo-map/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.2.5](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





## [0.2.4](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





## [0.2.3](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





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

**Note:** Version bump only for package @kong-ui-public/analytics-geo-map
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/analytics-geo-map/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kong-ui-public/analytics-geo-map",
"version": "0.2.2",
"version": "0.2.5",
"type": "module",
"main": "./dist/vitals-geo-map.umd.js",
"module": "./dist/vitals-geo-map.es.js",
Expand Down
24 changes: 24 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,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [8.4.5](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





## [8.4.4](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





## [8.4.3](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)

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





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

**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": "8.4.2",
"version": "8.4.5",
"type": "module",
"main": "./dist/vitals-metric-provider.umd.js",
"module": "./dist/vitals-metric-provider.es.js",
Expand Down
33 changes: 33 additions & 0 deletions packages/analytics/analytics-utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.8.1](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)


### Bug Fixes

* clean up request filter types ([#1610](https://github.com/Kong/public-ui-components/issues/1610)) ([c6c14df](https://github.com/Kong/public-ui-components/commit/c6c14df61aa20faf8ee4f8507cde353413cb7566))





# [4.8.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)


### Features

* **analytics-utilities:** date-fns warning fix ([#1604](https://github.com/Kong/public-ui-components/issues/1604)) ([a195e2c](https://github.com/Kong/public-ui-components/commit/a195e2cb8294e71e3c11fd8469f66a7a3b91d260))





# [4.7.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-11)


### Features

* update to new filter schema ([#1606](https://github.com/Kong/public-ui-components/issues/1606)) ([3d18ff2](https://github.com/Kong/public-ui-components/commit/3d18ff241929adbaf9383826c2bd1a6c61c156ad))





# [4.6.0](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-09-06)


Expand Down
2 changes: 1 addition & 1 deletion 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": "4.6.0",
"version": "4.8.1",
"type": "module",
"main": "./dist/vitals-utilities.umd.js",
"module": "./dist/vitals-utilities.es.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/analytics/analytics-utilities/src/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export function formatTime(ts: number, options: TimeFormatOptions = {}) {
const tz = options.tz || Intl.DateTimeFormat().resolvedOptions().timeZone

try {
let timeFormat = 'MMM dd, YYY hh:mm a'
let timeFormat = 'MMM dd, yyy hh:mm a'
if (options.short) {
timeFormat = 'MMM dd, YYY'
timeFormat = 'MMM dd, yyy'
}

if (options.includeTZ) {
Expand Down
16 changes: 14 additions & 2 deletions packages/analytics/analytics-utilities/src/types/explore/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@ export const exploreFilterTypesV2 = ['in', 'not_in', 'selector'] as const

export type ExploreFilterTypesV2 = typeof exploreFilterTypesV2[number]

export const metricFilterTypesV2 = ['=', '!=', '<', '>', '<=', '>='] as const
export const requestFilterTypeEqualsV2 = ['=', '!='] as const

export type MetricFilterTypesV2 = typeof metricFilterTypesV2[number]
export type RequestFilterTypeEqualsV2 = typeof requestFilterTypeEqualsV2[number]

export const requestFilterTypeMetricV2 = ['=', '!=', '<', '>', '<=', '>='] as const

export type RequestFilterTypeMetricV2 = typeof requestFilterTypeMetricV2[number]

export const requestFilterTypeEmptyV2 = ['empty', 'not_empty'] as const

export type RequestFilterTypeEmptyV2 = typeof requestFilterTypeEmptyV2[number]

export const requestFilterTypeWildcardV2 = ['starts_with', 'ends_with'] as const

export type RequestFilterTypeWildcardV2 = typeof requestFilterTypeWildcardV2[number]


// Note: time types are common to all of the datasources.
Expand Down
Loading

0 comments on commit ff75014

Please sign in to comment.