Compare commits

...

7 Commits

Author SHA1 Message Date
086f924d22 chore(deps): lock file maintenance
All checks were successful
Build / Build and analyze (pull_request) Successful in 1m40s
2024-10-01 06:01:18 +00:00
43cc6e96ec
style(hotel): fix string casing in Hotel interface
All checks were successful
Build / Build and analyze (push) Successful in 1m43s
2024-10-01 07:55:31 +02:00
8d1a676f5e
refactor(HotelItem): remove duplicate Input import
Some checks failed
Build / Build and analyze (push) Has been cancelled
2024-10-01 07:54:34 +02:00
eb9f11155a Merge pull request 'Add sonar-project.properties' (#7) from jank-patch-1 into master
All checks were successful
Build / Build and analyze (push) Successful in 1m40s
Reviewed-on: #7
2024-10-01 05:51:22 +00:00
fc013c8ee9 Add .gitea/workflows/build.yml
All checks were successful
Build / Build and analyze (pull_request) Successful in 1m40s
2024-10-01 05:49:05 +00:00
f9b2d998c6 Add sonar-project.properties 2024-10-01 05:48:28 +00:00
1cf47c6516
feat: add hotel service and integrate into app component 2024-10-01 07:45:24 +02:00
7 changed files with 3697 additions and 4553 deletions

@ -0,0 +1,30 @@
name: Build
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
# We do not recommend to use this in a pull request. Prefer using pull request
# decoration instead.
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

8129
package-lock.json generated

File diff suppressed because it is too large Load Diff

1
sonar-project.properties Normal file

@ -0,0 +1 @@
sonar.projectKey=Hotel-Manager

@ -1,6 +1,5 @@
import { Component } from "@angular/core";
import { Component, Input } from "@angular/core";
import { ChildComponent } from "../Child/child.component";
import { Input } from "@angular/core";
import { Hotel } from "./hotel";
import { CurrencyPipe } from "@angular/common";
import { FormsModule } from "@angular/forms";

@ -1,8 +1,8 @@
export interface Hotel {
hotelId: number;
hotelName: String;
description: String;
hotelName: string;
description: string;
price: number;
imageUrl: String;
imageUrl: string;
rating: number;
}

@ -0,0 +1,42 @@
import { Injectable } from "@angular/core";
import { Hotel } from "../../HotelItem/hotel";
@Injectable()
export class HotelService {
public getHotels(): Hotel[] {
return [
{
"hotelId": 1,
"hotelName": "Buea süßes Leben",
"description": "Schöne Aussicht am Meer",
"price": 230.5,
"imageUrl": "assets/img/1.jpg",
"rating": 3.5
},
{
"hotelId": 2,
"hotelName": "Marrakesch",
"description": "Genießen Sie den Blick auf die Berge",
"price": 145.5,
"imageUrl": "assets/img/2.jpg",
"rating": 5
},
{
"hotelId": 3,
"hotelName": "Abuja neuer Palast",
"description": "Kompletter Aufenthalt mit Autoservice",
"price": 120.12,
"imageUrl": "assets/img/3.jpg",
"rating": 4
},
{
"hotelId": 4,
"hotelName": "Kapstadt Stadt",
"description": "Wunderschönes Ambiente für Ihren Aufenthalt",
"price": 135.12,
"imageUrl": "assets/img/4.jpg",
"rating": 2.5
}
];
}
}

@ -3,16 +3,20 @@ import { HotelItem } from './HotelItem/HotelItem.component';
import { SearchComponent } from './Search/search.component';
import { UpperCasePipe } from '@angular/common';
import { TextPipe } from '../text.pipe';
import { HotelService } from './Parent/services/hotel.service';
import { inject } from '@angular/core';
@Component({
selector: 'app-root',
standalone: true,
imports: [HotelItem, SearchComponent, UpperCasePipe, TextPipe],
templateUrl: './app.component.html',
providers: [HotelService],
styleUrl: './app.component.css'
})
export class AppComponent {
public search: string = "";
public hotelService: HotelService = inject(HotelService);
public test() {
console.log(this.search);
@ -27,39 +31,6 @@ export class AppComponent {
return false;
}
public hotels = [
{
"hotelId": 1,
"hotelName": "Buea süßes Leben",
"description": "Schöne Aussicht am Meer",
"price": 230.5,
"imageUrl": "assets/img/1.jpg",
"rating": 3.5
},
{
"hotelId": 2,
"hotelName": "Marrakesch",
"description": "Genießen Sie den Blick auf die Berge",
"price": 145.5,
"imageUrl": "assets/img/2.jpg",
"rating": 5
},
{
"hotelId": 3,
"hotelName": "Abuja neuer Palast",
"description": "Kompletter Aufenthalt mit Autoservice",
"price": 120.12,
"imageUrl": "assets/img/3.jpg",
"rating": 4
},
{
"hotelId": 4,
"hotelName": "Kapstadt Stadt",
"description": "Wunderschönes Ambiente für Ihren Aufenthalt",
"price": 135.12,
"imageUrl": "assets/img/4.jpg",
"rating": 2.5
}
]
public hotels = this.hotelService.getHotels();
}