mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 23:30:10 +00:00
add multi select dropdown
This commit is contained in:
parent
79268309ee
commit
9fc298ba1a
@ -290,7 +290,7 @@ export default class APIKeyPermission extends BaseModel {
|
||||
Permission.CanEditProjectApiKey,
|
||||
],
|
||||
})
|
||||
@TableColumn({ required: true, type: TableColumnType.Array })
|
||||
@TableColumn({ required: false, type: TableColumnType.Array })
|
||||
@ManyToMany(() => {
|
||||
return Label;
|
||||
})
|
||||
|
@ -23,6 +23,7 @@ export interface ComponentProps {
|
||||
value?: string | undefined;
|
||||
onFocus?: (() => void) | undefined;
|
||||
onBlur?: (() => void) | undefined;
|
||||
isMultiSelect?: boolean;
|
||||
}
|
||||
|
||||
const Dropdown: FunctionComponent<ComponentProps> = (
|
||||
@ -68,6 +69,7 @@ const Dropdown: FunctionComponent<ComponentProps> = (
|
||||
onBlur={() => {
|
||||
props.onBlur && props.onBlur();
|
||||
}}
|
||||
isMulti={props.isMultiSelect}
|
||||
value={selectedValue}
|
||||
onFocus={() => {
|
||||
props.onFocus && props.onFocus();
|
||||
|
@ -147,7 +147,7 @@ const BasicForm: Function = <T extends Object>(
|
||||
</Field>
|
||||
)}
|
||||
|
||||
{field.fieldType === FormFieldSchemaType.Dropdown && (
|
||||
{(field.fieldType === FormFieldSchemaType.Dropdown || field.fieldType === FormFieldSchemaType.MultiSelectDropdown) && (
|
||||
<Field name={fieldName}>
|
||||
{({ form }: any) => {
|
||||
return (
|
||||
@ -167,6 +167,7 @@ const BasicForm: Function = <T extends Object>(
|
||||
true
|
||||
);
|
||||
}}
|
||||
isMultiSelect={field.fieldType === FormFieldSchemaType.MultiSelectDropdown}
|
||||
options={field.dropdownOptions || []}
|
||||
placeholder={field.placeholder || ''}
|
||||
initialValue={
|
||||
|
@ -13,8 +13,7 @@ enum FormFieldSchemaType {
|
||||
LongText,
|
||||
Color,
|
||||
Dropdown,
|
||||
MultiSelectDropdown,
|
||||
MultiSelectModelDropdown,
|
||||
MultiSelectDropdown,
|
||||
}
|
||||
|
||||
export default FormFieldSchemaType;
|
||||
|
@ -111,8 +111,9 @@ const APIKeyView: FunctionComponent<PageComponentProps> = (
|
||||
field: {
|
||||
labels: true,
|
||||
},
|
||||
title: 'Labels',
|
||||
fieldType: FormFieldSchemaType.MultiSelectModelDropdown,
|
||||
title: 'Labels (Optional)',
|
||||
description: 'Labels on which this permissions will apply on. This is optional and an advanced feature.',
|
||||
fieldType: FormFieldSchemaType.MultiSelectDropdown,
|
||||
dropdownModal: {
|
||||
type: Label,
|
||||
labelField: "name",
|
||||
|
Loading…
Reference in New Issue
Block a user