diff --git a/gradle/changelog/repo_overview_cards.yaml b/gradle/changelog/repo_overview_cards.yaml new file mode 100644 index 0000000000..e18228042d --- /dev/null +++ b/gradle/changelog/repo_overview_cards.yaml @@ -0,0 +1,2 @@ +- type: changed + description: Use card layout for repository overview diff --git a/scm-ui/ui-components/package.json b/scm-ui/ui-components/package.json index 2cb785253b..57d06ac9fd 100644 --- a/scm-ui/ui-components/package.json +++ b/scm-ui/ui-components/package.json @@ -28,6 +28,8 @@ "@scm-manager/ui-syntaxhighlighting": "2.46.1-SNAPSHOT", "@scm-manager/ui-tests": "2.46.1-SNAPSHOT", "@scm-manager/ui-text": "2.46.1-SNAPSHOT", + "@scm-manager/ui-layout": "2.46.1-SNAPSHOT", + "@scm-manager/ui-overlays": "2.46.1-SNAPSHOT", "@storybook/addon-actions": "^6.4.20", "@storybook/addon-essentials": "^6.4.20", "@storybook/addon-interactions": "^6.4.20", @@ -106,4 +108,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap index f4982cce67..9927108029 100644 --- a/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap +++ b/scm-ui/ui-components/src/__snapshots__/storyshots.test.ts.snap @@ -4450,158 +4450,6 @@ Array [ ] `; -exports[`Storyshots GroupEntry Default 1`] = ` -
-
- -
-
-
- -
-
-
- - main content - -
-

- - more text - -

-
-
-
-
- -
-
-
-
-
-`; - -exports[`Storyshots GroupEntry With long texts 1`] = ` -
-
- -
-
-
- -
-
-
- - Very-important-repository-with-a-particular-long-but-easily-rememberable-name-which-also-is-written-in-kebab-case - -
-

- - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. - -

-
-
-
-
- -
-
-
-
-
-`; - exports[`Storyshots Help Default 1`] = `
-
-
-
-
+
+
+
-
-
-
+
+ + overview.lastModified + + + +
+
+
- - - - + repository.archived - - -
-
+ +
`; @@ -71215,124 +71048,110 @@ exports[`Storyshots Repositories/RepositoryEntry Avatar EP 1`] = `
-
-
-
-
+
+
+
-
-
-
-
+
+ - - - - - - - - - + 3 days ago + + +
+
+
-
+ +
`; @@ -71340,127 +71159,113 @@ exports[`Storyshots Repositories/RepositoryEntry Before Title EP 1`] = `
-
-
-
-
+
+
+
-
-
-
-
+
+ - - - - - - - - - + 3 days ago + + +
+
+
-
+ +
`; @@ -71468,124 +71273,110 @@ exports[`Storyshots Repositories/RepositoryEntry Default 1`] = `
-
-
-
-
+
+
+
-
-
-
-
+
+ - - - - - - - - - + 3 days ago + + +
+
+
-
+ +
`; @@ -71593,137 +71384,122 @@ exports[`Storyshots Repositories/RepositoryEntry Exporting 1`] = `
-
-
-
-
+
+
+
-
-
-
+
+ + overview.lastModified + + + +
+
+
- - - - + repository.exporting - - -
-
+ +
`; @@ -71731,138 +71507,123 @@ exports[`Storyshots Repositories/RepositoryEntry HealthCheck Failure 1`] = `
-
-
-
-
+
+
+
-
-
-
+
+ + overview.lastModified + + + +
+
+
- - - - + repository.healthCheckFailure - - -
-
+ +
`; @@ -71870,149 +71631,134 @@ exports[`Storyshots Repositories/RepositoryEntry MultiRepositoryTags 1`] = `
-
-
-
-
+
+
+
-
-
-
+
+ + overview.lastModified + + + +
+
+
- - - - + repository.archived - - - + repository.exporting +
-
+ +
`; @@ -72020,138 +71766,123 @@ exports[`Storyshots Repositories/RepositoryEntry RepositoryFlag EP 1`] = `
-
-
-
-
+
+
+
-
-
-
+
+ + overview.lastModified + + + +
+
+
- - - - + repository.healthCheckFailure - - -
-
+ +
`; @@ -72159,124 +71890,110 @@ exports[`Storyshots Repositories/RepositoryEntry With long texts 1`] = `
-
-
-
-
+
+
+
-
-
-
- - veeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeery-loooooooooooooooooooooooooooooooooooooooooooooooooooong-repooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo-naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaame - - -
-
-
-
-
-
-
-

- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. -

-
+ veeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeery-loooooooooooooooooooooooooooooooooooooooooooooooooooong-repooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo-naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaame + +
+
-
+
+ - - - - - - - - - + 3 days ago + + +
+
+
-
+ +
`; diff --git a/scm-ui/ui-components/src/layout/GroupEntries.tsx b/scm-ui/ui-components/src/layout/GroupEntries.tsx index 14523f3e87..a2dbf9a0bc 100644 --- a/scm-ui/ui-components/src/layout/GroupEntries.tsx +++ b/scm-ui/ui-components/src/layout/GroupEntries.tsx @@ -22,35 +22,19 @@ * SOFTWARE. */ import React, { FC, ReactNode } from "react"; -import classNames from "classnames"; -import styled from "styled-components"; - -const Separator = styled.div` - border-bottom: 1px solid rgb(219, 219, 219, 0.5); -`; +import { CardList, Collapsible } from "@scm-manager/ui-layout"; type Props = { namespaceHeader: ReactNode; elements: ReactNode[]; + collapsed?: boolean; + onCollapsedChange?: (collapsed: boolean) => void; }; -const GroupEntries: FC = ({ namespaceHeader, elements }) => { - const content = elements.map((entry, index) => ( - -
{entry}
- {index + 1 !== elements.length ? : null} -
- )); - - return ( - <> -
- {namespaceHeader} -
-
{content}
-
- - ); -}; +const GroupEntries: FC = ({ namespaceHeader, elements, collapsed, onCollapsedChange }) => ( + + {elements} + +); export default GroupEntries; diff --git a/scm-ui/ui-components/src/layout/GroupEntry.stories.tsx b/scm-ui/ui-components/src/layout/GroupEntry.stories.tsx deleted file mode 100644 index c5ed3a9e2c..0000000000 --- a/scm-ui/ui-components/src/layout/GroupEntry.stories.tsx +++ /dev/null @@ -1,75 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2020-present Cloudogu GmbH and Contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -import Icon from "../Icon"; -import { storiesOf } from "@storybook/react"; -import { MemoryRouter } from "react-router-dom"; -import React from "react"; -import GroupEntry from "./GroupEntry"; -import { Button, ButtonGroup } from "../buttons"; -import copyToClipboard from "../CopyToClipboard"; - -const link = "/foo/bar"; -const avatar = ; -const name = main content; -const description = more text; -const longName = ( - - Very-important-repository-with-a-particular-long-but-easily-rememberable-name-which-also-is-written-in-kebab-case - -); -const contentRight = ( - -