@becollective/utils 1.10.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.semaphore/utils.yml +1 -1
- package/index.ts +7 -0
- package/lib/FeatureFlag.d.ts +12 -0
- package/lib/FeatureFlag.js +51 -0
- package/lib/constants/allowedHtmlTags.d.ts +7 -0
- package/lib/constants/allowedHtmlTags.js +8 -0
- package/lib/constants/avatarColours.d.ts +35 -0
- package/lib/constants/avatarColours.js +36 -0
- package/lib/constants/countries.d.ts +253 -0
- package/lib/constants/countries.js +254 -0
- package/lib/constants/currencies.d.ts +29 -0
- package/lib/constants/currencies.js +36 -0
- package/lib/constants/customFields.d.ts +11 -0
- package/lib/constants/customFields.js +12 -0
- package/lib/constants/distancesUnits.d.ts +11 -0
- package/lib/constants/distancesUnits.js +13 -0
- package/lib/constants/groups.d.ts +13 -0
- package/lib/constants/groups.js +85 -0
- package/lib/constants/insuranceStatuses.d.ts +15 -0
- package/lib/constants/insuranceStatuses.js +7 -0
- package/lib/constants/insuranceTypes.d.ts +35 -0
- package/lib/constants/insuranceTypes.js +36 -0
- package/lib/constants/languages.d.ts +2 -0
- package/lib/constants/languages.js +194 -0
- package/lib/constants/locales.d.ts +119 -0
- package/lib/constants/locales.js +191 -0
- package/lib/constants/notifications.d.ts +47 -0
- package/lib/constants/notifications.js +31 -0
- package/lib/constants/opportunities.d.ts +72 -0
- package/lib/constants/opportunities.js +82 -0
- package/lib/constants/qualificationTypes.d.ts +4 -0
- package/lib/constants/qualificationTypes.js +18 -0
- package/lib/constants/rules.d.ts +13 -0
- package/lib/constants/rules.js +21 -0
- package/lib/constants/subscriptions.d.ts +9 -0
- package/lib/constants/subscriptions.js +10 -0
- package/lib/constants/surveys.d.ts +16 -0
- package/lib/constants/surveys.js +17 -0
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +76 -0
- package/lib/date-time.d.ts +28 -0
- package/lib/date-time.js +79 -0
- package/lib/forms.d.ts +1 -0
- package/lib/forms.js +728 -0
- package/lib/locality.d.ts +5 -0
- package/lib/locality.js +15 -0
- package/lib/money.d.ts +7 -0
- package/lib/money.js +32 -0
- package/lib/opportunity.d.ts +1 -0
- package/lib/opportunity.js +11 -0
- package/lib/opportunityUser.d.ts +8 -0
- package/lib/opportunityUser.js +29 -0
- package/lib/password.d.ts +8 -0
- package/lib/password.js +43 -0
- package/lib/rrule/date.d.ts +4 -0
- package/lib/rrule/date.js +30 -0
- package/lib/rrule/index.d.ts +2 -0
- package/lib/rrule/index.js +18 -0
- package/lib/rrule/parsing.d.ts +6 -0
- package/lib/rrule/parsing.js +130 -0
- package/lib/rrule/parsing.test.d.ts +1 -0
- package/lib/rrule/parsing.test.js +11 -0
- package/lib/rrule.d.ts +49 -0
- package/lib/rrule.js +303 -0
- package/lib/src/FeatureFlag.d.ts +12 -0
- package/lib/src/FeatureFlag.js +51 -0
- package/lib/src/date-time.d.ts +28 -0
- package/lib/src/date-time.js +79 -0
- package/lib/src/forms.d.ts +1 -0
- package/lib/src/forms.js +728 -0
- package/lib/src/locality.d.ts +5 -0
- package/lib/src/locality.js +15 -0
- package/lib/src/money.d.ts +7 -0
- package/lib/src/money.js +32 -0
- package/lib/src/opportunity.d.ts +1 -0
- package/lib/src/opportunity.js +11 -0
- package/lib/src/opportunityUser.d.ts +8 -0
- package/lib/src/opportunityUser.js +29 -0
- package/lib/src/password.d.ts +8 -0
- package/lib/src/password.js +43 -0
- package/package.json +15 -29
- package/src/FeatureFlag.ts +26 -10
- package/src/constants/allowedHtmlTags.ts +6 -0
- package/src/constants/avatarColours.ts +34 -0
- package/src/constants/countries.ts +252 -0
- package/src/constants/currencies.ts +33 -0
- package/src/constants/customFields.ts +10 -0
- package/src/constants/distancesUnits.ts +11 -0
- package/src/constants/groups.ts +83 -0
- package/src/constants/insuranceStatuses.ts +5 -0
- package/src/constants/insuranceTypes.ts +34 -0
- package/src/constants/languages.ts +192 -0
- package/src/constants/locales.ts +189 -0
- package/src/constants/notifications.ts +30 -0
- package/src/constants/opportunities.ts +84 -0
- package/src/constants/qualificationTypes.ts +17 -0
- package/src/constants/rules.ts +22 -0
- package/src/constants/subscriptions.ts +8 -0
- package/src/constants/surveys.ts +15 -0
- package/src/constants.ts +40 -0
- package/src/{date-time.js → date-time.ts} +18 -11
- package/src/forms.ts +807 -0
- package/src/{opportunityUser.js → opportunityUser.ts} +5 -1
- package/src/{password.js → password.ts} +2 -0
- package/src/rrule/date.ts +25 -0
- package/src/rrule/index.ts +2 -0
- package/src/rrule/parsing.ts +136 -0
- package/src/rrule.ts +367 -0
- package/tests/{date-time.test.js → date-time.test.ts} +48 -46
- package/tests/featureFlag.test.ts +36 -39
- package/tests/forms.test-data.json +43 -0
- package/tests/forms.test-schema.json +144 -0
- package/tests/forms.test-uischema.json +117 -0
- package/tests/forms.test.ts +674 -0
- package/tests/{money.test.js → money.test.ts} +2 -3
- package/tests/{password.test.js → password.test.ts} +7 -6
- package/tests/rrule/parsing.test.ts +12 -0
- package/tests/rrule.test.ts +625 -0
- package/tsconfig.json +15 -12
- package/bundle.js +0 -270
- package/index.js +0 -25
- package/rollup.config.js +0 -25
- /package/src/{locality.js → locality.ts} +0 -0
- /package/src/{money.js → money.ts} +0 -0
- /package/src/{opportunity.js → opportunity.ts} +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { isUnderSixteen, isUnderAge, getAge, getShiftText } from '../lib/date-time';
|
|
2
|
+
import { DateTime } from 'luxon';
|
|
3
3
|
|
|
4
4
|
describe('getAge', () => {
|
|
5
|
-
const refPoint =
|
|
5
|
+
const refPoint = DateTime.now().minus({ years: 16 });
|
|
6
6
|
|
|
7
7
|
test('Returns the correct age', () => {
|
|
8
|
-
const dob =
|
|
8
|
+
const dob = refPoint;
|
|
9
9
|
|
|
10
10
|
expect(getAge(dob)).toBe(16);
|
|
11
|
-
expect(getAge(dob.
|
|
12
|
-
expect(getAge(dob.
|
|
11
|
+
expect(getAge(dob.minus({ years: 1 }).toUTC())).toBe(17);
|
|
12
|
+
expect(getAge(dob.plus({ months: 12 }).toUTC())).toBe(15);
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
test('Returns the age in specified measurement', () => {
|
|
16
|
-
const dob =
|
|
16
|
+
const dob = DateTime.now().minus({ months: 15 });
|
|
17
17
|
|
|
18
18
|
expect(getAge(dob)).toBe(1);
|
|
19
19
|
expect(getAge(dob, 'years')).toBe(1);
|
|
@@ -22,31 +22,31 @@ describe('getAge', () => {
|
|
|
22
22
|
|
|
23
23
|
test('Throws Error if dob is not a valid date-string', () => {
|
|
24
24
|
// eslint-disable-next-line no-undef
|
|
25
|
-
|
|
25
|
+
// cannot currently get this state due to TypeScript
|
|
26
|
+
// expect(() => getAge(undefined)).toThrow(/not defined/);
|
|
26
27
|
expect(() => getAge(null)).toThrow(/Invalid date/);
|
|
27
28
|
expect(() => getAge('not-valid')).toThrow(/Invalid date/);
|
|
28
29
|
});
|
|
29
30
|
});
|
|
30
31
|
|
|
31
32
|
describe('isUnderSixteen', () => {
|
|
32
|
-
const refPoint =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const dob = moment(refPoint);
|
|
33
|
+
const refPoint = DateTime.now().minus({ years: 16 });
|
|
34
|
+
test('Is not U16 if dob is 16 or 100 years ago', () => {
|
|
35
|
+
const dob = refPoint;
|
|
36
36
|
|
|
37
|
-
expect(isUnderSixteen(dob.
|
|
38
|
-
expect(isUnderSixteen(dob.
|
|
37
|
+
expect(isUnderSixteen(dob.minus({ minutes: 1 }).toUTC())).toBe(false);
|
|
38
|
+
expect(isUnderSixteen(dob.minus({ years: 100 }).toUTC())).toBe(false);
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
test('Is U16 if dob is less than 16 years ago', () => {
|
|
42
|
-
const dob =
|
|
42
|
+
const dob = refPoint;
|
|
43
43
|
|
|
44
|
-
expect(isUnderSixteen(dob.
|
|
45
|
-
expect(isUnderSixteen(dob.
|
|
44
|
+
expect(isUnderSixteen(dob.plus({ minutes: 1 }).toUTC())).toBe(true);
|
|
45
|
+
expect(isUnderSixteen(dob.plus({ years: 100 }).toUTC())).toBe(true);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
test('Undefined dob', () => {
|
|
49
|
-
expect(isUnderSixteen(
|
|
49
|
+
expect(isUnderSixteen(undefined)).toBe(false);
|
|
50
50
|
});
|
|
51
51
|
test('Null dob', () => {
|
|
52
52
|
expect(isUnderSixteen(null)).toBe(false);
|
|
@@ -57,24 +57,24 @@ describe('isUnderSixteen', () => {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
describe('isUnderAge - dateOfBirth', () => {
|
|
60
|
-
const refPoint =
|
|
60
|
+
const refPoint = DateTime.now().minus({ years: 13 });
|
|
61
61
|
const obj = {};
|
|
62
62
|
test('Is not U13 if dob is 13 years ago', () => {
|
|
63
|
-
const dob =
|
|
63
|
+
const dob = refPoint;
|
|
64
64
|
|
|
65
|
-
expect(isUnderAge(dob.
|
|
66
|
-
expect(isUnderAge(dob.
|
|
65
|
+
expect(isUnderAge(dob.minus({ minutes: 1 }).toUTC(), 13)).toBe(false);
|
|
66
|
+
expect(isUnderAge(dob.minus({ years: 100 }).toUTC(), 13)).toBe(false);
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
test('Is U16 if dob is less than 16 years ago', () => {
|
|
70
|
-
const dob =
|
|
70
|
+
const dob = refPoint;
|
|
71
71
|
|
|
72
|
-
expect(isUnderAge(dob.
|
|
73
|
-
expect(isUnderAge(dob.
|
|
72
|
+
expect(isUnderAge(dob.plus({ minutes: 1 }).toUTC(), 13)).toBe(true);
|
|
73
|
+
expect(isUnderAge(dob.plus({ years: 100 }).toUTC(), 13)).toBe(true);
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
test('Undefined dob', () => {
|
|
77
|
-
expect(isUnderAge(
|
|
77
|
+
expect(isUnderAge(undefined, 13)).toBe(false);
|
|
78
78
|
});
|
|
79
79
|
test('Null dob', () => {
|
|
80
80
|
expect(isUnderAge(null, 13)).toBe(false);
|
|
@@ -99,42 +99,43 @@ describe('isUnderAge - maxAcknowledgedAge', () => {
|
|
|
99
99
|
});
|
|
100
100
|
|
|
101
101
|
test('Undefined maxAcknowledgedAge', () => {
|
|
102
|
-
expect(isUnderAge(null, 13,
|
|
102
|
+
expect(isUnderAge(null, 13, undefined)).toBe(false);
|
|
103
103
|
});
|
|
104
104
|
test('Null maxAcknowledgedAge', () => {
|
|
105
105
|
expect(isUnderAge(null, 13, null)).toBe(false);
|
|
106
106
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
// Will not execute due to TypeScript
|
|
108
|
+
// test('Invalid value', () => {
|
|
109
|
+
// expect(isUnderAge(null, 13, '13x')).toBe(false);
|
|
110
|
+
// });
|
|
110
111
|
});
|
|
111
112
|
|
|
112
113
|
describe('isUnderAge - 10', () => {
|
|
113
|
-
const refPoint =
|
|
114
|
+
const refPoint = DateTime.now().minus({ years: 10 });
|
|
114
115
|
const obj = {};
|
|
115
116
|
test('Is not U13 if dob is 10 years ago', () => {
|
|
116
|
-
const dob =
|
|
117
|
+
const dob = refPoint;
|
|
117
118
|
|
|
118
|
-
expect(isUnderAge(dob.
|
|
119
|
-
expect(isUnderAge(dob.
|
|
119
|
+
expect(isUnderAge(dob.minus({ minutes: 1 }).toUTC(), 10)).toBe(false);
|
|
120
|
+
expect(isUnderAge(dob.minus({ years: 100 }).toUTC(), 10)).toBe(false);
|
|
120
121
|
});
|
|
121
122
|
|
|
122
123
|
test('Is U10 if dob is less than 10 years ago', () => {
|
|
123
|
-
const dob =
|
|
124
|
+
const dob = refPoint;
|
|
124
125
|
|
|
125
|
-
expect(isUnderAge(dob.
|
|
126
|
-
expect(isUnderAge(dob.
|
|
126
|
+
expect(isUnderAge(dob.plus({ minutes: 1 }).toUTC(), 10)).toBe(true);
|
|
127
|
+
expect(isUnderAge(dob.plus({ years: 100 }).toUTC(), 10)).toBe(true);
|
|
127
128
|
});
|
|
128
129
|
});
|
|
129
130
|
|
|
130
131
|
describe('isUnderAge - over 13', () => {
|
|
131
|
-
const refPoint =
|
|
132
|
+
const refPoint = DateTime.now().minus({ years: 15 });
|
|
132
133
|
const obj = {};
|
|
133
134
|
test('Is not U13 if dob is 15 years ago', () => {
|
|
134
|
-
const dob =
|
|
135
|
+
const dob = refPoint;
|
|
135
136
|
|
|
136
|
-
expect(isUnderAge(dob.
|
|
137
|
-
expect(isUnderAge(dob.
|
|
137
|
+
expect(isUnderAge(dob.minus({ minutes: 1 }).toUTC(), 15)).toBe(false);
|
|
138
|
+
expect(isUnderAge(dob.minus({ years: 100 }).toUTC(), 15)).toBe(false);
|
|
138
139
|
});
|
|
139
140
|
});
|
|
140
141
|
|
|
@@ -144,12 +145,13 @@ describe('getShiftText', () => {
|
|
|
144
145
|
const melbourne = 'Australia/Melbourne';
|
|
145
146
|
const auckland = 'Pacific/Auckland';
|
|
146
147
|
test('get shift text with melbourne timezone', () => {
|
|
147
|
-
expect(getShiftText(from, to, melbourne)).toBe('Thursday, 30 July 2020, 10:
|
|
148
|
+
expect(getShiftText(from, to, melbourne)).toBe('Thursday, 30 July 2020, 10:00AM-3:30PM');
|
|
148
149
|
});
|
|
149
150
|
test('get shift text with auckland timezone', () => {
|
|
150
|
-
expect(getShiftText(from, to, auckland)).toBe('Thursday, 30 July 2020, 12:
|
|
151
|
-
});
|
|
152
|
-
test('with empty data', () => {
|
|
153
|
-
expect(getShiftText()).toBe('');
|
|
151
|
+
expect(getShiftText(from, to, auckland)).toBe('Thursday, 30 July 2020, 12:00PM-5:30PM');
|
|
154
152
|
});
|
|
153
|
+
// Will not execute due to TypeScript
|
|
154
|
+
// test('with empty data', () => {
|
|
155
|
+
// expect(getShiftText()).toBe('');
|
|
156
|
+
// });
|
|
155
157
|
});
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import FeatureFlag from '../src/FeatureFlag';
|
|
1
|
+
import { FeatureFlag } from '../lib/FeatureFlag';
|
|
3
2
|
|
|
4
3
|
const featureFlag = new FeatureFlag();
|
|
5
|
-
jest.mock('axios');
|
|
6
|
-
const mockAxios = axios as jest.Mocked<typeof axios>;
|
|
7
4
|
const feature = 'test-feature';
|
|
8
5
|
|
|
6
|
+
let spy;
|
|
7
|
+
|
|
8
|
+
const createFetchSpyResolve = (mockResponse) => {
|
|
9
|
+
spy = jest.spyOn(global, "fetch").mockImplementation(
|
|
10
|
+
jest.fn(
|
|
11
|
+
() => Promise.resolve({ ok: true, json: () => Promise.resolve(mockResponse),
|
|
12
|
+
}),
|
|
13
|
+
) as jest.Mock );
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
describe('Make feature decision based on feature flags', () => {
|
|
10
17
|
test('should return true if feature is flagged active on localtest', async () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
15
|
-
);
|
|
18
|
+
createFetchSpyResolve({
|
|
19
|
+
Environments: ['localtest', 'compose'],
|
|
20
|
+
});
|
|
16
21
|
const isActive = await featureFlag.isFeatureActive(feature, {
|
|
17
22
|
env: 'localtest',
|
|
18
23
|
});
|
|
@@ -20,11 +25,9 @@ describe('Make feature decision based on feature flags', () => {
|
|
|
20
25
|
});
|
|
21
26
|
test('should return false if feature is NOT flagged active on localtest', async () => {
|
|
22
27
|
featureFlag.clearCache();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
})
|
|
27
|
-
);
|
|
28
|
+
createFetchSpyResolve({
|
|
29
|
+
Environments: ['dev-au'],
|
|
30
|
+
});
|
|
28
31
|
const isActive = await featureFlag.isFeatureActive(feature, {
|
|
29
32
|
env: 'localtest',
|
|
30
33
|
});
|
|
@@ -32,7 +35,7 @@ describe('Make feature decision based on feature flags', () => {
|
|
|
32
35
|
});
|
|
33
36
|
test('should return false if no result returned from feature flag', async () => {
|
|
34
37
|
featureFlag.clearCache();
|
|
35
|
-
|
|
38
|
+
createFetchSpyResolve({});
|
|
36
39
|
const isActive = await featureFlag.isFeatureActive(feature, {
|
|
37
40
|
env: 'localtest',
|
|
38
41
|
});
|
|
@@ -41,61 +44,55 @@ describe('Make feature decision based on feature flags', () => {
|
|
|
41
44
|
describe('Test caching', () => {
|
|
42
45
|
test('should return same result for same parameter without fetch api', async () => {
|
|
43
46
|
featureFlag.clearCache();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
);
|
|
47
|
+
createFetchSpyResolve({
|
|
48
|
+
Environments: ['localtest', 'compose'],
|
|
49
|
+
});
|
|
49
50
|
const isActive = await featureFlag.isFeatureActive(feature, {
|
|
50
51
|
env: 'localtest',
|
|
51
52
|
});
|
|
52
|
-
expect(
|
|
53
|
+
expect(spy).toHaveBeenCalled();
|
|
53
54
|
expect(isActive).toBe(true);
|
|
54
|
-
|
|
55
|
+
spy.mockClear();
|
|
55
56
|
const secondCallResult = await featureFlag.isFeatureActive(feature, {
|
|
56
57
|
env: 'localtest',
|
|
57
58
|
});
|
|
58
|
-
expect(
|
|
59
|
+
expect(spy).not.toHaveBeenCalled();
|
|
59
60
|
expect(secondCallResult).toBe(true);
|
|
60
61
|
});
|
|
61
62
|
test('should fetch api after expiry', async () => {
|
|
62
63
|
featureFlag.clearCache();
|
|
63
64
|
featureFlag.setCacheTtl(0);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})
|
|
68
|
-
);
|
|
65
|
+
createFetchSpyResolve({
|
|
66
|
+
Environments: ['localtest', 'compose'],
|
|
67
|
+
});
|
|
69
68
|
const isActive = await featureFlag.isFeatureActive(feature, {
|
|
70
69
|
env: 'localtest',
|
|
71
70
|
});
|
|
72
|
-
expect(
|
|
71
|
+
expect(spy).toHaveBeenCalled();
|
|
73
72
|
expect(isActive).toBe(true);
|
|
74
|
-
|
|
73
|
+
spy.mockClear();
|
|
75
74
|
const secondCallResult = await featureFlag.isFeatureActive(feature, {
|
|
76
75
|
env: 'localtest',
|
|
77
76
|
});
|
|
78
|
-
expect(
|
|
77
|
+
expect(spy).toHaveBeenCalled();
|
|
79
78
|
expect(secondCallResult).toBe(true);
|
|
80
79
|
});
|
|
81
80
|
test('should fetch api for different parameter', async () => {
|
|
82
81
|
featureFlag.clearCache();
|
|
83
82
|
featureFlag.setCacheTtl(1000 * 60 * 5);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
})
|
|
88
|
-
);
|
|
83
|
+
createFetchSpyResolve({
|
|
84
|
+
Environments: ['localtest', 'compose'],
|
|
85
|
+
});
|
|
89
86
|
const isActive = await featureFlag.isFeatureActive(feature, {
|
|
90
87
|
env: 'localtest',
|
|
91
88
|
});
|
|
92
|
-
expect(
|
|
89
|
+
expect(spy).toHaveBeenCalled();
|
|
93
90
|
expect(isActive).toBe(true);
|
|
94
|
-
|
|
91
|
+
spy.mockClear();
|
|
95
92
|
const secondCallResult = await featureFlag.isFeatureActive(feature, {
|
|
96
93
|
env: 'compose',
|
|
97
94
|
});
|
|
98
|
-
expect(
|
|
95
|
+
expect(spy).toHaveBeenCalled();
|
|
99
96
|
expect(secondCallResult).toBe(true);
|
|
100
97
|
});
|
|
101
98
|
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"B1WsCeOaz": "Sam Smith",
|
|
3
|
+
"B1Wnumber": 5,
|
|
4
|
+
"B1WsCe555": "Yes",
|
|
5
|
+
"ryDRCeupz": "Joe",
|
|
6
|
+
"rkBk1-_pG": "+61434111222",
|
|
7
|
+
"rkF-kbOaz": ["Newspaper", "Google"],
|
|
8
|
+
"H1n4yZ_pM": "I like polar bears",
|
|
9
|
+
"SkbLy-_aG": true,
|
|
10
|
+
"B1UwJWOaM": ["Wed", "Tues", "Thurs"],
|
|
11
|
+
"BkgcybupG": "Male",
|
|
12
|
+
"r139kWOpz": "2018-05-31",
|
|
13
|
+
"Goh1che2u": {
|
|
14
|
+
"geo": {
|
|
15
|
+
"lat": -37.83528429999999,
|
|
16
|
+
"lng": 144.99534949999997
|
|
17
|
+
},
|
|
18
|
+
"location": {
|
|
19
|
+
"short": "South Yarra",
|
|
20
|
+
"long": "South Yarra"
|
|
21
|
+
},
|
|
22
|
+
"region": {
|
|
23
|
+
"short": "VIC",
|
|
24
|
+
"long": "Victoria"
|
|
25
|
+
},
|
|
26
|
+
"country": {
|
|
27
|
+
"short": "AU",
|
|
28
|
+
"long": "Australia"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"r1v5wcI0M": {
|
|
32
|
+
"from": "2018-05-15",
|
|
33
|
+
"to": "2018-05-23"
|
|
34
|
+
},
|
|
35
|
+
"BkNCKH9CM": "+61434111222",
|
|
36
|
+
"HyIyAz3X7": ["57b560694987a6d4c3554b1b", "57b560694987a6d4c3554b1d"],
|
|
37
|
+
"Bie7ohXee": {
|
|
38
|
+
"opportunityId": "5b988e6fa5db77bf46bcac79",
|
|
39
|
+
"volunteerId": "5b988e74a5db77bf46bcac7a",
|
|
40
|
+
"filename": "/foo/bar/baz.pdf"
|
|
41
|
+
},
|
|
42
|
+
"Bie7ohXef": "UK"
|
|
43
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"required": ["H1n4yZ_pM", "BkgcybupG"],
|
|
4
|
+
"properties": {
|
|
5
|
+
"B1WsCeOaz": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"title": "Who are you?"
|
|
8
|
+
},
|
|
9
|
+
"B1Wnumber": {
|
|
10
|
+
"type": "number",
|
|
11
|
+
"title": "Rate this"
|
|
12
|
+
},
|
|
13
|
+
"B1WsCe555": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"title": "Do you own your own vehicle?",
|
|
16
|
+
"bcReportable": "BC_OWN_VEHICLE"
|
|
17
|
+
},
|
|
18
|
+
"SJh2Rx_6G": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"title": "References",
|
|
21
|
+
"bcType": "heading"
|
|
22
|
+
},
|
|
23
|
+
"ryDRCeupz": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"title": "Name"
|
|
26
|
+
},
|
|
27
|
+
"rkBk1-_pG": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"title": "Phone",
|
|
30
|
+
"bcType": "phone"
|
|
31
|
+
},
|
|
32
|
+
"S1Bly-uaf": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"title": "Other",
|
|
35
|
+
"bcType": "heading"
|
|
36
|
+
},
|
|
37
|
+
"rkF-kbOaz": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"title": "Where did you hear about us?",
|
|
40
|
+
"items": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"enum": ["Newspaper", "Google", "Word of mouth"]
|
|
43
|
+
},
|
|
44
|
+
"uniqueItems": true,
|
|
45
|
+
"bcRequired": false
|
|
46
|
+
},
|
|
47
|
+
"H1n4yZ_pM": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"title": "Why do you want to help us?"
|
|
50
|
+
},
|
|
51
|
+
"SkbLy-_aG": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"title": "Volunteered Before?"
|
|
54
|
+
},
|
|
55
|
+
"B1UwJWOaM": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"title": "What days would you like to volunteer",
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"enum": ["Mon", "Tues", "Wed", "Thurs", "Fri"]
|
|
61
|
+
},
|
|
62
|
+
"uniqueItems": true
|
|
63
|
+
},
|
|
64
|
+
"BkgcybupG": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"title": "Gender",
|
|
67
|
+
"items": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"enum": ["Male", "Female", "Other"]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"r139kWOpz": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"title": "When can you start?",
|
|
75
|
+
"bcType": "date"
|
|
76
|
+
},
|
|
77
|
+
"Goh1che2u": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"title": "Where do you want to volunteer?",
|
|
80
|
+
"bcType": "location"
|
|
81
|
+
},
|
|
82
|
+
"r1v5wcI0M": {
|
|
83
|
+
"title": "What date range would you prefer?",
|
|
84
|
+
"type": "object",
|
|
85
|
+
"properties": {},
|
|
86
|
+
"bcType": "dateRange"
|
|
87
|
+
},
|
|
88
|
+
"BkNCKH9CM": {
|
|
89
|
+
"title": "Phone Number",
|
|
90
|
+
"type": "string",
|
|
91
|
+
"bcType": "phone"
|
|
92
|
+
},
|
|
93
|
+
"SyDtPZrkm": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"title": "spacer",
|
|
96
|
+
"bcType": "spacer"
|
|
97
|
+
},
|
|
98
|
+
"cSCgS2dlE": {
|
|
99
|
+
"title": "Paragraph",
|
|
100
|
+
"text": "<p>Rich text</p>",
|
|
101
|
+
"type": "string",
|
|
102
|
+
"bcType": "textParagraph"
|
|
103
|
+
},
|
|
104
|
+
"HyIyAz3X7": {
|
|
105
|
+
"title": "Skills Required",
|
|
106
|
+
"type": "array",
|
|
107
|
+
"uniqueItems": true,
|
|
108
|
+
"bcType": "skills",
|
|
109
|
+
"items": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"anyOf": [
|
|
112
|
+
{
|
|
113
|
+
"enum": ["57b560694987a6d4c3554b1b"],
|
|
114
|
+
"title": "Office Reception",
|
|
115
|
+
"type": "string"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"enum": ["57b560694987a6d4c3554b1d"],
|
|
119
|
+
"title": "Executive Administration",
|
|
120
|
+
"type": "string"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"enum": ["57b560694987a6d4c3554b1c"],
|
|
124
|
+
"title": "Office Management",
|
|
125
|
+
"type": "string"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"Bie7ohXee": {
|
|
131
|
+
"title": "Upload a file",
|
|
132
|
+
"type": "string",
|
|
133
|
+
"bcType": "file"
|
|
134
|
+
},
|
|
135
|
+
"Bie7ohXef": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"title": "Country of Birth",
|
|
138
|
+
"items": {
|
|
139
|
+
"type": "string",
|
|
140
|
+
"enum": ["UK", "AU", "NZ"]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ui:order": [
|
|
3
|
+
"B1WsCeOaz",
|
|
4
|
+
"B1WsCe555",
|
|
5
|
+
"SJh2Rx_6G",
|
|
6
|
+
"ryDRCeupz",
|
|
7
|
+
"rkBk1-_pG",
|
|
8
|
+
"S1Bly-uaf",
|
|
9
|
+
"rkF-kbOaz",
|
|
10
|
+
"H1n4yZ_pM",
|
|
11
|
+
"SkbLy-_aG",
|
|
12
|
+
"B1UwJWOaM",
|
|
13
|
+
"BkgcybupG",
|
|
14
|
+
"r139kWOpz",
|
|
15
|
+
"r1v5wcI0M",
|
|
16
|
+
"BkNCKH9CM",
|
|
17
|
+
"SyDtPZrkm"
|
|
18
|
+
],
|
|
19
|
+
"B1WsCeOaz": {
|
|
20
|
+
"ui:widget": "WidgetTextBox",
|
|
21
|
+
"ui:title": "Who are you?",
|
|
22
|
+
"ui:bc-helperText": "Something helpful"
|
|
23
|
+
},
|
|
24
|
+
"B1Wnumber": {
|
|
25
|
+
"ui:widget": "WidgetSocialPrescribing",
|
|
26
|
+
"ui:title": "Rate this"
|
|
27
|
+
},
|
|
28
|
+
"B1WsCe555": {
|
|
29
|
+
"ui:widget": "WidgetTextBox",
|
|
30
|
+
"ui:title": "Do you own your own vehicle?",
|
|
31
|
+
"ui:bc-helperText": "Something helpful"
|
|
32
|
+
},
|
|
33
|
+
"SJh2Rx_6G": {
|
|
34
|
+
"ui:widget": "WidgetHeading",
|
|
35
|
+
"ui:title": "References"
|
|
36
|
+
},
|
|
37
|
+
"ryDRCeupz": {
|
|
38
|
+
"ui:widget": "WidgetTextBox",
|
|
39
|
+
"ui:title": "Name"
|
|
40
|
+
},
|
|
41
|
+
"rkBk1-_pG": {
|
|
42
|
+
"ui:widget": "WidgetPhone",
|
|
43
|
+
"ui:title": "Phone"
|
|
44
|
+
},
|
|
45
|
+
"S1Bly-uaf": {
|
|
46
|
+
"ui:widget": "WidgetHeading",
|
|
47
|
+
"ui:title": "Other"
|
|
48
|
+
},
|
|
49
|
+
"rkF-kbOaz": {
|
|
50
|
+
"ui:widget": "WidgetDropDown",
|
|
51
|
+
"ui:title": "Where did you hear about us?",
|
|
52
|
+
"ui:bc-helperText": "",
|
|
53
|
+
"ui:bc-required": false,
|
|
54
|
+
"ui:bc-multiSelect": true
|
|
55
|
+
},
|
|
56
|
+
"H1n4yZ_pM": {
|
|
57
|
+
"ui:widget": "WidgetTextArea",
|
|
58
|
+
"ui:title": "Why do you want to help us?",
|
|
59
|
+
"ui:bc-helperText": "",
|
|
60
|
+
"ui:bc-required": true
|
|
61
|
+
},
|
|
62
|
+
"SkbLy-_aG": {
|
|
63
|
+
"ui:widget": "WidgetToggle",
|
|
64
|
+
"ui:title": "Volunteered Before?"
|
|
65
|
+
},
|
|
66
|
+
"B1UwJWOaM": {
|
|
67
|
+
"ui:widget": "WidgetTickbox",
|
|
68
|
+
"ui:title": "What days would you like to volunteer"
|
|
69
|
+
},
|
|
70
|
+
"BkgcybupG": {
|
|
71
|
+
"ui:widget": "WidgetRadio",
|
|
72
|
+
"ui:title": "Gender",
|
|
73
|
+
"ui:bc-helperText": "",
|
|
74
|
+
"ui:bc-required": true
|
|
75
|
+
},
|
|
76
|
+
"r139kWOpz": {
|
|
77
|
+
"ui:widget": "WidgetDate",
|
|
78
|
+
"ui:title": "When can you start?"
|
|
79
|
+
},
|
|
80
|
+
"Goh1che2u": {
|
|
81
|
+
"ui:widget": "WidgetLocation",
|
|
82
|
+
"ui:title": "Where do you want to volunteer?"
|
|
83
|
+
},
|
|
84
|
+
"r1v5wcI0M": {
|
|
85
|
+
"ui:widget": "WidgetDateRange",
|
|
86
|
+
"ui:title": "What date range would you prefer?",
|
|
87
|
+
"ui:field": "dateRange"
|
|
88
|
+
},
|
|
89
|
+
"BkNCKH9CM": {
|
|
90
|
+
"ui:widget": "WidgetPhone",
|
|
91
|
+
"ui:title": "Phone Number"
|
|
92
|
+
},
|
|
93
|
+
"SyDtPZrkm": {
|
|
94
|
+
"ui:title": "",
|
|
95
|
+
"ui:widget": "WidgetSpacer"
|
|
96
|
+
},
|
|
97
|
+
"cSCgS2dlE": {
|
|
98
|
+
"ui:widget": "WidgetTextParagraph",
|
|
99
|
+
"ui:title": "Paragraph"
|
|
100
|
+
},
|
|
101
|
+
"HyIyAz3X7": {
|
|
102
|
+
"ui:widget": "WidgetSkillsRequired",
|
|
103
|
+
"ui:title": "Skills Required"
|
|
104
|
+
},
|
|
105
|
+
"Bie7ohXee": {
|
|
106
|
+
"ui:widget": "WidgetFile",
|
|
107
|
+
"ui:title": "Your resume"
|
|
108
|
+
},
|
|
109
|
+
"Bie7ohXef": {
|
|
110
|
+
"ui:widget": "WidgetCountry",
|
|
111
|
+
"ui:title": "Country of Birth"
|
|
112
|
+
},
|
|
113
|
+
"Bie7ohXeg": {
|
|
114
|
+
"ui:widget": "WidgetTextParagraph",
|
|
115
|
+
"ui:title": ""
|
|
116
|
+
}
|
|
117
|
+
}
|