mirror of https://github.com/portainer/portainer
feat(edge/groups): make selector required
parent
1140804fe9
commit
6674df6dc9
|
@ -28,6 +28,7 @@ export const componentsModule = angular
|
||||||
'error',
|
'error',
|
||||||
'horizontal',
|
'horizontal',
|
||||||
'isGroupVisible',
|
'isGroupVisible',
|
||||||
|
'required',
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
.component(
|
.component(
|
||||||
|
|
|
@ -18,6 +18,7 @@ interface Props {
|
||||||
error?: string | string[];
|
error?: string | string[];
|
||||||
horizontal?: boolean;
|
horizontal?: boolean;
|
||||||
isGroupVisible?(group: EdgeGroup): boolean;
|
isGroupVisible?(group: EdgeGroup): boolean;
|
||||||
|
required?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function EdgeGroupsSelector({
|
export function EdgeGroupsSelector({
|
||||||
|
@ -26,6 +27,7 @@ export function EdgeGroupsSelector({
|
||||||
error,
|
error,
|
||||||
horizontal,
|
horizontal,
|
||||||
isGroupVisible = () => true,
|
isGroupVisible = () => true,
|
||||||
|
required,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const selector = (
|
const selector = (
|
||||||
<InnerSelector
|
<InnerSelector
|
||||||
|
@ -36,11 +38,11 @@ export function EdgeGroupsSelector({
|
||||||
);
|
);
|
||||||
|
|
||||||
return horizontal ? (
|
return horizontal ? (
|
||||||
<FormControl errors={error} label="Edge Groups">
|
<FormControl errors={error} label="Edge Groups" required={required}>
|
||||||
{selector}
|
{selector}
|
||||||
</FormControl>
|
</FormControl>
|
||||||
) : (
|
) : (
|
||||||
<FormSection title="Edge Groups">
|
<FormSection title={`Edge Groups${required ? ' *' : ''}`}>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<div className="col-sm-12">{selector} </div>
|
<div className="col-sm-12">{selector} </div>
|
||||||
{error && (
|
{error && (
|
||||||
|
|
Loading…
Reference in New Issue