Skip to content

Commit bfc8ee8

Browse files
committed
feat: add learn more for for-each
1 parent 08dd0c6 commit bfc8ee8

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

packages/backend/src/apps/toolbox/actions/for-each/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const action: IRawAction = {
2020
key: 'forEach',
2121
description: 'Repeat actions for each item',
2222
groupsLaterSteps: true,
23+
announcementContentKey: 'learn-for-each',
2324
arguments: [
2425
{
2526
label: 'Choose items',

packages/frontend/src/components/EditorLayout/AnnouncementModal/assets/ForEach.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import dedent from 'dedent'
2+
3+
import ForEachAnimation from '../assets/ForEach.json'
4+
5+
export const FOR_EACH_ITEM_LIST = [
6+
{
7+
title: 'How to use for each item',
8+
details: dedent`
9+
This action lets you repeat the same steps for multiple items. These items can be rows from your Tiles/M365 tables, or FormSG checkbox options.
10+
`,
11+
multimedia: {
12+
animationData: ForEachAnimation,
13+
},
14+
},
15+
{
16+
title: 'For each item',
17+
details: dedent`
18+
Example use cases:
19+
* Send individual emails to a list of unconfirmed event attendees, reminding them to RSVP for an upcoming event.
20+
21+
22+
* Retrieve a list of your team members and find each person's assigned tasks for the week, then send a personalized email to each person with their tasks.
23+
24+
25+
* Go through each checkbox option in a FormSG submission and send emails to different recipients based on the selected options.
26+
`,
27+
},
28+
]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
import { FOR_EACH_ITEM_LIST } from './ForEachItemList'
12
import { ANNOUNCEMENT_ITEM_LIST } from './UiRevampItemList'
23

34
export const ANNOUNCEMENT_CONTENT_MAP = {
45
'ui-revamp-2025': {
56
announcementContent: ANNOUNCEMENT_ITEM_LIST,
67
buttonText: 'Experience it now',
78
},
9+
'learn-for-each': {
10+
announcementContent: FOR_EACH_ITEM_LIST,
11+
buttonText: 'Try it now',
12+
},
813
}

packages/frontend/src/components/EditorRightDrawer/Step.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { useStepMetadata } from '@/hooks/useStepMetadata'
1414

1515
import FlowStepConfigurationModal from '../FlowStepConfigurationModal'
1616

17+
import LearnMoreInfobox from './LearnMoreInfobox'
18+
1719
type StepProps = {
1820
step: IStep
1921
isLastStep: boolean
@@ -74,6 +76,9 @@ export default function Step(props: StepProps): React.ReactElement | null {
7476
>
7577
<Fragment>
7678
{/* Place ChooseConnectionSubstep outside the accordion structure */}
79+
<LearnMoreInfobox
80+
selectedActionOrTrigger={selectedActionOrTrigger}
81+
/>
7782
{hasConnection && app && (
7883
<ChooseConnectionSubstep
7984
step={step}

0 commit comments

Comments
 (0)