Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add a new help URL to the Expression editor #2814

Merged
merged 63 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
68cb85b
fix: make error messages multiline
beyackle Apr 28, 2020
bf08a54
pass customizable help URL through as prop
beyackle Apr 28, 2020
5659a9c
Merge branch 'master' into beyackle/multilineError
beyackle Apr 28, 2020
95671e2
Merge branch 'master' into beyackle/multilineError
cwhitten Apr 28, 2020
93c92ea
Merge branch 'master' into beyackle/multilineError
beyackle Apr 28, 2020
0b2c1be
move HELP_URL
beyackle Apr 28, 2020
0736033
fix location to somewhere more sensible
beyackle Apr 28, 2020
1beff6b
Update package.json
beyackle Apr 28, 2020
bd7adb1
Update package.json
beyackle Apr 28, 2020
7e52faa
pass customizable help URL through as prop
beyackle Apr 28, 2020
d2931f6
move HELP_URL
beyackle Apr 28, 2020
f4d02e0
fix location to somewhere more sensible
beyackle Apr 28, 2020
a5b1a22
Update package.json
beyackle Apr 28, 2020
a65041e
Update package.json
beyackle Apr 28, 2020
1a8b480
suggestions from PR
beyackle Apr 29, 2020
f4fb651
Merge branch 'beyackle/multilineError' of https://github.com/microsof…
beyackle Apr 29, 2020
ec2e248
Merge branch 'master' into beyackle/multilineError
beyackle Apr 29, 2020
a08a2ef
pass customizable help URL through as prop
beyackle Apr 28, 2020
392148e
move HELP_URL
beyackle Apr 28, 2020
fc26937
fix location to somewhere more sensible
beyackle Apr 28, 2020
4b11903
Update package.json
beyackle Apr 28, 2020
9a18649
Update package.json
beyackle Apr 28, 2020
49badf2
suggestions from PR
beyackle Apr 29, 2020
655e8a3
pass customizable help URL through as prop
beyackle Apr 28, 2020
330faad
move HELP_URL
beyackle Apr 28, 2020
4326c69
fix location to somewhere more sensible
beyackle Apr 28, 2020
fd893d4
Update package.json
beyackle Apr 28, 2020
f8fdc33
Merge branch 'beyackle/multilineError' of https://github.com/microsof…
beyackle Apr 29, 2020
c24a85d
fix stray props
beyackle Apr 29, 2020
c89d54e
make helpLink name consistent
beyackle Apr 29, 2020
534f8cf
Update SkillEndpointField.tsx
beyackle Apr 29, 2020
e01797e
Merge branch 'master' into beyackle/multilineError
beyackle Apr 29, 2020
b2657a8
Merge branch 'master' into beyackle/multilineError
beyackle Apr 29, 2020
84f7ab2
apply fixes from comments
beyackle Apr 30, 2020
8170d26
pass customizable help URL through as prop
beyackle Apr 28, 2020
84f6a67
move HELP_URL
beyackle Apr 28, 2020
69c5673
fix location to somewhere more sensible
beyackle Apr 28, 2020
189f288
Update package.json
beyackle Apr 28, 2020
6f8b6c7
Update package.json
beyackle Apr 28, 2020
7672b52
suggestions from PR
beyackle Apr 29, 2020
eace763
pass customizable help URL through as prop
beyackle Apr 28, 2020
1b6208e
move HELP_URL
beyackle Apr 28, 2020
bb4bd1e
fix location to somewhere more sensible
beyackle Apr 28, 2020
85eaa21
Update package.json
beyackle Apr 28, 2020
f52d0c8
pass customizable help URL through as prop
beyackle Apr 28, 2020
ef5656a
move HELP_URL
beyackle Apr 28, 2020
42fc3fa
fix location to somewhere more sensible
beyackle Apr 28, 2020
55633a1
suggestions from PR
beyackle Apr 29, 2020
3202b61
pass customizable help URL through as prop
beyackle Apr 28, 2020
c46c2cd
move HELP_URL
beyackle Apr 28, 2020
cf25921
fix location to somewhere more sensible
beyackle Apr 28, 2020
1e773fd
Update package.json
beyackle Apr 28, 2020
1fc5ad7
fix stray props
beyackle Apr 29, 2020
49d7241
make helpLink name consistent
beyackle Apr 29, 2020
ffbbb9b
Update SkillEndpointField.tsx
beyackle Apr 29, 2020
3e6cb83
apply fixes from comments
beyackle Apr 30, 2020
1d3fdf2
Update SchemaField.tsx
beyackle Apr 30, 2020
78ce36b
Merge branch 'beyackle/multilineError' of https://github.com/microsof…
beyackle Apr 30, 2020
91fb6e1
Update PropertyEditor.tsx
beyackle Apr 30, 2020
1859f37
Merge branch 'master' into beyackle/multilineError
beyackle Apr 30, 2020
14446e8
make suggested changes and fix unit test
beyackle Apr 30, 2020
4af5cd1
Merge branch 'master' into beyackle/multilineError
beyackle Apr 30, 2020
4d3e26b
Merge branch 'master' into beyackle/multilineError
a-b-r-o-w-n Apr 30, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@

import React from 'react';
import { MessageBar, MessageBarType } from 'office-ui-fabric-react/lib/MessageBar';
import { Link } from 'office-ui-fabric-react/lib/Link';
import formatMessage from 'format-message';

interface ErrorMessageProps {
label?: string | false;
error?: string;
helpURL?: string;
}

const ErrorMessage: React.FC<ErrorMessageProps> = props => {
const { error, label } = props;
const { error, label, helpURL } = props;

return (
<MessageBar
truncated
dismissButtonAriaLabel={formatMessage('Close')}
isMultiline={false}
isMultiline={true}
messageBarType={MessageBarType.error}
overflowButtonAriaLabel={formatMessage('See more')}
>
{[label, error].filter(Boolean).join(' ')}
{helpURL && (
<Link key="a" href={helpURL} target="_blank" rel="noopener noreferrer">
{formatMessage('Refer to the syntax documentation here.')}
</Link>
)}
</MessageBar>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ const FormRow: React.FC<FormRowProps> = props => {

const { required = [] } = schema;

const HELP_URL =
'https://github.com/microsoft/BotBuilder-Samples/tree/master/experimental/common-expression-language';

if (Array.isArray(row)) {
return (
<div css={formRow.row}>
Expand Down Expand Up @@ -108,6 +111,7 @@ const FormRow: React.FC<FormRowProps> = props => {
onBlur={onBlur}
onChange={onChange(row)}
onFocus={onFocus}
helpURL={HELP_URL}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const SchemaField: React.FC<FieldProps> = props => {
rawErrors,
hideError,
onChange,
helpURL,
...rest
} = props;
const pluginConfig = usePluginConfig();
Expand All @@ -50,7 +51,9 @@ const SchemaField: React.FC<FieldProps> = props => {
}
}, []);

const error = typeof rawErrors === 'string' && <ErrorMessage error={rawErrors} label={getUiLabel(props)} />;
const error = typeof rawErrors === 'string' && (
<ErrorMessage error={rawErrors} label={getUiLabel(props)} helpURL={helpURL} />
);

if (!schema || name.startsWith('$')) {
return null;
Expand Down
1 change: 1 addition & 0 deletions Composer/packages/extensions/extension/src/types/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface FieldProps<T = any> {
disabled?: boolean;
enumOptions?: string[];
error?: string | JSX.Element;
helpURL?: string;
hideError?: boolean;
id: string;
label?: string | false;
Expand Down
1 change: 0 additions & 1 deletion Composer/packages/lib/code-editor/src/BaseEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ const BaseEditor: React.FC<BaseEditorProps> = props => {
messageBarType={hasError ? MessageBarType.error : hasWarning ? MessageBarType.warning : MessageBarType.info}
isMultiline={true}
dismissButtonAriaLabel={formatMessage('Close')}
overflowButtonAriaLabel={formatMessage('See more')}
>
{messageHelp}
{syntaxLink}
Expand Down