Add frontend.

This commit is contained in:
Florian THIERRY
2021-07-31 12:26:51 +02:00
parent ef04d3dbea
commit c281df00c7
56 changed files with 32276 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
<div class="container">
<select #select>
<option>Option 1</option>
<option>Option 2</option>
</select>
<div class="icon">
<mat-icon (click)="select.focus()">unfold_more</mat-icon>
</div>
</div>

View File

@@ -0,0 +1,39 @@
$btn-primary-background-top: #4ca4f6;
$btn-primary-background-bottom: #0073f7;
$select-icon-radius: 4px;
.container {
position: relative;
display: flex;
justify-content: center;
align-items: center;
select {
}
.icon {
position: absolute;
top: 0;
right: 0;
width: 1.5rem;
background-image: linear-gradient($btn-primary-background-top, $btn-primary-background-bottom);
color: white;
height: 23px;
top: 3px;
right: 0;
border-radius: 0 $select-icon-radius $select-icon-radius 0;
mat-icon {
font-size: 19px;
display: flex;
justify-content: center;
align-items: center;
&:hover {
cursor: default;
}
}
}
}

View File

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

View File

@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-select',
templateUrl: './select.component.html',
styleUrls: ['./select.component.scss']
})
export class SelectComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

View File

@@ -0,0 +1,6 @@
export interface Application {
id: string;
name: string;
serviceName: string;
serviceType: string;
}

View File

@@ -0,0 +1,4 @@
export interface ReferentialData {
value: string,
label: string
}

View File

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

View File

@@ -0,0 +1,17 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Application } from '../entities/Application';
@Injectable({
providedIn: 'root'
})
export class ApplicationService {
constructor(
private _httpClient: HttpClient
) {}
add(application: Application): Promise<Application> {
return this._httpClient.post<Application>('/api/applications', application).toPromise();
}
}

View File

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

View File

@@ -0,0 +1,16 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { ReferentialData } from '../entities/ReferentialData';
@Injectable({
providedIn: 'root'
})
export class ReferentialDataService {
constructor(
private _httpClient: HttpClient
) {}
getServiceTypes(): Promise<ReferentialData[]> {
return this._httpClient.get<ReferentialData[]>('/api/referentialData/serviceTypes').toPromise();
}
}