@scm-manager/ui-components 3.4.2 → 3.4.3-20240825-085111
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.
- package/package.json +9 -9
- package/src/Autocomplete.tsx +11 -18
- package/src/BackendErrorNotification.tsx +11 -18
- package/src/BranchSelector.stories.tsx +10 -18
- package/src/BranchSelector.tsx +11 -18
- package/src/Breadcrumb.stories.tsx +11 -18
- package/src/Breadcrumb.tsx +11 -18
- package/src/CardColumn.stories.tsx +11 -18
- package/src/CardColumn.tsx +11 -18
- package/src/CardColumnGroup.tsx +11 -18
- package/src/CardColumnSmall.stories.tsx +11 -18
- package/src/CardColumnSmall.tsx +10 -18
- package/src/CommaSeparatedList.tsx +10 -18
- package/src/CopyToClipboard.ts +10 -18
- package/src/DangerZone.tsx +10 -18
- package/src/Date.stories.tsx +11 -18
- package/src/DateElement.ts +11 -18
- package/src/DateFromNow.tsx +10 -18
- package/src/DateShort.tsx +10 -18
- package/src/Duration.stories.tsx +10 -18
- package/src/Duration.tsx +10 -18
- package/src/ErrorBoundary.tsx +11 -18
- package/src/ErrorNotification.tsx +11 -18
- package/src/ErrorPage.tsx +11 -18
- package/src/FileSize.test.ts +10 -18
- package/src/FileSize.tsx +11 -18
- package/src/GroupAutocomplete.tsx +11 -18
- package/src/Help.stories.tsx +11 -18
- package/src/Help.tsx +11 -18
- package/src/HelpIcon.tsx +11 -18
- package/src/Icon.stories.tsx +11 -18
- package/src/Icon.tsx +11 -18
- package/src/Image.tsx +11 -18
- package/src/LinkPaginator.tsx +11 -18
- package/src/Loading.stories.tsx +11 -18
- package/src/Loading.tsx +11 -18
- package/src/Logo.stories.tsx +11 -18
- package/src/Logo.tsx +11 -18
- package/src/MailLink.tsx +11 -18
- package/src/Notification.stories.tsx +10 -18
- package/src/Notification.tsx +11 -18
- package/src/OverviewPageActions.tsx +11 -18
- package/src/Paginator.test.tsx +11 -18
- package/src/Paginator.tsx +11 -18
- package/src/PdfViewer.stories.tsx +10 -18
- package/src/PdfViewer.tsx +10 -18
- package/src/PreformattedCodeBlock.stories.tsx +11 -18
- package/src/PreformattedCodeBlock.tsx +11 -18
- package/src/ProtectedRoute.tsx +11 -18
- package/src/SmallLoadingSpinner.stories.tsx +11 -18
- package/src/SmallLoadingSpinner.tsx +11 -18
- package/src/StatePaginator.tsx +11 -18
- package/src/SyntaxHighlighter.stories.tsx +11 -18
- package/src/SyntaxHighlighter.tsx +11 -18
- package/src/SyntaxHighlighterRenderer.tsx +10 -18
- package/src/Tag.stories.tsx +10 -18
- package/src/Tag.tsx +11 -18
- package/src/Tooltip.stories.tsx +10 -18
- package/src/Tooltip.tsx +11 -18
- package/src/UserAutocomplete.tsx +11 -18
- package/src/UserGroupAutocomplete.tsx +11 -18
- package/src/__resources__/Diff.binary.ts +10 -18
- package/src/__resources__/Diff.hunks.ts +10 -18
- package/src/__resources__/Diff.markdown.ts +10 -18
- package/src/__resources__/Diff.simple.ts +10 -18
- package/src/__resources__/HttpServer.go.ts +10 -18
- package/src/__resources__/HttpServer.java.ts +10 -18
- package/src/__resources__/HttpServer.js.ts +10 -18
- package/src/__resources__/HttpServer.py.ts +10 -18
- package/src/__resources__/SearchHit.ts +10 -18
- package/src/__resources__/changesets.tsx +10 -18
- package/src/__resources__/markdown-changelog.md.ts +11 -18
- package/src/__resources__/markdown-commit-link.md.ts +11 -18
- package/src/__resources__/markdown-images.md.ts +10 -18
- package/src/__resources__/markdown-inline-xml.md.ts +11 -18
- package/src/__resources__/markdown-links.md.ts +10 -18
- package/src/__resources__/markdown-uml-codeblock.md.ts +11 -18
- package/src/__resources__/markdown-without-lang.md.ts +10 -18
- package/src/__resources__/markdown-xml-codeblock.md.ts +11 -18
- package/src/__resources__/markdown-xss.md.ts +10 -18
- package/src/__resources__/repository.ts +11 -18
- package/src/__resources__/test-page.md.ts +10 -18
- package/src/avatar/Avatar.ts +10 -18
- package/src/avatar/AvatarImage.tsx +11 -18
- package/src/avatar/AvatarWrapper.tsx +11 -18
- package/src/avatar/index.ts +10 -18
- package/src/buttons/AddButton.tsx +11 -18
- package/src/buttons/Button.tsx +11 -18
- package/src/buttons/ButtonAddons.tsx +11 -18
- package/src/buttons/ButtonGroup.tsx +11 -18
- package/src/buttons/CreateButton.tsx +11 -18
- package/src/buttons/DeleteButton.tsx +11 -18
- package/src/buttons/DownloadButton.tsx +11 -18
- package/src/buttons/EditButton.tsx +11 -18
- package/src/buttons/LinkStyleButton.tsx +10 -18
- package/src/buttons/NoStyleButton.tsx +10 -18
- package/src/buttons/OpenInFullscreenButton.tsx +11 -18
- package/src/buttons/RemoveEntryOfTableButton.tsx +11 -18
- package/src/buttons/SubmitButton.tsx +11 -18
- package/src/buttons/index.stories.tsx +11 -18
- package/src/buttons/index.ts +10 -18
- package/src/comparators.test.ts +10 -18
- package/src/comparators.ts +10 -18
- package/src/config/Configuration.tsx +11 -18
- package/src/config/ConfigurationBinder.tsx +11 -18
- package/src/config/ConfigurationForm.tsx +10 -18
- package/src/config/index.ts +10 -18
- package/src/createA11yId.tsx +10 -18
- package/src/devBuild.test.ts +10 -18
- package/src/devBuild.ts +10 -18
- package/src/devices.ts +10 -18
- package/src/forms/AddEntryToTableField.tsx +11 -18
- package/src/forms/AddKeyValueEntryToTableField.stories.tsx +11 -18
- package/src/forms/AddKeyValueEntryToTableField.tsx +11 -18
- package/src/forms/AutocompleteAddEntryToTableField.tsx +11 -18
- package/src/forms/Checkbox.stories.tsx +11 -18
- package/src/forms/Checkbox.tsx +11 -18
- package/src/forms/DropDown.stories.tsx +11 -18
- package/src/forms/DropDown.tsx +11 -18
- package/src/forms/FileInput.stories.tsx +11 -18
- package/src/forms/FileInput.tsx +11 -18
- package/src/forms/FileUpload.tsx +10 -18
- package/src/forms/FilterInput.tsx +11 -18
- package/src/forms/FormFieldTypes.tsx +11 -18
- package/src/forms/InputField.stories.tsx +11 -18
- package/src/forms/InputField.tsx +11 -18
- package/src/forms/LabelWithHelpIcon.tsx +11 -18
- package/src/forms/MemberNameTagGroup.tsx +11 -18
- package/src/forms/PasswordConfirmation.tsx +11 -18
- package/src/forms/Radio.stories.tsx +11 -18
- package/src/forms/Radio.tsx +11 -18
- package/src/forms/Select.stories.tsx +11 -18
- package/src/forms/Select.tsx +11 -18
- package/src/forms/TagGroup.tsx +11 -18
- package/src/forms/Textarea.stories.tsx +11 -18
- package/src/forms/Textarea.tsx +11 -18
- package/src/forms/TriStateCheckbox.tsx +11 -18
- package/src/forms/index.ts +10 -18
- package/src/forms/useAutofocus.ts +10 -18
- package/src/forms/useInnerRef.ts +10 -18
- package/src/index.ts +17 -20
- package/src/languages.test.ts +10 -18
- package/src/languages.ts +10 -18
- package/src/layout/CustomQueryFlexWrappedColumns.tsx +11 -18
- package/src/layout/Footer.stories.tsx +11 -18
- package/src/layout/Footer.tsx +11 -18
- package/src/layout/FooterSection.tsx +11 -18
- package/src/layout/GroupEntries.tsx +11 -18
- package/src/layout/Header.tsx +11 -18
- package/src/layout/Level.tsx +11 -18
- package/src/layout/NamespaceEntries.tsx +11 -18
- package/src/layout/Page.tsx +11 -18
- package/src/layout/PageActions.tsx +11 -18
- package/src/layout/PrimaryContentColumn.tsx +11 -18
- package/src/layout/SecondaryNavigationColumn.tsx +11 -18
- package/src/layout/SubSubtitle.tsx +11 -18
- package/src/layout/Subtitle.tsx +11 -18
- package/src/layout/Title.tsx +11 -18
- package/src/layout/index.ts +10 -18
- package/src/markdown/LazyMarkdownView.tsx +11 -18
- package/src/markdown/MarkdownCodeRenderer.tsx +10 -18
- package/src/markdown/MarkdownHeadingRenderer.test.ts +10 -18
- package/src/markdown/MarkdownHeadingRenderer.tsx +11 -18
- package/src/markdown/MarkdownImageRenderer.test.ts +10 -18
- package/src/markdown/MarkdownImageRenderer.tsx +11 -18
- package/src/markdown/MarkdownLinkRenderer.test.tsx +11 -18
- package/src/markdown/MarkdownLinkRenderer.tsx +11 -18
- package/src/markdown/MarkdownView.stories.tsx +11 -18
- package/src/markdown/MarkdownView.tsx +11 -18
- package/src/markdown/PluginApi.ts +11 -18
- package/src/markdown/createComponentList.ts +11 -18
- package/src/markdown/createMdastPlugin.ts +11 -18
- package/src/markdown/markdownExtensions.ts +11 -18
- package/src/markdown/paths.ts +10 -18
- package/src/markdown/remarkChangesetShortLinkParser.test.ts +10 -18
- package/src/markdown/remarkChangesetShortLinkParser.ts +10 -18
- package/src/markdown/remarkToRehypeRendererAdapters.ts +11 -18
- package/src/markdown/remarkValuelessTextAdapter.ts +10 -18
- package/src/modals/ActiveModalCountContextProvider.tsx +10 -18
- package/src/modals/ConfirmAlert.stories.tsx +10 -18
- package/src/modals/ConfirmAlert.tsx +11 -18
- package/src/modals/CreateTagModal.tsx +10 -18
- package/src/modals/FullscreenModal.tsx +11 -18
- package/src/modals/Modal.stories.tsx +10 -18
- package/src/modals/Modal.tsx +11 -18
- package/src/modals/activeModalCountContext.ts +10 -18
- package/src/modals/index.ts +10 -18
- package/src/modals/useActiveModals.ts +10 -18
- package/src/modals/useRegisterModal.test.tsx +10 -18
- package/src/modals/useRegisterModal.ts +10 -18
- package/src/navigation/ExternalLink.tsx +11 -18
- package/src/navigation/ExternalNavLink.tsx +11 -18
- package/src/navigation/MenuContext.tsx +10 -18
- package/src/navigation/NavAction.tsx +11 -18
- package/src/navigation/NavLink.tsx +11 -18
- package/src/navigation/Navigation.tsx +11 -18
- package/src/navigation/PrimaryNavigation.tsx +11 -18
- package/src/navigation/PrimaryNavigationLink.tsx +11 -18
- package/src/navigation/RoutingProps.ts +10 -18
- package/src/navigation/SecondaryNavigation.stories.tsx +10 -18
- package/src/navigation/SecondaryNavigation.tsx +11 -18
- package/src/navigation/SecondaryNavigationContext.ts +11 -18
- package/src/navigation/SecondaryNavigationItem.tsx +11 -18
- package/src/navigation/SubNavigation.tsx +11 -18
- package/src/navigation/SubNavigationContext.ts +11 -18
- package/src/navigation/index.ts +10 -18
- package/src/navigation/useActiveMatch.ts +10 -18
- package/src/navigation/useNavigationLock.ts +10 -18
- package/src/popover/Popover.stories.tsx +10 -18
- package/src/popover/Popover.tsx +10 -18
- package/src/popover/index.ts +10 -18
- package/src/popover/usePopover.ts +10 -18
- package/src/repos/CommitAuthor.tsx +10 -18
- package/src/repos/Diff.stories.tsx +11 -18
- package/src/repos/Diff.tsx +75 -29
- package/src/repos/DiffButton.tsx +11 -18
- package/src/repos/DiffDropDown.tsx +11 -18
- package/src/repos/DiffExpander.test.ts +11 -18
- package/src/repos/DiffExpander.ts +10 -18
- package/src/repos/DiffFile.tsx +10 -18
- package/src/repos/DiffStatistics.tsx +27 -18
- package/src/repos/DiffTypes.ts +10 -18
- package/src/repos/HealthCheckFailureDetail.tsx +10 -18
- package/src/repos/HealthCheckFailureList.tsx +10 -18
- package/src/repos/HunkExpandDivider.tsx +11 -18
- package/src/repos/HunkExpandLink.tsx +11 -18
- package/src/repos/JumpToFileButton.tsx +17 -20
- package/src/repos/LoadingDiff.tsx +57 -35
- package/src/repos/RepositoryAvatar.tsx +11 -18
- package/src/repos/RepositoryEntry.stories.tsx +11 -18
- package/src/repos/RepositoryEntry.tsx +11 -18
- package/src/repos/RepositoryEntryLink.tsx +11 -18
- package/src/repos/RepositoryFlag.tsx +10 -18
- package/src/repos/RepositoryFlags.tsx +11 -18
- package/src/repos/TokenizedDiffView.tsx +11 -18
- package/src/repos/annotate/Annotate.stories.tsx +10 -18
- package/src/repos/annotate/Annotate.tsx +10 -18
- package/src/repos/annotate/AnnotateLine.tsx +11 -18
- package/src/repos/annotate/AnnotatePopover.tsx +10 -18
- package/src/repos/annotate/AuthorImage.tsx +10 -18
- package/src/repos/annotate/actions.ts +10 -18
- package/src/repos/annotate/index.ts +10 -18
- package/src/repos/changesets/ChangesetAuthor.tsx +11 -18
- package/src/repos/changesets/ChangesetButtonGroup.tsx +11 -18
- package/src/repos/changesets/ChangesetDescription.tsx +10 -18
- package/src/repos/changesets/ChangesetDiff.test.ts +10 -18
- package/src/repos/changesets/ChangesetDiff.tsx +11 -18
- package/src/repos/changesets/ChangesetId.tsx +11 -18
- package/src/repos/changesets/ChangesetList.tsx +11 -18
- package/src/repos/changesets/ChangesetRow.tsx +11 -18
- package/src/repos/changesets/ChangesetTag.tsx +11 -18
- package/src/repos/changesets/ChangesetTagBase.tsx +11 -18
- package/src/repos/changesets/ChangesetTags.tsx +11 -18
- package/src/repos/changesets/ChangesetTagsCollapsed.tsx +11 -18
- package/src/repos/changesets/Changesets.stories.tsx +10 -18
- package/src/repos/changesets/ContributorAvatar.tsx +10 -18
- package/src/repos/changesets/SignatureIcon.tsx +11 -18
- package/src/repos/changesets/SingleChangeset.tsx +11 -18
- package/src/repos/changesets/changesets.test.ts +10 -18
- package/src/repos/changesets/changesets.ts +10 -18
- package/src/repos/changesets/index.ts +10 -18
- package/src/repos/defaultCollapsed.ts +10 -18
- package/src/repos/diff/BinaryDiffFileContent.tsx +10 -18
- package/src/repos/diff/ChangeTag.tsx +10 -18
- package/src/repos/diff/DiffFileHunk.tsx +10 -18
- package/src/repos/diff/DiffFileTree.tsx +123 -0
- package/src/repos/diff/FileTitle.tsx +10 -18
- package/src/repos/diff/HunkFooter.tsx +10 -18
- package/src/repos/diff/HunkHeader.tsx +10 -18
- package/src/repos/diff/LastHunkFooter.tsx +10 -18
- package/src/repos/diff/LazyDiffFile.tsx +11 -18
- package/src/repos/diff/helpers.ts +10 -18
- package/src/repos/diff/styledElements.tsx +39 -18
- package/src/repos/diff/types.ts +10 -18
- package/src/repos/diffs.test.ts +10 -18
- package/src/repos/diffs.ts +20 -18
- package/src/repos/index.ts +10 -18
- package/src/repositories.test.ts +10 -18
- package/src/repositories.ts +10 -18
- package/src/search/HighlightedFragment.tsx +10 -18
- package/src/search/Hit.tsx +10 -18
- package/src/search/TextHitField.stories.tsx +11 -18
- package/src/search/TextHitField.tsx +10 -18
- package/src/search/fields.ts +10 -18
- package/src/search/index.ts +10 -18
- package/src/storyshots.test.ts +10 -18
- package/src/styleConstants.ts +10 -18
- package/src/table/Column.tsx +11 -18
- package/src/table/InfoTable.tsx +10 -18
- package/src/table/SortIcon.tsx +11 -18
- package/src/table/Table.stories.tsx +11 -18
- package/src/table/Table.tsx +11 -18
- package/src/table/TextColumn.tsx +11 -18
- package/src/table/index.ts +10 -18
- package/src/table/types.ts +10 -18
- package/src/toast/Toast.tsx +11 -18
- package/src/toast/ToastArea.tsx +10 -18
- package/src/toast/ToastButton.tsx +11 -18
- package/src/toast/ToastButtons.tsx +11 -18
- package/src/toast/ToastNotification.tsx +11 -18
- package/src/toast/index.stories.tsx +11 -18
- package/src/toast/index.ts +10 -18
- package/src/toast/themes.ts +10 -18
- package/src/useDateFormatter.test.ts +10 -18
- package/src/useDateFormatter.ts +10 -18
- package/src/useGeneratedId.tsx +10 -18
- package/src/usePortalRootElement.ts +10 -18
- package/src/useScrollToElement.ts +36 -22
- package/src/useSecondaryNavigation.tsx +11 -18
- package/src/validation.test.ts +10 -18
- package/src/validation.ts +10 -18
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
7
|
+
*
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
|
+
*
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { FileTree } from "@scm-manager/ui-types";
|
|
18
|
+
import React, { FC } from "react";
|
|
19
|
+
import { FileDiffContainer, FileDiffContent, FileDiffContentTitle } from "./styledElements";
|
|
20
|
+
import { Icon } from "@scm-manager/ui-core";
|
|
21
|
+
import { useTranslation } from "react-i18next";
|
|
22
|
+
import styled from "styled-components";
|
|
23
|
+
|
|
24
|
+
type Props = { tree: FileTree; currentFile: string; setCurrentFile: (path: string) => void };
|
|
25
|
+
|
|
26
|
+
const StyledIcon = styled(Icon)`
|
|
27
|
+
min-width: 1.5rem;
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const DiffFileTree: FC<Props> = ({ tree, currentFile, setCurrentFile }) => {
|
|
31
|
+
const [t] = useTranslation("repos");
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<FileDiffContainer className={"mt-4 py-3 pr-2"}>
|
|
35
|
+
<FileDiffContentTitle className={"ml-4 pb-4 title is-6"}>{t("changesets.diffTreeTitle")}</FileDiffContentTitle>
|
|
36
|
+
<FileDiffContent>
|
|
37
|
+
{Object.keys(tree.children).map((key) => (
|
|
38
|
+
<TreeNode
|
|
39
|
+
key={key}
|
|
40
|
+
node={tree.children[key]}
|
|
41
|
+
parentPath={""}
|
|
42
|
+
currentFile={currentFile}
|
|
43
|
+
setCurrentFile={setCurrentFile}
|
|
44
|
+
/>
|
|
45
|
+
))}
|
|
46
|
+
</FileDiffContent>
|
|
47
|
+
</FileDiffContainer>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default DiffFileTree;
|
|
52
|
+
|
|
53
|
+
type NodeProps = { node: FileTree; parentPath: string; currentFile: string; setCurrentFile: (path: string) => void };
|
|
54
|
+
|
|
55
|
+
const addPath = (parentPath: string, path: string) => {
|
|
56
|
+
if ("" === parentPath) {
|
|
57
|
+
return path;
|
|
58
|
+
}
|
|
59
|
+
return parentPath + "/" + path;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const TreeNode: FC<NodeProps> = ({ node, parentPath, currentFile, setCurrentFile }) => {
|
|
63
|
+
const [t] = useTranslation("repos");
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<li>
|
|
67
|
+
{Object.keys(node.children).length > 0 ? (
|
|
68
|
+
<ul className={"py-1 pr-1 pl-3"}>
|
|
69
|
+
<li className={"is-flex has-text-grey"}>
|
|
70
|
+
<StyledIcon alt={t("diff.showContent")}>folder</StyledIcon>
|
|
71
|
+
<div className={"ml-1"}>{node.nodeName}</div>
|
|
72
|
+
</li>
|
|
73
|
+
{Object.keys(node.children).map((key) => (
|
|
74
|
+
<TreeNode
|
|
75
|
+
key={key}
|
|
76
|
+
node={node.children[key]}
|
|
77
|
+
parentPath={addPath(parentPath, node.nodeName)}
|
|
78
|
+
currentFile={currentFile}
|
|
79
|
+
setCurrentFile={setCurrentFile}
|
|
80
|
+
/>
|
|
81
|
+
))}
|
|
82
|
+
</ul>
|
|
83
|
+
) : (
|
|
84
|
+
<TreeFile
|
|
85
|
+
path={node.nodeName}
|
|
86
|
+
parentPath={parentPath}
|
|
87
|
+
currentFile={currentFile}
|
|
88
|
+
setCurrentFile={setCurrentFile}
|
|
89
|
+
/>
|
|
90
|
+
)}
|
|
91
|
+
</li>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
type FileProps = { path: string; parentPath: string; currentFile: string; setCurrentFile: (path: string) => void };
|
|
96
|
+
|
|
97
|
+
export const TreeFileContent = styled.div`
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
const TreeFile: FC<FileProps> = ({ path, parentPath, currentFile, setCurrentFile }) => {
|
|
102
|
+
const [t] = useTranslation("repos");
|
|
103
|
+
const completePath = addPath(parentPath, path);
|
|
104
|
+
|
|
105
|
+
const isCurrentFile = () => {
|
|
106
|
+
return currentFile === completePath;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<TreeFileContent className={"is-flex py-1 pl-3"} onClick={() => setCurrentFile(completePath)}>
|
|
111
|
+
{isCurrentFile() ? (
|
|
112
|
+
<StyledIcon style={{ minWidth: "1.5rem" }} key={completePath + "file"} alt={t("diff.showContent")}>
|
|
113
|
+
file
|
|
114
|
+
</StyledIcon>
|
|
115
|
+
) : (
|
|
116
|
+
<StyledIcon style={{ minWidth: "1.5rem" }} key={completePath + "file"} type="far" alt={t("diff.showContent")}>
|
|
117
|
+
file
|
|
118
|
+
</StyledIcon>
|
|
119
|
+
)}
|
|
120
|
+
<div className={"ml-1"}>{path}</div>
|
|
121
|
+
</TreeFileContent>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import { FileDiff } from "@scm-manager/ui-types";
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import { ExpandableHunk } from "../DiffExpander";
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import React, { FC, useCallback } from "react";
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import { ExpandableHunk } from "../DiffExpander";
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
16
|
+
|
|
24
17
|
import React, { FC, useCallback, useEffect, useMemo, useState } from "react";
|
|
25
18
|
import { useTranslation } from "react-i18next";
|
|
26
19
|
import classNames from "classnames";
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import { FileDiff, Hunk as HunkType } from "@scm-manager/ui-types";
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import styled from "styled-components";
|
|
@@ -90,3 +82,32 @@ export const PanelHeading = styled.div<{ sticky?: boolean | number }>`
|
|
|
90
82
|
}
|
|
91
83
|
}}
|
|
92
84
|
`;
|
|
85
|
+
|
|
86
|
+
export const FileTreeContent = styled.div`
|
|
87
|
+
min-width: 25%;
|
|
88
|
+
max-width: 25%;
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
export const DiffContent = styled.div`
|
|
92
|
+
width: 100%;
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
export const FileDiffContainer = styled.div`
|
|
96
|
+
border: 1px solid var(--scm-border-color);
|
|
97
|
+
border-radius: 1rem;
|
|
98
|
+
position: sticky;
|
|
99
|
+
top: 5rem;
|
|
100
|
+
`;
|
|
101
|
+
|
|
102
|
+
export const FileDiffContentTitle = styled.div`
|
|
103
|
+
border-bottom: 1px solid var(--scm-border-color);
|
|
104
|
+
box-shadow: 0 24px 3px -24px var(--scm-border-color);
|
|
105
|
+
`;
|
|
106
|
+
|
|
107
|
+
export const FileDiffContent = styled.ul`
|
|
108
|
+
overflow: auto;
|
|
109
|
+
@supports (-moz-appearance: none) {
|
|
110
|
+
max-height: calc(100vh - 11rem);
|
|
111
|
+
}
|
|
112
|
+
max-height: calc(100svh - 11rem);
|
|
113
|
+
`;
|
package/src/repos/diff/types.ts
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import { FileDiff } from "@scm-manager/ui-types";
|
package/src/repos/diffs.test.ts
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import { FileChangeType, Hunk, FileDiff } from "@scm-manager/ui-types";
|
package/src/repos/diffs.ts
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import { BaseContext } from "./DiffTypes";
|
|
@@ -44,3 +36,13 @@ export function createHunkIdentifierFromContext(ctx: BaseContext) {
|
|
|
44
36
|
export function escapeWhitespace(path: string) {
|
|
45
37
|
return path?.toLowerCase().replace(/\W/g, "-");
|
|
46
38
|
}
|
|
39
|
+
|
|
40
|
+
export function getAnchorSelector(uriHashContent: string) {
|
|
41
|
+
return "#" + escapeWhitespace(decodeURIComponent(uriHashContent));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function getFileNameFromHash(hash: string) {
|
|
45
|
+
const matcher = new RegExp(/^#diff-(.*)$/, "g");
|
|
46
|
+
const match = matcher.exec(hash);
|
|
47
|
+
return match ? match[1] : undefined;
|
|
48
|
+
}
|
package/src/repos/index.ts
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import * as diffs from "./diffs";
|
package/src/repositories.test.ts
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
2
|
+
* Copyright (c) 2020 - present Cloudogu GmbH
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
|
6
|
+
* Software Foundation, version 3.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
8
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
9
|
+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
10
|
+
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
11
|
+
* details.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
13
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
14
|
+
* along with this program. If not, see https://www.gnu.org/licenses/.
|
|
23
15
|
*/
|
|
24
16
|
|
|
25
17
|
import { Repository } from "@scm-manager/ui-types";
|