mirror of
https://github.com/nocodb/nocodb.git
synced 2026-02-01 23:48:33 +00:00
feat: new trigger nodes
This commit is contained in:
14
packages/nc-gui/assets/nc-icons-v2/record-enters-view.svg
Normal file
14
packages/nc-gui/assets/nc-icons-v2/record-enters-view.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M13.3333 6.66663V2.66663C13.3333 2.313 13.1928 1.97386 12.9428 1.72382C12.6928 1.47377 12.3536 1.33329 12 1.33329H3.99999C3.64637 1.33329 3.30723 1.47377 3.05718 1.72382C2.80713 1.97386 2.66666 2.313 2.66666 2.66663V13.3333C2.66666 13.6869 2.80713 14.0261 3.05718 14.2761C3.30723 14.5262 3.64637 14.6666 3.99999 14.6666H6.66666" stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M10.6667 4.66663H5.33334" stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M7.33002 7.33002H5.33002" stroke="currentColor" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<g clip-path="url(#clip0_7412_41702)">
|
||||
<path d="M8.29166 12.5C8.29166 12.5 9.45832 10.1667 11.5 10.1667C13.5417 10.1667 14.7083 12.5 14.7083 12.5C14.7083 12.5 13.5417 14.8334 11.5 14.8334C9.45832 14.8334 8.29166 12.5 8.29166 12.5Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M11.5 13.375C11.9832 13.375 12.375 12.9832 12.375 12.5C12.375 12.0168 11.9832 11.625 11.5 11.625C11.0168 11.625 10.625 12.0168 10.625 12.5C10.625 12.9832 11.0168 13.375 11.5 13.375Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_7412_41702">
|
||||
<rect width="7" height="7" fill="white" transform="translate(8 9)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -1090,6 +1090,56 @@ defineExpose({
|
||||
|
||||
<div v-else-if="!isDateType(types[filter.fk_column_id])" class="flex-grow"></div>
|
||||
</template>
|
||||
<template v-if="workflow && showDynamicCondition">
|
||||
<NcDropdown
|
||||
class="nc-settings-dropdown h-full flex items-center min-w-0 rounded-lg"
|
||||
:trigger="['click']"
|
||||
placement="left"
|
||||
>
|
||||
<NcButton type="text" size="small">
|
||||
<GeneralIcon icon="settings" />
|
||||
</NcButton>
|
||||
|
||||
<template #overlay>
|
||||
<div class="relative overflow-visible min-h-17 w-10">
|
||||
<div
|
||||
class="absolute -top-21 flex flex-col min-h-34.5 w-70 p-1.5 bg-nc-bg-default rounded-lg border-1 border-nc-border-gray-medium justify-start overflow-hidden"
|
||||
style="box-shadow: 0px 4px 6px -2px rgba(0, 0, 0, 0.06), 0px -12px 16px -4px rgba(0, 0, 0, 0.1)"
|
||||
>
|
||||
<div
|
||||
class="px-4 py-3 flex flex-col select-none gap-y-2 cursor-pointer rounded-md hover:bg-nc-bg-gray-light text-nc-content-gray-subtle2 nc-new-record-with-grid group"
|
||||
@click="resetDynamicField(filter, i)"
|
||||
>
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<div class="flex flex-row items-center justify-start gap-x-3">Static condition</div>
|
||||
<GeneralIcon
|
||||
v-if="!filter.dynamic && !filter.fk_value_col_id"
|
||||
icon="check"
|
||||
class="w-4 h-4 text-primary"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-row text-xs text-nc-content-gray-disabled">Filter based on static value</div>
|
||||
</div>
|
||||
<div
|
||||
v-e="['c:filter:dynamic-filter']"
|
||||
class="px-4 py-3 flex flex-col select-none gap-y-2 cursor-pointer cursor-pointer rounded-md hover:bg-nc-bg-gray-light text-nc-content-gray-subtle2 nc-new-record-with-form group"
|
||||
@click="changeToDynamic(filter, i)"
|
||||
>
|
||||
<div class="flex flex-row items-center justify-between w-full">
|
||||
<div class="flex flex-row items-center justify-start gap-x-2.5">Dynamic condition</div>
|
||||
<GeneralIcon
|
||||
v-if="filter.dynamic || filter.fk_value_col_id"
|
||||
icon="check"
|
||||
class="w-4 h-4 text-primary"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-row text-xs text-nc-content-gray-disabled">Filter based on dynamic value</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</NcDropdown>
|
||||
</template>
|
||||
<template v-if="link && showDynamicCondition">
|
||||
<NcDropdown
|
||||
class="nc-settings-dropdown h-full flex items-center min-w-0 rounded-lg"
|
||||
|
||||
@@ -644,6 +644,13 @@ import NcInsertBefore from '~icons/nc-icons/insert-before'
|
||||
import NcInsertAfter from '~icons/nc-icons/insert-after'
|
||||
import NcWebhook from '~icons/nc-icons-v2/webhook'
|
||||
|
||||
import NcFormResponse from '~icons/nc-icons-v2/new-form-responce'
|
||||
import NcRecordCreate from '~icons/nc-icons-v2/record-create'
|
||||
import NcRecordUpdate from '~icons/nc-icons-v2/record-update'
|
||||
import NcRecordDelete from '~icons/nc-icons-v2/record-delete'
|
||||
import NcRecordEntersView from '~icons/nc-icons-v2/record-enters-view'
|
||||
import NcIfElse from '~icons/nc-icons-v2/if-else'
|
||||
|
||||
import NcLogoAsanaColored from '~icons/nc-icons-v2/asana-colored.svg'
|
||||
import NcLogoAsana from '~icons/nc-icons-v2/asana.svg'
|
||||
import NcLogoBitbucketColored from '~icons/nc-icons-v2/bitbucket-colored.svg'
|
||||
@@ -1805,6 +1812,15 @@ export const iconMap = {
|
||||
'ncSun': NcSun,
|
||||
'ncGraduationCap': NcGraduationCap,
|
||||
'ncSupportAgent': h(NcSupportAgent, { stroke: 'transparent' }),
|
||||
'ncBuilding': NcBuilding,
|
||||
'ncRecordCreate': NcRecordCreate,
|
||||
'ncRecordUpdate': NcRecordUpdate,
|
||||
'ncRecordDelete': NcRecordDelete,
|
||||
'ncRecordFind': NcAuditNew,
|
||||
'ncFormResponse': NcFormResponse,
|
||||
'ncIfElse': NcIfElse,
|
||||
'ncRecordEntersView': NcRecordEntersView,
|
||||
'ncExtUrlPreviewEmptyState': h(NcExtUrlPreviewEmptyState, { stroke: 'transparent' }),
|
||||
}
|
||||
|
||||
export const getMdiIcon = (type: string): any => {
|
||||
|
||||
@@ -65,8 +65,10 @@ export async function validateCondition(
|
||||
data: any = {},
|
||||
{
|
||||
client,
|
||||
skipFetchingChildren = false,
|
||||
}: {
|
||||
client: string;
|
||||
skipFetchingChildren?: boolean;
|
||||
},
|
||||
) {
|
||||
if (!filters.length) {
|
||||
@@ -78,9 +80,14 @@ export async function validateCondition(
|
||||
const filter = _filter instanceof Filter ? _filter : new Filter(_filter);
|
||||
let res;
|
||||
if (filter.is_group) {
|
||||
filter.children = filter.children || (await filter.getChildren(context));
|
||||
// If skipFetchingChildren is true, only use children from the object
|
||||
// This is useful for filters stored in JSON (like workflow configs) that aren't in the database
|
||||
filter.children = skipFetchingChildren
|
||||
? filter.children || []
|
||||
: filter.children || (await filter.getChildren(context));
|
||||
res = await validateCondition(context, filter.children, data, {
|
||||
client,
|
||||
skipFetchingChildren,
|
||||
});
|
||||
} else {
|
||||
const column = await filter.getColumn(context);
|
||||
|
||||
Reference in New Issue
Block a user