Skip to content

Commit aadfa30

Browse files
PjaijaipauljaijaiCopilot
authored
Release v1.32.0 (#474)
* Feature/notificaiton (#424) * fix: fix infinite scroll props * feat: create with dot icons * feat: replace conversation icon * feat: create spinning loader * feat: add bell icon * fix: remove conversation message loader * feat: api implementation * feat: ui implementation * feat: create notification table * feat: update unseen notifcation function * refactor: house keep * refactor: house keep nav menue * refactor: house keep * refactor: text copies * feat: message noti copy and ui * feat: rename function and make it 24 hr --------- Co-authored-by: Pjaijai <paul6a24@hotmail.com> * Feature/allow compnay search on job journey search bar and sheet (#426) * feat: replace job type with company * style: style fix * docs: adding back doc * feat: update function --------- Co-authored-by: Pjaijai <paul6a24@hotmail.com> * Feature/Fire job journey (#427) * fix: fix company folder * feat(implement fire): implement fire * fix: update fire table migration script --------- Co-authored-by: Pjaijai <paul6a24@hotmail.com> * style: update display company option style * style: update company select style * Update client/modules/job-journey/create/components/sections/preview.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: fix type * fix: fix location label display * chore(release): 1.32.0 --------- Co-authored-by: Pjaijai <paul6a24@hotmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 424b821 commit aadfa30

File tree

3 files changed

+96
-27
lines changed

3 files changed

+96
-27
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [1.32.0](https://github.com/Pjaijai/Referalah/compare/v1.21.1...v1.32.0) (2025-12-07)
6+
7+
8+
### Features
9+
10+
* update copies ([#470](https://github.com/Pjaijai/Referalah/issues/470)) ([2cef9e3](https://github.com/Pjaijai/Referalah/commit/2cef9e369084fad3d624ea5c59a5a72d6561c21e))
11+
12+
13+
### Bug Fixes
14+
15+
* fix location label display ([904b022](https://github.com/Pjaijai/Referalah/commit/904b022a4ac7abc794baac0c1a8caad45b4d07cf))
16+
* fix type ([9e13542](https://github.com/Pjaijai/Referalah/commit/9e135421b694dca9d09346e61be6bb83fa21f809))
17+
518
## [1.31.0](https://github.com/Pjaijai/Referalah/compare/v1.21.1...v1.31.0) (2025-11-15)
619

720

client/hooks/common/options/location-options-list.tsx

Lines changed: 82 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,44 @@ const useLocationOptionsList = (
2121

2222
// Helper function to get the hierarchical label
2323
const getLocationLabel = (location: TLocationData): string => {
24-
const parts: string[] = [getName(location)]
25-
26-
// For Level 1 and Level 2, include emoji if present
27-
if (location.level === 1 || location.level === 2) {
28-
if (location.meta_data?.emoji) {
29-
parts.unshift(location.meta_data.emoji)
30-
return parts.join(" ")
31-
}
24+
const parts: string[] = []
25+
26+
// Add emoji if present for Level 1 and Level 2
27+
if (
28+
(location.level === 1 || location.level === 2) &&
29+
location.meta_data?.emoji
30+
) {
31+
parts.push(location.meta_data.emoji)
3232
}
3333

34-
// If no parent, return the name (and emoji if already added)
35-
if (!location.parent_uuid) {
36-
return parts.join(" ")
37-
}
34+
// Add current location name
35+
parts.push(getName(location))
3836

39-
// Add parent name
40-
if (location.parent_uuid) {
41-
const parent = locationMap.get(location.parent_uuid)
42-
if (parent) parts.push(getName(parent))
37+
// If level 1 or no parent, return now
38+
if (location.level === 1 || !location.parent_uuid) {
39+
return parts.join(" ")
4340
}
4441

45-
// Add country name if applicable and not already added
46-
if (location.country_uuid) {
42+
// Add parent name if parent exists
43+
const parent = locationMap.get(location.parent_uuid)
44+
if (parent) {
45+
parts.push(getName(parent))
46+
47+
// For level 3, also try to add country if it exists and is different from parent
48+
if (
49+
location.level === 3 &&
50+
location.country_uuid &&
51+
location.country_uuid !== location.parent_uuid
52+
) {
53+
const country = locationMap.get(location.country_uuid)
54+
if (country && country.uuid !== parent.uuid) {
55+
parts.push(getName(country))
56+
}
57+
}
58+
} else if (location.country_uuid) {
59+
// If parent not found but country exists, add country
4760
const country = locationMap.get(location.country_uuid)
48-
if (country && country.uuid !== location.parent_uuid) {
61+
if (country) {
4962
parts.push(getName(country))
5063
}
5164
}
@@ -154,28 +167,71 @@ const useLocationOptionsList = (
154167
// Process Level 2 with parent_uuid that weren't processed as children of Level 1
155168
level2WithParent.forEach((location) => {
156169
if (!options.some((opt) => opt.value === location.uuid)) {
157-
processLocation(location, 2)
170+
// Add level 2 location
171+
options.push({
172+
value: location.uuid,
173+
label: getLocationLabel(location),
174+
})
175+
176+
// Add its level 3 children
177+
const level3Children = level3WithParent.filter(
178+
(loc) => loc.parent_uuid === location.uuid
179+
)
180+
level3Children.sort(sortByName)
181+
182+
level3Children.forEach((child) => {
183+
options.push({
184+
value: child.uuid,
185+
label: getLocationLabel(child),
186+
})
187+
})
158188
}
159189
})
160190

161191
// Process Level 3 with parent_uuid that weren't processed as children of Level 2
192+
// BUT skip those whose parent is in level2WithoutParent (they'll be added with their parent)
162193
level3WithParent.forEach((location) => {
163194
if (!options.some((opt) => opt.value === location.uuid)) {
164-
options.push({
165-
value: location.uuid,
166-
label: getLocationLabel(location),
167-
})
195+
// Check if parent is in level2WithoutParent
196+
const parentIsOrphan = level2WithoutParent.some(
197+
(l2) => l2.uuid === location.parent_uuid
198+
)
199+
200+
// Only add if parent is not an orphan (without parent)
201+
if (!parentIsOrphan) {
202+
options.push({
203+
value: location.uuid,
204+
label: getLocationLabel(location),
205+
})
206+
}
168207
}
169208
})
170209

171-
// Step 6: Process Level 2 and Level 3 without parent_uuid last
210+
// Step 6: Process Level 2 without parent_uuid and their Level 3 children
172211
level2WithoutParent.forEach((location) => {
173212
options.push({
174213
value: location.uuid,
175214
label: getLocationLabel(location),
176215
})
216+
217+
// Add level 3 children that belong to this level 2 location
218+
const level3Children = level3WithParent.filter(
219+
(loc) => loc.parent_uuid === location.uuid
220+
)
221+
level3Children.sort(sortByName)
222+
223+
level3Children.forEach((child) => {
224+
// Only add if not already in options
225+
if (!options.some((opt) => opt.value === child.uuid)) {
226+
options.push({
227+
value: child.uuid,
228+
label: getLocationLabel(child),
229+
})
230+
}
231+
})
177232
})
178233

234+
// Process Level 3 without parent_uuid last
179235
level3WithoutParent.forEach((location) => {
180236
options.push({
181237
value: location.uuid,
@@ -189,7 +245,7 @@ const useLocationOptionsList = (
189245
}
190246

191247
return options
192-
}, [locations, locale, searchTerm])
248+
}, [locations, locale, searchTerm, showAllOption])
193249
}
194250

195251
export default useLocationOptionsList

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Referalah",
33
"description": "An open source online platform for people to connect each other",
4-
"version": "1.31.0",
4+
"version": "1.32.0",
55
"license": "Apache-2.0",
66
"scripts": {
77
"prepare": "husky install .husky",

0 commit comments

Comments
 (0)