Skip to content

Commit

Permalink
Merge branch 'main' into feat/TDX-4666-hide-default-tag-when-all-tagged
Browse files Browse the repository at this point in the history
  • Loading branch information
amerc15 authored Oct 15, 2024
2 parents 3005d1b + 6306141 commit 943c3d0
Show file tree
Hide file tree
Showing 71 changed files with 1,453 additions and 413 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"lerna": "lerna"
},
"devDependencies": {
"@babel/types": "^7.25.6",
"@babel/types": "^7.25.7",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@digitalroute/cz-conventional-changelog-for-jira": "^8.0.1",
"@evilmartians/lefthook": "^1.7.17",
"@evilmartians/lefthook": "^1.7.18",
"@kong/design-tokens": "1.17.2",
"@kong/eslint-config-kong-ui": "^1.1.1",
"@kong/kongponents": "9.10.3",
"@kong/kongponents": "9.11.2",
"@stylistic/stylelint-plugin": "^3.0.1",
"@types/flat": "^5.0.5",
"@types/js-yaml": "^4.0.9",
Expand All @@ -35,7 +35,7 @@
"@types/uuid": "^10.0.0",
"@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vitest/ui": "^2.1.1",
"@vitest/ui": "^2.1.2",
"@vue/test-utils": "^2.4.6",
"@vue/tsconfig": "^0.5.1",
"c8": "^10.1.2",
Expand All @@ -53,7 +53,7 @@
"postcss-html": "^1.7.0",
"rimraf": "^6.0.1",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.78.0",
"sass": "^1.79.5",
"stylelint": "^16.9.0",
"stylelint-config-html": "^1.1.0",
"stylelint-config-recommended-scss": "^14.1.0",
Expand All @@ -63,13 +63,13 @@
"tsc-alias": "^1.8.10",
"tslib": "^2.7.0",
"typedoc": "^0.26.7",
"typedoc-plugin-markdown": "^4.2.8",
"typedoc-plugin-markdown": "^4.2.9",
"typescript": "~5.6.2",
"uuid": "^10.0.0",
"vite": "^5.4.8",
"vite-plugin-externals": "^0.6.2",
"vite-plugin-vue-devtools": "^7.4.6",
"vitest": "^2.1.1",
"vitest": "^2.1.2",
"vue": "^3.4.38",
"vue-router": "^4.4.5",
"vue-tsc": "^2.1.6"
Expand Down
24 changes: 24 additions & 0 deletions packages/analytics/analytics-chart/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.

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

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





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

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





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

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





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


Expand Down
6 changes: 3 additions & 3 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": "5.0.7",
"version": "5.0.10",
"type": "module",
"main": "./dist/vitals-chart.umd.js",
"module": "./dist/vitals-chart.es.js",
Expand All @@ -22,14 +22,14 @@
},
"peerDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/kongponents": "^9.10.3",
"@kong/kongponents": "^9.11.2",
"vue": ">= 3.3.13 < 4"
},
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong-ui-public/sandbox-layout": "workspace:^",
"@kong/design-tokens": "1.17.2",
"@kong/kongponents": "9.10.3",
"@kong/kongponents": "9.11.2",
"@types/uuid": "^10.0.0",
"file-saver": "^2.0.5",
"lodash.mapkeys": "^4.6.0",
Expand Down
8 changes: 8 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,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

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

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





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

**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.14",
"version": "0.8.15",
"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.35](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-10-14)

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





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

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





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

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





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

**Note:** Version bump only for package @kong-ui-public/analytics-geo-map
Expand Down
6 changes: 3 additions & 3 deletions 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.32",
"version": "0.2.35",
"type": "module",
"main": "./dist/vitals-geo-map.umd.js",
"module": "./dist/vitals-geo-map.es.js",
Expand Down Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "1.17.2",
"@kong/kongponents": "9.10.3",
"@kong/kongponents": "9.11.2",
"@types/geojson": "^7946.0.14",
"maplibre-gl": "^4.7.1",
"vue": "^3.4.38"
Expand All @@ -65,7 +65,7 @@
},
"peerDependencies": {
"@kong-ui-public/i18n": "workspace:^",
"@kong/kongponents": "9.10.3",
"@kong/kongponents": "9.11.2",
"maplibre-gl": "workspace:^",
"vue": "^3.4.38"
},
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.35](https://github.com/Kong/public-ui-components/compare/@kong-ui-public/[email protected]...@kong-ui-public/[email protected]) (2024-10-14)

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





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

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





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

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





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

**Note:** Version bump only for package @kong-ui-public/analytics-metric-provider
Expand Down
6 changes: 3 additions & 3 deletions 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.32",
"version": "8.4.35",
"type": "module",
"main": "./dist/vitals-metric-provider.umd.js",
"module": "./dist/vitals-metric-provider.es.js",
Expand Down Expand Up @@ -60,14 +60,14 @@
"@kong-ui-public/analytics-config-store": "workspace:^",
"@kong-ui-public/analytics-utilities": "workspace:^",
"@kong-ui-public/i18n": "workspace:^",
"@kong/kongponents": "^9.10.3"
"@kong/kongponents": "^9.11.2"
},
"devDependencies": {
"@kong-ui-public/analytics-config-store": "workspace:^",
"@kong-ui-public/analytics-utilities": "workspace:^",
"@kong-ui-public/i18n": "workspace:^",
"@kong/design-tokens": "1.17.2",
"@kong/kongponents": "9.10.3",
"@kong/kongponents": "9.11.2",
"pinia": ">= 2.1.7 < 3"
}
}
11 changes: 11 additions & 0 deletions packages/analytics/analytics-utilities/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

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


### Bug Fixes

* **analytics:** fix delta queries for absolute timeframes [MA-3273] ([#1707](https://github.com/Kong/public-ui-components/issues/1707)) ([0bfe0c7](https://github.com/Kong/public-ui-components/commit/0bfe0c723cc8485a55fca9c739541f01d5436bdf))





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


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": "5.0.2",
"version": "5.0.3",
"type": "module",
"main": "./dist/vitals-utilities.umd.js",
"module": "./dist/vitals-utilities.es.js",
Expand Down
65 changes: 50 additions & 15 deletions packages/analytics/analytics-utilities/src/queryTime.spec.tz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { add, setDate, startOfDay, startOfMonth, startOfWeek, subMilliseconds }

import { TimeframeKeys } from './types'
import { DeltaQueryTime, TimeseriesQueryTime, UnaryQueryTime } from './queryTime'
import type { Timeframe } from './timeframes'
import { Timeframe } from './timeframes'
import { datePickerSelectionToTimeframe, TimePeriods } from './timeframes'
import { formatInTimeZone } from 'date-fns-tz'
import { runUtcTest } from './specUtils'
Expand Down Expand Up @@ -469,6 +469,43 @@ runDstTest('daylight savings time: spring', () => {

expect(deltaQuery.granularitySeconds()).toBe(unaryQuery.granularitySeconds())
})

it('determines a correct trend query across multiple transitions', () => {
const start = new Date(1702832400000) // 2023-12-17, noon Eastern time
const end = new Date(1727798400000) // 2024-10-01, noon Eastern time
const timeframeLength = (end.getTime() - start.getTime()) / 1000

const timePeriod = new Timeframe({
key: 'custom',
timeframeText: 'custom',
display: 'custom',
startCustom: start,
endCustom: end,
timeframeLength: () => timeframeLength,
defaultResponseGranularity: 'daily',
dataGranularity: 'daily',
isRelative: false,
allowedTiers: ['free', 'plus', 'enterprise'],
})

const unaryQuery = new UnaryQueryTime(timePeriod, 'US/Eastern')

expect(unaryQuery.startMs()).toEqual(1702789200000) // 2023-12-17, midnight Eastern time
expect(unaryQuery.endMs()).toEqual(1727841600000) // 2024-10-02, midnight Eastern time

// The length of the above timespan. Due to DST, it's 1 hour shy of 290 days.
const expectedGranularity = 1727841600000 - 1702789200000

expect(unaryQuery.granularityMs()).toEqual(expectedGranularity)

const deltaQuery = new DeltaQueryTime(timePeriod, 'US/Eastern')

expect(deltaQuery.startMs()).toEqual(1677736800000) // 2023-03-02, 1 AM Eastern time
expect(deltaQuery.endMs()).toEqual(1727841600000) // 2024-10-02, midnight Eastern time

// Exactly half of the full delta timespan.
expect(deltaQuery.granularityMs()).toEqual(expectedGranularity)
})
})

runDstTest('daylight savings time: fall', () => {
Expand Down Expand Up @@ -533,6 +570,7 @@ runUtcTest('UTC: timezone handling', () => {
const unaryQuery = new UnaryQueryTime(getTimePeriod(TimeframeKeys.CURRENT_WEEK), 'US/Eastern')

// Unary and delta end times should be rounded up to the nearest day.
// (Total length: 3 full days)
expect(unaryQuery.endDate()).toEqual(new Date('2023-11-09T05:00:00.000Z'))
expect(deltaQuery.endDate()).toEqual(new Date('2023-11-09T05:00:00.000Z'))

Expand All @@ -541,8 +579,9 @@ runUtcTest('UTC: timezone handling', () => {

// Delta start times are tricky; the existing behavior is to just match the length of the timeframe rather than
// actually comparing to the full previous week.
// Because we're dealing with absolute timeframes, this rounds to the nearest day and therefore tracks DST.
expect(deltaQuery.startDate()).toEqual(new Date('2023-11-03T04:00:00.000Z'))
// This timeperiod isn't guaranteed cover integer numbers of days, because days might be different lengths
// around DST boundaries.
expect(deltaQuery.startDate()).toEqual(new Date('2023-11-03T05:00:00.000Z'))
expect(deltaQuery.granularitySeconds()).toBe(unaryQuery.granularitySeconds())
})

Expand All @@ -559,9 +598,8 @@ runUtcTest('UTC: timezone handling', () => {

// Delta start times are tricky; the existing behavior is to just match the length of the timeframe rather than
// actually comparing to the full previous week.
// DST introduces an odd edge case where the timeframe length is N days + 1 hour. We basically round the timeframe
// up to the nearest day, so we end up with N+1 days.
expect(deltaQuery.startDate()).toEqual(new Date('2023-10-22T04:00:00.000Z'))
// The timeframe is 7 days and 1 hour due to the DST transition.
expect(deltaQuery.startDate()).toEqual(new Date('2023-10-23T03:00:00.000Z'))
expect(deltaQuery.granularitySeconds()).toBe(unaryQuery.granularitySeconds())
})

Expand All @@ -579,8 +617,8 @@ runUtcTest('UTC: timezone handling', () => {

// Delta start times are tricky; the existing behavior is to just match the length of the timeframe rather than
// actually comparing to the full previous month.
// The timeframe gets rounded up to the nearest day, so this tracks the DST change.
expect(deltaQuery.startDate()).toEqual(new Date('2023-10-23T04:00:00.000Z'))
// The timeframe is 7 days and 1 hour due to the DST transition.
expect(deltaQuery.startDate()).toEqual(new Date('2023-10-24T03:00:00.000Z'))
expect(deltaQuery.granularitySeconds()).toBe(unaryQuery.granularitySeconds())
})

Expand Down Expand Up @@ -647,8 +685,7 @@ runUtcTest('UTC: timezone handling', () => {

// Delta start times are tricky; the existing behavior is to just match the length of the timeframe rather than
// actually comparing to the full previous week.
// This is extended to the nearest day, which in this case results in a different hour offset due to DST.
expect(deltaQuery.startDate()).toEqual(new Date('2023-10-22T21:00:00.000Z'))
expect(deltaQuery.startDate()).toEqual(new Date('2023-10-22T22:00:00.000Z'))
expect(deltaQuery.granularitySeconds()).toBe(unaryQuery.granularitySeconds())
})

Expand All @@ -665,8 +702,7 @@ runUtcTest('UTC: timezone handling', () => {

// Delta start times are tricky; the existing behavior is to just match the length of the timeframe rather than
// actually comparing to the full previous month.
// This is extended to the nearest day, which in this case results in a different hour offset due to DST.
expect(deltaQuery.startDate()).toEqual(new Date('2023-10-22T21:00:00.000Z'))
expect(deltaQuery.startDate()).toEqual(new Date('2023-10-22T22:00:00.000Z'))
expect(deltaQuery.granularitySeconds()).toBe(unaryQuery.granularitySeconds())
})

Expand All @@ -684,9 +720,8 @@ runUtcTest('UTC: timezone handling', () => {

// Delta start times are tricky; the existing behavior is to just match the length of the timeframe rather than
// actually comparing to the full previous month.
// DST introduces an odd edge case where the timeframe length is N days + 1 hour. We basically round the timeframe
// up to the nearest day, so we end up with N+1 days.
expect(deltaQuery.startDate()).toEqual(new Date('2023-08-29T21:00:00.000Z'))
// Bulgaria's DST change happens in this window, so the actual timeframe length is 31 days and 1 hour.
expect(deltaQuery.startDate()).toEqual(new Date('2023-08-30T20:00:00.000Z'))

expect(deltaQuery.granularitySeconds()).toBe(unaryQuery.granularitySeconds())
})
Expand Down
Loading

0 comments on commit 943c3d0

Please sign in to comment.