-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAK: montée version principale
- Loading branch information
Alain BOUDARD
committed
Apr 7, 2022
1 parent
df53d21
commit 6601da0
Showing
19 changed files
with
3,507 additions
and
4,718 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface Fileup { | ||
nameFile: string; | ||
urlFile: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<ul class="list-group"> | ||
<li *ngFor="let file of files$ | async" class="list-group-item d-flex justify-content-between align-items-center"> | ||
{{file.nameFile}} | ||
<span class="badge badge-primary badge-pill">14</span> | ||
</li> | ||
</ul> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ListComponent } from './list.component'; | ||
|
||
describe('ListComponent', () => { | ||
let component: ListComponent; | ||
let fixture: ComponentFixture<ListComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ ListComponent ] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(ListComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
import {FilesService} from "../../services/files.service"; | ||
import {Observable} from "rxjs"; | ||
import {Fileup} from "../../dto/fileup"; | ||
|
||
@Component({ | ||
selector: 'app-list', | ||
templateUrl: './list.component.html', | ||
styleUrls: ['./list.component.scss'] | ||
}) | ||
export class ListComponent implements OnInit { | ||
|
||
files$: Observable<Fileup[]>; | ||
|
||
constructor( | ||
private filesService: FilesService | ||
) { } | ||
|
||
ngOnInit(): void { | ||
this.files$ = this.filesService.getFiles(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
import { Injectable } from '@angular/core'; | ||
import {HttpClient } from '@angular/common/http'; | ||
import { Observable } from 'rxjs'; | ||
import {Fileup} from "../dto/fileup"; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class FilesService { | ||
|
||
endpoint = '/upload/'; | ||
|
||
constructor(private httpClient: HttpClient) {} | ||
|
||
postFile(fileToUpload: File): Observable<any> { | ||
const endpoint = '/upload/'; | ||
|
||
const formData: FormData = new FormData(); | ||
formData.append('fileUpload', fileToUpload, fileToUpload.name); | ||
|
||
return this.httpClient.post(endpoint, formData, { responseType: 'text' }); | ||
return this.httpClient.post(this.endpoint, formData, { responseType: 'text' }); | ||
} | ||
|
||
getFiles(): Observable<Fileup[]> { | ||
return this.httpClient.get<Fileup[]>(this.endpoint); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters