Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Composer/packages/adaptive-form/src/components/FormRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,7 @@ export const getRowProps = (rowProps: FormRowProps, field: string) => {
const { required = [] } = schema;
const fieldSchema = resolvePropSchema(schema, field, definitions);

const intellisenseScopes: string[] = [];
if (field === 'property') {
intellisenseScopes.push('variable-scopes');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the logic is deleted from FormRow, but where is it added in IntellisenseField? I only see the use of projectId in IntellisenseField.tsx.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @GeoffCoxMSFT, I made sure that Intellisense can consume the data from the uiSchema in the 1st Intellisense PR.
This is what uiOptions.properties?.[field] does.
I only needed the hardcoding as a temporary thing until the data was in the schema.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to be aware of is that users with old ui schemas will not get this behavior. Maybe we keep the hardcoded path for now, but prefer the UI Schema options if they are set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the uiSchema not bundled with the code? Aka won't users with the latest app version not also have the latest uiSchema? I would rather avoid any hardcoding when we can. Any field with the "property" value will get one type of Intellisense, which might lead to unexpected behaviors if that value is used for a different purpose (aka not a variable setter) somewhere in the schema.

}

const newUiOptions = (uiOptions.properties?.[field] as UIOptions) ?? {};
newUiOptions.intellisenseScopes = intellisenseScopes;

return {
id: `${id}.${field}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { FieldProps } from '@bfc/extension-client';
import { FieldProps, useShellApi } from '@bfc/extension-client';
import { IntellisenseTextField } from '@bfc/intellisense';
import { TextField } from 'office-ui-fabric-react/lib/TextField';
import React from 'react';
Expand All @@ -12,12 +12,15 @@ import { FieldLabel } from '../FieldLabel';
export const IntellisenseField: React.FC<FieldProps<string>> = function IntellisenseField(props) {
const { id, value = '', onChange, label, description, uiOptions, required } = props;

const { projectId } = useShellApi();

return (
<>
<FieldLabel description={description} helpLink={uiOptions?.helpLink} id={id} label={label} required={required} />

<IntellisenseTextField
id={`intellisense-${id}`}
projectId={projectId}
scopes={uiOptions.intellisenseScopes || []}
url={getIntellisenseUrl()}
value={value}
Expand Down