Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ui/src/app/search/rich-skill-search-results.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class RichSkillSearchResultsComponent extends SkillsListComponent impleme

title = "Search Results"

selectAllChecked = false
showSearchEmptyMessage = true
private multiplePagesSelected: boolean = false

Expand Down Expand Up @@ -80,18 +81,22 @@ export class RichSkillSearchResultsComponent extends SkillsListComponent impleme

handleSelectAll(selectAllChecked: boolean): void {
this.multiplePagesSelected = this.totalPageCount > 1
this.selectAllChecked = selectAllChecked
}

getSelectAllCount(): number {
return this.totalCount
}

handleClickAddCollection(action: TableActionDefinition, skill?: ApiSkillSummary): boolean {
const selectedSkills = this.getSelectedSkills(skill)

this.router.navigate(["/collections/add-skills"], {
// If there are selected skills, use them. Otherwise, use the search results.
state: {
selectedSkills: this.getSelectedSkills(skill),
totalCount: this.totalCount,
search: this.apiSearch
selectedSkills,
totalCount: this.selectAllChecked || !selectedSkills?.length ? this.totalCount : selectedSkills?.length,
search: this.selectAllChecked || !selectedSkills?.length ? this.apiSearch : undefined
} as ExtrasSelectedSkillsState
})
return false
Expand Down