Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8fd0102
add new types and exports
dmceachernmsft Nov 23, 2022
5f1e236
planning comments
dmceachernmsft Nov 23, 2022
4f7eced
add new component to storybook
dmceachernmsft Nov 23, 2022
f97ea92
storybook updates for new component
dmceachernmsft Nov 23, 2022
1034054
build API files
dmceachernmsft Nov 23, 2022
bbda291
update logic to show new component in composite
dmceachernmsft Nov 23, 2022
4c0c466
Change files
dmceachernmsft Nov 23, 2022
76e1be9
Duplicate change files for beta release
dmceachernmsft Nov 23, 2022
60f2046
Update @azure-communication-react-0c042af8-f59d-4af5-a8ed-26ff9ea334f…
dmceachernmsft Nov 23, 2022
89b3a03
Update @azure-communication-react-0c042af8-f59d-4af5-a8ed-26ff9ea334f…
dmceachernmsft Nov 23, 2022
98e5fce
Merge branch 'main' into dmceachernmsft/unsupported-browser-version
dmceachernmsft Nov 23, 2022
917dfd6
fix lint
dmceachernmsft Nov 23, 2022
ea31277
fix cc issues
dmceachernmsft Nov 23, 2022
dc0a89c
Merge branch 'main' into dmceachernmsft/unsupported-browser-version
dmceachernmsft Nov 23, 2022
30631fa
refactor to use Child component
dmceachernmsft Nov 24, 2022
c68fc57
Merge branch 'dmceachernmsft/unsupported-browser-version' of https://…
dmceachernmsft Nov 24, 2022
5855626
Merge branch 'main' into dmceachernmsft/unsupported-browser-version
dmceachernmsft Nov 24, 2022
2b1ba58
Merge branch 'main' into dmceachernmsft/unsupported-browser-version
dmceachernmsft Nov 24, 2022
70447d6
update for comments
dmceachernmsft Nov 24, 2022
05c615a
fix cc issues
dmceachernmsft Nov 24, 2022
789939b
Merge branch 'main' into dmceachernmsft/unsupported-browser-version
dmceachernmsft Nov 28, 2022
99af1f0
fix cc issues
dmceachernmsft Nov 28, 2022
35a738d
Merge branch 'main' into dmceachernmsft/unsupported-browser-version
dmceachernmsft Nov 28, 2022
b37a79e
Merge branch 'main' into dmceachernmsft/unsupported-browser-version
dmceachernmsft Nov 28, 2022
e9b7297
updates per comments
dmceachernmsft Nov 29, 2022
b5fdf8d
Merge branch 'main' into dmceachernmsft/unsupported-browser-version
dmceachernmsft Nov 29, 2022
3ebabd4
Merge branch 'main' into dmceachernmsft/unsupported-browser-version
dmceachernmsft Nov 30, 2022
e07e79e
flip storybook default behavior
dmceachernmsft Nov 30, 2022
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
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Introduce UI to inform the user that their browser version is out of date.",
"packageName": "@azure/communication-react",
"email": "94866715+dmceachernmsft@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Introduce UI to inform the user that their browser version is out of date.",
"packageName": "@azure/communication-react",
"email": "94866715+dmceachernmsft@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,7 @@ export interface ComponentStrings {
sendBox: SendBoxStrings;
typingIndicator: TypingIndicatorStrings;
UnsupportedBrowser: UnsupportedBrowserStrings;
UnsupportedBrowserVersion: UnsupportedBrowserVersionStrings;
videoGallery: VideoGalleryStrings;
videoTile: VideoTileStrings;
}
Expand Down Expand Up @@ -1809,7 +1810,7 @@ export const DEFAULT_COMPONENT_ICONS: {
DomainPermissionMic: JSX.Element;
DomainPermissionCameraDenied: JSX.Element;
DomainPermissionMicDenied: JSX.Element;
UnsupportedBrowserWarning: JSX.Element;
UnsupportedEnvironmentWarning: JSX.Element;
BrowserPermissionDeniedError: JSX.Element;
VideoTilePinned: JSX.Element;
};
Expand Down Expand Up @@ -1901,7 +1902,7 @@ export const DEFAULT_COMPOSITE_ICONS: {
DomainPermissionMic: JSX.Element;
DomainPermissionCameraDenied: JSX.Element;
DomainPermissionMicDenied: JSX.Element;
UnsupportedBrowserWarning: JSX.Element;
UnsupportedEnvironmentWarning: JSX.Element;
BrowserPermissionDeniedError: JSX.Element;
VideoTilePinned: JSX.Element;
};
Expand Down Expand Up @@ -3076,7 +3077,23 @@ export interface UnsupportedBrowserProps {

// @beta
export interface UnsupportedBrowserStrings {
moreHelpLink: string;
moreHelpText: string;
primaryText: string;
secondaryText: string;
}

// @beta
export const UnsupportedBrowserVersion: (props: UnsupportedBrowserVersionProps) => JSX.Element;

// @beta
export interface UnsupportedBrowserVersionProps {
onTroubleshootingClick?: () => void;
strings: UnsupportedBrowserVersionStrings;
}

// @beta
export interface UnsupportedBrowserVersionStrings {
moreHelpText: string;
primaryText: string;
secondaryText: string;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/communication-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ export * from './mergedHooks';
export { UnsupportedBrowser } from '../../react-components/src';
/* @conditional-compile-remove(unsupported-browser) */
export type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';
/* @conditional-compile-remove(unsupported-browser) */
export { UnsupportedBrowserVersion } from '../../react-components/src';
/* @conditional-compile-remove(unsupported-browser) */
export type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';
/* @conditional-compile-remove(call-readiness) */
export { _DevicePermissionDropdown } from '../../react-components/src';
/* @conditional-compile-remove(call-readiness) */
Expand Down
21 changes: 19 additions & 2 deletions packages/react-components/review/beta/react-components.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ export interface ComponentStrings {
sendBox: SendBoxStrings;
typingIndicator: TypingIndicatorStrings;
UnsupportedBrowser: UnsupportedBrowserStrings;
UnsupportedBrowserVersion: UnsupportedBrowserVersionStrings;
videoGallery: VideoGalleryStrings;
videoTile: VideoTileStrings;
}
Expand Down Expand Up @@ -521,7 +522,7 @@ export const DEFAULT_COMPONENT_ICONS: {
DomainPermissionMic: JSX.Element;
DomainPermissionCameraDenied: JSX.Element;
DomainPermissionMicDenied: JSX.Element;
UnsupportedBrowserWarning: JSX.Element;
UnsupportedEnvironmentWarning: JSX.Element;
BrowserPermissionDeniedError: JSX.Element;
VideoTilePinned: JSX.Element;
};
Expand Down Expand Up @@ -1568,7 +1569,23 @@ export interface UnsupportedBrowserProps {

// @beta
export interface UnsupportedBrowserStrings {
moreHelpLink: string;
moreHelpText: string;
primaryText: string;
secondaryText: string;
}

// @beta
export const UnsupportedBrowserVersion: (props: UnsupportedBrowserVersionProps) => JSX.Element;

// @beta
export interface UnsupportedBrowserVersionProps {
onTroubleshootingClick?: () => void;
strings: UnsupportedBrowserVersionStrings;
}

// @beta
export interface UnsupportedBrowserVersionStrings {
moreHelpText: string;
primaryText: string;
secondaryText: string;
}
Expand Down
32 changes: 32 additions & 0 deletions packages/react-components/review/stable/react-components.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,38 @@ export interface TypingIndicatorStylesProps extends BaseCustomStyles {
typingUserDisplayName?: IStyle;
}

// @beta
export const UnsupportedBrowser: (props: UnsupportedBrowserProps) => JSX.Element;

// @beta
export interface UnsupportedBrowserProps {
onTroubleshootingClick?: () => void;
strings: UnsupportedBrowserStrings;
}

// @beta
export interface UnsupportedBrowserStrings {
moreHelpText: string;
primaryText: string;
secondaryText: string;
}

// @beta
export const UnsupportedBrowserVersion: (props: UnsupportedBrowserVersionProps) => JSX.Element;

// @beta
export interface UnsupportedBrowserVersionProps {
onTroubleshootingClick?: () => void;
strings: UnsupportedBrowserVersionStrings;
}

// @beta
export interface UnsupportedBrowserVersionStrings {
moreHelpText: string;
primaryText: string;
secondaryText: string;
}

// @public
export type UpdateMessageCallback = (messageId: string, content: string) => Promise<void>;

Expand Down
54 changes: 8 additions & 46 deletions packages/react-components/src/components/UnsupportedBrowser.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

/* @conditional-compile-remove(unsupported-browser) */
import { Icon, Link, Stack, Text } from '@fluentui/react';
/* @conditional-compile-remove(unsupported-browser) */
import { _pxToRem } from '@internal/acs-ui-common';
import React from 'react';
/* @conditional-compile-remove(unsupported-browser) */
import { useLocale } from '../localization';
/* @conditional-compile-remove(unsupported-browser) */
import {
containerStyles,
iconStyles,
linkTextStyles,
mainTextStyles,
secondaryTextStyles
} from './styles/UnsupportedBrowser.styles';
import { UnsupportedEnvironment } from './UnsupportedEnvironment';

/**
* Strings for UnsupportedBrowser component
Expand All @@ -27,54 +15,28 @@ export interface UnsupportedBrowserStrings {
primaryText: string;
/** String for the secondary text */
secondaryText: string;
/** String for the help link */
moreHelpLink: string;
/** String to display in the text for the help link */
moreHelpText: string;
}

/**
* props for UnsupportedBrowser UI
* props for {@link UnsupportedBrowser} UI
*
* @beta
*/
export interface UnsupportedBrowserProps {
/** Handler to perform a action when the help link is actioned */
/** Handler to perform an action when the help link is actioned */
onTroubleshootingClick?: () => void;
/** String overrides for the component */
strings: UnsupportedBrowserStrings;
}

/* @conditional-compile-remove(unsupported-browser) */
const UnsupportedBrowserContainer = (props: UnsupportedBrowserProps): JSX.Element => {
const { onTroubleshootingClick, strings } = props;
return (
<Stack styles={containerStyles}>
<Icon styles={iconStyles} iconName="UnsupportedBrowserWarning" data-ui-id="unsupportedBrowserIcon"></Icon>
<Text styles={mainTextStyles}>{strings.primaryText}</Text>
<Text styles={secondaryTextStyles}>{strings.secondaryText}</Text>
{onTroubleshootingClick && (
<Link
styles={linkTextStyles}
onClick={() => {
onTroubleshootingClick();
}}
data-ui-id="unsupportedBrowserLink"
>
{strings.moreHelpLink}
</Link>
)}
</Stack>
);
};

/**
* UI to display to the user that the browser they are using is not supported by calling application.
* UI to display to the user that the browser they are using is not supported by Azure Communications Calling service.
*
* @beta
*/
export const UnsupportedBrowser = (props: UnsupportedBrowserProps): JSX.Element => {
/* @conditional-compile-remove(unsupported-browser) */
const strings = useLocale().strings.UnsupportedBrowser;
/* @conditional-compile-remove(unsupported-browser) */
return <UnsupportedBrowserContainer {...props} strings={strings} />;
return <></>;
const { onTroubleshootingClick, strings } = props;
return <UnsupportedEnvironment onTroubleshootingClick={onTroubleshootingClick} strings={strings} />;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { _pxToRem } from '@internal/acs-ui-common';
import React from 'react';
import { UnsupportedEnvironment } from './UnsupportedEnvironment';

/**
* Strings for UnsupportedBrowser component
*
* @beta
*/
export interface UnsupportedBrowserVersionStrings {
/** String for the primary text */
primaryText: string;
/** String for the secondary text */
secondaryText: string;
/** String to display in the text for the help link */
moreHelpText: string;
}

/**
* props for {@link UnsupportedBrowserVersion} UI
*
* @beta
*/
export interface UnsupportedBrowserVersionProps {
/** Handler to perform an action when the help link is actioned */
onTroubleshootingClick?: () => void;
/** String overrides for the component */
strings: UnsupportedBrowserVersionStrings;
}

/**
* UI to display to the user that the browser version they are using is out of date
* and not supported by Azure Communications Calling service.
*
Comment thread
dmceachernmsft marked this conversation as resolved.
* @beta
*/
export const UnsupportedBrowserVersion = (props: UnsupportedBrowserVersionProps): JSX.Element => {
const { onTroubleshootingClick, strings } = props;
return <UnsupportedEnvironment onTroubleshootingClick={onTroubleshootingClick} strings={strings} />;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

/* @conditional-compile-remove(unsupported-browser) */
import { Icon, Link, Stack, Text } from '@fluentui/react';
/* @conditional-compile-remove(unsupported-browser) */
import { _pxToRem } from '@internal/acs-ui-common';
import React from 'react';
/* @conditional-compile-remove(unsupported-browser) */
import {
containerStyles,
iconStyles,
linkTextStyles,
mainTextStyles,
secondaryTextStyles
} from './styles/UnsupportedEnvironment.styles';

/**
* @private
*/
export interface UnsupportedEnvironmentStrings {
/** String for the primary text */
primaryText: string;
/** String for the secondary text */
secondaryText: string;
/** String to display in the text for the help link */
moreHelpText: string;
}

/**
* props for {@link UnsupportedEnvironment} UI
*
* @private
*/
export interface UnsupportedEnvironmentProps {
/** Handler to perform a action when the help link is actioned */
onTroubleshootingClick?: () => void;
/** String overrides for the component */
strings: UnsupportedEnvironmentStrings;
}

/* @conditional-compile-remove(unsupported-browser) */
const UnsupportedEnvironmentContainer = (props: UnsupportedEnvironmentProps): JSX.Element => {
const { onTroubleshootingClick, strings } = props;
return (
<Stack styles={containerStyles}>
<Icon
styles={iconStyles}
iconName="UnsupportedEnvironmentWarning"
data-ui-id="unsupported-environment-icon"
></Icon>
<Text styles={mainTextStyles}>{strings.primaryText}</Text>
<Text styles={secondaryTextStyles}>{strings.secondaryText}</Text>
{onTroubleshootingClick && (
<Link
styles={linkTextStyles}
onClick={() => {
onTroubleshootingClick();
}}
data-ui-id="unsupported-environment-link"
>
{strings.moreHelpText}
</Link>
)}
</Stack>
);
};

/**
* UI to display to the user that the browser they are using is not supported by calling application.
*
* @private
*/
export const UnsupportedEnvironment = (props: UnsupportedEnvironmentProps): JSX.Element => {
/* @conditional-compile-remove(unsupported-browser) */
return <UnsupportedEnvironmentContainer {...props} />;
return <></>;
};
5 changes: 3 additions & 2 deletions packages/react-components/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,11 @@ export { _RemoteVideoTile } from './RemoteVideoTile';
export { _HighContrastAwareIcon } from './HighContrastAwareIcon';
export type { _HighContrastAwareIconProps } from './HighContrastAwareIcon';

/* @conditional-compile-remove(unsupported-browser) */
export { UnsupportedBrowser } from './UnsupportedBrowser';
/* @conditional-compile-remove(unsupported-browser) */
export type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from './UnsupportedBrowser';
export { UnsupportedBrowserVersion } from './UnsupportedBrowserVersion';
export type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from './UnsupportedBrowserVersion';

export { _TroubleshootingGuideErrorBar } from './TroubleshootingGuideErrorBar';
export type {
_TroubleshootingGuideErrorBarStrings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export const secondaryTextStyles: ITextStyles = {
root: {
margin: 'auto',
fontWeight: 400,
paddingBottom: '0.5rem'
paddingBottom: '0.5rem',
textAlign: 'center'
}
};

Expand Down
Loading