Skip to content

Commit bbbbe41

Browse files
committed
Wip on pivot to prod services
1 parent e0f42c2 commit bbbbe41

File tree

5 files changed

+2969
-2884
lines changed

5 files changed

+2969
-2884
lines changed

packages/mgt-chat/src/components/ManageChatMembers/ListChatMembers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface ListChatMembersProps {
2121
closeParentPopover: () => void;
2222
}
2323

24-
const RemovePerson = bundleIcon(Dismiss24Regular, () => null);
24+
const RemovePerson = bundleIcon(Dismiss24Regular, Dismiss24Regular);
2525

2626
const ListChatMembers = ({ members, currentUserId, removeChatMember, closeParentPopover }: ListChatMembersProps) => {
2727
const [removeDialogOpen, setRemoveDialogOpen] = useState(false);
@@ -52,7 +52,7 @@ const ListChatMembers = ({ members, currentUserId, removeChatMember, closeParent
5252
<DialogSurface>
5353
<DialogBody>
5454
<DialogTitle>Remove {removeUser?.displayName || ''} from the conversation?</DialogTitle>
55-
<DialogContent>They'll still have access to the chat history.</DialogContent>
55+
<DialogContent>They&apos;ll still have access to the chat history.</DialogContent>
5656
<DialogActions>
5757
<Button appearance="secondary" onClick={closeDialog}>
5858
Close

packages/mgt-chat/src/statefulClient/GraphConfig.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,26 @@ import { GraphEndpoint } from '@microsoft/mgt-element';
33
export class GraphConfig {
44
public static useCanary = false;
55

6-
public static version = 'testprodbetaembedforteamswebsockets';
6+
public static version = 'v1.0';
77

8-
public static subscriptionConnectionVersion = 'testprodv1.0e2ewebsockets';
8+
// public static subscriptionConnectionVersion = 'testprodv1.0e2ewebsockets';
99

1010
public static get graphEndpoint(): GraphEndpoint {
11-
return GraphConfig.useCanary ? 'https://canary.graph.microsoft.com' : 'https://graph.microsoft.com';
12-
}
13-
14-
private static get baseCanaryUrl() {
15-
return `https://canary.graph.microsoft.com/${GraphConfig.version}`;
11+
// return GraphConfig.useCanary ? 'https://canary.graph.microsoft.com' :
12+
return 'https://graph.microsoft.com';
1613
}
1714

1815
public static get subscriptionEndpoint(): string {
19-
return GraphConfig.useCanary ? `${GraphConfig.baseCanaryUrl}/subscriptions` : '/subscriptions';
16+
return '/subscriptions';
2017
}
2118

22-
public static adjustNotificationUrl(url: string): string {
23-
let temp = url;
24-
if (GraphConfig.useCanary && url) {
25-
temp = url.replace('https://graph.microsoft.com/1.0', GraphConfig.baseCanaryUrl);
26-
temp = temp.replace('https://graph.microsoft.com/beta', GraphConfig.baseCanaryUrl);
27-
}
28-
temp = temp.replace(GraphConfig.version, GraphConfig.subscriptionConnectionVersion);
29-
return temp.replace('wss:', '');
30-
}
19+
// public static adjustNotificationUrl(url: string): string {
20+
// let temp = url;
21+
// if (GraphConfig.useCanary && url) {
22+
// temp = url.replace('https://graph.microsoft.com/1.0', GraphConfig.baseCanaryUrl);
23+
// temp = temp.replace('https://graph.microsoft.com/beta', GraphConfig.baseCanaryUrl);
24+
// }
25+
// temp = temp.replace(GraphConfig.version, GraphConfig.subscriptionConnectionVersion);
26+
// return temp.replace('wss:', '');
27+
// }
3128
}

packages/mgt-chat/src/statefulClient/GraphNotificationClient.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* -------------------------------------------------------------------------------------------
66
*/
77

8-
import { IGraph, Providers, error, log } from '@microsoft/mgt-element';
8+
import { BetaGraph, IGraph, Providers, error, log } from '@microsoft/mgt-element';
99
import * as signalR from '@microsoft/signalr';
1010
import { ThreadEventEmitter } from './ThreadEventEmitter';
1111
import type { Subscription, ChatMessage, Chat, AadUserConversationMember } from '@microsoft/microsoft-graph-types';
@@ -43,16 +43,15 @@ export class GraphNotificationClient {
4343
private get graph() {
4444
return this._graph;
4545
}
46+
private get beta() {
47+
return BetaGraph.fromGraph(this._graph);
48+
}
4649

4750
/**
4851
*
4952
*/
5053
constructor(private readonly emitter: ThreadEventEmitter, private readonly _graph: IGraph) {}
5154

52-
private get _publicKey() {
53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YUxDTDVFMWtYNGl3WTdPSSs2K3k3NVR4ZjROZ0x1DQpLTGcyUWZrTGRLOXorS1JsQm1tWTI4Y0dOZHV5bmtzVFM3QnpyRHQzMjRSMEV0M0V5QzRzQzRlb2JyTGFTbi9ODQpKcU83S3VIaHdheE8wUmFnN0dPNTdZTWFpNy8yV0kxQ09vTlhFOTJUTEg5NXFuMFBJWWVtSlhEVmdsOE8ybzJBDQplcmU2R1JBQXc3UWFjSERpUjdFd1o5UnVwQldNTkFxbHpiNGRFNk13bzZtWkMwcDQrQng0MHZnb2hKbWtiNXhiDQozclJsME0wM0F6RmQwVWpqNGtLOGkzdy9ic0E4cDdMWUlIS3BjQkVjS3MzbGwvV2Y3UTlhVE1LS3NvTDNTdlpYDQpIT0xrS3pYbGc4K1l4blJKZ3ZoS2I4WmFQV3R1V25ZeG5oaUlYVk4yeVBqdjlzcU56NWVmWDJOTDByczhCV0Z4DQp2T0tUcCt5dnp2aVhDeVVpSW9LMFVacHpNTWlaY05LUEdOTHgxWkM4UDJVSTNENWwwL1IvWHo5UGtSTjVveFFzDQppZz09DQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t';
54-
}
55-
5655
private readonly getToken = async () => {
5756
const token = await Providers.globalProvider.getAccessToken();
5857
if (!token) throw new Error('Could not retrieve token for user');
@@ -156,12 +155,12 @@ export class GraphNotificationClient {
156155

157156
log('subscribing to changes for ' + resourcePath);
158157
// send subscription POST to Graph
159-
const subscription: Subscription = (await this.graph
158+
const subscription: Subscription = (await this.beta
160159
.api(GraphConfig.subscriptionEndpoint)
161160
.post(subscriptionDefinition)) as Subscription;
162161
if (!subscription?.notificationUrl) throw new Error('Subscription not created');
163162
log(subscription);
164-
subscription.notificationUrl = GraphConfig.adjustNotificationUrl(subscription.notificationUrl);
163+
// subscription.notificationUrl = GraphConfig.adjustNotificationUrl(subscription.notificationUrl);
165164

166165
const awaits: Promise<void>[] = [];
167166
// Cache the subscription in storage for re-hydration on page refreshes
@@ -298,7 +297,7 @@ export class GraphNotificationClient {
298297
if (someExpired) {
299298
await this.removeSubscriptions(cacheData.subscriptions);
300299
} else if (webSocketUrl) {
301-
await this.createSignalRConnection(GraphConfig.adjustNotificationUrl(webSocketUrl));
300+
await this.createSignalRConnection(webSocketUrl);
302301
await this.renewChatSubscriptions();
303302
return;
304303
}

samples/react-chat/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ brokerSettings.defaultSubscriptionLifetimeInMinutes = 7;
1111
brokerSettings.renewalThreshold = 65;
1212
brokerSettings.timerInterval = 15;
1313

14-
GraphConfig.useCanary = true;
14+
// GraphConfig.useCanary = true;
1515

1616
Providers.globalProvider = new Msal2Provider({
1717
baseURL: GraphConfig.graphEndpoint,

0 commit comments

Comments
 (0)