Selaa lähdekoodia

Bumps graph dependency, uses new tooltip event param

main
Ramin Tadayon 1 vuosi sitten
vanhempi
commit
e302ea54fd
No known key found for this signature in database GPG Key ID: 5B90E918AEBCE7A7
5 muutettua tiedostoa jossa 26 lisäystä ja 8 poistoa
  1. +1
    -1
      package.json
  2. +7
    -0
      src/plus/webviews/graph/protocol.ts
  3. +12
    -2
      src/webviews/apps/plus/graph/GraphWrapper.tsx
  4. +2
    -1
      src/webviews/apps/settings/partials/commit-graph.html
  5. +4
    -4
      yarn.lock

+ 1
- 1
package.json Näytä tiedosto

@ -12731,7 +12731,7 @@
"vscode:prepublish": "yarn run bundle"
},
"dependencies": {
"@gitkraken/gitkraken-components": "2.0.0",
"@gitkraken/gitkraken-components": "2.1.0",
"@microsoft/fast-element": "1.11.0",
"@microsoft/fast-react-wrapper": "0.3.16-0",
"@octokit/core": "4.1.0",

+ 7
- 0
src/plus/webviews/graph/protocol.ts Näytä tiedosto

@ -1,4 +1,5 @@
import type {
CommitDateTimeSource,
CssVariables,
ExcludeByType,
ExcludeRefsById,
@ -49,6 +50,12 @@ export enum GraphRefMetadataTypes {
export const supportedRefMetadataTypes: GraphRefMetadataType[] = Object.values(GraphRefMetadataTypes);
export type GraphCommitDateTimeSource = CommitDateTimeSource;
export enum GraphCommitDateTimeSources {
RowEntry = 'rowEntry',
Tooltip = 'tooltip',
}
export interface State {
windowFocused?: boolean;
repositories?: GraphRepository[];

+ 12
- 2
src/webviews/apps/plus/graph/GraphWrapper.tsx Näytä tiedosto

@ -25,6 +25,7 @@ import type {
GraphAvatars,
GraphColumnName,
GraphColumnsConfig,
GraphCommitDateTimeSource,
GraphComponentConfig,
GraphExcludedRef,
GraphExcludeTypes,
@ -49,6 +50,7 @@ import {
DidChangeWorkingTreeNotificationType,
DidFetchNotificationType,
DidSearchNotificationType,
GraphCommitDateTimeSources,
} from '../../../../plus/webviews/graph/protocol';
import type { Subscription } from '../../../../subscription';
import { getSubscriptionTimeRemaining, SubscriptionState } from '../../../../subscription';
@ -89,7 +91,8 @@ export interface GraphWrapperProps {
}
const getGraphDateFormatter = (config?: GraphComponentConfig): OnFormatCommitDateTime => {
return (commitDateTime: number) => formatCommitDateTime(commitDateTime, config?.dateStyle, config?.dateFormat);
return (commitDateTime: number, source?: GraphCommitDateTimeSource) =>
formatCommitDateTime(commitDateTime, config?.dateStyle, config?.dateFormat, source);
};
const createIconElements = (): { [key: string]: ReactElement<any> } => {
@ -1071,8 +1074,15 @@ function formatCommitDateTime(
commitDateTime: number,
style: DateStyle = DateStyle.Absolute,
format: DateTimeFormat | string = 'short+short',
source?: GraphCommitDateTimeSource,
): string {
return style === DateStyle.Relative ? fromNow(commitDateTime) : formatDate(commitDateTime, format);
switch (source) {
case GraphCommitDateTimeSources.Tooltip:
return formatDate(commitDateTime, format);
case GraphCommitDateTimeSources.RowEntry:
default:
return style === DateStyle.Relative ? fromNow(commitDateTime) : formatDate(commitDateTime, format);
}
}
function getClosestSearchResultIndex(

+ 2
- 1
src/webviews/apps/settings/partials/commit-graph.html Näytä tiedosto

@ -183,7 +183,8 @@
>
</div>
<p class="setting__hint hidden" data-visibility="graph.pullRequests.enabled">
<i class="icon icon__info"></i>Requires a connection to a supported remote service (e.g. GitHub)
<i class="icon icon__info"></i>Requires a connection to a supported remote service (e.g.
GitHub)
</p>
</div>

+ 4
- 4
yarn.lock Näytä tiedosto

@ -295,10 +295,10 @@
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
"@gitkraken/gitkraken-components@2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@gitkraken/gitkraken-components/-/gitkraken-components-2.0.0.tgz#1a1cbb2ef3873a412b693381ea56869a018e697c"
integrity sha512-3caeyF2imEIwZSCwDAf8f5bsxzVZ+0kmL1lZww3CANFlDnhgK8LRU3QkdnuW/PICwZYEpOJop3/0myVBwE3Ieg==
"@gitkraken/gitkraken-components@2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@gitkraken/gitkraken-components/-/gitkraken-components-2.1.0.tgz#5252db16363bd6d7f40a480c8515f3e5ca24802c"
integrity sha512-zyyJaMTaUiMUgJOIq6pQHQVAy9f1d2pspEc4p1aY+xlsO4R7o+RywGAEP20xHvkLaHkwJyKsDTbKh7xGSshDyA==
dependencies:
"@axosoft/react-virtualized" "9.22.3-gitkraken.3"
classnames "^2.3.2"

Ladataan…
Peruuta
Tallenna