@stoker-platform/web-app 0.5.151 → 0.5.152
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/List.tsx +9 -14
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/List.tsx
CHANGED
|
@@ -740,23 +740,18 @@ export function List({
|
|
|
740
740
|
const field = getField(fields, columnId)
|
|
741
741
|
if (!isRelationField(field)) return 0
|
|
742
742
|
const titleField = field.titleField
|
|
743
|
+
let rawA: string
|
|
744
|
+
let rawB: string
|
|
743
745
|
if (titleField) {
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
(Object.values(rowB.original[field.name])[0] as StokerRecord)[titleField].toLowerCase()
|
|
749
|
-
? -1
|
|
750
|
-
: 0
|
|
746
|
+
const recordA = Object.values(rowA.original[field.name] ?? {})[0] as StokerRecord | undefined
|
|
747
|
+
const recordB = Object.values(rowB.original[field.name] ?? {})[0] as StokerRecord | undefined
|
|
748
|
+
rawA = recordA?.[titleField]?.toString().toLowerCase() ?? ""
|
|
749
|
+
rawB = recordB?.[titleField]?.toString().toLowerCase() ?? ""
|
|
751
750
|
} else {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
? 1
|
|
755
|
-
: (Object.keys(rowA.original[field.name])[0] as string) <
|
|
756
|
-
(Object.keys(rowB.original[field.name])[0] as string)
|
|
757
|
-
? -1
|
|
758
|
-
: 0
|
|
751
|
+
rawA = (Object.keys(rowA.original[field.name] ?? {})[0] ?? "").toLowerCase()
|
|
752
|
+
rawB = (Object.keys(rowB.original[field.name] ?? {})[0] ?? "").toLowerCase()
|
|
759
753
|
}
|
|
754
|
+
return rawA > rawB ? 1 : rawA < rawB ? -1 : 0
|
|
760
755
|
},
|
|
761
756
|
dateSortingFn: (rowA, rowB, columnId) => {
|
|
762
757
|
const valueA = getSortingValue(
|