@gitkraken/gitkraken-components 11.2.1 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @gitkraken/gitkraken-components might be problematic. Click here for more details.
- package/CHANGELOG.md +10 -0
- package/dist/components/graph/GraphContainer.d.ts +6 -0
- package/dist/components/graph/refzone/RefNode.d.ts +2 -0
- package/dist/components/graph/refzone/RefNodes.d.ts +3 -1
- package/dist/components/graph/refzone/RefZone.d.ts +2 -0
- package/dist/components/graph/rowRenderers/RefZoneRow.d.ts +2 -0
- package/dist/domain/graph/GraphTypes.d.ts +7 -0
- package/dist/domain/graph/PullRequestHelpers.d.ts +6 -0
- package/dist/domain/hostingservice/HostingServiceTypes.d.ts +7 -0
- package/dist/index.js +2 -2
- package/dist/types.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 12.0.0
|
|
4
|
+
|
|
5
|
+
- **BREAKING CHANGE:** `hostingServiceInfo` is now a required `GraphContainer` prop ([#392](https://github.com/gitkraken/GitKrakenComponents/pull/392))
|
|
6
|
+
- It maps every `HostingServiceType` to that service's display name and the character that prefixes a pull request number on it (for example `#`, or `!` for GitLab merge requests). The graph no longer keeps its own copy of the service names, so consumers must pass this prop; omitting it is a compile error, and a pull request row will throw at runtime.
|
|
7
|
+
- **BREAKING CHANGE:** `PullRequestIcon-Tooltip` no longer hardcodes `#` ([#392](https://github.com/gitkraken/GitKrakenComponents/pull/392))
|
|
8
|
+
- `{0}` is now a pull request id that already carries its service's character, so the default changed from `'#{0}: {1}\n Double-click to open pull request on {2}'` to `'{0}: {1}\n Double-click to open pull request on {2}'`. Consumers that ship their own translation map fall back to `DEFAULT_TRANSLATIONS` only when no `translate` prop is given, so they must update this key in lockstep or every pull request tooltip renders `##123` (`!!123` on GitLab).
|
|
9
|
+
- Deprecated `getHostingServiceName` in favor of the `hostingServiceInfo` prop. It still ships in this release and will be removed in the next major version. ([#392](https://github.com/gitkraken/GitKrakenComponents/pull/392))
|
|
10
|
+
- Added `stackPosition` and `stackSize` to pull request ref metadata. When both are whole numbers and `stackPosition` falls between 1 and `stackSize`, the pull request icon's tooltip names the pull request's position in its stack. ([#392](https://github.com/gitkraken/GitKrakenComponents/pull/392))
|
|
11
|
+
- Added the `PullRequestIcon-TooltipWithStack` translation key for that tooltip. Consumers that ship their own translation map should add it. ([#392](https://github.com/gitkraken/GitKrakenComponents/pull/392))
|
|
12
|
+
|
|
3
13
|
## 11.2.1
|
|
4
14
|
|
|
5
15
|
- Ensures the branch or tag creation input remains visible and usable when its target commit scrolls out of the virtualized graph viewport ([#390](https://github.com/gitkraken/GitKrakenComponents/pull/390))
|
|
@@ -7,6 +7,7 @@ import type { CssVariables } from '../../domain/generic/GenericTypes';
|
|
|
7
7
|
import type { GraphCommitDescDisplayMode, GraphMarkerType, GraphSearchMode, GraphZone, GraphZoneType, ShiftSelectMode } from '../../domain/graph/GraphConstants';
|
|
8
8
|
import type { ThrottledFn } from '../../domain/graph/GraphHelpers';
|
|
9
9
|
import type { AbsoluteNodeLeftByColumn, AvatarUrlByEmail, AvatarUrlRequestedByEmail, ChildrenBySha, ColumnColorByColumn, DownstreamsByUpstream, EdgeByColumn, ExcludeByType, ExcludeRefsById, ExcludeRemotesByName, FormatCommitMessage, FormatRefShorthand, GetExternalIcon, GetMissingAvatar, GetMissingRefMetadata, GraphColumnSetting, GraphColumnsSettings, GraphContexts, GraphMarkerColors, GraphMarkerRowIndices, GraphPlatform, GraphRefGroup, GraphRow, GraphZoneModeConstants, GraphZonesByType, Head, HighlightedShas, IncludeOnlyRefsById, IncludeOnlyRemotesByName, IsRefShorthandValid, IsSelectedBySha, NodeOffsetByColumn, NodeOpacityByColumn, OnClearCurrentlyHoveredGraphCommit, OnClickCommit, OnClickGraphRef, OnClickGraphRow, OnClickRef, OnColumnsCalculated, OnCommitContextMenu, OnCommitMessageChange, OnCurrentlyHoveredGraphCommit, OnDoubleClickCommit, OnDoubleClickGraphRef, OnDoubleClickGraphRow, OnDoubleClickRef, OnEmailsMissingAvatarUrls, OnFilterColumnClick, OnFormatCommitDateTime, OnGraphColumnReOrdered, OnGraphColumnResized, OnGraphColumnsReOrdered, OnGraphMouseEnter, OnGraphMouseLeave, OnGraphRefNodeHovered, OnGraphRefNodeUnhovered, OnGraphResized, OnGraphRowHovered, OnGraphRowUnhovered, OnGraphScrollForZone, OnGraphVisibleRowsChanged, OnGraphZoneResize, OnGraphZoneResizeEnd, OnLoadSelectedGraphRow, OnPopupGraphHeaderContextMenu, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefContextMenu, OnRefCreate, OnRefCreateCancel, OnRefCreateContextMenu, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefShorthandChange, OnRefsMissingMetadata, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnRowContextMenu, OnScrollForZone, OnSelectGraphRows, OnSettingsClick, OnShowMoreCommits, OnToggleRefNodesShown, OnToggleRefsVisibilityClick, OnWipMessageBlur, OnWipMessageFocus, ProcessedGraphRow, ProcessedGraphRowBySha, RefMetadataById, RefMetadataRequestedById, RefMetadataType, RefsMissingMetadata, Remote, ReserverInfoBySha, RowEdges, RowStats, RowStatsConstraints, ShaByRefId, Tag, TopAndBottomVisibleRowIndex } from '../../domain/graph/GraphTypes';
|
|
10
|
+
import type { HostingServiceInfoType, HostingServiceType } from '../../domain/hostingservice/HostingServiceTypes';
|
|
10
11
|
import type { TranslationFn } from '../../domain/language/LanguageTypes';
|
|
11
12
|
import type { CreateRefFormData, RefIconsPosition } from '../../domain/ref/RefTypes';
|
|
12
13
|
import type { OnBlur, OnKeyDown, OnKeyUp, OnMouseDown, OnResizeParams } from '../../domain/ui/UiTypes';
|
|
@@ -35,6 +36,11 @@ export interface StateProps {
|
|
|
35
36
|
downstreamsByUpstream?: DownstreamsByUpstream;
|
|
36
37
|
formatRefShorthand?: FormatRefShorthand;
|
|
37
38
|
highlightRowsOnRefHover?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The display name and pull request character (for example `#` or `!`) to use for each hosting service.
|
|
41
|
+
* Every `HostingServiceType` must be present, since pull request metadata names its hosting service by type.
|
|
42
|
+
*/
|
|
43
|
+
hostingServiceInfo: Record<HostingServiceType, HostingServiceInfoType>;
|
|
38
44
|
isContainerWindowFocused?: boolean;
|
|
39
45
|
isRefShorthandValid?: IsRefShorthandValid;
|
|
40
46
|
showGhostRefsOnRowHover?: boolean;
|
|
@@ -2,6 +2,7 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
|
|
4
4
|
import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, GraphRef, GraphRefGroup, OnClickRef, OnClickRefMetadata, OnDoubleClickRef, OnDoubleClickRefMetadata, OnHideRefClick, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefZoneContextMenu, RefMetadataById, RefMetadataItem, RefMetadataType } from '../../../domain/graph/GraphTypes';
|
|
5
|
+
import type { HostingServiceInfoType, HostingServiceType } from '../../../domain/hostingservice/HostingServiceTypes';
|
|
5
6
|
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
6
7
|
import type { RefIconsPosition } from '../../../domain/ref/RefTypes';
|
|
7
8
|
import type { OnClick, OnContextMenu, OnDoubleClick } from '../../../domain/ui/UiTypes';
|
|
@@ -11,6 +12,7 @@ export type RefNodeProps = {
|
|
|
11
12
|
groupIsHovered: boolean;
|
|
12
13
|
hasActive: boolean;
|
|
13
14
|
hasRefs: boolean;
|
|
15
|
+
hostingServiceInfo: Record<HostingServiceType, HostingServiceInfoType>;
|
|
14
16
|
isActive: boolean;
|
|
15
17
|
isGhostRef: boolean;
|
|
16
18
|
isHidden?: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactElement, RefObject } from 'react';
|
|
2
2
|
import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
|
|
3
3
|
import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClickRef, OnDoubleClickRef, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefZoneContextMenu, OnToggleRefNodesShown, GraphRefGroup as RefGroup, RefGroupContexts, RefMetadataById, RefMetadataType } from '../../../domain/graph/GraphTypes';
|
|
4
|
+
import type { HostingServiceInfoType, HostingServiceType } from '../../../domain/hostingservice/HostingServiceTypes';
|
|
4
5
|
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
5
6
|
import type { RefIconsPosition } from '../../../domain/ref/RefTypes';
|
|
6
7
|
type RefNodesProps = {
|
|
@@ -14,6 +15,7 @@ type RefNodesProps = {
|
|
|
14
15
|
targetRef: RefObject<HTMLDivElement>;
|
|
15
16
|
hasActive: boolean;
|
|
16
17
|
hasRefs: boolean;
|
|
18
|
+
hostingServiceInfo: Record<HostingServiceType, HostingServiceInfoType>;
|
|
17
19
|
includeOnlyRefsById: IncludeOnlyRefsById;
|
|
18
20
|
includeOnlyRemotesByName: IncludeOnlyRemotesByName;
|
|
19
21
|
isGhostRef: boolean;
|
|
@@ -43,5 +45,5 @@ type RefNodesProps = {
|
|
|
43
45
|
type: CommitType;
|
|
44
46
|
useColumnHeaderIcons: boolean;
|
|
45
47
|
};
|
|
46
|
-
declare function RefNodes({ enabledRefMetadataTypes, column, columnForColoring, context, enableShowHideRefsOptions, targetRef, hasActive, hasRefs, getExternalIcon, includeOnlyRefsById, includeOnlyRemotesByName, isGhostRef, isHovered, isInUnsupportedRebase, numGraphColumns, onMissingRefMetadata, pinnedBranchFullName, refGroupContexts, refGroupsByName, refIconsPosition, refMetadata, refNodeHovered, sha, showRemoteNamesOnRefs, showContextMenuForGroupedRef, onClickRef, onDoubleClickRef, onToggleRefNodesShown, onRefBeginDrag, onRefCanDrag, onRefCanDrop, onRefDragEnter, onRefDragLeave, onRefDrop, onRefEndDrag, translate, type, useColumnHeaderIcons, }: RefNodesProps): ReactElement<'span' | 'div'>;
|
|
48
|
+
declare function RefNodes({ enabledRefMetadataTypes, column, columnForColoring, context, enableShowHideRefsOptions, targetRef, hasActive, hasRefs, getExternalIcon, hostingServiceInfo, includeOnlyRefsById, includeOnlyRemotesByName, isGhostRef, isHovered, isInUnsupportedRebase, numGraphColumns, onMissingRefMetadata, pinnedBranchFullName, refGroupContexts, refGroupsByName, refIconsPosition, refMetadata, refNodeHovered, sha, showRemoteNamesOnRefs, showContextMenuForGroupedRef, onClickRef, onDoubleClickRef, onToggleRefNodesShown, onRefBeginDrag, onRefCanDrag, onRefCanDrop, onRefDragEnter, onRefDragLeave, onRefDrop, onRefEndDrag, translate, type, useColumnHeaderIcons, }: RefNodesProps): ReactElement<'span' | 'div'>;
|
|
47
49
|
export default RefNodes;
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { CommitType, Sha } from '../../../domain/commit/CommitTypes';
|
|
4
4
|
import type { Style } from '../../../domain/generic/GenericTypes';
|
|
5
5
|
import type { GetExternalIcon, GetMissingRefMetadata, GraphItemContext, GraphRefGroup, IncludeOnlyRefsById, IncludeOnlyRemotesByName, OnClickRef, OnDoubleClickRef, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnToggleRefNodesShown, RefGroupContexts, RefMetadataById, RefMetadataType } from '../../../domain/graph/GraphTypes';
|
|
6
|
+
import type { HostingServiceInfoType, HostingServiceType } from '../../../domain/hostingservice/HostingServiceTypes';
|
|
6
7
|
import type { TranslationFn } from '../../../domain/language/LanguageTypes';
|
|
7
8
|
import type { RefIconsPosition } from '../../../domain/ref/RefTypes';
|
|
8
9
|
type RefZoneDefaultProps = {
|
|
@@ -18,6 +19,7 @@ type RefZoneProps = {
|
|
|
18
19
|
hasActive: boolean;
|
|
19
20
|
hasRefs: boolean;
|
|
20
21
|
hasTimeline: boolean;
|
|
22
|
+
hostingServiceInfo: Record<HostingServiceType, HostingServiceInfoType>;
|
|
21
23
|
hoveredRefGroup: GraphRefGroup | null;
|
|
22
24
|
hoveredRefZoneSha?: Sha;
|
|
23
25
|
includeOnlyRefsById: IncludeOnlyRefsById;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GridCellRenderer } from 'react-virtualized';
|
|
2
2
|
import type { Sha } from '../../../domain/commit/CommitTypes';
|
|
3
3
|
import type { CommonGraphRowDispatchProps, CommonGraphRowProps, FormatRefShorthand, GetMissingRefMetadata, IncludeOnlyRefsById, IncludeOnlyRemotesByName, IsRefShorthandValid, OnClickRef, OnDoubleClickRef, OnRefBeginDrag, OnRefCanDrag, OnRefCanDrop, OnRefCreate, OnRefCreateCancel, OnRefCreateContextMenu, OnRefDragEnter, OnRefDragLeave, OnRefDrop, OnRefEndDrag, OnRefNodeHovered, OnRefNodeUnhovered, OnRefShorthandChange, OnRefZoneContextMenu, OnRefZoneHovered, OnRefZoneUnhovered, OnToggleRefNodesShown, RefMetadataById } from '../../../domain/graph/GraphTypes';
|
|
4
|
+
import type { HostingServiceInfoType, HostingServiceType } from '../../../domain/hostingservice/HostingServiceTypes';
|
|
4
5
|
import type { GetRealKeyForCellFunc } from '../../../domain/reactvirtualized/ReactVirtualizedHelpers';
|
|
5
6
|
import type { CreateRefFormData, RefIconsPosition } from '../../../domain/ref/RefTypes';
|
|
6
7
|
interface OwnProps {
|
|
@@ -13,6 +14,7 @@ interface StateProps {
|
|
|
13
14
|
isCreateRefFloating?: boolean;
|
|
14
15
|
formatRefShorthand: FormatRefShorthand;
|
|
15
16
|
enableShowHideRefsOptions: boolean;
|
|
17
|
+
hostingServiceInfo: Record<HostingServiceType, HostingServiceInfoType>;
|
|
16
18
|
isInUnsupportedRebase: boolean;
|
|
17
19
|
isRefShorthandValid: IsRefShorthandValid;
|
|
18
20
|
hoveredRefZoneSha?: Sha;
|
|
@@ -242,6 +242,13 @@ export interface PullRequestMetadata extends BaseMetadata {
|
|
|
242
242
|
author?: string;
|
|
243
243
|
date?: number;
|
|
244
244
|
state?: string;
|
|
245
|
+
/**
|
|
246
|
+
* This pull request's position in its stack, counting from 1 at the bottom. Ignored unless it is a whole
|
|
247
|
+
* number from 1 through `stackSize`.
|
|
248
|
+
*/
|
|
249
|
+
stackPosition?: number;
|
|
250
|
+
/** How many pull requests the stack holds. Only names the position when paired with `stackPosition`. */
|
|
251
|
+
stackSize?: number;
|
|
245
252
|
url?: string;
|
|
246
253
|
}
|
|
247
254
|
export interface UpstreamMetadata extends BaseMetadata {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HostingServiceInfoType, HostingServiceType } from '../hostingservice/HostingServiceTypes';
|
|
2
|
+
import type { TranslationFn } from '../language/LanguageTypes';
|
|
3
|
+
import type { PullRequestMetadata } from './GraphTypes';
|
|
4
|
+
export declare function hasStackPosition(stackPosition?: number, stackSize?: number): boolean;
|
|
5
|
+
export declare function getPullRequestDisplayId(pullRequestCharacter: string, pullRequestId: number): string;
|
|
6
|
+
export declare function getPullRequestTooltipText(pullRequest: PullRequestMetadata, hostingServiceInfo: Record<HostingServiceType, HostingServiceInfoType>, translate: TranslationFn): string;
|
|
@@ -16,4 +16,11 @@ export type JiraServerIssueTrackerType = 'jiraServer';
|
|
|
16
16
|
export type TrelloIssueTrackerType = 'trello';
|
|
17
17
|
export type BitbucketIssueTrackerType = 'bitbucket';
|
|
18
18
|
export type IssueTrackerType = GitHubIssueTrackerType | GithubEnterpriseIssueTrackerType | GitLabIssueTrackerType | GitLabSelfHostedIssueTrackerType | JiraCloudIssueTrackerType | JiraServerIssueTrackerType | TrelloIssueTrackerType | AzureDevopsIssueTrackerType | BitbucketIssueTrackerType;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Pass `hostingServiceInfo` to `GraphContainer` instead. Removed in the next major version.
|
|
21
|
+
*/
|
|
19
22
|
export declare function getHostingServiceName(hostingServiceType: HostingServiceType): string;
|
|
23
|
+
export type HostingServiceInfoType = {
|
|
24
|
+
name: string;
|
|
25
|
+
pullRequestCharacter: string;
|
|
26
|
+
};
|