Compare commits

..

23 Commits

Author SHA1 Message Date
6a823bf02e Merge branch 'main' into deployment/backend 2025-02-12 10:37:15 +00:00
Huy
0870f5a73d Merge pull request 'feat: Implement Login and Logout functionality, protect authenticated routes' (!12) from feature/oauth into main
All checks were successful
Release / Release (push) Successful in 33s
Reviewed-on: #12
Reviewed-by: lziemke <lea.z4@schule.bremen.de>
Reviewed-by: Constantin Simonis <constantin@simonis.lol>
2025-02-12 10:00:53 +00:00
Phan Huy Tran
13769e0df5 fix: Translate login to german 2025-02-12 11:00:29 +01:00
Phan Huy Tran
4b9574ac96 fix: fix routing 2025-02-12 11:00:29 +01:00
Phan Huy Tran
f6bcc1be11 Prettier and rebase 2025-02-12 11:00:29 +01:00
Phan Huy Tran
c3f9ba7bca Add nested route config for authentication 2025-02-12 11:00:29 +01:00
Phan Huy Tran
dc993b2879 Add alerts 2025-02-12 11:00:29 +01:00
Phan Huy Tran
53f21a220f Add logout and login functionality 2025-02-12 11:00:29 +01:00
Phan Huy Tran
f10de66c12 Refactor auth guard 2025-02-12 11:00:29 +01:00
Phan Huy Tran
fa30fc3305 Protect homepage with keycloak 2025-02-12 11:00:29 +01:00
a23a438a7e Merge pull request 'ci/semantic-versioning' (!14) from ci/semantic-versioning into main
All checks were successful
Release / Release (push) Successful in 1m34s
Reviewed-on: #14
Reviewed-by: Constantin Simonis <constantin@simonis.lol>
Reviewed-by: Huy <ptran@noreply@simonis.lol>
2025-02-12 09:54:14 +00:00
94ac9bd491
style(release.yml): format permissions section in YAML 2025-02-12 10:52:49 +01:00
f4541c5d86
ci: update branch name in release workflow config 2025-02-12 10:51:57 +01:00
774e55c6a6
ci: change runner to remote in release workflow 2025-02-12 10:50:51 +01:00
25ff804b76
ci: add master branch trigger for release workflow 2025-02-12 10:49:53 +01:00
002ddd6dbe Merge branch 'main' into ci/semantic-versioning
Some checks failed
Release / Release (push) Has been cancelled
2025-02-12 09:48:50 +00:00
ab9598950a
build: add release configuration for semantic release
Some checks are pending
Release / Release (push) Waiting to run
2025-02-12 10:47:23 +01:00
f31a959ec5
build: add Gitea release workflow configuration 2025-02-12 10:45:42 +01:00
Huy
9a8f9d5c41 Merge pull request 'feat: Implement homepage skeleton (CAS-30)' (!13) from feature/homepage into main
Reviewed-on: #13
Reviewed-by: Huy <ptran@noreply@simonis.lol>
Reviewed-by: jank1619 <jan@kjan.email>
2025-02-12 09:42:55 +00:00
Lea
7d4cfe1794 removed not used stuff 2025-02-12 10:31:12 +01:00
Lea
b010d49752 deleted sample request file 2025-02-12 10:26:28 +01:00
Lea
f5ae0e358c finished homepage skeleton 2025-02-12 10:21:41 +01:00
Lea
bbbf0a9473 homepage skeleton 2025-02-12 08:54:28 +01:00
10 changed files with 124 additions and 10 deletions

View File

@ -0,0 +1,27 @@
name: Release
on:
push:
branches:
- "main"
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
permissions:
contents: read
jobs:
release:
name: Release
runs-on: remote
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Create Release
uses: https://git.kjan.de/actions/semantic-release@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}

View File

@ -1,4 +1,8 @@
import { APP_INITIALIZER, ApplicationConfig, provideExperimentalZonelessChangeDetection } from '@angular/core';
import {
APP_INITIALIZER,
ApplicationConfig,
provideExperimentalZonelessChangeDetection,
} from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';

View File

@ -1,6 +1,16 @@
import { Routes } from '@angular/router';
import {LandingPageComponent} from "./landing-page/landing-page.component";
import { LandingPageComponent } from './landing-page/landing-page.component';
import { HomepageComponent } from './homepage/homepage/homepage.component';
import { authGuard } from './auth.guard';
export const routes: Routes = [
{ path: '', component: LandingPageComponent }
{
path: '',
component: LandingPageComponent,
},
{
path: 'home',
component: HomepageComponent,
canActivate: [authGuard],
}
];

View File

@ -2,15 +2,14 @@ import { CanActivateFn } from '@angular/router';
import { inject } from '@angular/core';
import { KeycloakService } from 'keycloak-angular';
export const authGuard: CanActivateFn = async (route, state) => {
export const authGuard: CanActivateFn = async () => {
const keycloakService = inject(KeycloakService);
const isLoggedIn = keycloakService.isLoggedIn();
if (isLoggedIn) {
return true;
} else {
keycloakService.login();
return false;
}
keycloakService.login();
return false;
};

View File

@ -0,0 +1,29 @@
<nav class="bg-black border-b border-amber-600/30 sticky top-0 z-50">
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
<!-- logo goes here -->
<div class="flex gap-4">
<button class="btn-primary" (click)="logout()">Ausloggen</button>
</div>
<div>
<button class="btn-primary">Benutzer</button>
</div>
</div>
</nav>
<div class="grid grid-cols-3">
<div class="w-1/3 h-1/4">
<p>Spiel Vorschau</p>
<p>Spiel Name</p>
<button type="button" class="btn-primary">Jetzt spielen</button>
</div>
<div class="w-1/3 h-1/4">
<p>Spiel Vorschau</p>
<p>Spiel Name</p>
<button type="button" class="btn-primary">Jetzt spielen</button>
</div>
<div class="w-1/3 h-1/4">
<p>Spiel Vorschau</p>
<p>Spiel Name</p>
<button type="button" class="btn-primary">Jetzt spielen</button>
</div>
</div>

View File

@ -0,0 +1,17 @@
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { KeycloakService } from 'keycloak-angular';
@Component({
selector: 'app-homepage',
standalone: true,
imports: [],
templateUrl: './homepage.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HomepageComponent {
private keycloakService: KeycloakService = inject(KeycloakService);
logout() {
this.keycloakService.logout();
}
}

View File

@ -0,0 +1 @@
<button (click)="login()">Einloggen</button>

View File

@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import { KeycloakService } from 'keycloak-angular';
@Component({
selector: 'app-landing-page',
@ -7,5 +8,9 @@ import { Component } from '@angular/core';
templateUrl: './landing-page.component.html',
})
export class LandingPageComponent {
private keycloakService: KeycloakService = inject(KeycloakService);
login() {
this.keycloakService.login();
}
}

View File

@ -1 +1,8 @@
@import "tailwindcss";
@import 'tailwindcss';
.btn-primary {
@apply px-4 py-2 cursor-pointer relative font-bold rounded-lg transition-all duration-300 ease-out transform-gpu hover:scale-105 will-change-transform bg-gradient-to-r from-emerald-500 to-emerald-400 text-black hover:shadow-xl hover:shadow-emerald-500/20;
}
.btn-secondary {
@apply px-4 py-2 cursor-pointer relative font-bold rounded-lg transition-all duration-300 ease-out transform-gpu hover:scale-105 will-change-transform bg-white/10 text-white hover:bg-white/20;
}

15
release.config.cjs Normal file
View File

@ -0,0 +1,15 @@
module.exports = {
branches: ['main'],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
["@saithodev/semantic-release-gitea", {
"giteaUrl": "https://git.simonis.lol"
}],
],
};