Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(kdatetimepicker): use Timeperiod from public-ui [MA-1995] #1726

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"semantic-release": "semantic-release"
},
"dependencies": {
"@kong-ui-public/analytics-utilities": "^0.7.2",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kongponents cannot have a dependency on this package - this repo is completely isolated from other kong component libraries

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood

"axios": "^0.27.2",
"date-fns": "^2.30.0",
"date-fns-tz": "^2.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/components/KDateTimePicker/KDateTimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ import KIcon from '@/components/KIcon/KIcon.vue'
import KPop from '@/components/KPop/KPop.vue'
import KSegmentedControl from '@/components/KSegmentedControl/KSegmentedControl.vue'
import 'v-calendar/dist/style.css'
import type { DateTimePickerState, TimeFrameSection, TimePeriod, TimeRange, Mode, CSSProperties } from '@/types'
import type { TimePeriod } from '@kong-ui-public/analytics-utilities'
import type { DateTimePickerState, TimeFrameSection, TimeRange, Mode, CSSProperties } from '@/types'
import { ModeArray } from '@/types'
import { KUI_COLOR_TEXT_NEUTRAL, KUI_ICON_SIZE_30 } from '@kong/design-tokens'

Expand Down
11 changes: 1 addition & 10 deletions src/types/date-time-picker.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
import type { AnyElementOf } from '@/types/utils'

import type { TimePeriod } from '@kong-ui-public/analytics-utilities'
export interface TimeRange {
Copy link
Contributor

@filipgutica filipgutica Sep 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, kongponents cannot have a dependency on another kong package

start: Date | number,
end: Date | number,
timePeriodsKey?: string
}

export interface TimePeriod {
key: string // unique identifier
display: string
timeframeText: string
timeframeLength: () => string
start: () => Date
end: () => Date
}

export interface TimeFrameSection {
section: string
values: TimePeriod[]
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,14 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"

"@kong-ui-public/analytics-utilities@^0.7.2":
version "0.7.2"
resolved "https://registry.npmjs.org/@kong-ui-public/analytics-utilities/-/analytics-utilities-0.7.2.tgz#8618d758b6f005a038fc89c116b415b78c167e67"
integrity sha512-/K/PsWsdcbdxsE1QAMjRcFhiAZ//Oo8L5tKS0ZVZ2gLRSCqpMKSFD56ZiTiXiZuq/cy5QCjiKadxeRpGeAJBxw==
dependencies:
date-fns "^2.30.0"
date-fns-tz "^2.0.0"

"@kong/design-tokens@^1.10.2":
version "1.10.2"
resolved "https://registry.yarnpkg.com/@kong/design-tokens/-/design-tokens-1.10.2.tgz#2b9dc88bba73c2968ea1d06ba7b348910444cf10"
Expand Down