mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-07 12:17:00 +02:00
Improve headings structure (#1883)
The content of the SCM-Manager should be made accessible and usable in a sensibly structured way so that web content is easy to use for ever user.
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
import React, { FC } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Repository } from "@scm-manager/ui-types";
|
||||
import { ErrorNotification, Loading } from "@scm-manager/ui-components";
|
||||
import { SubSubtitle, ErrorNotification, Loading } from "@scm-manager/ui-components";
|
||||
import { useChangesets, useDefaultBranch } from "@scm-manager/ui-api";
|
||||
|
||||
type Props = {
|
||||
@@ -34,16 +34,12 @@ type Props = {
|
||||
|
||||
const CloneInformation: FC<Props> = ({ url, repository }) => {
|
||||
const [t] = useTranslation("plugins");
|
||||
const {
|
||||
data: changesets,
|
||||
error: changesetsError,
|
||||
isLoading: changesetsLoading,
|
||||
} = useChangesets(repository, { limit: 1 });
|
||||
const {
|
||||
data: defaultBranchData,
|
||||
isLoading: defaultBranchLoading,
|
||||
error: defaultBranchError,
|
||||
} = useDefaultBranch(repository);
|
||||
const { data: changesets, error: changesetsError, isLoading: changesetsLoading } = useChangesets(repository, {
|
||||
limit: 1
|
||||
});
|
||||
const { data: defaultBranchData, isLoading: defaultBranchLoading, error: defaultBranchError } = useDefaultBranch(
|
||||
repository
|
||||
);
|
||||
|
||||
if (changesetsLoading || defaultBranchLoading) {
|
||||
return <Loading />;
|
||||
@@ -56,7 +52,7 @@ const CloneInformation: FC<Props> = ({ url, repository }) => {
|
||||
return (
|
||||
<div className="content">
|
||||
<ErrorNotification error={error} />
|
||||
<h4>{t("scm-git-plugin.information.clone")}</h4>
|
||||
<SubSubtitle>{t("scm-git-plugin.information.clone")}</SubSubtitle>
|
||||
<pre>
|
||||
<code>
|
||||
git clone {url}
|
||||
@@ -72,7 +68,7 @@ const CloneInformation: FC<Props> = ({ url, repository }) => {
|
||||
</pre>
|
||||
{emptyRepository && (
|
||||
<>
|
||||
<h4>{t("scm-git-plugin.information.create")}</h4>
|
||||
<SubSubtitle>{t("scm-git-plugin.information.create")}</SubSubtitle>
|
||||
<pre>
|
||||
<code>
|
||||
git init {repository.name}
|
||||
@@ -96,7 +92,7 @@ const CloneInformation: FC<Props> = ({ url, repository }) => {
|
||||
</pre>
|
||||
</>
|
||||
)}
|
||||
<h4>{t("scm-git-plugin.information.replace")}</h4>
|
||||
<SubSubtitle>{t("scm-git-plugin.information.replace")}</SubSubtitle>
|
||||
<pre>
|
||||
<code>
|
||||
git remote add origin {url}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
import React from "react";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Branch } from "@scm-manager/ui-types";
|
||||
import { SubSubtitle } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = WithTranslation & {
|
||||
branch: Branch;
|
||||
@@ -35,11 +36,11 @@ class GitBranchInformation extends React.Component<Props> {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h4>{t("scm-git-plugin.information.fetch")}</h4>
|
||||
<SubSubtitle>{t("scm-git-plugin.information.fetch")}</SubSubtitle>
|
||||
<pre>
|
||||
<code>git fetch</code>
|
||||
</pre>
|
||||
<h4>{t("scm-git-plugin.information.checkout")}</h4>
|
||||
<SubSubtitle>{t("scm-git-plugin.information.checkout")}</SubSubtitle>
|
||||
<pre>
|
||||
<code>git checkout {branch.name}</code>
|
||||
</pre>
|
||||
|
||||
@@ -21,9 +21,11 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { WithTranslation, withTranslation } from "react-i18next";
|
||||
import { Repository } from "@scm-manager/ui-types";
|
||||
import { SubSubtitle } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = WithTranslation & {
|
||||
repository: Repository;
|
||||
@@ -37,7 +39,7 @@ class GitMergeInformation extends React.Component<Props> {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h4>{t("scm-git-plugin.information.merge.heading")}</h4>
|
||||
<SubSubtitle>{t("scm-git-plugin.information.merge.heading")}</SubSubtitle>
|
||||
{t("scm-git-plugin.information.merge.checkout")}
|
||||
<pre>
|
||||
<code>git checkout {target}</code>
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
*/
|
||||
|
||||
import React, { FC } from "react";
|
||||
import { Tag } from "@scm-manager/ui-types";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Tag } from "@scm-manager/ui-types";
|
||||
import { SubSubtitle } from "@scm-manager/ui-components";
|
||||
|
||||
type Props = {
|
||||
tag: Tag;
|
||||
@@ -35,7 +36,7 @@ const GitTagInformation: FC<Props> = ({ tag }) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<h4>{t("scm-git-plugin.information.checkoutTag")}</h4>
|
||||
<SubSubtitle>{t("scm-git-plugin.information.checkoutTag")}</SubSubtitle>
|
||||
<pre>
|
||||
<code>
|
||||
git checkout tags/{tag.name} -b branch/{tag.name}
|
||||
|
||||
Reference in New Issue
Block a user