Skip to content

Commit 916335e

Browse files
committed
chore(journey-client): refactored client and built test app
1 parent 6b110df commit 916335e

139 files changed

Lines changed: 1505 additions & 1096 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

e2e/davinci-app/components/flow-link.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

e2e/davinci-app/components/label.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

e2e/davinci-app/components/multi-value.ts

Lines changed: 0 additions & 76 deletions
This file was deleted.

e2e/davinci-app/components/object-value.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

e2e/davinci-app/components/protect.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

e2e/davinci-app/components/single-value.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

e2e/davinci-app/components/social-login-button.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
3+
*
4+
* This software may be modified and distributed under the terms
5+
* of the MIT license. See the LICENSE file for details.
6+
*/
7+
import type { PasswordCallback } from '@forgerock/journey-client/types';
8+
9+
export default function passwordComponent(
10+
formEl: HTMLFormElement,
11+
callback: PasswordCallback,
12+
idx: number,
13+
) {
14+
const collectorKey = callback?.payload?.input?.[0].name || `collector-${idx}`;
15+
const label = document.createElement('label');
16+
const input = document.createElement('input');
17+
18+
label.htmlFor = collectorKey;
19+
label.innerText = callback.getPrompt();
20+
input.type = 'password';
21+
input.id = collectorKey;
22+
input.name = collectorKey;
23+
24+
formEl?.appendChild(label);
25+
formEl?.appendChild(input);
26+
27+
formEl?.querySelector(`#${collectorKey}`)?.addEventListener('input', (event) => {
28+
callback.setPassword((event.target as HTMLInputElement).value);
29+
});
30+
}

e2e/journey-app/components/text.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
3+
*
4+
* This software may be modified and distributed under the terms
5+
* of the MIT license. See the LICENSE file for details.
6+
*/
7+
import type { NameCallback } from '@forgerock/journey-client/types';
8+
9+
export default function textComponent(
10+
formEl: HTMLFormElement,
11+
callback: NameCallback,
12+
idx: number,
13+
) {
14+
const collectorKey = callback?.payload?.input?.[0].name || `collector-${idx}`;
15+
const label = document.createElement('label');
16+
const input = document.createElement('input');
17+
18+
label.htmlFor = collectorKey;
19+
label.innerText = callback.getPrompt();
20+
input.type = 'text';
21+
input.id = collectorKey;
22+
input.name = collectorKey;
23+
24+
formEl?.appendChild(label);
25+
formEl?.appendChild(input);
26+
27+
formEl?.querySelector(`#${collectorKey}`)?.addEventListener('input', (event) => {
28+
callback.setName((event.target as HTMLInputElement).value);
29+
});
30+
}

0 commit comments

Comments
 (0)