Skip to content
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
4 changes: 2 additions & 2 deletions packages/fxa-settings/src/lib/channels/firefox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ export type WebChannelServices =
| {
sync: SyncEngines;
}
// For sync optional flows (currently Relay and AiWindow)
// For sync optional flows (currently Relay and SmartWindow)
| {
relay: {};
}
| {
aiwindow: {};
smartwindow: {};
};

// ref: [FxAccounts.sys.mjs](https://searchfox.org/mozilla-central/rev/82828dba9e290914eddd294a0871533875b3a0b5/services/fxaccounts/FxAccounts.sys.mjs#910)
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-settings/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const Constants = {
// flows that use the Firefox `client_id`. These may be placeholders/defaults
// we move some of these into the CMS in FXA-12378, based on entrypoint.
RELIER_FF_CLIENT_RELAY_SERVICE_NAME: 'Firefox Relay',
RELIER_FF_CLIENT_AI_MODE_SERVICE_NAME: 'Firefox AI Window',
RELIER_FF_CLIENT_SMART_WINDOW_SERVICE_NAME: 'Firefox Smart Window',

RELIER_KEYS_LENGTH: 32,
RELIER_KEYS_CONTEXT_INFO_PREFIX: 'identity.mozilla.com/picl/v1/oauth/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('useFxAStatus', () => {
});
});

it('returns supportsKeysOptionalLogin: true when Relay or AiWindow service', async () => {
it('returns supportsKeysOptionalLogin: true when Relay or SmartWindow service', async () => {
const integration = {
type: IntegrationType.OAuthNative,
isSync: () => false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class GenericIntegration<
return false;
}

isFirefoxClientServiceAiWindow() {
isFirefoxClientServiceSmartWindow() {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ describe('OAuthNativeIntegration', function () {
expect(model.getServiceName()).toBe('Firefox Relay');
});

it('returns AI Window service name for aiwindow service', () => {
it('returns Smart Window service name for smartwindow service', () => {
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
model.data.service = OAuthNativeServices.AiWindow;
expect(model.getServiceName()).toBe('Firefox AI Window');
model.data.service = OAuthNativeServices.SmartWindow;
expect(model.getServiceName()).toBe('Firefox Smart Window');
});
});

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

it('returns false when service is aiwindow', () => {
it('returns false when service is smartwindow', () => {
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
model.data.service = OAuthNativeServices.AiWindow;
model.data.service = OAuthNativeServices.SmartWindow;
expect(model.isFirefoxClientServiceRelay()).toBe(false);
});
});

describe('isFirefoxClientServiceAiWindow', () => {
it('returns true when service is aiwindow', () => {
describe('isFirefoxClientServiceSmartWindow', () => {
it('returns true when service is smartwindow', () => {
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
model.data.service = OAuthNativeServices.AiWindow;
expect(model.isFirefoxClientServiceAiWindow()).toBe(true);
model.data.service = OAuthNativeServices.SmartWindow;
expect(model.isFirefoxClientServiceSmartWindow()).toBe(true);
});

it('returns false when service is sync', () => {
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
model.data.service = OAuthNativeServices.Sync;
expect(model.isFirefoxClientServiceAiWindow()).toBe(false);
expect(model.isFirefoxClientServiceSmartWindow()).toBe(false);
});

it('returns false when service is relay', () => {
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
model.data.service = OAuthNativeServices.Relay;
expect(model.isFirefoxClientServiceAiWindow()).toBe(false);
expect(model.isFirefoxClientServiceSmartWindow()).toBe(false);
});
});

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

it('returns true when service is aiwindow', () => {
it('returns true when service is smartwindow', () => {
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
model.data.service = OAuthNativeServices.AiWindow;
model.data.service = OAuthNativeServices.SmartWindow;
expect(model.isFirefoxNonSync()).toBe(true);
});
});
Expand All @@ -232,10 +232,10 @@ describe('OAuthNativeIntegration', function () {
expect(model.getWebChannelServices()).toEqual({ relay: {} });
});

it('returns aiwindow services when service is aiwindow', () => {
it('returns smartwindow services when service is smartwindow', () => {
model.clientInfo = mockClientInfo(OAuthNativeClients.FirefoxDesktop);
model.data.service = OAuthNativeServices.AiWindow;
expect(model.getWebChannelServices()).toEqual({ aiwindow: {} });
model.data.service = OAuthNativeServices.SmartWindow;
expect(model.getWebChannelServices()).toEqual({ smartwindow: {} });
});

it('returns sync services when service is sync', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export enum OAuthNativeClients {
export enum OAuthNativeServices {
Sync = 'sync',
Relay = 'relay',
AiWindow = 'aiwindow',
SmartWindow = 'smartwindow',
}

/**
Expand Down Expand Up @@ -101,17 +101,17 @@ export class OAuthNativeIntegration extends OAuthWebIntegration {
);
}

isFirefoxClientServiceAiWindow() {
isFirefoxClientServiceSmartWindow() {
return (
this.isFirefoxClient() &&
this.data.service === OAuthNativeServices.AiWindow
this.data.service === OAuthNativeServices.SmartWindow
);
}

isFirefoxNonSync() {
return (
this.isFirefoxClientServiceRelay() ||
this.isFirefoxClientServiceAiWindow()
this.isFirefoxClientServiceSmartWindow()
);
}

Expand Down Expand Up @@ -141,8 +141,8 @@ export class OAuthNativeIntegration extends OAuthWebIntegration {
if (this.isFirefoxClientServiceRelay()) {
return { relay: {} };
}
if (this.isFirefoxClientServiceAiWindow()) {
return { aiwindow: {} };
if (this.isFirefoxClientServiceSmartWindow()) {
return { smartwindow: {} };
}
if (this.isDefaultSyncService()) {
return { sync: syncEngines || {} };
Expand All @@ -157,8 +157,8 @@ export class OAuthNativeIntegration extends OAuthWebIntegration {
if (this.isFirefoxClientServiceRelay()) {
return Constants.RELIER_FF_CLIENT_RELAY_SERVICE_NAME;
}
if (this.isFirefoxClientServiceAiWindow()) {
return Constants.RELIER_FF_CLIENT_AI_MODE_SERVICE_NAME;
if (this.isFirefoxClientServiceSmartWindow()) {
return Constants.RELIER_FF_CLIENT_SMART_WINDOW_SERVICE_NAME;
}
// TODO: handle Thunderbird case better? FXA-10848
return 'Firefox';
Expand Down
4 changes: 2 additions & 2 deletions packages/fxa-settings/src/models/integrations/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe('isFirefoxService', () => {
expect(result).toBe(true);
});

it('should return true for OAuthNativeServices.AiWindow', () => {
const result = isFirefoxService(OAuthNativeServices.AiWindow);
it('should return true for OAuthNativeServices.SmartWindow', () => {
const result = isFirefoxService(OAuthNativeServices.SmartWindow);
expect(result).toBe(true);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-settings/src/models/integrations/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function isFirefoxService(service?: string) {
return (
service === OAuthNativeServices.Sync ||
service === OAuthNativeServices.Relay ||
service === OAuthNativeServices.AiWindow
service === OAuthNativeServices.SmartWindow
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-settings/src/pages/Index/container.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ describe('IndexContainer', () => {
getClientId: () => 'abc123',
isSync: () => true,
isFirefoxClientServiceRelay: () => false,
isFirefoxClientServiceAiWindow: () => false,
isFirefoxClientServiceSmartWindow: () => false,
wantsKeys: () => true,
getCmsInfo: () => undefined,
data: { clientId: 'abc123' },
Expand Down
4 changes: 2 additions & 2 deletions packages/fxa-settings/src/pages/Index/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export const WithThirdPartyAuthServiceRelayIntegration = storyWithProps({
supportsKeysOptionalLogin: true,
});

export const WithThirdPartyAuthServiceAIWindowIntegration = storyWithProps({
export const WithThirdPartyAuthServiceSmartWindowIntegration = storyWithProps({
integration: createMockIndexOAuthNativeIntegration({
isFirefoxClientServiceAiWindow: true,
isFirefoxClientServiceSmartWindow: true,
isSync: false,
}),
supportsKeysOptionalLogin: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/fxa-settings/src/pages/Index/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ describe('Index page', () => {
thirdPartyAuthWithSeparatorRendered();
});

it('renders third party auth with service=aiwindow when supportsKeysOptionalLogin is true', () => {
it('renders third party auth with service=smartwindow when supportsKeysOptionalLogin is true', () => {
renderWithLocalizationProvider(
<Subject
integration={createMockIndexOAuthNativeIntegration({
isSync: false,
isFirefoxClientServiceAiWindow: true,
isFirefoxClientServiceSmartWindow: true,
})}
supportsKeysOptionalLogin={true}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-settings/src/pages/Index/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type IndexIntegration = Pick<
| 'isSync'
| 'getClientId'
| 'isFirefoxClientServiceRelay'
| 'isFirefoxClientServiceAiWindow'
| 'isFirefoxClientServiceSmartWindow'
| 'isFirefoxNonSync'
| 'data'
| 'getCmsInfo'
Expand Down
10 changes: 5 additions & 5 deletions packages/fxa-settings/src/pages/Index/mocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ export function createMockIndexOAuthIntegration({
export function createMockIndexOAuthNativeIntegration({
isSync = true,
isFirefoxClientServiceRelay = false,
isFirefoxClientServiceAiWindow = false,
isFirefoxClientServiceSmartWindow = false,
cmsInfo,
}: {
isSync?: boolean;
isFirefoxClientServiceRelay?: boolean;
isFirefoxClientServiceAiWindow?: boolean;
isFirefoxClientServiceSmartWindow?: boolean;
cmsInfo?: RelierCmsInfo;
} = {}): IndexIntegration {
return {
type: IntegrationType.OAuthNative,
isSync: () => isSync,
getClientId: () => MOCK_CLIENT_ID,
isFirefoxClientServiceRelay: () => isFirefoxClientServiceRelay,
isFirefoxClientServiceAiWindow: () => isFirefoxClientServiceAiWindow,
isFirefoxClientServiceSmartWindow: () => isFirefoxClientServiceSmartWindow,
isFirefoxNonSync: () =>
isFirefoxClientServiceRelay || isFirefoxClientServiceAiWindow,
isFirefoxClientServiceRelay || isFirefoxClientServiceSmartWindow,
getCmsInfo: () => cmsInfo,
getLegalTerms: () => undefined,
data: new OAuthIntegrationData(
Expand All @@ -85,7 +85,7 @@ export function createMockIndexWebIntegration(): IndexIntegration {
isSync: () => false,
getClientId: () => undefined,
isFirefoxClientServiceRelay: () => false,
isFirefoxClientServiceAiWindow: () => false,
isFirefoxClientServiceSmartWindow: () => false,
isFirefoxNonSync: () => false,
getCmsInfo: () => undefined,
getLegalTerms: () => undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function mockSyncDesktopV3Integration() {
data: { service: 'sync' },
isDesktopSync: () => true,
isFirefoxClientServiceRelay: () => false,
isFirefoxClientServiceAiWindow: () => false,
isFirefoxClientServiceSmartWindow: () => false,
isFirefoxNonSync: () => false,
isFirefoxMobileClient: () => false,
getCmsInfo: () => undefined,
Expand All @@ -172,7 +172,7 @@ function mockOAuthNativeIntegration(
data: { service: 'sync' },
isDesktopSync: () => true,
isFirefoxClientServiceRelay: () => false,
isFirefoxClientServiceAiWindow: () => false,
isFirefoxClientServiceSmartWindow: () => false,
isFirefoxNonSync: () => false,
isFirefoxMobileClient: () => isFirefoxMobileClient,
getCmsInfo: () => undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const mockWebIntegration = {
isSync: () => false,
wantsKeys: () => false,
isFirefoxClientServiceRelay: () => false,
isFirefoxClientServiceAiWindow: () => false,
isFirefoxClientServiceSmartWindow: () => false,
getCmsInfo: () => undefined,
data: {
validate: () => {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const mockWebSigninIntegration = {
isSync: () => false,
wantsKeys: () => false,
isFirefoxClientServiceRelay: () => false,
isFirefoxClientServiceAiWindow: () => false,
isFirefoxClientServiceSmartWindow: () => false,
isFirefoxNonSync: () => false,
getWebChannelServices: mockGetWebChannelServices(),
getCmsInfo: () => undefined,
Expand All @@ -48,7 +48,7 @@ export const mockOAuthNativeSigninIntegration = (
isSync: () => isSync,
wantsKeys: () => false,
isFirefoxClientServiceRelay: () => isRelay,
isFirefoxClientServiceAiWindow: () => false,
isFirefoxClientServiceSmartWindow: () => false,
isFirefoxNonSync: () => isRelay,
getWebChannelServices: mockGetWebChannelServices({ isSync, isRelay }),
data: new IntegrationData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function createMockSigninWebSyncIntegration() {
data: new WebIntegrationData(new GenericData({})),
isDesktopSync: () => true,
isFirefoxClientServiceRelay: () => false,
isFirefoxClientServiceAiWindow: () => false,
isFirefoxClientServiceSmartWindow: () => false,
isFirefoxNonSync: () => false,
getWebChannelServices: mockGetWebChannelServices({ isSync: true }),
wantsLogin: () => false,
Expand Down
12 changes: 6 additions & 6 deletions packages/fxa-settings/src/pages/Signin/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,27 @@ export const SignInRelayWithPasswordlessSupport = storyWithProps({
supportsKeysOptionalLogin: true,
});

export const CachedSignInAiWindowWithPasswordlessSupport = storyWithProps({
export const CachedSignInRelayWithPasswordlessSupport = storyWithProps({
sessionToken: MOCK_SESSION_TOKEN,
integration: createMockSigninOAuthNativeIntegration({
service: OAuthNativeServices.AiWindow,
service: OAuthNativeServices.Relay,
isSync: false,
}),
supportsKeysOptionalLogin: true,
});

export const CachedSignInRelayWithPasswordlessSupport = storyWithProps({
export const CachedSignInSmartWindowWithPasswordlessSupport = storyWithProps({
sessionToken: MOCK_SESSION_TOKEN,
integration: createMockSigninOAuthNativeIntegration({
service: OAuthNativeServices.Relay,
service: OAuthNativeServices.SmartWindow,
isSync: false,
}),
supportsKeysOptionalLogin: true,
});

export const SignInAiWindowWithPasswordlessSupport = storyWithProps({
export const SignInSmartWindowWithPasswordlessSupport = storyWithProps({
integration: createMockSigninOAuthNativeIntegration({
service: OAuthNativeServices.AiWindow,
service: OAuthNativeServices.SmartWindow,
isSync: false,
}),
supportsKeysOptionalLogin: true,
Expand Down
8 changes: 4 additions & 4 deletions packages/fxa-settings/src/pages/Signin/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ describe('Signin component', () => {
});
});

it('renders third party auth when service=aiwindow and supportsKeysOptionalLogin is true', () => {
it('renders third party auth when service=smartwindow and supportsKeysOptionalLogin is true', () => {
const integration = createMockSigninOAuthNativeIntegration({
service: OAuthNativeServices.AiWindow,
service: OAuthNativeServices.SmartWindow,
isSync: false,
});
render({
Expand Down Expand Up @@ -1048,9 +1048,9 @@ describe('Signin component', () => {
});
});

it('shows cached signin for service=aiwindow when supportsKeysOptionalLogin is true', () => {
it('shows cached signin for service=smartwindow when supportsKeysOptionalLogin is true', () => {
const integration = createMockSigninOAuthNativeIntegration({
service: OAuthNativeServices.AiWindow,
service: OAuthNativeServices.SmartWindow,
isSync: false,
});
render({
Expand Down
Loading
Loading