mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
merge
This commit is contained in:
@@ -25,13 +25,13 @@ class LinkPaginator extends React.Component<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
renderPreviousButton(label?: string) {
|
||||
renderPreviousButton(className: string, label?: string) {
|
||||
const { page } = this.props;
|
||||
const previousPage = page - 1;
|
||||
|
||||
return (
|
||||
<Button
|
||||
className={"pagination-previous"}
|
||||
className={className}
|
||||
label={label ? label : previousPage.toString()}
|
||||
disabled={!this.hasLink("prev")}
|
||||
link={`${previousPage}`}
|
||||
@@ -44,12 +44,12 @@ class LinkPaginator extends React.Component<Props> {
|
||||
return collection._links[name];
|
||||
}
|
||||
|
||||
renderNextButton(label?: string) {
|
||||
renderNextButton(className: string, label?: string) {
|
||||
const { page } = this.props;
|
||||
const nextPage = page + 1;
|
||||
return (
|
||||
<Button
|
||||
className={"pagination-next"}
|
||||
className={className}
|
||||
label={label ? label : nextPage.toString()}
|
||||
disabled={!this.hasLink("next")}
|
||||
link={`${nextPage}`}
|
||||
@@ -96,13 +96,13 @@ class LinkPaginator extends React.Component<Props> {
|
||||
links.push(this.separator());
|
||||
}
|
||||
if (page > 2) {
|
||||
links.push(this.renderPreviousButton());
|
||||
links.push(this.renderPreviousButton("pagination-link"));
|
||||
}
|
||||
|
||||
links.push(this.currentPage(page));
|
||||
|
||||
if (page + 1 < pageTotal) {
|
||||
links.push(this.renderNextButton());
|
||||
links.push(this.renderNextButton("pagination-link"));
|
||||
}
|
||||
if (page + 2 < pageTotal)
|
||||
//if there exists pages between next and last
|
||||
@@ -118,13 +118,13 @@ class LinkPaginator extends React.Component<Props> {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<nav className="pagination is-centered" aria-label="pagination">
|
||||
{this.renderPreviousButton(t("paginator.previous"))}
|
||||
{this.renderPreviousButton("pagination-previous", t("paginator.previous"))}
|
||||
<ul className="pagination-list">
|
||||
{this.pageLinks().map((link, index) => {
|
||||
return <li key={index}>{link}</li>;
|
||||
})}
|
||||
</ul>
|
||||
{this.renderNextButton(t("paginator.next"))}
|
||||
{this.renderNextButton("pagination-next", t("paginator.next"))}
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import Button, { type ButtonProps } from "./Button";
|
||||
import type {File} from "@scm-manager/ui-types";
|
||||
|
||||
type Props = {
|
||||
displayName: string,
|
||||
@@ -10,9 +8,9 @@ type Props = {
|
||||
|
||||
class DownloadButton extends React.Component<Props> {
|
||||
render() {
|
||||
const {displayName, url} = this.props;
|
||||
const { displayName, url } = this.props;
|
||||
return (
|
||||
<a className="button is-large is-info" href={url}>
|
||||
<a className="button is-large is-link" href={url}>
|
||||
<span className="icon is-medium">
|
||||
<i className="fas fa-arrow-circle-down" />
|
||||
</span>
|
||||
|
||||
45
scm-ui-components/packages/ui-components/src/forms/Radio.js
Normal file
45
scm-ui-components/packages/ui-components/src/forms/Radio.js
Normal file
@@ -0,0 +1,45 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import { Help } from "../index";
|
||||
|
||||
type Props = {
|
||||
label?: string,
|
||||
name?: string,
|
||||
value?: string,
|
||||
checked: boolean,
|
||||
onChange?: (value: boolean, name?: string) => void,
|
||||
disabled?: boolean,
|
||||
helpText?: string
|
||||
};
|
||||
|
||||
class Radio extends React.Component<Props> {
|
||||
renderHelp = () => {
|
||||
const helpText = this.props.helpText;
|
||||
if (helpText) {
|
||||
return <Help message={helpText} />;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="field is-grouped">
|
||||
<div className="control">
|
||||
<label className="radio" disabled={this.props.disabled}>
|
||||
<input
|
||||
type="radio"
|
||||
name={this.props.name}
|
||||
value={this.props.value}
|
||||
checked={this.props.checked}
|
||||
onChange={this.props.onChange}
|
||||
disabled={this.props.disabled}
|
||||
/>{" "}
|
||||
{this.props.label}
|
||||
{this.renderHelp()}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Radio;
|
||||
@@ -4,6 +4,7 @@ export { default as AddEntryToTableField } from "./AddEntryToTableField.js";
|
||||
export { default as AutocompleteAddEntryToTableField } from "./AutocompleteAddEntryToTableField.js";
|
||||
export { default as MemberNameTable } from "./MemberNameTable.js";
|
||||
export { default as Checkbox } from "./Checkbox.js";
|
||||
export { default as Radio } from "./Radio.js";
|
||||
export { default as InputField } from "./InputField.js";
|
||||
export { default as Select } from "./Select.js";
|
||||
export { default as Textarea } from "./Textarea.js";
|
||||
|
||||
@@ -43,6 +43,7 @@ class ConfirmAlert extends React.Component<Props> {
|
||||
<button
|
||||
key={i}
|
||||
onClick={() => this.handleClickButton(button)}
|
||||
href="javascript:void(0);"
|
||||
>
|
||||
{button.label}
|
||||
</button>
|
||||
|
||||
@@ -18,7 +18,7 @@ class NavAction extends React.Component<Props> {
|
||||
|
||||
return (
|
||||
<li>
|
||||
<a onClick={action}>{showIcon}{label}</a>
|
||||
<a onClick={action} href="javascript:void(0);">{showIcon}{label}</a>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,15 +3,16 @@ import React from "react";
|
||||
import type { Changeset, Repository, Tag } from "@scm-manager/ui-types";
|
||||
|
||||
import classNames from "classnames";
|
||||
import {Interpolate, translate} from "react-i18next";
|
||||
import { Interpolate, translate } from "react-i18next";
|
||||
import ChangesetId from "./ChangesetId";
|
||||
import injectSheet from "react-jss";
|
||||
import {DateFromNow} from "../..";
|
||||
import { DateFromNow } from "../..";
|
||||
import ChangesetAuthor from "./ChangesetAuthor";
|
||||
import ChangesetTag from "./ChangesetTag";
|
||||
|
||||
import {parseDescription} from "./changesets";
|
||||
import {AvatarWrapper, AvatarImage} from "../../avatar";
|
||||
import { parseDescription } from "./changesets";
|
||||
import { AvatarWrapper, AvatarImage } from "../../avatar";
|
||||
import { ExtensionPoint } from "@scm-manager/ui-extensions";
|
||||
|
||||
const styles = {
|
||||
pointer: {
|
||||
@@ -64,7 +65,15 @@ class ChangesetRow extends React.Component<Props> {
|
||||
<div className={classNames("media-content", classes.withOverflow)}>
|
||||
<div className="content">
|
||||
<p className="is-ellipsis-overflow">
|
||||
<strong>{description.title}</strong>
|
||||
<strong>
|
||||
<ExtensionPoint
|
||||
name="changesets.changeset.description"
|
||||
props={{ changeset, value: description.title }}
|
||||
renderAll={false}
|
||||
>
|
||||
{description.title}
|
||||
</ExtensionPoint>
|
||||
</strong>
|
||||
<br />
|
||||
<Interpolate
|
||||
i18nKey="changesets.changeset.summary"
|
||||
|
||||
Reference in New Issue
Block a user