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; onChange?: (v: any) => void;
target: string; target: string;
wait?: number; wait?: number;
manual?: boolean;
service: ResourceActionOptions<P>; service: ResourceActionOptions<P>;
}; };
const InternalRemoteSelect = connect( const InternalRemoteSelect = connect(
(props: RemoteSelectProps) => { (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 compile = useCompile();
const firstRun = useRef(false); const firstRun = useRef(false);
@ -36,7 +37,7 @@ const InternalRemoteSelect = connect(
}, },
}, },
{ {
manual: true, manual,
debounceWait: wait, debounceWait: wait,
}, },
); );

View File

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

View File

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

View File

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