Allow to select full object and object id in filters (#14083)
Today WorkflowVariablesDropdownAllItems is used for variable picker in all workflow steps, and for step field picker in filters. Using that component in filters prevent us from knowing if a full record or only the id has been selected. This PR: - creates a new component WorkflowDropdownStepOutputItems, mostly copying the logic of WorkflowVariablesDropdownAllItems - call it WorkflowStepFilterFieldSelect, removing the display logic from that parent component - store isFullRecord in filter. So we now know if we should display a record picker or a uuid picker Before - selecting id makes picker behaves like when we select an object https://github.com/user-attachments/assets/bde34dc5-8011-4983-8d0f-d8cb0cb3c045 After - selecting object and id are two different things https://github.com/user-attachments/assets/49289990-3e6d-4ad7-abc1-e3ade2a821bb
This commit is contained in:
-42
@@ -21,10 +21,8 @@ describe('evaluateFilterConditions', () => {
|
||||
): ResolvedFilter => ({
|
||||
id: 'filter1',
|
||||
type: type,
|
||||
label: 'Test Filter',
|
||||
rightOperand,
|
||||
operand,
|
||||
displayValue: String(rightOperand),
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand,
|
||||
});
|
||||
@@ -784,10 +782,8 @@ describe('evaluateFilterConditions', () => {
|
||||
const filter: ResolvedFilter = {
|
||||
id: 'filter1',
|
||||
type: 'CURRENCY',
|
||||
label: 'Currency Filter',
|
||||
rightOperand: 'USD',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'USD',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 'USD',
|
||||
compositeFieldSubFieldName: 'currencyCode',
|
||||
@@ -800,10 +796,8 @@ describe('evaluateFilterConditions', () => {
|
||||
const filter: ResolvedFilter = {
|
||||
id: 'filter1',
|
||||
type: 'CURRENCY',
|
||||
label: 'Currency Filter',
|
||||
rightOperand: 100,
|
||||
operand: ViewFilterOperand.GreaterThanOrEqual,
|
||||
displayValue: '100',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 150,
|
||||
compositeFieldSubFieldName: 'amountMicros',
|
||||
@@ -1215,20 +1209,16 @@ describe('evaluateFilterConditions', () => {
|
||||
{
|
||||
id: 'filter1',
|
||||
type: 'RELATION',
|
||||
label: 'Name Filter',
|
||||
rightOperand: 'John',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'John',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 'John',
|
||||
},
|
||||
{
|
||||
id: 'filter2',
|
||||
type: 'NUMBER',
|
||||
label: 'Age Filter',
|
||||
rightOperand: 25,
|
||||
operand: ViewFilterOperand.GreaterThanOrEqual,
|
||||
displayValue: '25',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 30,
|
||||
},
|
||||
@@ -1244,20 +1234,16 @@ describe('evaluateFilterConditions', () => {
|
||||
{
|
||||
id: 'filter1',
|
||||
type: 'RELATION',
|
||||
label: 'Name Filter',
|
||||
rightOperand: 'John',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'John',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 'John',
|
||||
},
|
||||
{
|
||||
id: 'filter2',
|
||||
type: 'NUMBER',
|
||||
label: 'Age Filter',
|
||||
rightOperand: 25,
|
||||
operand: ViewFilterOperand.GreaterThanOrEqual,
|
||||
displayValue: '25',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 20, // This will fail
|
||||
},
|
||||
@@ -1283,20 +1269,16 @@ describe('evaluateFilterConditions', () => {
|
||||
{
|
||||
id: 'filter1',
|
||||
type: 'RELATION',
|
||||
label: 'Name Filter',
|
||||
rightOperand: 'John',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'John',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 'John',
|
||||
},
|
||||
{
|
||||
id: 'filter2',
|
||||
type: 'NUMBER',
|
||||
label: 'Age Filter',
|
||||
rightOperand: 25,
|
||||
operand: ViewFilterOperand.GreaterThanOrEqual,
|
||||
displayValue: '25',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 30,
|
||||
},
|
||||
@@ -1319,20 +1301,16 @@ describe('evaluateFilterConditions', () => {
|
||||
{
|
||||
id: 'filter1',
|
||||
type: 'RELATION',
|
||||
label: 'Name Filter',
|
||||
rightOperand: 'John',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'John',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 'Jane', // This will fail
|
||||
},
|
||||
{
|
||||
id: 'filter2',
|
||||
type: 'NUMBER',
|
||||
label: 'Age Filter',
|
||||
rightOperand: 25,
|
||||
operand: ViewFilterOperand.GreaterThanOrEqual,
|
||||
displayValue: '25',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 30,
|
||||
},
|
||||
@@ -1357,20 +1335,16 @@ describe('evaluateFilterConditions', () => {
|
||||
{
|
||||
id: 'filter1',
|
||||
type: 'RELATION',
|
||||
label: 'Name Filter',
|
||||
rightOperand: 'John',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'John',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 'Jane', // This will fail
|
||||
},
|
||||
{
|
||||
id: 'filter2',
|
||||
type: 'NUMBER',
|
||||
label: 'Age Filter',
|
||||
rightOperand: 25,
|
||||
operand: ViewFilterOperand.GreaterThanOrEqual,
|
||||
displayValue: '25',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 30, // This will pass
|
||||
},
|
||||
@@ -1393,20 +1367,16 @@ describe('evaluateFilterConditions', () => {
|
||||
{
|
||||
id: 'filter1',
|
||||
type: 'RELATION',
|
||||
label: 'Name Filter',
|
||||
rightOperand: 'John',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'John',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 'Jane', // This will fail
|
||||
},
|
||||
{
|
||||
id: 'filter2',
|
||||
type: 'NUMBER',
|
||||
label: 'Age Filter',
|
||||
rightOperand: 25,
|
||||
operand: ViewFilterOperand.GreaterThanOrEqual,
|
||||
displayValue: '25',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 20, // This will fail
|
||||
},
|
||||
@@ -1435,20 +1405,16 @@ describe('evaluateFilterConditions', () => {
|
||||
{
|
||||
id: 'filter1',
|
||||
type: 'RELATION',
|
||||
label: 'Name Filter',
|
||||
rightOperand: 'John',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'John',
|
||||
stepFilterGroupId: 'group1',
|
||||
leftOperand: 'John',
|
||||
},
|
||||
{
|
||||
id: 'filter2',
|
||||
type: 'NUMBER',
|
||||
label: 'Age Filter',
|
||||
rightOperand: 25,
|
||||
operand: ViewFilterOperand.GreaterThanOrEqual,
|
||||
displayValue: '25',
|
||||
stepFilterGroupId: 'group2',
|
||||
leftOperand: 30,
|
||||
},
|
||||
@@ -1485,30 +1451,24 @@ describe('evaluateFilterConditions', () => {
|
||||
{
|
||||
id: 'filter1',
|
||||
type: 'RELATION',
|
||||
label: 'Filter 1',
|
||||
rightOperand: 'John',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'John',
|
||||
stepFilterGroupId: 'child1',
|
||||
leftOperand: 'Jane', // This will fail
|
||||
},
|
||||
{
|
||||
id: 'filter2',
|
||||
type: 'RELATION',
|
||||
label: 'Filter 2',
|
||||
rightOperand: 'Smith',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'Smith',
|
||||
stepFilterGroupId: 'child1',
|
||||
leftOperand: 'Smith', // This will pass (OR group passes)
|
||||
},
|
||||
{
|
||||
id: 'filter3',
|
||||
type: 'NUMBER',
|
||||
label: 'Filter 3',
|
||||
rightOperand: 25,
|
||||
operand: ViewFilterOperand.GreaterThanOrEqual,
|
||||
displayValue: '25',
|
||||
stepFilterGroupId: 'child2',
|
||||
leftOperand: 30, // This will pass (AND group passes)
|
||||
},
|
||||
@@ -1548,10 +1508,8 @@ describe('evaluateFilterConditions', () => {
|
||||
{
|
||||
id: 'filter1',
|
||||
type: 'RELATION',
|
||||
label: 'Name Filter',
|
||||
rightOperand: 'John',
|
||||
operand: ViewFilterOperand.Is,
|
||||
displayValue: 'John',
|
||||
stepFilterGroupId: 'nonexistent',
|
||||
leftOperand: 'John',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user