mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Switch repo overview layout to cards
Squash commits of branch feature/repo_overview_cards: - Switch repo overview layout to cards - wip - Merge branch 'develop' into feature/repo_overview_cards - Fix collapsible - Fix collapsible - Fix styling - Merge branch 'develop' into feature/repo_overview_cards - Fix type for collapsible - Add changelog - Update storyshots - Merge branch 'develop' into feature/repo_overview_cards Committed-by: Thomas Zerr <thomas.zerr@cloudogu.com> Co-authored-by: tzerr <thomas.zerr@cloudogu.com>
This commit is contained in:
@@ -22,35 +22,18 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
import React, { FC } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Icon, RepositoryEntry, GroupEntries } from "@scm-manager/ui-components";
|
||||
import { NamespaceEntries, RepositoryEntry } from "@scm-manager/ui-components";
|
||||
import { RepositoryGroup } from "@scm-manager/ui-types";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
type Props = {
|
||||
group: RepositoryGroup;
|
||||
};
|
||||
|
||||
const RepositoryGroupEntry: FC<Props> = ({ group }) => {
|
||||
const [t] = useTranslation("namespaces");
|
||||
|
||||
const settingsLink = group.namespace?._links?.permissions && (
|
||||
<Link to={`/namespace/${group.name}/settings`} aria-label={t("repositoryOverview.settings.tooltip")}>
|
||||
<Icon color="inherit" name="cog" title={t("repositoryOverview.settings.tooltip")} className="is-size-6 ml-2" />
|
||||
</Link>
|
||||
);
|
||||
const namespaceHeader = (
|
||||
<>
|
||||
<Link to={`/repos/${group.name}/`} className="has-text-inherit">
|
||||
{group.name}
|
||||
</Link>{" "}
|
||||
{settingsLink}
|
||||
</>
|
||||
);
|
||||
const entries = group.repositories.map((repository, index) => {
|
||||
return <RepositoryEntry repository={repository} key={index} />;
|
||||
const entries = group.repositories.map((repository) => {
|
||||
return <RepositoryEntry repository={repository} key={repository.name} />;
|
||||
});
|
||||
return <GroupEntries namespaceHeader={namespaceHeader} elements={entries} />;
|
||||
return <NamespaceEntries group={group} elements={entries} />;
|
||||
};
|
||||
|
||||
export default RepositoryGroupEntry;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
import React from "react";
|
||||
import React, { FC } from "react";
|
||||
|
||||
import { NamespaceCollection, Repository } from "@scm-manager/ui-types";
|
||||
|
||||
@@ -33,19 +33,12 @@ type Props = {
|
||||
namespaces: NamespaceCollection;
|
||||
};
|
||||
|
||||
class RepositoryList extends React.Component<Props> {
|
||||
render() {
|
||||
const { repositories, namespaces } = this.props;
|
||||
|
||||
const groups = groupByNamespace(repositories, namespaces);
|
||||
return (
|
||||
<div className="content">
|
||||
{groups.map((group) => {
|
||||
return <RepositoryGroupEntry group={group} key={group.name} />;
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
const RepositoryList: FC<Props> = ({ repositories, namespaces }) => (
|
||||
<>
|
||||
{groupByNamespace(repositories, namespaces).map((group) => (
|
||||
<RepositoryGroupEntry group={group} key={group.name} />
|
||||
))}
|
||||
</>
|
||||
);
|
||||
|
||||
export default RepositoryList;
|
||||
|
||||
Reference in New Issue
Block a user