mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
make repository navigation fixed // add title for collapsed navigation items
This commit is contained in:
@@ -10,6 +10,7 @@ type Props = {
|
||||
activeWhenMatch?: (route: any) => boolean;
|
||||
activeOnlyWhenExact: boolean;
|
||||
icon?: string;
|
||||
title?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -209,6 +209,7 @@ class RepositoryRoot extends React.Component<Props, State> {
|
||||
to={`${url}/info`}
|
||||
icon="fas fa-info-circle"
|
||||
label={t("repositoryRoot.menu.informationNavLink")}
|
||||
title={t("repositoryRoot.menu.informationNavLink")}
|
||||
/>
|
||||
<RepositoryNavLink
|
||||
repository={repository}
|
||||
@@ -218,6 +219,7 @@ class RepositoryRoot extends React.Component<Props, State> {
|
||||
label={t("repositoryRoot.menu.branchesNavLink")}
|
||||
activeWhenMatch={this.matchesBranches}
|
||||
activeOnlyWhenExact={false}
|
||||
title={t("repositoryRoot.menu.branchesNavLink")}
|
||||
/>
|
||||
<RepositoryNavLink
|
||||
repository={repository}
|
||||
@@ -227,12 +229,14 @@ class RepositoryRoot extends React.Component<Props, State> {
|
||||
label={t("repositoryRoot.menu.sourcesNavLink")}
|
||||
activeWhenMatch={this.matchesCode}
|
||||
activeOnlyWhenExact={false}
|
||||
title={t("repositoryRoot.menu.sourcesNavLink")}
|
||||
/>
|
||||
<ExtensionPoint name="repository.navigation" props={extensionProps} renderAll={true} />
|
||||
<SubNavigation
|
||||
to={`${url}/settings/general`}
|
||||
label={t("repositoryRoot.menu.settingsNavLink")}
|
||||
onCollapsed={() => this.onCollapse(false)}
|
||||
title={t("repositoryRoot.menu.settingsNavLink")}
|
||||
>
|
||||
<EditRepoNavLink repository={repository} editUrl={`${url}/settings/general`} />
|
||||
<PermissionsNavLink permissionUrl={`${url}/settings/permissions`} repository={repository} />
|
||||
|
||||
@@ -442,11 +442,11 @@ export function getPermissionsLink(state: object, namespace: string, name: strin
|
||||
return repo && repo._links ? repo._links.permissions.href : undefined;
|
||||
}
|
||||
|
||||
const REPOSITORY_NAVIGATION_COLLAPSED = "repository-menu-collapsed";
|
||||
const REPOSITORY_MENU_COLLAPSED = "repository-menu-collapsed";
|
||||
|
||||
export function isRepositoryMenuCollapsed() {
|
||||
return localStorage.getItem(REPOSITORY_NAVIGATION_COLLAPSED) === "true";
|
||||
return localStorage.getItem(REPOSITORY_MENU_COLLAPSED) === "true";
|
||||
}
|
||||
export function switchRepositoryMenuCollapsed(newStatus: boolean) {
|
||||
localStorage.setItem(REPOSITORY_NAVIGATION_COLLAPSED, String(newStatus));
|
||||
export function switchRepositoryMenuCollapsed(status: boolean) {
|
||||
localStorage.setItem(REPOSITORY_MENU_COLLAPSED, String(status));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user