forked from presidio-oss/specif-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.constants.ts
228 lines (209 loc) · 7.62 KB
/
app.constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
import { environment } from '../../environments/environment';
export const APP_CONSTANTS = {
WORKING_DIR: 'WORKING_DIR',
VERSION: 'APP_VERSION',
APP_URL: 'APP_URL',
APP_PASSCODE_KEY: 'APP_PASSCODE_KEY',
};
export const FILTER_STRINGS = { BASE: 'base', FEATURE: 'feature', ARCHIVED: 'archived' };
export const CHAT_TYPES = {
REQUIREMENT: 'requirement',
USERSTORY: 'userstory',
TASK: 'task',
};
export const BP_FILE_KEYS = {
BRD_KEY: 'selectedBRDs',
PRD_KEY: 'selectedPRDs',
};
export const ERROR_MESSAGES = {
PASSWORD_ERROR: 'Passcode does not match. Please try again.',
GENERATE_SUGGESTIONS_FAILED: 'Failed to generate suggestions',
DELETE_ASSOCIATED_ERROR: (reqId: string, bpIds: string[]) =>
`Unable to remove ${reqId} because it's linked to the following business processes: ${bpIds.join(', ')}.`,
};
export const SOLUTION_CREATION_TOGGLE_MESSAGES = {
BROWNFIELD_SOLUTION:
'Enabling this toggle will not generate any business or solution requirements for the given solution.',
GREENFIELD_SOLUTION:
'You can create requirements based on the solution context!',
};
export const CONFIRMATION_DIALOG = {
DELETION: {
TITLE: 'Confirm Deletion',
DESCRIPTION: (entityName: string) =>
`Are you sure you want to delete <span class="font-semibold">${entityName}</span>?`,
CANCEL_BUTTON_TEXT: 'Cancel',
PROCEED_BUTTON_TEXT: 'Delete',
},
UNSAVED_CHANGES: {
TITLE: 'Confirm',
DESCRIPTION:
'You have unsaved changes on this page. Are you sure you want to navigate to another page without saving?',
PROCEED_BUTTON_TEXT: 'Stay',
CANCEL_BUTTON_TEXT: 'Leave',
},
LOGOUT: {
TITLE: 'Confirm Logout',
DESCRIPTION: 'Are you sure you want to log out?',
CANCEL_BUTTON_TEXT: 'Cancel',
PROCEED_BUTTON_TEXT: 'Log Out',
},
JIRA_REAUTHENTICATION: {
TITLE: 'Reauthenticate with Jira',
DESCRIPTION:
'Your session with Jira has expired. Please reauthenticate to continue.',
CANCEL_BUTTON_TEXT: 'Cancel',
PROCEED_BUTTON_TEXT: 'Reauthenticate',
},
JIRA_DETAILS_MISSING: {
TITLE: 'Jira Integration Incomplete',
DESCRIPTION:
'It looks like your Jira details are missing. Please return to the integration settings, fill in your details, and save them to continue.',
CANCEL_BUTTON_TEXT: 'Cancel',
PROCEED_BUTTON_TEXT: 'Open integration settings',
},
};
export const REQUIREMENT_TYPE = {
BRD: 'BRD',
PRD: 'PRD',
UIR: 'UIR',
NFR: 'NFR',
BP: 'BP',
US: 'US',
TASK: 'TASK',
} as const;
export const REQUIREMENT_DISPLAY_NAME_MAP = {
[REQUIREMENT_TYPE.US]: 'User Story',
[REQUIREMENT_TYPE.BP]: 'Business Process',
[REQUIREMENT_TYPE.BRD]: 'Business Requirement',
[REQUIREMENT_TYPE.NFR]: 'Non Functional Requirement',
[REQUIREMENT_TYPE.PRD]: 'Product Requirement',
[REQUIREMENT_TYPE.UIR]: 'User Interface Requirement',
[REQUIREMENT_TYPE.TASK]: 'Task',
};
const getEntityDisplayName = (folderId: string): string => {
return (
REQUIREMENT_DISPLAY_NAME_MAP[
folderId as keyof typeof REQUIREMENT_DISPLAY_NAME_MAP
] || 'Unknown Requirement'
);
};
const TOASTER_MESSAGES_DEFAULT_TEMPLATE = {
SUCCESS: (entityKey: string, action: string, entityId?: string) => {
return entityId
? `${getEntityDisplayName(entityKey)} - <span class="font-semibold">${entityId}</span> ${action} successfully!`
: `${getEntityDisplayName(entityKey)} ${action} successfully!`;
},
FAILURE: (entityKey: string, action: string, entityId?: string) => {
return entityId
? `Failed to ${action} ${getEntityDisplayName(entityKey)} - <span class="highlight">${entityId}</span>. Please try again.`
: `Failed to ${action} ${getEntityDisplayName(entityKey)}. Please try again.`;
},
};
export const TOASTER_MESSAGES = {
ENTITY: {
ADD: {
SUCCESS: (entityType: string) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.SUCCESS(entityType, 'added'),
FAILURE: (entityType: string) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.FAILURE(entityType, 'add'),
},
UPDATE: {
SUCCESS: (entityType: string, entityId: string) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.SUCCESS(
entityType,
'updated',
entityId,
),
FAILURE: (entityType: string, entityId: string) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.FAILURE(
entityType,
'update',
entityId,
),
},
DELETE: {
SUCCESS: (entityType: string, entityId: string) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.SUCCESS(
entityType,
'deleted',
entityId,
),
FAILURE: (entityType: string, entityId: string) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.FAILURE(
entityType,
'delete',
entityId,
),
},
COPY: {
SUCCESS: (entityType: string, entityId: string) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.SUCCESS(
entityType,
'copied',
entityId,
),
FAILURE: (entityType: string, entityId: string) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.FAILURE(entityType, 'copy', entityId),
},
GENERATE: {
SUCCESS: (entityType: string, isRegenerate = false) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.SUCCESS(
entityType,
isRegenerate ? 'regenerated' : 'generated',
),
FAILURE: (entityType: string, isRegenerate = false) =>
TOASTER_MESSAGES_DEFAULT_TEMPLATE.FAILURE(
entityType,
isRegenerate ? 'regenerate' : 'generate',
),
},
},
};
export const APP_MESSAGES = {
AWS_BEDROCK_TOOLTIP_MESSAGE: `Enabling the AWS Bedrock Knowledge Base enriches ${environment.ThemeConfiguration.appName} with enterprise-specific context, enhancing its ability to generate precise, business-relevant responses. This added context improves accuracy and ensures deeper alignment with the overall solution.`,
JIRA_ACCORDION:
'JIRA Integration allows users to publish generated user stories as Jira issues by configuring their Jira account and authenticating with Jira. Following configuration of details users can authenticate with Jira to establish a secure sync. Once synchronized, users can select the\n' +
'Sync with Jira\n' +
'option to create tickets directly in JIRA with the configured Project Key.',
AWS_BEDROCK_ACCORDION_MESSAGE: `Using the AWS Bedrock Knowledge Base enriches ${environment.ThemeConfiguration.appName} with enterprise-specific context, enhancing its ability to generate precise, business-relevant responses. This added context improves accuracy and ensures deeper alignment with the overall solution.`,
JIRA_PREREQUISITE: `Please ensure that you have the following issue types in your JIRA project:
<ul class="list-disc pl-5 mt-2">
<li>Epic</li>
<li>Story</li>
<li>Task</li>
</ul>`,
};
export const TOOLTIP_CONTENT = {
IMPORT_FROM_CODE_BUTTON: 'Import from Code',
};
export const PRD_HEADINGS = {
SCREENS: 'Screens: ',
PERSONAS: 'Personas: ',
SCREENS_FORMATTED: '\n\nScreens:\n',
PERSONAS_FORMATTED: '\n\nPersonas:\n',
};
export const FOLDER = {
BRD: 'BRD',
PRD: 'PRD',
NFR: 'NFR',
UIR: 'UIR',
BP: 'BP',
};
export const REQUIREMENT_TYPE_FOLDER_MAP = {
[REQUIREMENT_TYPE.BRD]: FOLDER.BRD,
[REQUIREMENT_TYPE.PRD]: FOLDER.PRD,
[REQUIREMENT_TYPE.NFR]: FOLDER.NFR,
[REQUIREMENT_TYPE.UIR]: FOLDER.UIR,
[REQUIREMENT_TYPE.BP]: FOLDER.BP,
} as const;
export const FOLDER_REQUIREMENT_TYPE_MAP = {
[FOLDER.BRD]: REQUIREMENT_TYPE.BRD,
[FOLDER.PRD]: REQUIREMENT_TYPE.PRD,
[FOLDER.NFR]: REQUIREMENT_TYPE.NFR,
[FOLDER.UIR]: REQUIREMENT_TYPE.UIR,
[FOLDER.BP]: REQUIREMENT_TYPE.BP,
} as const;
// types
export type RequirementType =
(typeof REQUIREMENT_TYPE)[keyof typeof REQUIREMENT_TYPE];