fix(plugin-workflow): fix assignees config component in manual node (#1547)

This commit is contained in:
Junyi 2023-03-07 19:24:02 +08:00 committed by GitHub
parent aa3ca7a959
commit 313217a671
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 11 deletions

View File

@ -14,12 +14,13 @@ export type RemoteSelectProps<P = any> = SelectProps<P, any> & {
onChange?: (v: any) => void;
target: string;
wait?: number;
manual?: boolean;
service: ResourceActionOptions<P>;
};
const InternalRemoteSelect = connect(
(props: RemoteSelectProps) => {
const { fieldNames = {}, service = {}, wait = 300, value, objectValue, ...others } = props;
const { fieldNames = {}, service = {}, wait = 300, value, objectValue, manual = true, ...others } = props;
const compile = useCompile();
const firstRun = useRef(false);
@ -36,7 +37,7 @@ const InternalRemoteSelect = connect(
},
},
{
manual: true,
manual,
debounceWait: wait,
},
);

View File

@ -375,7 +375,7 @@ export function NodeDefaultView(props) {
type: 'void',
properties: {
...(instruction.view ? { view: instruction.view } : {}),
config: {
button: {
type: 'void',
'x-content': detailText,
'x-component': Button,

View File

@ -26,9 +26,10 @@ export function AssigneesSelect({ multiple = false, value = [], onChange }) {
service={{
resource: 'users'
}}
manual={false}
value={value[0]}
onChange={(v) => {
onChange([v]);
onChange(v != null ? [v] : []);
}}
/>
</Variable.Input>

View File

@ -41,13 +41,6 @@ export default {
'x-component': 'AssigneesSelect',
'x-component-props': {
// multiple: true,
// fieldNames: {
// label: 'nickname',
// value: 'id',
// },
// service: {
// resource: 'users'
// },
},
required: true,
default: [],