mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Integrate Plugin Center myCloudogu Authentication (#1884)
Allows scm-manager instances to authenticate with the configured plugin center. If the default plugin center is used, a myCloudogu account is used for authentication which in turn enables downloading special myCloudogu plugins directly through the plugin administration page. Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com> Co-authored-by: Matthias Thieroff <93515444+mthieroff@users.noreply.github.com> Co-authored-by: Philipp Ahrendt <philipp.ahrendt@cloudogu.com>
This commit is contained in:
@@ -61,32 +61,43 @@ const Button: FC<Props> = ({
|
||||
loading,
|
||||
disabled,
|
||||
action,
|
||||
color = "default",
|
||||
color = "default"
|
||||
}) => {
|
||||
const renderIcon = () => {
|
||||
return <>{icon ? <Icon name={icon} color="inherit" className="is-medium pr-1" /> : null}</>;
|
||||
};
|
||||
|
||||
const classes = classNames(
|
||||
"button",
|
||||
"is-" + color,
|
||||
{ "is-loading": loading },
|
||||
{ "is-fullwidth": fullWidth },
|
||||
{ "is-reduced-mobile": reducedMobile },
|
||||
className
|
||||
);
|
||||
|
||||
const content = (
|
||||
<>
|
||||
{renderIcon()}{" "}
|
||||
{(label || children) && (
|
||||
<>
|
||||
{label} {children}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
if (link && !disabled) {
|
||||
if (link.includes("://")) {
|
||||
return (
|
||||
<a className={classes} href={link} aria-label={label}>
|
||||
{content}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Link
|
||||
className={classNames(
|
||||
"button",
|
||||
"is-" + color,
|
||||
{ "is-loading": loading },
|
||||
{ "is-fullwidth": fullWidth },
|
||||
{ "is-reduced-mobile": reducedMobile },
|
||||
className
|
||||
)}
|
||||
to={link}
|
||||
aria-label={label}
|
||||
>
|
||||
{renderIcon()}{" "}
|
||||
{(label || children) && (
|
||||
<>
|
||||
{label} {children}
|
||||
</>
|
||||
)}
|
||||
<Link className={classes} to={link} aria-label={label}>
|
||||
{content}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
@@ -96,23 +107,11 @@ const Button: FC<Props> = ({
|
||||
type={type}
|
||||
title={title}
|
||||
disabled={disabled}
|
||||
onClick={(event) => action && action(event)}
|
||||
className={classNames(
|
||||
"button",
|
||||
"is-" + color,
|
||||
{ "is-loading": loading },
|
||||
{ "is-fullwidth": fullWidth },
|
||||
{ "is-reduced-mobile": reducedMobile },
|
||||
className
|
||||
)}
|
||||
onClick={event => action && action(event)}
|
||||
className={classes}
|
||||
{...createAttributesForTesting(testId)}
|
||||
>
|
||||
{renderIcon()}{" "}
|
||||
{(label || children) && (
|
||||
<>
|
||||
{label} {children}
|
||||
</>
|
||||
)}
|
||||
{content}
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user