Skip to content

Commit 07b8b81

Browse files
committed
Fix SGG obfuscated formatter now shows "degree programme" instead of "study programme"
1 parent 0c45f7f commit 07b8b81

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

services/frontend/src/components/StudyGuidanceGroups/StudyGuidanceGroupOverview.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ const LinkToGroup = ({ group }) => {
2626
)
2727
}
2828

29-
const prettifyCamelCase = string => {
30-
const splitted = string.match(/[A-Za-z][a-z]*/g) ?? []
31-
return splitted.map(word => word.charAt(0).toLowerCase() + word.substring(1)).join(' ')
29+
const prettifyTagName = string => {
30+
if (string === 'studyProgramme') return 'Degree programme'
31+
32+
return string
3233
}
3334

3435
const cellWrapper = { display: 'flex', gap: '8px', width: '100%' }
@@ -208,7 +209,7 @@ const TagCell = ({ group, studyProgrammes, tagName }) => {
208209
</div>
209210
</div>
210211
) : (
211-
<Button content={`Add ${prettifyCamelCase(tagName)}`} icon="add" onClick={toggleEdit} size="tiny" />
212+
<Button content={`Add ${prettifyTagName(tagName)}`} icon="add" onClick={toggleEdit} size="tiny" />
212213
)}
213214
</>
214215
)

0 commit comments

Comments
 (0)