Skip to content

Commit 64cfb59

Browse files
authored
Merge pull request #19909 from mozilla/FXA-12886
chore(naming): Rename all aimode and aiwindow refs to smartwindow
2 parents fec799a + d8025f4 commit 64cfb59

29 files changed

Lines changed: 92 additions & 92 deletions

packages/fxa-settings/src/lib/channels/firefox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ export type WebChannelServices =
107107
| {
108108
sync: SyncEngines;
109109
}
110-
// For sync optional flows (currently Relay and AiWindow)
110+
// For sync optional flows (currently Relay and SmartWindow)
111111
| {
112112
relay: {};
113113
}
114114
| {
115-
aiwindow: {};
115+
smartwindow: {};
116116
};
117117

118118
// ref: [FxAccounts.sys.mjs](https://searchfox.org/mozilla-central/rev/82828dba9e290914eddd294a0871533875b3a0b5/services/fxaccounts/FxAccounts.sys.mjs#910)

packages/fxa-settings/src/lib/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const Constants = {
8080
// flows that use the Firefox `client_id`. These may be placeholders/defaults
8181
// we move some of these into the CMS in FXA-12378, based on entrypoint.
8282
RELIER_FF_CLIENT_RELAY_SERVICE_NAME: 'Firefox Relay',
83-
RELIER_FF_CLIENT_AI_MODE_SERVICE_NAME: 'Firefox AI Window',
83+
RELIER_FF_CLIENT_SMART_WINDOW_SERVICE_NAME: 'Firefox Smart Window',
8484

8585
RELIER_KEYS_LENGTH: 32,
8686
RELIER_KEYS_CONTEXT_INFO_PREFIX: 'identity.mozilla.com/picl/v1/oauth/',

packages/fxa-settings/src/lib/hooks/useFxAStatus/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe('useFxAStatus', () => {
120120
});
121121
});
122122

123-
it('returns supportsKeysOptionalLogin: true when Relay or AiWindow service', async () => {
123+
it('returns supportsKeysOptionalLogin: true when Relay or SmartWindow service', async () => {
124124
const integration = {
125125
type: IntegrationType.OAuthNative,
126126
isSync: () => false,

packages/fxa-settings/src/models/integrations/integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class GenericIntegration<
8686
return false;
8787
}
8888

89-
isFirefoxClientServiceAiWindow() {
89+
isFirefoxClientServiceSmartWindow() {
9090
return false;
9191
}
9292

packages/fxa-settings/src/models/integrations/oauth-native-integration.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ describe('OAuthNativeIntegration', function () {
153153
expect(model.getServiceName()).toBe('Firefox Relay');
154154
});
155155

156-
it('returns AI Window service name for aiwindow service', () => {
156+
it('returns Smart Window service name for smartwindow service', () => {
157157
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
158-
model.data.service = OAuthNativeServices.AiWindow;
159-
expect(model.getServiceName()).toBe('Firefox AI Window');
158+
model.data.service = OAuthNativeServices.SmartWindow;
159+
expect(model.getServiceName()).toBe('Firefox Smart Window');
160160
});
161161
});
162162

@@ -173,30 +173,30 @@ describe('OAuthNativeIntegration', function () {
173173
expect(model.isFirefoxClientServiceRelay()).toBe(false);
174174
});
175175

176-
it('returns false when service is aiwindow', () => {
176+
it('returns false when service is smartwindow', () => {
177177
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
178-
model.data.service = OAuthNativeServices.AiWindow;
178+
model.data.service = OAuthNativeServices.SmartWindow;
179179
expect(model.isFirefoxClientServiceRelay()).toBe(false);
180180
});
181181
});
182182

183-
describe('isFirefoxClientServiceAiWindow', () => {
184-
it('returns true when service is aiwindow', () => {
183+
describe('isFirefoxClientServiceSmartWindow', () => {
184+
it('returns true when service is smartwindow', () => {
185185
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
186-
model.data.service = OAuthNativeServices.AiWindow;
187-
expect(model.isFirefoxClientServiceAiWindow()).toBe(true);
186+
model.data.service = OAuthNativeServices.SmartWindow;
187+
expect(model.isFirefoxClientServiceSmartWindow()).toBe(true);
188188
});
189189

190190
it('returns false when service is sync', () => {
191191
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
192192
model.data.service = OAuthNativeServices.Sync;
193-
expect(model.isFirefoxClientServiceAiWindow()).toBe(false);
193+
expect(model.isFirefoxClientServiceSmartWindow()).toBe(false);
194194
});
195195

196196
it('returns false when service is relay', () => {
197197
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
198198
model.data.service = OAuthNativeServices.Relay;
199-
expect(model.isFirefoxClientServiceAiWindow()).toBe(false);
199+
expect(model.isFirefoxClientServiceSmartWindow()).toBe(false);
200200
});
201201
});
202202

@@ -218,9 +218,9 @@ describe('OAuthNativeIntegration', function () {
218218
expect(model.isFirefoxNonSync()).toBe(true);
219219
});
220220

221-
it('returns true when service is aiwindow', () => {
221+
it('returns true when service is smartwindow', () => {
222222
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
223-
model.data.service = OAuthNativeServices.AiWindow;
223+
model.data.service = OAuthNativeServices.SmartWindow;
224224
expect(model.isFirefoxNonSync()).toBe(true);
225225
});
226226
});
@@ -232,10 +232,10 @@ describe('OAuthNativeIntegration', function () {
232232
expect(model.getWebChannelServices()).toEqual({ relay: {} });
233233
});
234234

235-
it('returns aiwindow services when service is aiwindow', () => {
235+
it('returns smartwindow services when service is smartwindow', () => {
236236
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
237-
model.data.service = OAuthNativeServices.AiWindow;
238-
expect(model.getWebChannelServices()).toEqual({ aiwindow: {} });
237+
model.data.service = OAuthNativeServices.SmartWindow;
238+
expect(model.getWebChannelServices()).toEqual({ smartwindow: {} });
239239
});
240240

241241
it('returns sync services when service is sync', () => {

packages/fxa-settings/src/models/integrations/oauth-native-integration.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export enum OAuthNativeClients {
4848
export enum OAuthNativeServices {
4949
Sync = 'sync',
5050
Relay = 'relay',
51-
AiWindow = 'aiwindow',
51+
SmartWindow = 'smartwindow',
5252
}
5353

5454
/**
@@ -101,17 +101,17 @@ export class OAuthNativeIntegration extends OAuthWebIntegration {
101101
);
102102
}
103103

104-
isFirefoxClientServiceAiWindow() {
104+
isFirefoxClientServiceSmartWindow() {
105105
return (
106106
this.isFirefoxClient() &&
107-
this.data.service === OAuthNativeServices.AiWindow
107+
this.data.service === OAuthNativeServices.SmartWindow
108108
);
109109
}
110110

111111
isFirefoxNonSync() {
112112
return (
113113
this.isFirefoxClientServiceRelay() ||
114-
this.isFirefoxClientServiceAiWindow()
114+
this.isFirefoxClientServiceSmartWindow()
115115
);
116116
}
117117

@@ -141,8 +141,8 @@ export class OAuthNativeIntegration extends OAuthWebIntegration {
141141
if (this.isFirefoxClientServiceRelay()) {
142142
return { relay: {} };
143143
}
144-
if (this.isFirefoxClientServiceAiWindow()) {
145-
return { aiwindow: {} };
144+
if (this.isFirefoxClientServiceSmartWindow()) {
145+
return { smartwindow: {} };
146146
}
147147
if (this.isDefaultSyncService()) {
148148
return { sync: syncEngines || {} };
@@ -157,8 +157,8 @@ export class OAuthNativeIntegration extends OAuthWebIntegration {
157157
if (this.isFirefoxClientServiceRelay()) {
158158
return Constants.RELIER_FF_CLIENT_RELAY_SERVICE_NAME;
159159
}
160-
if (this.isFirefoxClientServiceAiWindow()) {
161-
return Constants.RELIER_FF_CLIENT_AI_MODE_SERVICE_NAME;
160+
if (this.isFirefoxClientServiceSmartWindow()) {
161+
return Constants.RELIER_FF_CLIENT_SMART_WINDOW_SERVICE_NAME;
162162
}
163163
// TODO: handle Thunderbird case better? FXA-10848
164164
return 'Firefox';

packages/fxa-settings/src/models/integrations/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ describe('isFirefoxService', () => {
1616
expect(result).toBe(true);
1717
});
1818

19-
it('should return true for OAuthNativeServices.AiWindow', () => {
20-
const result = isFirefoxService(OAuthNativeServices.AiWindow);
19+
it('should return true for OAuthNativeServices.SmartWindow', () => {
20+
const result = isFirefoxService(OAuthNativeServices.SmartWindow);
2121
expect(result).toBe(true);
2222
});
2323

packages/fxa-settings/src/models/integrations/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function isFirefoxService(service?: string) {
88
return (
99
service === OAuthNativeServices.Sync ||
1010
service === OAuthNativeServices.Relay ||
11-
service === OAuthNativeServices.AiWindow
11+
service === OAuthNativeServices.SmartWindow
1212
);
1313
}
1414

packages/fxa-settings/src/pages/Index/container.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ describe('IndexContainer', () => {
142142
getClientId: () => 'abc123',
143143
isSync: () => true,
144144
isFirefoxClientServiceRelay: () => false,
145-
isFirefoxClientServiceAiWindow: () => false,
145+
isFirefoxClientServiceSmartWindow: () => false,
146146
wantsKeys: () => true,
147147
getCmsInfo: () => undefined,
148148
data: { clientId: 'abc123' },

packages/fxa-settings/src/pages/Index/index.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ export const WithThirdPartyAuthServiceRelayIntegration = storyWithProps({
5050
supportsKeysOptionalLogin: true,
5151
});
5252

53-
export const WithThirdPartyAuthServiceAIWindowIntegration = storyWithProps({
53+
export const WithThirdPartyAuthServiceSmartWindowIntegration = storyWithProps({
5454
integration: createMockIndexOAuthNativeIntegration({
55-
isFirefoxClientServiceAiWindow: true,
55+
isFirefoxClientServiceSmartWindow: true,
5656
isSync: false,
5757
}),
5858
supportsKeysOptionalLogin: true,

0 commit comments

Comments
 (0)