refactor(trigger): simplify provider path handling in workflow components

- Updated various components to directly use `provider.name` instead of constructing a path with `provider.plugin_id` and `provider.name`.
- Adjusted related calls to `invalidateSubscriptions` and other functions to reflect this change.

These modifications enhance code clarity and streamline the handling of provider information in the trigger plugin components.
This commit is contained in:
Harry
2025-09-09 00:17:20 +08:00
parent ff30395dc1
commit dc16f1b65a
5 changed files with 15 additions and 22 deletions

View File

@ -241,8 +241,8 @@ const BasePanel: FC<BasePanelProps> = ({
// For trigger plugins, check if they have existing subscriptions (authenticated)
const triggerProvider = useMemo(() => {
if (data.type === BlockEnum.TriggerPlugin) {
if (data.provider_id && data.provider_name)
return `${data.provider_id}/${data.provider_name}`
if (data.provider_name)
return data.provider_name
return data.provider_id || ''
}
return ''

View File

@ -32,11 +32,8 @@ const NodeAuth: FC<NodeAuthProps> = ({ data, onAuthorizationChange }) => {
const provider = useMemo(() => {
if (data.type === BlockEnum.TriggerPlugin) {
// If we have both plugin_id and provider_name, construct the full path
if (data.provider_id && data.provider_name)
return `${data.provider_id}/${data.provider_name}`
// Otherwise use provider_id as fallback (might be already complete)
return data.provider_id || ''
if (data.provider_name)
return data.provider_name
}
return data.provider_id || ''
}, [data.type, data.provider_id, data.provider_name])