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
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export const ABSChannels: React.FC<RuntimeSettingsProps> = (props) => {
channelName: channelId,
location: 'global',
properties: {
acceptedTerms: opts?.acceptedTerms,
isEnabled: true,
},
},
Expand Down Expand Up @@ -286,7 +287,47 @@ export const ABSChannels: React.FC<RuntimeSettingsProps> = (props) => {
}
await httpClient.put(url, data, { headers: { Authorization: `Bearer ${token}` } });
if (channelId === CHANNELS.TEAMS) {
setShowTeamsCallOut(true);
const createResults = await httpClient.get(url, { headers: { Authorization: `Bearer ${token}` } });
if (!createResults.data?.properties?.properties?.acceptedTerms === true) {
if (
await OpenConfirmModal(formatMessage('Microsoft Teams terms and conditions'), null, {
disabled: true,
confirmText: formatMessage('Agree'),
checkboxProps: {
kind: 'doubleConfirm',
checkboxLabel: (
<div>
{formatMessage.rich(
'I agree to the <a>Microsoft Channel Publication Terms</a> and the <a2>Microsoft Privacy Statement</a2> for my deployment to the Microsoft Teams channel.',
{
a: ({ children }) => (
<a href="https://aka.ms/bots/terms/channels" rel="noreferrer" target="_blank">
{children}
</a>
),
a2: ({ children }) => (
<a
href="https://privacy.microsoft.com/en-us/privacystatement"
rel="noreferrer"
target="_blank"
>
{children}
</a>
),
}
)}
</div>
),
},
})
) {
return await createChannelService(channelId, { ...opts, acceptedTerms: true });
} else {
return await deleteChannelService(channelId);
}
} else {
setShowTeamsCallOut(true);
}
}
// success!!
setChannelStatus({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const confirmationContainer = css`
/**
* When we want the user to check the box to confirm their action, in addition to confirming the dialog.
*/
type DoubleConfirmCheckboxProps = { kind: 'doubleConfirm'; checkboxLabel?: string };
type DoubleConfirmCheckboxProps = { kind: 'doubleConfirm'; checkboxLabel?: React.ReactElement };
/**
* When we want to ask user for extra checks in addition to the original action confirmation.
*/
Expand Down Expand Up @@ -118,7 +118,9 @@ const ConfirmDialog: React.FC<ConfirmDialogProps> = (props) => {
}

function defaultContentRender() {
return <div css={builtInStyles[style]}> {subTitle} </div>;
if (subTitle) {
return <div css={builtInStyles[style]}> {subTitle} </div>;
}
}

const renderCheckbox = React.useCallback(() => {
Expand All @@ -131,7 +133,7 @@ const ConfirmDialog: React.FC<ConfirmDialogProps> = (props) => {
{checkboxProps.kind === 'doubleConfirm' ? (
<Checkbox
checked={!disabled}
label={(checkboxProps as DoubleConfirmCheckboxProps).checkboxLabel}
label={(checkboxProps as DoubleConfirmCheckboxProps).checkboxLabel as any}
onChange={handleCheckbox}
/>
) : (
Expand Down