Class

InvestigationSortingHelper

InvestigationSortingHelper()

Helper class for investigation sorting, filtering, and grouping operations

Constructor

# new InvestigationSortingHelper()

View Source utils/investigation/sorting-helper.js, line 12

Methods

# applyGrouping(data, group, sortConfig) → {object}

Applies grouping to investigation data

Parameters:
Name Type Attributes Description
data object

Data containing items or sections

items Array.<IInvestigationListItemDto> <optional>

Optional items array

sections Array.<IInvestigationSection> <optional>

Optional sections array

group GroupType

The group type to apply

sortConfig IInvestigationSearchDto

Search configuration with sort options

View Source utils/investigation/sorting-helper.js, line 388

Data with grouping applied

object

# buildAuthorSections(items, sortConfig, currentUserIdopt) → {Array.<IInvestigationSection>}

Builds sections grouped by author with current user first

Parameters:
Name Type Attributes Description
items Array.<IInvestigationListItemDto>

Array of items to group

sortConfig IInvestigationSearchDto

Search configuration with sort options

currentUserId string <optional>

Optional current user ID to prioritize

View Source utils/investigation/sorting-helper.js, line 329

Array of sections grouped by author

Array.<IInvestigationSection>

# buildCurriculumGradeSections(items, sortConfig) → {Array.<IInvestigationSection>}

Builds sections grouped by curriculum and grade

Parameters:
Name Type Description
items Array.<IInvestigationListItemDto>

Array of items to group

sortConfig IInvestigationSearchDto

Search configuration with sort options

View Source utils/investigation/sorting-helper.js, line 245

Array of sections grouped by curriculum and grade

Array.<IInvestigationSection>

# buildCurriculumStatusSections(items, sortConfig) → {Array.<IInvestigationSection>}

Builds sections grouped by curriculum and status

Parameters:
Name Type Description
items Array.<IInvestigationListItemDto>

Array of items to group

sortConfig IInvestigationSearchDto

Search configuration with sort options

View Source utils/investigation/sorting-helper.js, line 299

Array of sections grouped by curriculum and status

Array.<IInvestigationSection>

# buildGradeSections(items, sortConfig) → {Array.<IInvestigationSection>}

Builds sections grouped by grade only

Parameters:
Name Type Description
items Array.<IInvestigationListItemDto>

Array of items to group

sortConfig IInvestigationSearchDto

Search configuration with sort options

View Source utils/investigation/sorting-helper.js, line 274

Array of sections grouped by grade

Array.<IInvestigationSection>

# buildSections(items, section, sortConfig) → {Array.<IInvestigationSection>}

Builds sections based on section type

Parameters:
Name Type Description
items Array.<IInvestigationListItemDto>

Array of items to group into sections

section SectionType

The section type

sortConfig IInvestigationSearchDto

Search configuration with sort options

View Source utils/investigation/sorting-helper.js, line 217

Array of sections

Array.<IInvestigationSection>

# compareGrades(a, b) → {number}

Compares two grades for sorting

Parameters:
Name Type Description
a string

First grade to compare

b string

Second grade to compare

View Source utils/investigation/sorting-helper.js, line 37

Comparison result

number

# compareUnitGrades(gradeA, gradeB) → {number}

Compares two unit grades

Parameters:
Name Type Description
gradeA string

First grade to compare

gradeB string

Second grade to compare

View Source utils/investigation/sorting-helper.js, line 111

Comparison result

number

# extractUnitIdentifier(unitStr) → {string|null}

Extracts unit identifier: "Unit 4.1: Title" → "4.1"

Parameters:
Name Type Description
unitStr string | null | undefined

The unit string to parse

View Source utils/investigation/sorting-helper.js, line 48

The unit identifier or null

string | null

# formatStatusDisplay(status) → {string}

Formats status for display

Parameters:
Name Type Description
status string

The status code

View Source utils/investigation/sorting-helper.js, line 236

Human-readable status string

string

# getSubjectOrder() → {Record.<string, number>}

Returns subject ordering map

View Source utils/investigation/sorting-helper.js, line 160

Map of subject names to sort order

Record.<string, number>

# getSurnameFromName(name) → {string}

Extracts surname from full name

Parameters:
Name Type Description
name string | null

The full name

View Source utils/investigation/sorting-helper.js, line 129

The surname or empty string

string

# getUnitGradeSortType(grade) → {number}

Gets sort type for unit grade: 0=K, 1=numeric, 2=other, 3=empty

Parameters:
Name Type Description
grade string

The grade string

View Source utils/investigation/sorting-helper.js, line 95

The sort type number

number

# gradeToSortValue(grade) → {number}

Converts grade to a sortable numeric value. Order: K=0, 1-12=1-12, P=13, B=14, C=15, other=99, empty=999

Parameters:
Name Type Description
grade string | null | undefined

The grade string

View Source utils/investigation/sorting-helper.js, line 22

Numeric sort value

number

# parseUnitGrade(unitStr) → {string}

Extracts grade from unit string: "Unit 4.1: Title" → "4"

Parameters:
Name Type Description
unitStr string | null | undefined

The unit string to parse

View Source utils/investigation/sorting-helper.js, line 84

The grade string or empty string

string

# parseUnitNumber(unitStr) → {number}

Parses unit number from unit string

Parameters:
Name Type Description
unitStr string | null | undefined

The unit string to parse

View Source utils/investigation/sorting-helper.js, line 67

The unit number or 999 if not found

number

# sortAuthorProfiles(profiles, currentUserIdopt) → {Array.<T>}

Sorts author profiles: current user first, then by surname A→Z

Parameters:
Name Type Attributes Description
profiles Array.<T>

Array of profiles to sort

currentUserId string <optional>

Optional current user ID to prioritize

View Source utils/investigation/sorting-helper.js, line 142

Sorted array of profiles

Array.<T>

# sortInvestigationItems(items, searchDto) → {Array.<IInvestigationListItemDto>}

Sorts investigation items based on search criteria

Parameters:
Name Type Description
items Array.<IInvestigationListItemDto>

Array of items to sort

searchDto IInvestigationSearchDto

Search configuration with sort options

View Source utils/investigation/sorting-helper.js, line 172

Sorted array of items

Array.<IInvestigationListItemDto>