Merged in feature/ui_adjustments (pull request #374)

Move more buttons to the right
This commit is contained in:
Eduard Heimbuch
2019-12-12 10:01:27 +00:00
4 changed files with 25 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
import React, { FormEvent } from "react";
import { WithTranslation, withTranslation } from "react-i18next";
import { Branch, Repository, Link } from "@scm-manager/ui-types";
import { apiClient, BranchSelector, ErrorPage, Loading, Subtitle, SubmitButton } from "@scm-manager/ui-components";
import { apiClient, BranchSelector, ErrorPage, Loading, Subtitle, Level, SubmitButton } from "@scm-manager/ui-components";
type Props = WithTranslation & {
repository: Repository;
@@ -143,10 +143,14 @@ class RepositoryConfig extends React.Component<Props, State> {
}
const submitButton = disabled ? null : (
<SubmitButton
label={t("scm-git-plugin.repo-config.submit")}
loading={submitPending}
disabled={!this.state.selectedBranchName}
<Level
right={
<SubmitButton
label={t("scm-git-plugin.repo-config.submit")}
loading={submitPending}
disabled={!this.state.selectedBranchName}
/>
}
/>
);

View File

@@ -1,7 +1,7 @@
import React from "react";
import { WithTranslation, withTranslation } from "react-i18next";
import { Repository, Branch, BranchRequest } from "@scm-manager/ui-types";
import { Select, InputField, SubmitButton, validation as validator } from "@scm-manager/ui-components";
import { Select, InputField, Level, SubmitButton, validation as validator } from "@scm-manager/ui-components";
import { orderBranches } from "../util/orderBranches";
type Props = WithTranslation & {
@@ -83,10 +83,14 @@ class BranchForm extends React.Component<Props, State> {
</div>
<div className="columns">
<div className="column">
<SubmitButton
disabled={disabled || !this.isValid()}
loading={loading}
label={t("branches.create.submit")}
<Level
right={
<SubmitButton
disabled={disabled || !this.isValid()}
loading={loading}
label={t("branches.create.submit")}
/>
}
/>
</div>
</div>

View File

@@ -107,7 +107,7 @@ class FileTree extends React.Component<Props> {
<th>{t("sources.file-tree.name")}</th>
<th className="is-hidden-mobile">{t("sources.file-tree.length")}</th>
<th className="is-hidden-mobile">{t("sources.file-tree.lastModified")}</th>
<th className="is-hidden-mobile">{t("sources.file-tree.description")}</th>
<th className="is-hidden-touch">{t("sources.file-tree.description")}</th>
{binder.hasExtension("repos.sources.tree.row.right") && <th className="is-hidden-mobile" />}
</tr>
</thead>

View File

@@ -16,6 +16,10 @@ const MinWidthTd = styled.td`
min-width: 10em;
`;
const NoWrapTd = styled.td`
white-space: nowrap;
`;
export function createLink(base: string, file: File) {
let link = base;
if (file.path) {
@@ -67,11 +71,11 @@ export default class FileTreeLeaf extends React.Component<Props> {
<tr>
<td>{this.createFileIcon(file)}</td>
<MinWidthTd className="is-word-break">{this.createFileName(file)}</MinWidthTd>
<td className="is-hidden-mobile">{fileSize}</td>
<NoWrapTd className="is-hidden-mobile">{fileSize}</NoWrapTd>
<td className="is-hidden-mobile">
<DateFromNow date={file.lastModified} />
</td>
<MinWidthTd className={classNames("is-word-break", "is-hidden-mobile")}>{file.description}</MinWidthTd>
<MinWidthTd className={classNames("is-word-break", "is-hidden-touch")}>{file.description}</MinWidthTd>
{binder.hasExtension("repos.sources.tree.row.right") && (
<td className="is-hidden-mobile">
{!file.directory && (