@reqquest/ui 1.1.1 → 1.1.2
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/dist/api.js +1 -1159
- package/dist/components/FieldCardCheckbox.svelte +1 -1
- package/dist/components/index.js +2 -11
- package/dist/index.js +2 -4
- package/package.json +2 -2
- package/dist/components/AppRequestCard.svelte +0 -172
- package/dist/components/ApplicantProgramList.svelte +0 -184
- package/dist/components/ApplicantProgramListTooltip.svelte +0 -22
- package/dist/components/ApplicantPromptPage.svelte +0 -88
- package/dist/components/ApplicationDetailsView.svelte +0 -307
- package/dist/components/ButtonLoadingIcon.svelte +0 -28
- package/dist/components/IntroPanel.svelte +0 -41
- package/dist/components/PeriodPanel.svelte +0 -100
- package/dist/components/RenderDisplayComponent.svelte +0 -38
- package/dist/components/ReviewerList.svelte +0 -93
- package/dist/components/StatusMessageList.svelte +0 -35
- package/dist/components/WarningIconYellow.svelte +0 -20
- package/dist/csv.js +0 -21
- package/dist/status-utils.js +0 -343
- package/dist/stores/IStateStore.js +0 -0
- package/dist/util.js +0 -14
- /package/dist/{components/types.js → types.js} +0 -0
package/dist/csv.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
function convertJsonToCsv(jsonData) {
|
|
2
|
-
const headers = Object.keys(jsonData[0]);
|
|
3
|
-
let csvContent = headers.join(',') + '\n';
|
|
4
|
-
jsonData.forEach(item => {
|
|
5
|
-
const values = Object.values(item);
|
|
6
|
-
csvContent += values.join(',') + '\n';
|
|
7
|
-
});
|
|
8
|
-
return csvContent;
|
|
9
|
-
}
|
|
10
|
-
export function downloadCsv(data, title = 'App_Requests') {
|
|
11
|
-
const csvString = convertJsonToCsv(data);
|
|
12
|
-
const blob = new Blob([csvString], { type: 'text/csv;charset=utf-8,' });
|
|
13
|
-
const url = URL.createObjectURL(blob);
|
|
14
|
-
const link = document.createElement('a');
|
|
15
|
-
link.setAttribute('href', url);
|
|
16
|
-
link.setAttribute('download', title + '.csv');
|
|
17
|
-
document.body.appendChild(link);
|
|
18
|
-
link.click();
|
|
19
|
-
document.body.removeChild(link);
|
|
20
|
-
URL.revokeObjectURL(url);
|
|
21
|
-
}
|
package/dist/status-utils.js
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import { enumAppRequestStatus, enumRequirementType } from './typed-client/schema.js';
|
|
2
|
-
import { longNumericTime } from './util.js';
|
|
3
|
-
// ========================================
|
|
4
|
-
// === AppRequest Status ===
|
|
5
|
-
// ========================================
|
|
6
|
-
export const APP_REQUEST_STATUS_CONFIG = {
|
|
7
|
-
STARTED: {
|
|
8
|
-
label: 'In progress',
|
|
9
|
-
description: 'Application is in progress and has not been submitted.',
|
|
10
|
-
color: 'green',
|
|
11
|
-
waitingOn: 'Applicant',
|
|
12
|
-
buttonText: 'Edit Application',
|
|
13
|
-
actionType: 'navigate',
|
|
14
|
-
category: 'current',
|
|
15
|
-
navigation: {
|
|
16
|
-
label: 'Continue application',
|
|
17
|
-
href: (requestId) => `/requests/${requestId}/apply`
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
READY_TO_SUBMIT: {
|
|
21
|
-
label: 'In progress',
|
|
22
|
-
description: 'Application is complete and ready to submit.',
|
|
23
|
-
color: 'green',
|
|
24
|
-
waitingOn: 'Applicant',
|
|
25
|
-
buttonText: 'Edit Application',
|
|
26
|
-
actionType: 'navigate',
|
|
27
|
-
category: 'current',
|
|
28
|
-
navigation: {
|
|
29
|
-
label: 'Continue application',
|
|
30
|
-
href: (requestId) => `/requests/${requestId}/apply`
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
PREAPPROVAL: {
|
|
34
|
-
label: 'Review pending',
|
|
35
|
-
description: 'Application submitted and waiting for pre-approval requirements.',
|
|
36
|
-
color: 'blue',
|
|
37
|
-
waitingOn: 'System',
|
|
38
|
-
buttonText: 'Export Application',
|
|
39
|
-
actionType: 'export',
|
|
40
|
-
category: 'current'
|
|
41
|
-
},
|
|
42
|
-
APPROVAL: {
|
|
43
|
-
label: 'In review',
|
|
44
|
-
description: 'Application is being reviewed.',
|
|
45
|
-
color: 'blue',
|
|
46
|
-
waitingOn: 'Reviewer',
|
|
47
|
-
buttonText: 'Export Application',
|
|
48
|
-
actionType: 'export',
|
|
49
|
-
category: 'current'
|
|
50
|
-
},
|
|
51
|
-
ACCEPTANCE: {
|
|
52
|
-
label: 'Offer pending',
|
|
53
|
-
description: 'Waiting for you to respond to the offer.',
|
|
54
|
-
color: 'teal',
|
|
55
|
-
waitingOn: 'Applicant',
|
|
56
|
-
buttonText: 'Review Offer',
|
|
57
|
-
actionType: 'navigate',
|
|
58
|
-
category: 'current',
|
|
59
|
-
navigation: {
|
|
60
|
-
label: 'Review Offer',
|
|
61
|
-
href: (requestId) => `/requests/${requestId}/accept`
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
ACCEPTED: {
|
|
65
|
-
label: 'Offer accepted',
|
|
66
|
-
description: 'You have accepted an offer.',
|
|
67
|
-
color: 'green',
|
|
68
|
-
waitingOn: 'No one, complete',
|
|
69
|
-
buttonText: 'Download Offer',
|
|
70
|
-
actionType: 'download',
|
|
71
|
-
category: 'past'
|
|
72
|
-
},
|
|
73
|
-
READY_TO_ACCEPT: {
|
|
74
|
-
label: 'Offer pending',
|
|
75
|
-
description: 'You have been offered and can now accept.',
|
|
76
|
-
color: 'teal',
|
|
77
|
-
waitingOn: 'Applicant',
|
|
78
|
-
buttonText: 'Review Offer',
|
|
79
|
-
actionType: 'navigate',
|
|
80
|
-
category: 'current',
|
|
81
|
-
navigation: {
|
|
82
|
-
label: 'Review Offer',
|
|
83
|
-
href: (requestId) => `/requests/${requestId}/accept`
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
REVIEW_COMPLETE: {
|
|
87
|
-
label: 'In review',
|
|
88
|
-
description: 'Your application is being reviewed.',
|
|
89
|
-
color: 'blue',
|
|
90
|
-
waitingOn: 'Reviewer',
|
|
91
|
-
buttonText: 'Export Application',
|
|
92
|
-
actionType: 'export',
|
|
93
|
-
category: 'current'
|
|
94
|
-
},
|
|
95
|
-
APPROVED: {
|
|
96
|
-
label: 'Approved',
|
|
97
|
-
description: 'Your application has been approved.',
|
|
98
|
-
color: 'green',
|
|
99
|
-
waitingOn: 'No one, complete',
|
|
100
|
-
buttonText: '',
|
|
101
|
-
actionType: 'none',
|
|
102
|
-
category: 'past'
|
|
103
|
-
},
|
|
104
|
-
NOT_APPROVED: {
|
|
105
|
-
label: 'Ineligible',
|
|
106
|
-
description: 'Your application was not approved.',
|
|
107
|
-
color: 'red',
|
|
108
|
-
waitingOn: 'No one, complete',
|
|
109
|
-
buttonText: '',
|
|
110
|
-
actionType: 'none',
|
|
111
|
-
category: 'past'
|
|
112
|
-
},
|
|
113
|
-
NOT_ACCEPTED: {
|
|
114
|
-
label: 'Offer declined',
|
|
115
|
-
description: 'The offer was not accepted.',
|
|
116
|
-
color: 'gray',
|
|
117
|
-
waitingOn: 'No one, complete',
|
|
118
|
-
buttonText: '',
|
|
119
|
-
actionType: 'none',
|
|
120
|
-
category: 'past'
|
|
121
|
-
},
|
|
122
|
-
CANCELLED: {
|
|
123
|
-
label: 'Cancelled',
|
|
124
|
-
description: 'Application was cancelled before submission.',
|
|
125
|
-
color: 'gray',
|
|
126
|
-
waitingOn: 'No one, complete',
|
|
127
|
-
buttonText: '',
|
|
128
|
-
actionType: 'none',
|
|
129
|
-
category: 'past'
|
|
130
|
-
},
|
|
131
|
-
WITHDRAWN: {
|
|
132
|
-
label: 'Withdrawn',
|
|
133
|
-
description: 'Application was withdrawn after submission.',
|
|
134
|
-
color: 'gray',
|
|
135
|
-
waitingOn: 'No one, complete',
|
|
136
|
-
buttonText: '',
|
|
137
|
-
actionType: 'none',
|
|
138
|
-
category: 'past'
|
|
139
|
-
},
|
|
140
|
-
DISQUALIFIED: {
|
|
141
|
-
label: 'Ineligible',
|
|
142
|
-
description: 'All applications have been disqualified.',
|
|
143
|
-
color: 'red',
|
|
144
|
-
waitingOn: 'Applicant',
|
|
145
|
-
buttonText: '',
|
|
146
|
-
actionType: 'none',
|
|
147
|
-
category: 'past'
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
export const REVIEWER_STATUS_CONFIG = {
|
|
151
|
-
STARTED: {
|
|
152
|
-
label: 'In progress',
|
|
153
|
-
description: 'Application is in progress and has not been submitted.',
|
|
154
|
-
color: 'green'
|
|
155
|
-
},
|
|
156
|
-
READY_TO_SUBMIT: {
|
|
157
|
-
label: 'In progress',
|
|
158
|
-
description: 'Application is complete and ready to submit.',
|
|
159
|
-
color: 'green'
|
|
160
|
-
},
|
|
161
|
-
PREAPPROVAL: {
|
|
162
|
-
label: 'Review pending',
|
|
163
|
-
description: 'Application submitted and waiting for pre-approval requirements.',
|
|
164
|
-
color: 'blue'
|
|
165
|
-
},
|
|
166
|
-
APPROVAL: {
|
|
167
|
-
label: 'In review',
|
|
168
|
-
description: 'Application is being reviewed.',
|
|
169
|
-
color: 'blue'
|
|
170
|
-
},
|
|
171
|
-
ACCEPTANCE: {
|
|
172
|
-
label: 'Offer pending',
|
|
173
|
-
description: 'Waiting for you to respond to the offer.',
|
|
174
|
-
color: 'teal'
|
|
175
|
-
},
|
|
176
|
-
ACCEPTED: {
|
|
177
|
-
label: 'Offer accepted',
|
|
178
|
-
description: 'You have accepted an offer.',
|
|
179
|
-
color: 'green'
|
|
180
|
-
},
|
|
181
|
-
READY_TO_ACCEPT: {
|
|
182
|
-
label: 'Offer pending',
|
|
183
|
-
description: 'You have been offered and can now accept.',
|
|
184
|
-
color: 'teal'
|
|
185
|
-
},
|
|
186
|
-
REVIEW_COMPLETE: {
|
|
187
|
-
label: 'Ready to release',
|
|
188
|
-
description: 'Review is ready to be released to the applicant.',
|
|
189
|
-
color: 'blue'
|
|
190
|
-
},
|
|
191
|
-
APPROVED: {
|
|
192
|
-
label: 'Approved',
|
|
193
|
-
description: 'Your application has been approved.',
|
|
194
|
-
color: 'green'
|
|
195
|
-
},
|
|
196
|
-
NOT_APPROVED: {
|
|
197
|
-
label: 'Ineligible',
|
|
198
|
-
description: 'Your application was not approved.',
|
|
199
|
-
color: 'red'
|
|
200
|
-
},
|
|
201
|
-
NOT_ACCEPTED: {
|
|
202
|
-
label: 'Offer declined',
|
|
203
|
-
description: 'The offer was not accepted.',
|
|
204
|
-
color: 'gray'
|
|
205
|
-
},
|
|
206
|
-
CANCELLED: {
|
|
207
|
-
label: 'Cancelled',
|
|
208
|
-
description: 'Application was cancelled before submission.',
|
|
209
|
-
color: 'gray'
|
|
210
|
-
},
|
|
211
|
-
WITHDRAWN: {
|
|
212
|
-
label: 'Withdrawn',
|
|
213
|
-
description: 'Application was withdrawn after submission.',
|
|
214
|
-
color: 'gray'
|
|
215
|
-
},
|
|
216
|
-
DISQUALIFIED: {
|
|
217
|
-
label: 'Ineligible',
|
|
218
|
-
description: 'All applications have been disqualified.',
|
|
219
|
-
color: 'red'
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
// Get complete AppRequest status information
|
|
223
|
-
export function getAppRequestStatusInfo(status) {
|
|
224
|
-
return APP_REQUEST_STATUS_CONFIG[status] ?? {
|
|
225
|
-
label: status,
|
|
226
|
-
description: 'Status pending.',
|
|
227
|
-
color: 'gray',
|
|
228
|
-
waitingOn: 'No one, complete',
|
|
229
|
-
buttonText: '',
|
|
230
|
-
actionType: 'none',
|
|
231
|
-
category: 'past'
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
// Extract status categories
|
|
235
|
-
export function getCurrentStatuses() {
|
|
236
|
-
return Object.keys(APP_REQUEST_STATUS_CONFIG).filter(status => APP_REQUEST_STATUS_CONFIG[status].category === 'current');
|
|
237
|
-
}
|
|
238
|
-
export function getPastStatuses() {
|
|
239
|
-
return Object.keys(APP_REQUEST_STATUS_CONFIG).filter(status => APP_REQUEST_STATUS_CONFIG[status].category === 'past');
|
|
240
|
-
}
|
|
241
|
-
// Helper for navigation buttons
|
|
242
|
-
export function getNavigationButton(status, requestId) {
|
|
243
|
-
const navigation = APP_REQUEST_STATUS_CONFIG[status]?.navigation;
|
|
244
|
-
if (!navigation)
|
|
245
|
-
return null;
|
|
246
|
-
return {
|
|
247
|
-
label: navigation.label,
|
|
248
|
-
href: navigation.href(requestId)
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
// Helper functions for status actions
|
|
252
|
-
export function getSubmitButtonText(status) {
|
|
253
|
-
return APP_REQUEST_STATUS_CONFIG[status].buttonText;
|
|
254
|
-
}
|
|
255
|
-
export function getStatusActionType(status) {
|
|
256
|
-
return APP_REQUEST_STATUS_CONFIG[status].actionType;
|
|
257
|
-
}
|
|
258
|
-
// ========================================
|
|
259
|
-
// === Application Status ===
|
|
260
|
-
// ========================================
|
|
261
|
-
// Map ApplicationStatus enum to display info
|
|
262
|
-
export function getApplicationStatusInfo(status) {
|
|
263
|
-
const statusMap = {
|
|
264
|
-
ACCEPTED: {
|
|
265
|
-
label: 'Offer accepted',
|
|
266
|
-
description: 'Offer accepted and all requirements met.',
|
|
267
|
-
color: 'green'
|
|
268
|
-
},
|
|
269
|
-
ELIGIBLE: {
|
|
270
|
-
label: 'Eligible',
|
|
271
|
-
description: 'All requirements met, acceptance pending.',
|
|
272
|
-
color: 'green'
|
|
273
|
-
},
|
|
274
|
-
INELIGIBLE: {
|
|
275
|
-
label: 'Ineligible',
|
|
276
|
-
description: 'One or more requirements not met.',
|
|
277
|
-
color: 'red'
|
|
278
|
-
},
|
|
279
|
-
PENDING: {
|
|
280
|
-
label: 'In progress',
|
|
281
|
-
description: 'Awaiting further information.',
|
|
282
|
-
color: 'purple'
|
|
283
|
-
},
|
|
284
|
-
REJECTED: {
|
|
285
|
-
label: 'Offer declined',
|
|
286
|
-
description: 'Offer rejected or requirements not met.',
|
|
287
|
-
color: 'gray'
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
return statusMap[status] ?? { label: status, description: 'Unknown status.', color: 'gray' };
|
|
291
|
-
}
|
|
292
|
-
export const applicantStatuses = new Set([
|
|
293
|
-
enumAppRequestStatus.STARTED,
|
|
294
|
-
enumAppRequestStatus.READY_TO_SUBMIT
|
|
295
|
-
]);
|
|
296
|
-
export const submissionRequirementTypes = new Set([
|
|
297
|
-
enumRequirementType.PREQUAL,
|
|
298
|
-
enumRequirementType.QUALIFICATION,
|
|
299
|
-
enumRequirementType.POSTQUAL
|
|
300
|
-
]);
|
|
301
|
-
export const applicantRequirementTypes = new Set([
|
|
302
|
-
enumRequirementType.PREQUAL,
|
|
303
|
-
enumRequirementType.POSTQUAL,
|
|
304
|
-
enumRequirementType.QUALIFICATION,
|
|
305
|
-
enumRequirementType.ACCEPTANCE
|
|
306
|
-
]);
|
|
307
|
-
export const reviewRequirementTypes = new Set([
|
|
308
|
-
enumRequirementType.APPROVAL,
|
|
309
|
-
enumRequirementType.PREAPPROVAL
|
|
310
|
-
]);
|
|
311
|
-
export const reviewerRequirementTypes = new Set([
|
|
312
|
-
enumRequirementType.APPROVAL,
|
|
313
|
-
enumRequirementType.PREAPPROVAL,
|
|
314
|
-
enumRequirementType.WORKFLOW
|
|
315
|
-
]);
|
|
316
|
-
// ========================================
|
|
317
|
-
// === Periods ===
|
|
318
|
-
// ========================================
|
|
319
|
-
const noClosePeriodDate = '9999-12-031T23:59:59.000-06:00';
|
|
320
|
-
export function getPeriodStatus(period) {
|
|
321
|
-
if (!period.openDate)
|
|
322
|
-
return 'unknown';
|
|
323
|
-
const now = new Date();
|
|
324
|
-
const openDate = new Date(period.openDate);
|
|
325
|
-
const closeDate = (!period.closeDate) ? new Date(noClosePeriodDate) : new Date(period.closeDate);
|
|
326
|
-
if (now < openDate)
|
|
327
|
-
return 'upcoming';
|
|
328
|
-
if (now > closeDate)
|
|
329
|
-
return 'closed';
|
|
330
|
-
return 'open';
|
|
331
|
-
}
|
|
332
|
-
export function getPeriodDisplayInfo(period) {
|
|
333
|
-
const status = getPeriodStatus(period);
|
|
334
|
-
return {
|
|
335
|
-
status,
|
|
336
|
-
openLabel: status === 'closed' ? 'TBD' : longNumericTime(period.openDate),
|
|
337
|
-
openDateMachineFormat: period.openDate,
|
|
338
|
-
closeLabel: status === 'closed' ? 'Application closed' : 'Application closes',
|
|
339
|
-
closeDate: (!period.closeDate) ? longNumericTime(noClosePeriodDate) : longNumericTime(period.closeDate),
|
|
340
|
-
closeDateMachineFormat: period.closeDate ?? new Date(noClosePeriodDate),
|
|
341
|
-
canStartNew: status === 'open' && period.reviewed === true
|
|
342
|
-
};
|
|
343
|
-
}
|
|
File without changes
|
package/dist/util.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { DateTime } from 'luxon';
|
|
2
|
-
// Date Formatting Functions
|
|
3
|
-
export function longDateTime(dt) {
|
|
4
|
-
const dateTime = typeof dt === 'string' ? DateTime.fromISO(dt) : dt;
|
|
5
|
-
return dateTime.toFormat("MMMM d, yyyy '@' H:mm a");
|
|
6
|
-
}
|
|
7
|
-
export function longNumericTime(dt) {
|
|
8
|
-
const dateTime = typeof dt === 'string' ? DateTime.fromISO(dt) : dt;
|
|
9
|
-
return dateTime.toFormat('MM/dd/yyyy h:mm a');
|
|
10
|
-
}
|
|
11
|
-
export function machineDateTime(dt) {
|
|
12
|
-
const dateTime = typeof dt === 'string' ? DateTime.fromISO(dt) : dt;
|
|
13
|
-
return dateTime.toISO({ suppressMilliseconds: true });
|
|
14
|
-
}
|
|
File without changes
|