Skip to content

Commit 2526311

Browse files
committed
add new rsf-http-register config options
1 parent c6bff45 commit 2526311

File tree

7 files changed

+94
-7
lines changed

7 files changed

+94
-7
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"react-scripts": "^3.2.0"
1010
},
1111
"dependencies": {
12+
"@types/react": "^16.9.23",
1213
"@types/socket.io-client": "^1.4.32",
1314
"dotenv": "^8.2.0",
1415
"electron-log": "^3.0.8",
@@ -23,7 +24,7 @@
2324
"rsf-mattermostable": "1.0.15",
2425
"rsf-smsable": "1.0.21",
2526
"rsf-telegramable": "1.0.82",
26-
"rsf-types": "0.0.35",
27+
"rsf-types": "0.0.36",
2728
"socket.io-client": "^2.3.0",
2829
"typescript": "^3.7.2"
2930
},

src/components/PublicLinkForm/index.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ import './PublicLinkForm.css'
33

44
import FormLimitPicker from '../forms/FormLimitPicker'
55
import FormTimePicker from '../forms/FormTimePicker'
6+
import RegisterTypesConfig from '../RegisterTypesConfig'
67

78
export default function PublicLinkForm({ publicLink, updatePublicLink }) {
9+
const TITLE_KEY = 'title'
810
const DESCRIPTION_KEY = 'description'
911
const MAX_TIME_KEY = 'maxTime'
1012
const MAX_PARTICIPANTS_KEY = 'maxParticipants'
13+
const TYPES_KEY = 'types'
1114

15+
const title = publicLink[TITLE_KEY]
1216
const description = publicLink[DESCRIPTION_KEY]
1317
const maxTime = publicLink[MAX_TIME_KEY]
1418
const maxParticipants = publicLink[MAX_PARTICIPANTS_KEY]
19+
const types = publicLink[TYPES_KEY]
1520

1621
const participantLimitInput = {
1722
shortLabel: 'Number of participants',
@@ -26,16 +31,29 @@ export default function PublicLinkForm({ publicLink, updatePublicLink }) {
2631
<div className='public-link-form'>
2732
<div className='link-delivery'>You’ll get the link after you submit</div>
2833
<div className='input-wrapper'>
29-
<div className='input-label'>Description in the link</div>
34+
<div className='input-label'>Title</div>
3035
<div className='input-help-label'>
31-
Write down a short description of what this rapid sensemaking process
36+
Provide a welcoming title that will be presented in big text at the top of the page
37+
</div>
38+
<textarea
39+
value={title}
40+
onChange={evt => updatePublicLink(TITLE_KEY, evt.target.value)}
41+
/>
42+
</div>
43+
<div className='input-wrapper'>
44+
<div className='input-label'>Description</div>
45+
<div className='input-help-label'>
46+
Write down a short description of what this flow
3247
is about and what it will involve (optional)
3348
</div>
3449
<textarea
3550
value={description}
3651
onChange={evt => updatePublicLink(DESCRIPTION_KEY, evt.target.value)}
3752
/>
3853
</div>
54+
<div className='input-wrapper'>
55+
<RegisterTypesConfig types={types} onChange={val => updatePublicLink(TYPES_KEY, val)} />
56+
</div>
3957
<div className='input-row'>
4058
<div className='input-wrapper'>
4159
<FormLimitPicker
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.register-types {
2+
margin-top: 10px;
3+
}
4+
5+
.register-type {
6+
color: #4a4a4a;
7+
font-size: 18px;
8+
}
9+
10+
.register-type input {
11+
cursor: pointer;
12+
}
13+
14+
.register-type label {
15+
margin-left: 6px;
16+
cursor: pointer;
17+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react'
2+
import './RegisterTypesConfig.css'
3+
4+
export default function RegisterTypesConfig({ types, onChange }) {
5+
return <>
6+
<div className='input-label'>Apps</div>
7+
<div className='input-help-label'>
8+
Select which apps participants will be allowed to register with
9+
</div>
10+
<div className="register-types">
11+
{Object.keys(types).map(type => {
12+
return <div className="register-type" key={type}>
13+
<input type="checkbox" id={type} checked={types[type]} onChange={() => onChange({...types, [type]: !types[type]})}></input>
14+
<label htmlFor={type}>{type}</label>
15+
</div>
16+
})}
17+
</div>
18+
</>
19+
}

src/components/TemplatePreview/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,16 @@ export default function TemplatePreview({
4646
{/* Step 2 */}
4747
{method === FROM_PUBLIC_LINK && (
4848
<>
49+
<TemplatePreviewElement label={'Public Link Title'}>
50+
{publicLink.title}
51+
</TemplatePreviewElement>
4952
<TemplatePreviewElement label={'Public Link Description'}>
5053
{publicLink.description}
5154
</TemplatePreviewElement>
55+
<TemplatePreviewElement label={'Apps Enabled'}>
56+
{/* filter out ones with FALSE value */}
57+
{Object.keys(publicLink.types).filter((type) => publicLink.types[type]).map(type => <div>{type}</div>)}
58+
</TemplatePreviewElement>
5259
<TemplatePreviewElement label={'Public Link Time Limit'}>
5360
<RenderMaxTime seconds={publicLink.maxTime} />
5461
</TemplatePreviewElement>

typescript/process-config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ function defaultProcessConfig(): ProcessConfig {
1717
participantList: null,
1818
publicLink: {
1919
id: guidGenerator(),
20+
title: 'You are invited to join a rapid sensemaking flow',
2021
description: '',
2122
maxTime: 5 * 60, // 5 minutes, in seconds
22-
maxParticipants: '*' // Unlimited
23+
maxParticipants: '*', // Unlimited
24+
types: {
25+
telegram: true,
26+
sms: true,
27+
mattermost: true
28+
}
2329
}
2430
},
2531
// step 3

0 commit comments

Comments
 (0)