Skip to content

Commit

Permalink
Sort meta data teams alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Nov 27, 2024
1 parent 2e8e6ca commit 515a91b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package de.tum.in.www1.hephaestus.meta;

import de.tum.in.www1.hephaestus.gitprovider.team.TeamService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import de.tum.in.www1.hephaestus.gitprovider.team.TeamService;

@Service
public class MetaService {

private static final Logger logger = LoggerFactory.getLogger(MetaService.class);

@Autowired
Expand All @@ -24,6 +24,10 @@ public class MetaService {
public MetaDataDTO getMetaData() {
logger.info("Getting meta data...");
var teams = teamService.getAllTeams();
return new MetaDataDTO(teams, scheduledDay, scheduledTime);
return new MetaDataDTO(
teams.stream().sorted((team1, team2) -> team1.name().compareTo(team2.name())).toList(),
scheduledDay,
scheduledTime
);
}
}
4 changes: 2 additions & 2 deletions webapp/src/app/home/leaderboard/filter/team/team.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, computed, effect, input, signal } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Router, RouterLink } from '@angular/router';
import { Router } from '@angular/router';
import { BrnSelectModule } from '@spartan-ng/ui-select-brain';
import { HlmSelectModule } from '@spartan-ng/ui-select-helm';
import { HlmLabelModule } from '@spartan-ng/ui-label-helm';
Expand All @@ -14,7 +14,7 @@ interface SelectOption {
@Component({
selector: 'app-leaderboard-filter-team',
standalone: true,
imports: [RouterLink, BrnSelectModule, HlmSelectModule, HlmLabelModule, FormsModule],
imports: [BrnSelectModule, HlmSelectModule, HlmLabelModule, FormsModule],
templateUrl: './team.component.html'
})
export class LeaderboardFilterTeamComponent {
Expand Down

0 comments on commit 515a91b

Please sign in to comment.