Skip to content

Commit 1d93479

Browse files
waleedlatif1claude
andcommitted
fix(microsoft-ad): fix docsLink underscore and accountEnabled update safety
- Change docsLink from microsoft-ad to microsoft_ad to match docs routing - Split accountEnabled dropdown into separate create/update subBlocks - Update operation shows "No Change" default (empty string) to prevent silently re-enabling disabled accounts when updating other fields - Create operation keeps "Yes" default as before Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 763de06 commit 1d93479

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

apps/sim/blocks/blocks/microsoft_ad.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const MicrosoftAdBlock: BlockConfig<MicrosoftAdResponse> = {
1010
description: 'Manage users and groups in Azure AD (Microsoft Entra ID)',
1111
longDescription:
1212
'Integrate Azure Active Directory into your workflows. List, create, update, and delete users and groups. Manage group memberships programmatically.',
13-
docsLink: 'https://docs.sim.ai/tools/microsoft-ad',
13+
docsLink: 'https://docs.sim.ai/tools/microsoft_ad',
1414
category: 'tools',
1515
bgColor: '#0078D4',
1616
icon: AzureIcon,
@@ -92,12 +92,24 @@ export const MicrosoftAdBlock: BlockConfig<MicrosoftAdResponse> = {
9292
id: 'accountEnabled',
9393
title: 'Account Enabled',
9494
type: 'dropdown',
95+
options: [
96+
{ label: 'No Change', id: '' },
97+
{ label: 'Yes', id: 'true' },
98+
{ label: 'No', id: 'false' },
99+
],
100+
value: () => '',
101+
condition: { field: 'operation', value: 'update_user' },
102+
},
103+
{
104+
id: 'accountEnabledCreate',
105+
title: 'Account Enabled',
106+
type: 'dropdown',
95107
options: [
96108
{ label: 'Yes', id: 'true' },
97109
{ label: 'No', id: 'false' },
98110
],
99111
value: () => 'true',
100-
condition: { field: 'operation', value: ['create_user', 'update_user'] },
112+
condition: { field: 'operation', value: 'create_user' },
101113
},
102114
// Update user optional fields
103115
{
@@ -308,8 +320,8 @@ export const MicrosoftAdBlock: BlockConfig<MicrosoftAdResponse> = {
308320
if (params.top) result.top = Number(params.top)
309321
if (params.filter) result.filter = params.filter
310322
if (params.search) result.search = params.search
311-
if (params.accountEnabled !== undefined)
312-
result.accountEnabled = params.accountEnabled === 'true'
323+
const accountEnabledVal = params.accountEnabled || params.accountEnabledCreate
324+
if (accountEnabledVal) result.accountEnabled = accountEnabledVal === 'true'
313325
if (params.mailEnabled !== undefined) result.mailEnabled = params.mailEnabled === 'true'
314326
if (params.securityEnabled !== undefined)
315327
result.securityEnabled = params.securityEnabled === 'true'
@@ -331,6 +343,7 @@ export const MicrosoftAdBlock: BlockConfig<MicrosoftAdResponse> = {
331343
userPrincipalName: { type: 'string' },
332344
password: { type: 'string' },
333345
accountEnabled: { type: 'string' },
346+
accountEnabledCreate: { type: 'string' },
334347
givenName: { type: 'string' },
335348
surname: { type: 'string' },
336349
jobTitle: { type: 'string' },

0 commit comments

Comments
 (0)