Skip to content

Commit 7d96a28

Browse files
authored
Release v1.45.2 (#1084)
## Features - Update 2 existing templates: Attendance taking and update mailing lists ## Fixes - UI bugs with add step modal - UI changes for templates
2 parents a0c374c + 763921c commit 7d96a28

File tree

19 files changed

+562
-173
lines changed

19 files changed

+562
-173
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,5 @@
106106
"tsconfig-paths": "^4.2.0",
107107
"type-fest": "4.10.3"
108108
},
109-
"version": "1.45.1"
109+
"version": "1.45.2"
110110
}

packages/backend/src/db/storage/attendance-taking.ts renamed to packages/backend/src/db/storage/archived_templates/attendance-taking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
TILE_COL_DATA_PLACEHOLDER,
77
TILE_ID_PLACEHOLDER,
88
TILES_SAMPLE_URL_DESCRIPTION,
9-
} from './constants'
9+
} from '../constants'
1010

1111
const ATTENDANCE_TAKING_ID = '04f95a37-46fe-455b-aa96-28c421379e1a'
1212

packages/backend/src/db/storage/update-mailing-lists.ts renamed to packages/backend/src/db/storage/archived_templates/update-mailing-lists.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
TILE_COL_DATA_PLACEHOLDER,
77
TILE_ID_PLACEHOLDER,
88
TILES_SAMPLE_URL_DESCRIPTION,
9-
} from './constants'
9+
} from '../constants'
1010

1111
const UPDATE_MAILING_LISTS_ID = '8ec2728a-6e4a-49c7-8721-ef6d4eb1d946'
1212

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
import type { ITemplate } from '@plumber/types'
2+
3+
import {
4+
CREATE_TEMPLATE_STEP_VARIABLE,
5+
FORMSG_SAMPLE_URL_DESCRIPTION,
6+
TILE_COL_DATA_PLACEHOLDER,
7+
TILE_ID_PLACEHOLDER,
8+
TILES_SAMPLE_URL_DESCRIPTION,
9+
} from './constants'
10+
11+
const ATTENDANCE_TAKING_ID = '2ba52802-0de0-4dc7-9d2c-b68a21db3492'
12+
13+
export const ATTENDANCE_TAKING_TEMPLATE: ITemplate = {
14+
id: ATTENDANCE_TAKING_ID,
15+
name: 'Attendance taking',
16+
description:
17+
'Track attendance for your event using a form and a pre-populated table of event participants',
18+
iconName: 'BiCheckDouble',
19+
tags: ['empty'],
20+
// Steps: formsg --> find tile row --> if-then condition --> create or update tile row
21+
steps: [
22+
{
23+
position: 1,
24+
appKey: 'formsg',
25+
eventKey: 'newSubmission',
26+
sampleUrl: 'https://form.gov.sg/66c2c58c0ebf8abcb0ad4c76',
27+
sampleUrlDescription: FORMSG_SAMPLE_URL_DESCRIPTION,
28+
},
29+
{
30+
position: 2,
31+
appKey: 'tiles',
32+
eventKey: 'findSingleRow',
33+
sampleUrl:
34+
'https://plumber.gov.sg/tiles/c77bc8fc-e1ca-4300-a50d-7f2933b9e5b4/a4ca3902-f0ef-41e1-9f5d-45c602c04d50',
35+
sampleUrlDescription: TILES_SAMPLE_URL_DESCRIPTION,
36+
parameters: {
37+
filters: [
38+
{
39+
columnId: TILE_COL_DATA_PLACEHOLDER('Email'),
40+
value: CREATE_TEMPLATE_STEP_VARIABLE('Replace with email response'),
41+
operator: 'equals',
42+
},
43+
],
44+
returnLastRow: true,
45+
tableId: TILE_ID_PLACEHOLDER,
46+
},
47+
},
48+
{
49+
position: 3,
50+
appKey: 'toolbox',
51+
eventKey: 'ifThen',
52+
parameters: {
53+
depth: 0,
54+
branchName: 'New event attendance',
55+
conditions: [
56+
{
57+
is: 'is',
58+
text: '0',
59+
field: CREATE_TEMPLATE_STEP_VARIABLE('rowsFound', 2),
60+
condition: 'equals',
61+
},
62+
],
63+
},
64+
},
65+
{
66+
position: 4,
67+
appKey: 'tiles',
68+
eventKey: 'createTileRow',
69+
parameters: {
70+
rowData: [
71+
{
72+
columnId: TILE_COL_DATA_PLACEHOLDER('Email'),
73+
cellValue: CREATE_TEMPLATE_STEP_VARIABLE(
74+
'Replace with email response',
75+
),
76+
},
77+
{
78+
columnId: TILE_COL_DATA_PLACEHOLDER('Name'),
79+
cellValue: CREATE_TEMPLATE_STEP_VARIABLE(
80+
'Replace with name response',
81+
),
82+
},
83+
{
84+
columnId: TILE_COL_DATA_PLACEHOLDER('Attended?'),
85+
cellValue: 'Yes',
86+
},
87+
{
88+
columnId: TILE_COL_DATA_PLACEHOLDER('Remarks'),
89+
cellValue: 'Walk-in, not from pre-populated list',
90+
},
91+
],
92+
tableId: TILE_ID_PLACEHOLDER,
93+
},
94+
},
95+
{
96+
position: 5,
97+
appKey: 'toolbox',
98+
eventKey: 'ifThen',
99+
parameters: {
100+
depth: 0,
101+
branchName: 'Update existing attendance',
102+
conditions: [
103+
{
104+
is: 'not',
105+
text: '0',
106+
field: CREATE_TEMPLATE_STEP_VARIABLE('rowsFound', 2),
107+
condition: 'equals',
108+
},
109+
],
110+
},
111+
},
112+
{
113+
position: 6,
114+
appKey: 'tiles',
115+
eventKey: 'updateSingleRow',
116+
parameters: {
117+
rowId: CREATE_TEMPLATE_STEP_VARIABLE('rowId', 2),
118+
rowData: [
119+
{
120+
columnId: TILE_COL_DATA_PLACEHOLDER('Attended?'),
121+
cellValue: 'Yes',
122+
},
123+
],
124+
tableId: TILE_ID_PLACEHOLDER,
125+
},
126+
},
127+
],
128+
tileTemplateData: {
129+
name: 'Event attendance',
130+
columns: ['Email', 'Name', 'Attended?', 'Remarks'],
131+
rowData: [
132+
{
133+
134+
Name: 'Jane Doe',
135+
},
136+
{
137+
138+
Name: 'John Doe',
139+
'Attended?': 'Yes',
140+
},
141+
{
142+
143+
Name: 'Jack Doe',
144+
'Attended?': 'Yes',
145+
Remarks: 'Walk-in, not from pre-populated list',
146+
},
147+
],
148+
},
149+
}

packages/backend/src/db/storage/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import type { ITemplate } from '@plumber/types'
22

3-
import { ATTENDANCE_TAKING_TEMPLATE } from './attendance-taking'
3+
import { ATTENDANCE_TAKING_TEMPLATE } from './attendance-taking-v2'
44
import { GET_LIVE_UPDATES_THROUGH_TELEGRAM_TEMPLATE } from './get-live-updates-through-telegram'
55
import { ROUTE_SUPPORT_ENQUIRIES_TEMPLATE } from './route-support-enquiries'
66
import { SCHEDULE_REMINDERS_TEMPLATE } from './schedule-reminders'
77
import { SEND_A_COPY_OF_FORM_RESPONSE_TEMPLATE } from './send-a-copy-of-form-response'
88
import { SEND_FOLLOW_UPS_TEMPLATE } from './send-follow-ups'
99
import { SEND_MESSAGE_TO_A_SLACK_CHANNEL_TEMPLATE } from './send-message-to-a-slack-channel'
1010
import { TRACK_FEEDBACK_TEMPLATE } from './track-feedback'
11-
import { UPDATE_MAILING_LISTS_TEMPLATE } from './update-mailing-lists'
11+
import { UPDATE_MAILING_LISTS_TEMPLATE } from './update-mailing-lists-v2'
1212

1313
// Helper function to ensure templates cannot be modified
1414
function deepFreeze<T>(object: T): T {
@@ -26,6 +26,12 @@ function deepFreeze<T>(object: T): T {
2626
return Object.freeze(object)
2727
}
2828

29+
/**
30+
* When major changes are made to a template, move the current one to the archived folder
31+
* and create a new one with the updated version number and assign a new UUID.
32+
*
33+
* Update the grafana dashboard with the newer version too.
34+
*/
2935
export const TEMPLATES: ITemplate[] = deepFreeze<ITemplate[]>([
3036
SEND_FOLLOW_UPS_TEMPLATE, // contains demo video
3137
SEND_A_COPY_OF_FORM_RESPONSE_TEMPLATE,

packages/backend/src/db/storage/route-support-enquiries.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ export const ROUTE_SUPPORT_ENQUIRIES_TEMPLATE: ITemplate = {
8484
parameters: {
8585
body: `<p style="margin: 0">You have received a support request from ${CREATE_TEMPLATE_STEP_VARIABLE(
8686
'Replace this with data from step 1',
87-
)}!</p><p style="margin: 0"></p><p style="margin: 0">Here is what their request is about:</p><p style="margin: 0">${CREATE_TEMPLATE_STEP_VARIABLE(
87+
)}! </p><p style="margin: 0"></p><p style="margin: 0">Here is what their request is about: </p><p style="margin: 0">${CREATE_TEMPLATE_STEP_VARIABLE(
8888
'Replace this with data from step 1',
8989
)}</p><p style="margin: 0"></p><p style="margin: 0">Please respond to them within 3 working days. Thank you!</p>`,
9090
subject: `You have received a IT support request from ${CREATE_TEMPLATE_STEP_VARIABLE(
9191
'Replace this with data from step 1',
9292
)}!`,
93-
senderName: 'IT support ',
93+
senderName: 'IT support request',
9494
destinationEmail: USER_EMAIL_PLACEHOLDER,
9595
},
9696
},
@@ -115,6 +115,20 @@ export const ROUTE_SUPPORT_ENQUIRIES_TEMPLATE: ITemplate = {
115115
},
116116
{
117117
position: 7,
118+
appKey: 'postman',
119+
eventKey: 'sendTransactionalEmail',
120+
parameters: {
121+
body: `<p style="margin: 0">You have received a support request from ${CREATE_TEMPLATE_STEP_VARIABLE(
122+
'Replace this with data from step 1',
123+
)}! </p><p style="margin: 0"></p><p style="margin: 0">Here is what their request is about: </p><p style="margin: 0">${CREATE_TEMPLATE_STEP_VARIABLE(
124+
'Replace this with data from step 1',
125+
)}</p><p style="margin: 0"></p><p style="margin: 0">Please respond to them within 3 working days. Thank you!</p>`,
126+
subject: `You have received a IT support request from ${CREATE_TEMPLATE_STEP_VARIABLE(
127+
'Replace this with data from step 1',
128+
)}!`,
129+
senderName: 'IT support request',
130+
destinationEmail: USER_EMAIL_PLACEHOLDER,
131+
},
118132
},
119133
{
120134
position: 8,
@@ -137,6 +151,20 @@ export const ROUTE_SUPPORT_ENQUIRIES_TEMPLATE: ITemplate = {
137151
},
138152
{
139153
position: 9,
154+
appKey: 'postman',
155+
eventKey: 'sendTransactionalEmail',
156+
parameters: {
157+
body: `<p style="margin: 0">You have received a support request from ${CREATE_TEMPLATE_STEP_VARIABLE(
158+
'Replace this with data from step 1',
159+
)}! </p><p style="margin: 0"></p><p style="margin: 0">Here is what their request is about: </p><p style="margin: 0">${CREATE_TEMPLATE_STEP_VARIABLE(
160+
'Replace this with data from step 1',
161+
)}</p><p style="margin: 0"></p><p style="margin: 0">Please respond to them within 3 working days. Thank you!</p>`,
162+
subject: `You have received a IT support request from ${CREATE_TEMPLATE_STEP_VARIABLE(
163+
'Replace this with data from step 1',
164+
)}!`,
165+
senderName: 'IT support request',
166+
destinationEmail: USER_EMAIL_PLACEHOLDER,
167+
},
140168
},
141169
],
142170
}

0 commit comments

Comments
 (0)