Feature/mirror (#1683)

Add mirror command and extension points.

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This commit is contained in:
Eduard Heimbuch
2021-06-04 14:05:47 +02:00
committed by GitHub
parent e55ba52ace
commit dd0975b49a
111 changed files with 6018 additions and 796 deletions

View File

@@ -0,0 +1,86 @@
/*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
import React, { ChangeEvent, FC, FocusEvent } from "react";
import classNames from "classnames";
import LabelWithHelpIcon from "./LabelWithHelpIcon";
import { createAttributesForTesting } from "../devBuild";
type Props = {
name?: string;
className?: string;
label?: string;
placeholder?: string;
helpText?: string;
disabled?: boolean;
testId?: string;
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
ref?: React.Ref<HTMLInputElement>;
};
const FileInput: FC<Props> = ({
name,
testId,
helpText,
placeholder,
disabled,
label,
className,
ref,
onBlur,
onChange
}) => {
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
if (onChange && event.target.files) {
onChange(event);
}
};
const handleBlur = (event: FocusEvent<HTMLInputElement>) => {
if (onBlur && event.target.files) {
onBlur(event);
}
};
return (
<div className={classNames("field", className)}>
<LabelWithHelpIcon label={label} helpText={helpText} />
<div className="control">
<input
ref={ref}
name={name}
className={classNames("input", "p-1", className)}
type="file"
placeholder={placeholder}
disabled={disabled}
onChange={handleChange}
onBlur={handleBlur}
{...createAttributesForTesting(testId)}
/>
</div>
</div>
);
};
export default FileInput;

View File

@@ -56,7 +56,7 @@ export default class TagGroup extends React.Component<Props> {
return (
<div className="control" key={key}>
<div className="tags has-addons">
<Tag color="info is-outlined" label={item.displayName} onRemove={() => this.removeEntry(item)} />
<Tag color="info" outlined={true} label={item.displayName} onRemove={() => this.removeEntry(item)} />
</div>
</div>
);
@@ -66,7 +66,7 @@ export default class TagGroup extends React.Component<Props> {
}
removeEntry = (item: DisplayedUser) => {
const newItems = this.props.items.filter(name => name !== item);
const newItems = this.props.items.filter((name) => name !== item);
this.props.onRemove(newItems);
};
}

View File

@@ -39,3 +39,4 @@ export { default as PasswordConfirmation } from "./PasswordConfirmation";
export { default as LabelWithHelpIcon } from "./LabelWithHelpIcon";
export { default as DropDown } from "./DropDown";
export { default as FileUpload } from "./FileUpload";
export { default as FileInput } from "./FileInput";