Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Sort Teams in Metadata alphabetically #193

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
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
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
Loading