Add frontend.
This commit is contained in:
@@ -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>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
15
cerberus/src/app/core/components/select/select.component.ts
Normal file
15
cerberus/src/app/core/components/select/select.component.ts
Normal 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 {
|
||||
}
|
||||
|
||||
}
|
||||
6
cerberus/src/app/core/entities/Application.ts
Normal file
6
cerberus/src/app/core/entities/Application.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export interface Application {
|
||||
id: string;
|
||||
name: string;
|
||||
serviceName: string;
|
||||
serviceType: string;
|
||||
}
|
||||
4
cerberus/src/app/core/entities/ReferentialData.ts
Normal file
4
cerberus/src/app/core/entities/ReferentialData.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export interface ReferentialData {
|
||||
value: string,
|
||||
label: string
|
||||
}
|
||||
16
cerberus/src/app/core/services/application.service.spec.ts
Normal file
16
cerberus/src/app/core/services/application.service.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
17
cerberus/src/app/core/services/application.service.ts
Normal file
17
cerberus/src/app/core/services/application.service.ts
Normal 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();
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
16
cerberus/src/app/core/services/referential-data.service.ts
Normal file
16
cerberus/src/app/core/services/referential-data.service.ts
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user