add frontend ng

This commit is contained in:
Tykayn 2025-10-03 11:56:55 +02:00 committed by tykayn
parent 80d52ff819
commit 83ef7bab6c
18 changed files with 188 additions and 4 deletions

View file

@ -0,0 +1 @@
<p>edit-form works!</p>

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { EditForm } from './edit-form';
describe('EditForm', () => {
let component: EditForm;
let fixture: ComponentFixture<EditForm>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [EditForm]
})
.compileComponents();
fixture = TestBed.createComponent(EditForm);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-edit-form',
imports: [],
templateUrl: './edit-form.html',
styleUrl: './edit-form.scss'
})
export class EditForm {
}

View file

@ -0,0 +1 @@
<p>osm works!</p>

View file

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { Osm } from './osm';
describe('Osm', () => {
let component: Osm;
let fixture: ComponentFixture<Osm>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [Osm]
})
.compileComponents();
fixture = TestBed.createComponent(Osm);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-osm',
imports: [],
templateUrl: './osm.html',
styleUrl: './osm.scss'
})
export class Osm {
}

View file

@ -0,0 +1 @@
<p>all-events works!</p>

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AllEvents } from './all-events';
describe('AllEvents', () => {
let component: AllEvents;
let fixture: ComponentFixture<AllEvents>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AllEvents]
})
.compileComponents();
fixture = TestBed.createComponent(AllEvents);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,11 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-all-events',
imports: [],
templateUrl: './all-events.html',
styleUrl: './all-events.scss'
})
export class AllEvents {
}

View file

@ -1,5 +1,6 @@
import { Component } from '@angular/core'; import { Component, inject } from '@angular/core';
import {Menu} from './menu/menu'; import {Menu} from './menu/menu';
import { OedbApi } from '../../services/oedb-api';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
@ -10,4 +11,12 @@ import {Menu} from './menu/menu';
styleUrl: './home.scss' styleUrl: './home.scss'
}) })
export class Home { export class Home {
OedbApi = inject(OedbApi);
constructor() {
this.OedbApi.getEvents({}).subscribe((events) => {
console.log(events);
});
}
} }

View file

@ -9,8 +9,6 @@
<input type="text" value="" placeholder="Rechercher une catégorie d'évènement"> <input type="text" value="" placeholder="Rechercher une catégorie d'évènement">
</div> </div>
<div id="what_categories"> <div id="what_categories">
@for (oedbc of oedb_what_categories; track $index) { @for (oedbc of oedb_what_categories; track $index) {
<div class="category"> <div class="category">
<div class="emoji"> <div class="emoji">
@ -63,8 +61,24 @@
<ul> <ul>
<li></li> <li></li>
</ul> </ul>
(bouton pour exporter) </div>
<div id="actions">
(actions)
<button class="button">exporter</button> <button class="button">exporter</button>
<button class="button">envoyer</button>
<button class="button">créer</button>
<button class="button">supprimer</button>
<button class="button">oui, toujours là</button>
<button class="button">non plus là</button>
<button class="button">pouet pouet!</button>
</div>
<div id="user_infos">
login OSM:
<a href="https://www.openstreetmap.org/user/tykayn">tykayn</a>
<br>
points de l'utilisateur:
12 points.
</div> </div>
</menu> </menu>

View file

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { OedbApi } from './oedb-api';
describe('OedbApi', () => {
let service: OedbApi;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(OedbApi);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View file

@ -0,0 +1,16 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class OedbApi {
private baseUrl = 'https://api.openeventdatabase.org';
constructor(private http: HttpClient) {
}
getEvents(params: any) {
return this.http.get(`${this.baseUrl}/event`, { params });
}
}

View file

@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { OsmAuth } from '../osm-auth';
describe('OsmAuth', () => {
let service: OsmAuth;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(OsmAuth);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View file

@ -0,0 +1,8 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class OsmAuth {
}