Make profile state filters multi-value

Address PR review feedback on the profile-state split: SAML sign-in now
activates a pending profile, deactivation counts owners against the
profile's own organization to close a last-owner bypass, the migration
leaves historical activated_at/deactivated_at NULL rather than
fabricating timestamps, and pending members are no longer rendered with
the deactivated (faded) styling.

Drop the single-value state filter in favor of the multi-value states
across the profile and signatory surfaces. Remove ProfileFilter.state
(only states[] remains) and convert the signatures profileState filter
to profileStates. Turn the console people filter, the CLI
"user list --state" flag, and the n8n listUsers and getAllSignatures
state inputs into multi-select controls, where an empty selection means
all states.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-07-28 18:16:52 +02:00
parent b10fc55b7f
commit eecf8a1d97
29 changed files with 88 additions and 106 deletions

View File

@@ -98,13 +98,12 @@ export const description: INodeProperties[] = [
description: 'Whether to filter by active contract status',
},
{
displayName: 'Profile State',
displayName: 'Profile States',
name: 'state',
type: 'options',
default: '',
description: 'Filter by signatory profile state',
type: 'multiOptions',
default: [],
description: 'Filter by signatory profile states',
options: [
{ name: 'Any', value: '' },
{ name: 'Pending', value: 'PENDING' },
{ name: 'Active', value: 'ACTIVE' },
{ name: 'Deactivated', value: 'DEACTIVATED' },
@@ -126,7 +125,7 @@ export async function execute(
const filter: IDataObject = {};
if ((filters.states as string[])?.length) filter.states = filters.states;
if (filters.activeContract !== undefined) filter.activeContract = filters.activeContract;
if (filters.state) filter.profileState = filters.state;
if ((filters.state as string[])?.length) filter.profileStates = filters.state;
const hasFilter = Object.keys(filter).length > 0;

View File

@@ -85,9 +85,9 @@ export const description: INodeProperties[] = [
description: 'Search users by full name or email address',
},
{
displayName: 'State',
displayName: 'States',
name: 'state',
type: 'options',
type: 'multiOptions',
displayOptions: {
show: {
resource: ['user'],
@@ -96,12 +96,11 @@ export const description: INodeProperties[] = [
},
options: [
{ name: 'Active', value: 'ACTIVE' },
{ name: 'All', value: '' },
{ name: 'Deactivated', value: 'DEACTIVATED' },
{ name: 'Pending', value: 'PENDING' },
],
default: '',
description: 'Filter by profile state',
default: [],
description: 'Filter by profile states',
},
{
displayName: 'Role',
@@ -153,7 +152,7 @@ export async function execute(
const returnAll = this.getNodeParameter('returnAll', itemIndex) as boolean;
const limit = this.getNodeParameter('limit', itemIndex, 50) as number;
const query = this.getNodeParameter('query', itemIndex, '') as string;
const state = this.getNodeParameter('state', itemIndex, '') as string;
const state = this.getNodeParameter('state', itemIndex, []) as string[];
const role = this.getNodeParameter('role', itemIndex, '') as string;
const kind = this.getNodeParameter('kind', itemIndex, '') as string;
@@ -194,8 +193,8 @@ export async function execute(
if (query) {
filter.query = query;
}
if (state) {
filter.state = state;
if (state.length > 0) {
filter.states = state;
}
if (role) {
filter.role = role;