Skip to content

Commit

Permalink
fix login and minor styling adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixTJDietrich committed Oct 27, 2024
1 parent dd37c8a commit 318c73b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface IssueCommentRepository extends JpaRepository<IssueComment, Long
LEFT JOIN FETCH ic.issue
LEFT JOIN FETCH ic.issue.repository
WHERE
ic.author.login = :authorLogin AND ic.createdAt >= :activitySince
ic.author.login ILIKE :authorLogin AND ic.createdAt >= :activitySince
AND (:onlyFromPullRequests = false OR ic.issue.htmlUrl LIKE '%/pull/%')
ORDER BY ic.createdAt DESC
""")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface PullRequestRepository extends JpaRepository<PullRequest, Long>
@Query("""
SELECT MIN(p.createdAt)
FROM PullRequest p
WHERE p.author.login = :authorLogin
WHERE p.author.login ILIKE :authorLogin
""")
Optional<OffsetDateTime> firstContributionByAuthorLogin(@Param("authorLogin") String authorLogin);

Expand All @@ -27,7 +27,7 @@ SELECT MIN(p.createdAt)
JOIN FETCH p.author
LEFT JOIN FETCH p.assignees
LEFT JOIN FETCH p.repository
WHERE (p.author.login = :assigneeLogin OR :assigneeLogin IN (SELECT u.login FROM p.assignees u)) AND p.state IN :states
WHERE (p.author.login ILIKE :assigneeLogin OR LOWER(:assigneeLogin) IN (SELECT LOWER(u.login) FROM p.assignees u)) AND p.state IN :states
ORDER BY p.createdAt DESC
""")
List<PullRequest> findAssignedByLoginAndStates(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public interface PullRequestReviewRepository extends JpaRepository<PullRequestRe
LEFT JOIN FETCH prr.pullRequest
LEFT JOIN FETCH prr.pullRequest.repository
LEFT JOIN FETCH prr.comments
WHERE prr.author.login = :authorLogin AND prr.submittedAt >= :activitySince
WHERE prr.author.login ILIKE :authorLogin AND prr.submittedAt >= :activitySince
ORDER BY prr.submittedAt DESC
""")
List<PullRequestReview> findAllByAuthorLoginSince(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface RepositoryRepository
SELECT r
FROM Repository r
JOIN PullRequest pr ON r.id = pr.repository.id
WHERE pr.author.login = :contributorLogin
WHERE pr.author.login ILIKE :contributorLogin
ORDER BY r.name ASC
""")
List<Repository> findContributedByLogin(@Param("contributorLogin") String contributorLogin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface UserRepository extends JpaRepository<User, Long> {
@Query("""
SELECT u
FROM User u
WHERE u.login = :login
WHERE u.login ILIKE :login
""")
Optional<User> findByLogin(@Param("login") String login);
}
4 changes: 1 addition & 3 deletions webapp/src/app/core/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<app-request-feature class="sm:hidden" iconOnly />
<app-theme-switcher />
@if (signedIn()) {
<button [brnMenuTriggerFor]="usermenu" class="ml-4">
<button [brnMenuTriggerFor]="usermenu" class="ml-2">
<hlm-avatar>
<img [src]="'https://github.com/' + user()!.username + '.png'" [alt]="user()?.name + '\'s avatar'" hlmAvatarImage />
<span hlmAvatarFallback>
Expand All @@ -25,9 +25,7 @@
<hlm-icon name="lucideUser" hlmMenuIcon />
<span>My Profile</span>
</a>

<hlm-menu-separator />

<button hlmMenuItem (click)="signOut()" class="cursor-pointer">
<hlm-icon name="lucideLogOut" hlmMenuIcon />
<span>Sign&nbsp;Out</span>
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/app/home/leaderboard/leaderboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class LeaderboardComponent {
user = this.securityStore.loadedUser;

trClass = (entry: LeaderboardEntry) => {
return cn('cursor-pointer', this.signedIn() && this.user()?.username === entry.user.login ? 'bg-emerald-950' : '');
return cn('cursor-pointer', this.signedIn() && this.user()?.username.toLowerCase() === entry.user.login.toLowerCase() ? 'bg-accent' : '');
};

leaderboard = input<LeaderboardEntry[]>();
Expand Down

0 comments on commit 318c73b

Please sign in to comment.