add frontend angular
This commit is contained in:
parent
f34a5f0a83
commit
070e8435d8
36 changed files with 10209 additions and 6 deletions
|
@ -38,7 +38,7 @@ CURRENT_DATE = datetime(2025, 9, 15, 23, 0)
|
||||||
EVENT_TYPES = ["scheduled", "forecast", "unscheduled"]
|
EVENT_TYPES = ["scheduled", "forecast", "unscheduled"]
|
||||||
|
|
||||||
# Event categories (what)
|
# Event categories (what)
|
||||||
EVENT_CATEGORIES = ["traffic", "nature", "weather", "sport", "conference", "party"]
|
EVENT_CATEGORIES = ["traffic", "nature", "weather", "sport", "conference", "party", "community", "wildlife"]
|
||||||
|
|
||||||
# Sample locations (Paris, Lyon, Marseille, Toulouse, Bordeaux, Lille)
|
# Sample locations (Paris, Lyon, Marseille, Toulouse, Bordeaux, Lille)
|
||||||
SAMPLE_LOCATIONS = [
|
SAMPLE_LOCATIONS = [
|
||||||
|
|
17
frontend/.editorconfig
Normal file
17
frontend/.editorconfig
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Editor configuration, see https://editorconfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.ts]
|
||||||
|
quote_type = single
|
||||||
|
ij_typescript_use_double_quotes = false
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
max_line_length = off
|
||||||
|
trim_trailing_whitespace = false
|
42
frontend/.gitignore
vendored
Normal file
42
frontend/.gitignore
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
|
||||||
|
|
||||||
|
# Compiled output
|
||||||
|
/dist
|
||||||
|
/tmp
|
||||||
|
/out-tsc
|
||||||
|
/bazel-out
|
||||||
|
|
||||||
|
# Node
|
||||||
|
/node_modules
|
||||||
|
npm-debug.log
|
||||||
|
yarn-error.log
|
||||||
|
|
||||||
|
# IDEs and editors
|
||||||
|
.idea/
|
||||||
|
.project
|
||||||
|
.classpath
|
||||||
|
.c9/
|
||||||
|
*.launch
|
||||||
|
.settings/
|
||||||
|
*.sublime-workspace
|
||||||
|
|
||||||
|
# Visual Studio Code
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.history/*
|
||||||
|
|
||||||
|
# Miscellaneous
|
||||||
|
/.angular/cache
|
||||||
|
.sass-cache/
|
||||||
|
/connect.lock
|
||||||
|
/coverage
|
||||||
|
/libpeerconnection.log
|
||||||
|
testem.log
|
||||||
|
/typings
|
||||||
|
|
||||||
|
# System files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
59
frontend/README.md
Normal file
59
frontend/README.md
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
# Frontend
|
||||||
|
|
||||||
|
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 20.3.2.
|
||||||
|
|
||||||
|
## Development server
|
||||||
|
|
||||||
|
To start a local development server, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng serve
|
||||||
|
```
|
||||||
|
|
||||||
|
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
||||||
|
|
||||||
|
## Code scaffolding
|
||||||
|
|
||||||
|
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng generate component component-name
|
||||||
|
```
|
||||||
|
|
||||||
|
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng generate --help
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
To build the project run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng build
|
||||||
|
```
|
||||||
|
|
||||||
|
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
||||||
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running end-to-end tests
|
||||||
|
|
||||||
|
For end-to-end (e2e) testing, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ng e2e
|
||||||
|
```
|
||||||
|
|
||||||
|
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
||||||
|
|
||||||
|
## Additional Resources
|
||||||
|
|
||||||
|
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
98
frontend/angular.json
Normal file
98
frontend/angular.json
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
{
|
||||||
|
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||||
|
"version": 1,
|
||||||
|
"newProjectRoot": "projects",
|
||||||
|
"projects": {
|
||||||
|
"frontend": {
|
||||||
|
"projectType": "application",
|
||||||
|
"schematics": {
|
||||||
|
"@schematics/angular:component": {
|
||||||
|
"style": "scss"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"prefix": "app",
|
||||||
|
"architect": {
|
||||||
|
"build": {
|
||||||
|
"builder": "@angular/build:application",
|
||||||
|
"options": {
|
||||||
|
"browser": "src/main.ts",
|
||||||
|
"polyfills": [
|
||||||
|
"zone.js"
|
||||||
|
],
|
||||||
|
"tsConfig": "tsconfig.app.json",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "public"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.scss"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "500kB",
|
||||||
|
"maximumError": "1MB"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "4kB",
|
||||||
|
"maximumError": "8kB"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputHashing": "all"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"optimization": false,
|
||||||
|
"extractLicenses": false,
|
||||||
|
"sourceMap": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "production"
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"builder": "@angular/build:dev-server",
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"buildTarget": "frontend:build:production"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"buildTarget": "frontend:build:development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "development"
|
||||||
|
},
|
||||||
|
"extract-i18n": {
|
||||||
|
"builder": "@angular/build:extract-i18n"
|
||||||
|
},
|
||||||
|
"test": {
|
||||||
|
"builder": "@angular/build:karma",
|
||||||
|
"options": {
|
||||||
|
"polyfills": [
|
||||||
|
"zone.js",
|
||||||
|
"zone.js/testing"
|
||||||
|
],
|
||||||
|
"tsConfig": "tsconfig.spec.json",
|
||||||
|
"inlineStyleLanguage": "scss",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "public"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"styles": [
|
||||||
|
"src/styles.scss"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9649
frontend/package-lock.json
generated
Normal file
9649
frontend/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
48
frontend/package.json
Normal file
48
frontend/package.json
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{
|
||||||
|
"name": "frontend",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"scripts": {
|
||||||
|
"ng": "ng",
|
||||||
|
"start": "ng serve",
|
||||||
|
"build": "ng build",
|
||||||
|
"watch": "ng build --watch --configuration development",
|
||||||
|
"test": "ng test"
|
||||||
|
},
|
||||||
|
"prettier": {
|
||||||
|
"printWidth": 100,
|
||||||
|
"singleQuote": true,
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "*.html",
|
||||||
|
"options": {
|
||||||
|
"parser": "angular"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"private": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@angular/common": "^20.3.0",
|
||||||
|
"@angular/compiler": "^20.3.0",
|
||||||
|
"@angular/core": "^20.3.0",
|
||||||
|
"@angular/forms": "^20.3.0",
|
||||||
|
"@angular/platform-browser": "^20.3.0",
|
||||||
|
"@angular/router": "^20.3.0",
|
||||||
|
"rxjs": "~7.8.0",
|
||||||
|
"tslib": "^2.3.0",
|
||||||
|
"zone.js": "~0.15.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@angular/build": "^20.3.2",
|
||||||
|
"@angular/cli": "^20.3.2",
|
||||||
|
"@angular/compiler-cli": "^20.3.0",
|
||||||
|
"@types/jasmine": "~5.1.0",
|
||||||
|
"jasmine-core": "~5.9.0",
|
||||||
|
"karma": "~6.4.0",
|
||||||
|
"karma-chrome-launcher": "~3.2.0",
|
||||||
|
"karma-coverage": "~2.2.0",
|
||||||
|
"karma-jasmine": "~5.1.0",
|
||||||
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
|
"typescript": "~5.9.2"
|
||||||
|
}
|
||||||
|
}
|
BIN
frontend/public/favicon.ico
Normal file
BIN
frontend/public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
12
frontend/src/app/app.config.ts
Normal file
12
frontend/src/app/app.config.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';
|
||||||
|
import { provideRouter } from '@angular/router';
|
||||||
|
|
||||||
|
import { routes } from './app.routes';
|
||||||
|
|
||||||
|
export const appConfig: ApplicationConfig = {
|
||||||
|
providers: [
|
||||||
|
provideBrowserGlobalErrorListeners(),
|
||||||
|
provideZoneChangeDetection({ eventCoalescing: true }),
|
||||||
|
provideRouter(routes)
|
||||||
|
]
|
||||||
|
};
|
25
frontend/src/app/app.html
Normal file
25
frontend/src/app/app.html
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||||
|
<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->
|
||||||
|
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->
|
||||||
|
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * -->
|
||||||
|
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||||
|
<!-- * * * * * * * * * Delete the template below * * * * * * * * * -->
|
||||||
|
<!-- * * * * * * * to get started with your project! * * * * * * * -->
|
||||||
|
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<main class="main">
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<h1>OEDB</h1>
|
||||||
|
<button class="login">login OSM</button>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<router-outlet/>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</main>
|
9
frontend/src/app/app.routes.ts
Normal file
9
frontend/src/app/app.routes.ts
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import { Routes } from '@angular/router';
|
||||||
|
import {Home} from './pages/home/home';
|
||||||
|
|
||||||
|
export const routes: Routes = [
|
||||||
|
{
|
||||||
|
path : '',
|
||||||
|
component: Home
|
||||||
|
}
|
||||||
|
];
|
3
frontend/src/app/app.scss
Normal file
3
frontend/src/app/app.scss
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
html{
|
||||||
|
font-family: "Calibri", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
}
|
23
frontend/src/app/app.spec.ts
Normal file
23
frontend/src/app/app.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
import { App } from './app';
|
||||||
|
|
||||||
|
describe('App', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [App],
|
||||||
|
}).compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create the app', () => {
|
||||||
|
const fixture = TestBed.createComponent(App);
|
||||||
|
const app = fixture.componentInstance;
|
||||||
|
expect(app).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should render title', () => {
|
||||||
|
const fixture = TestBed.createComponent(App);
|
||||||
|
fixture.detectChanges();
|
||||||
|
const compiled = fixture.nativeElement as HTMLElement;
|
||||||
|
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, frontend');
|
||||||
|
});
|
||||||
|
});
|
12
frontend/src/app/app.ts
Normal file
12
frontend/src/app/app.ts
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import { Component, signal } from '@angular/core';
|
||||||
|
import { RouterOutlet } from '@angular/router';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-root',
|
||||||
|
imports: [RouterOutlet],
|
||||||
|
templateUrl: './app.html',
|
||||||
|
styleUrl: './app.scss'
|
||||||
|
})
|
||||||
|
export class App {
|
||||||
|
protected readonly title = signal('frontend');
|
||||||
|
}
|
14
frontend/src/app/pages/home/home.html
Normal file
14
frontend/src/app/pages/home/home.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<p>home works!</p>
|
||||||
|
<div class="aside">
|
||||||
|
OpenEventDatabase
|
||||||
|
<a href="/demo/stats">stats</a>
|
||||||
|
<a href="https://source.cipherbliss.com/tykayn/oedb-backend">sources</a>
|
||||||
|
</div>
|
||||||
|
<div class="main">
|
||||||
|
main part
|
||||||
|
<br>
|
||||||
|
<div id="map">
|
||||||
|
|
||||||
|
(map)
|
||||||
|
</div>
|
||||||
|
</div>
|
28
frontend/src/app/pages/home/home.scss
Normal file
28
frontend/src/app/pages/home/home.scss
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
:host{
|
||||||
|
header{
|
||||||
|
background: #00acc1;
|
||||||
|
position: fixed;
|
||||||
|
top: 0 ;
|
||||||
|
width: 100vw;
|
||||||
|
min-height: 1rem;
|
||||||
|
}
|
||||||
|
main{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: start;
|
||||||
|
align-content: center;
|
||||||
|
}
|
||||||
|
.aside{
|
||||||
|
background: #fff8f8;
|
||||||
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
width : 0;
|
||||||
|
&.expanded{
|
||||||
|
width: 300px;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#map{
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
}
|
23
frontend/src/app/pages/home/home.spec.ts
Normal file
23
frontend/src/app/pages/home/home.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { Home } from './home';
|
||||||
|
|
||||||
|
describe('Home', () => {
|
||||||
|
let component: Home;
|
||||||
|
let fixture: ComponentFixture<Home>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [Home]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(Home);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
11
frontend/src/app/pages/home/home.ts
Normal file
11
frontend/src/app/pages/home/home.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-home',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './home.html',
|
||||||
|
styleUrl: './home.scss'
|
||||||
|
})
|
||||||
|
export class Home {
|
||||||
|
|
||||||
|
}
|
1
frontend/src/app/pages/home/menu/menu.html
Normal file
1
frontend/src/app/pages/home/menu/menu.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<p>menu works!</p>
|
0
frontend/src/app/pages/home/menu/menu.scss
Normal file
0
frontend/src/app/pages/home/menu/menu.scss
Normal file
23
frontend/src/app/pages/home/menu/menu.spec.ts
Normal file
23
frontend/src/app/pages/home/menu/menu.spec.ts
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { Menu } from './menu';
|
||||||
|
|
||||||
|
describe('Menu', () => {
|
||||||
|
let component: Menu;
|
||||||
|
let fixture: ComponentFixture<Menu>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [Menu]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(Menu);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
11
frontend/src/app/pages/home/menu/menu.ts
Normal file
11
frontend/src/app/pages/home/menu/menu.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-menu',
|
||||||
|
imports: [],
|
||||||
|
templateUrl: './menu.html',
|
||||||
|
styleUrl: './menu.scss'
|
||||||
|
})
|
||||||
|
export class Menu {
|
||||||
|
|
||||||
|
}
|
13
frontend/src/index.html
Normal file
13
frontend/src/index.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Frontend</title>
|
||||||
|
<base href="/">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<app-root></app-root>
|
||||||
|
</body>
|
||||||
|
</html>
|
6
frontend/src/main.ts
Normal file
6
frontend/src/main.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { bootstrapApplication } from '@angular/platform-browser';
|
||||||
|
import { appConfig } from './app/app.config';
|
||||||
|
import { App } from './app/app';
|
||||||
|
|
||||||
|
bootstrapApplication(App, appConfig)
|
||||||
|
.catch((err) => console.error(err));
|
1
frontend/src/styles.scss
Normal file
1
frontend/src/styles.scss
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/* You can add global styles to this file, and also import other style files */
|
15
frontend/tsconfig.app.json
Normal file
15
frontend/tsconfig.app.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/app",
|
||||||
|
"types": []
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"src/**/*.spec.ts"
|
||||||
|
]
|
||||||
|
}
|
34
frontend/tsconfig.json
Normal file
34
frontend/tsconfig.json
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
|
{
|
||||||
|
"compileOnSave": false,
|
||||||
|
"compilerOptions": {
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"importHelpers": true,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "preserve"
|
||||||
|
},
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
|
"strictInjectionParameters": true,
|
||||||
|
"strictInputAccessModifiers": true,
|
||||||
|
"typeCheckHostBindings": true,
|
||||||
|
"strictTemplates": true
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.app.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.spec.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
14
frontend/tsconfig.spec.json
Normal file
14
frontend/tsconfig.spec.json
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
||||||
|
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "./out-tsc/spec",
|
||||||
|
"types": [
|
||||||
|
"jasmine"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*.ts"
|
||||||
|
]
|
||||||
|
}
|
|
@ -1020,7 +1020,7 @@ class DemoMainResource:
|
||||||
const userInfoPanel = document.getElementById('user-info-panel');
|
const userInfoPanel = document.getElementById('user-info-panel');
|
||||||
|
|
||||||
// Only show the panel if the user has a username or points
|
// Only show the panel if the user has a username or points
|
||||||
if (username || points) {
|
if ((username || points) && userInfoPanel) {
|
||||||
userInfoPanel.style.display = 'block';
|
userInfoPanel.style.display = 'block';
|
||||||
|
|
||||||
// Update username display
|
// Update username display
|
||||||
|
|
|
@ -94,7 +94,7 @@ window.EVENT_TYPES = {
|
||||||
description: 'Fermeture partielle de voie'
|
description: 'Fermeture partielle de voie'
|
||||||
},
|
},
|
||||||
'traffic.roadwork': {
|
'traffic.roadwork': {
|
||||||
emoji: '⛑️',
|
emoji: '<img src="static/cone.png" class="icone cone" />',
|
||||||
label: 'Travaux routiers',
|
label: 'Travaux routiers',
|
||||||
category: 'Circulation',
|
category: 'Circulation',
|
||||||
description: 'Travaux sur la chaussée'
|
description: 'Travaux sur la chaussée'
|
||||||
|
@ -117,6 +117,7 @@ window.EVENT_TYPES = {
|
||||||
category: 'Danger',
|
category: 'Danger',
|
||||||
description: 'Des pirana attaquent dans cette piscine'
|
description: 'Des pirana attaquent dans cette piscine'
|
||||||
}
|
}
|
||||||
|
// ici ajouter d'autres catégories d'évènements à suggérer
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fonction pour obtenir les suggestions d'autocomplétion
|
// Fonction pour obtenir les suggestions d'autocomplétion
|
||||||
|
|
|
@ -3,7 +3,7 @@ const map = new maplibregl.Map({
|
||||||
container: 'map',
|
container: 'map',
|
||||||
style: 'https://tiles.openfreemap.org/styles/liberty',
|
style: 'https://tiles.openfreemap.org/styles/liberty',
|
||||||
center: [2.3522, 48.8566], // Default center (Paris)
|
center: [2.3522, 48.8566], // Default center (Paris)
|
||||||
zoom: 4
|
zoom: 3
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add navigation controls
|
// Add navigation controls
|
||||||
|
|
|
@ -676,6 +676,13 @@ function fillForm(issueType) {
|
||||||
typeSelect.value = 'unscheduled';
|
typeSelect.value = 'unscheduled';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'traffic_mammoth':
|
||||||
|
whatInput.value = 'traffic.mammoth';
|
||||||
|
labelInput.value = 'Obstacle';
|
||||||
|
descriptionInput.value = 'Circulation dense, mammouth laineux en obstacle';
|
||||||
|
typeSelect.value = 'unscheduled';
|
||||||
|
break;
|
||||||
|
|
||||||
// === RAIL TAB ===
|
// === RAIL TAB ===
|
||||||
case 'rail_delay':
|
case 'rail_delay':
|
||||||
whatInput.value = 'transport.rail.delay';
|
whatInput.value = 'transport.rail.delay';
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
zoom: 4
|
zoom: 4
|
||||||
});
|
});
|
||||||
map.addControl(new maplibregl.NavigationControl());
|
map.addControl(new maplibregl.NavigationControl());
|
||||||
fetch('/event?what={{ selected_what }}&limit=500')
|
fetch('https://api.openeventdatabase.org/event?what={{ selected_what }}&limit=500')
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (!data.features || !data.features.length) return;
|
if (!data.features || !data.features.length) return;
|
||||||
|
|
|
@ -109,6 +109,10 @@
|
||||||
<i class="fas fa-traffic-light"></i>
|
<i class="fas fa-traffic-light"></i>
|
||||||
Embouteillage
|
Embouteillage
|
||||||
</div>
|
</div>
|
||||||
|
<div class="issue-button road traffic-jam" onclick="fillForm('traffic_mammoth')">
|
||||||
|
<i class="fas fa-traffic-light"></i>
|
||||||
|
Mammouth
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
BIN
static/cone.png
Normal file
BIN
static/cone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 171 KiB |
|
@ -94,7 +94,7 @@ window.EVENT_TYPES = {
|
||||||
description: 'Fermeture partielle de voie'
|
description: 'Fermeture partielle de voie'
|
||||||
},
|
},
|
||||||
'traffic.roadwork': {
|
'traffic.roadwork': {
|
||||||
emoji: '⛑️',
|
emoji: '<img src="static/cone.png" class="icone cone" />',
|
||||||
label: 'Travaux routiers',
|
label: 'Travaux routiers',
|
||||||
category: 'Circulation',
|
category: 'Circulation',
|
||||||
description: 'Travaux sur la chaussée'
|
description: 'Travaux sur la chaussée'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue