Skip to content

Commit

Permalink
Sort parameter on criteria page
Browse files Browse the repository at this point in the history
  • Loading branch information
askask committed Jun 17, 2024
1 parent e54a3d7 commit eba0da4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/core/services/aql-editor/aql-editor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { IArchetypeQueryBuilderResponse } from 'src/app/shared/models/archetype-
import { IContainmentNode } from 'src/app/shared/models/archetype-query-builder/template/containment-node.interface'
import { IEhrbaseTemplate } from 'src/app/shared/models/archetype-query-builder/template/ehrbase-template.interface'
import { IDictionary } from 'src/app/shared/models/dictionary.interface'
import { compareLocaleStringValues } from '../../utils/sort.utils'

@Injectable({
providedIn: 'root',
Expand All @@ -34,8 +35,11 @@ export class AqlEditorService {
getTemplates(): Observable<IEhrbaseTemplate[]> {
return this.httpClient.get<IEhrbaseTemplate[]>(`${this.baseUrl}/template`).pipe(
tap((templates) => {
this.templates = templates
this.templatesSubject$.next(templates)
const tempSorted = templates.sort((a, b) =>
compareLocaleStringValues(a.description, b.description, a.templateId, b.templateId, true)
)
this.templates = tempSorted
this.templatesSubject$.next(tempSorted)
}),
catchError(this.handleError)
)
Expand Down

0 comments on commit eba0da4

Please sign in to comment.