Skip to content

Commit 0077390

Browse files
committed
fix(journey): use Device from journey-client instead of FRDevice
1 parent 3a20b42 commit 0077390

5 files changed

Lines changed: 7 additions & 14 deletions

File tree

core/journey/callbacks/_utilities/callback.utilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import type {
1515
} from '@forgerock/journey-client/types';
1616

1717
import { interpolate } from '$core/_utilities/i18n.utilities';
18-
import type { PolicyParams } from '@forgerock/javascript-sdk/src/auth/interfaces';
1918

2019
/** *********************************************
2120
* INTERFACES AND TYPES
@@ -27,7 +26,8 @@ export interface Policy {
2726
params: Record<string, unknown>;
2827
}
2928
export interface FailedPolicy {
30-
params: Partial<PolicyParams> | undefined;
29+
// TODO: PolicyParams must be re-exported by journey-client from forgerock/sdk-types, until then we derive the type like below
30+
params: PolicyRequirement['params'];
3131
policyRequirement: string;
3232
restructured: RestructuredParam[];
3333
}

core/journey/callbacks/device-profile/device-profile.stories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { expect } from 'storybook/test';
1111
import { callbackType } from '@forgerock/journey-client';
12-
import { FRDevice } from '@forgerock/javascript-sdk';
12+
import { Device } from '@forgerock/journey-client/device';
1313
import { createJourneyStep } from '$journey/_utilities/step.mock';
1414
import { deviceProfileMockNoMessage, deviceProfileMockMessage } from './device-profile.mock';
1515
import DeviceProfile from './device-profile.story.svelte';
@@ -49,7 +49,7 @@ export const Interaction = {
4949
},
5050
play: async ({ canvasElement }) => {
5151
const canvas = within(canvasElement);
52-
const device = new FRDevice({});
52+
const device = new Device({});
5353
const cb = stepWithMessage.getCallbackOfType(callbackType.DeviceProfileCallback);
5454

5555
const msg = canvas.getByText('This is a message');

core/journey/callbacks/device-profile/device-profile.story.svelte

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
-->
99

1010
<script lang="ts">
11-
import { Config } from '@forgerock/javascript-sdk';
1211
import type { DeviceProfileCallback } from '@forgerock/journey-client/types';
1312
1413
import Centered from '$components/primitives/box/centered.svelte';
@@ -21,9 +20,6 @@
2120
export let callbackMetadata: Maybe<CallbackMetadata>;
2221
export let selfSubmitFunction: () => void;
2322
24-
// Now required due to logger utility
25-
Config.set({ serverConfig: { baseUrl: 'https://example.com/am/' } });
26-
2723
let mergedCallbackMetadata = {
2824
derived: {
2925
canForceUserInputOptionality: false,

core/journey/callbacks/device-profile/device-profile.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
-->
99

1010
<script lang="ts">
11-
import { FRDevice } from '@forgerock/javascript-sdk';
11+
import { Device } from '@forgerock/journey-client/device';
1212
import type { DeviceProfileCallback } from '@forgerock/journey-client/types';
13+
1314
import Spinner from '$components/primitives/spinner/spinner.svelte';
1415
import Text from '$components/primitives/text/text.svelte';
1516
import type {
@@ -23,7 +24,7 @@
2324
export let callbackMetadata: Maybe<CallbackMetadata> = null;
2425
export let stepMetadata: Maybe<StepMetadata> = null;
2526
export let selfSubmitFunction: SelfSubmitFunction;
26-
const device = new FRDevice({});
27+
const device = new Device({});
2728
let deviceMessage = (callback as DeviceProfileCallback).getMessage();
2829
async function initializeProfile() {
2930
const location = callback?.isLocationRequired() ?? false;

core/journey/stages/stages.story.svelte

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
-->
99

1010
<script lang="ts">
11-
import { Config } from '@forgerock/javascript-sdk';
1211
import type { JourneyStep } from '@forgerock/journey-client/types';
1312
import type { z } from 'zod';
1413
@@ -34,9 +33,6 @@
3433
export let step: JourneyStep;
3534
export let style: z.infer<typeof partialStyleSchema>;
3635
37-
// Now required due to logger utility
38-
Config.set({ serverConfig: { baseUrl: 'https://example.com/am/' } });
39-
4036
let stageName;
4137
let stageJson;
4238

0 commit comments

Comments
 (0)