fix(frontend): App button triggered by (#1304)
* feat(frontend): add trigger list * feat(frontend): add trigger list * feat(frontend): add support for refreshOn * feat(frontend): add support for refreshOn * feat(frontend): rework * feat(frontend): rework * feat(frontend): code cleanup * fix(frontend): add support for triggerOnAppLoad
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
import { getDependencies } from './triggerListUtils'
|
||||
|
||||
const { selectedComponent, app } = getContext<AppViewerContext>('AppViewerContext')
|
||||
|
||||
export let fields: Record<string, StaticAppInput | ConnectedAppInput | RowAppInput | UserAppInput>
|
||||
|
||||
$: gridItem = $selectedComponent ? findGridItem($app, $selectedComponent) : undefined
|
||||
@@ -20,11 +19,22 @@
|
||||
$: onClick =
|
||||
gridItem?.data.type &&
|
||||
['buttoncomponent', 'formbuttoncomponent', 'formcomponent'].includes(gridItem?.data.type)
|
||||
|
||||
$: if (gridItem) {
|
||||
console.log(gridItem?.data.configuration.triggerOnAppLoad)
|
||||
}
|
||||
|
||||
$: onLoad =
|
||||
!onClick ||
|
||||
(gridItem?.data.configuration.triggerOnAppLoad.ctype === undefined &&
|
||||
// TODO: Type and value are not in sync.
|
||||
// @ts-ignore
|
||||
gridItem?.data.configuration.triggerOnAppLoad.value)
|
||||
</script>
|
||||
|
||||
<TriggerBadgesList
|
||||
inputDependencies={getDependencies(fields)}
|
||||
onLoad={!onClick}
|
||||
{onLoad}
|
||||
id={$selectedComponent}
|
||||
{onClick}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user