Commit 3772e6c5 authored by François Agneray's avatar François Agneray
Browse files

#1 => done

parent 1cf695fb
......@@ -9,7 +9,7 @@ list:
@echo " start > run a dev server for anis admin application (in memory)"
@echo " stop > stop the dev server for anis admin application"
@echo " restart > restart the dev server for anis admin (container)"
@echo " ng-build > generate the angular dist application (html, css, js)
@echo " ng-build > generate the angular dist application (html, css, js)"
@echo " log > display anis admin container logs"
@echo " debug > shell into anis admin container"
@echo ""
......
version: '3'
services:
anis-admin:
build: docker-conf-angular-cli
working_dir: /opt/app
command: ng serve --host=0.0.0.0 --disable-host-check --port 4201
ports:
- 4201:4201
volumes:
- .:/opt/app
\ No newline at end of file
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { Attribute, Option } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -13,22 +11,14 @@ export class AttributeService {
constructor(private http: HttpClient) { }
retrieveAttributes(datasetName: string) {
return this.http.get<{data: Attribute[]}>(this.API_PATH + '/' + datasetName + '/attribute').pipe(
map(res => res.data)
);
return this.http.get<Attribute[]>(this.API_PATH + '/' + datasetName + '/attribute');
}
retrieveOptions(datasetName: string) {
return this.http.get<{data: {id_attribute: number, options: Option[]}[]}>(this.API_PATH + '/' + datasetName + '/attribute/option')
.pipe(
map(res => res.data)
);
return this.http.get<{id_attribute: number, options: Option[]}[]>(this.API_PATH + '/' + datasetName + '/attribute/option');
}
editAttributeList(datasetName: string, attributeList: Attribute[]) {
return this.http.put<{data: Attribute[]}>(this.API_PATH + '/' + datasetName + '/attribute', attributeList)
.pipe(
map(res => res.data)
);
return this.http.put<Attribute[]>(this.API_PATH + '/' + datasetName + '/attribute', attributeList);
}
}
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { Category } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -13,9 +11,7 @@ export class CategoryService {
constructor(private http: HttpClient) { }
retrieveCategories() {
return this.http.get<{data: Category[]}>(this.API_PATH).pipe(
map(res => res.data)
);
return this.http.get<Category[]>(this.API_PATH);
}
addCategory(category: Category) {
......@@ -23,9 +19,7 @@ export class CategoryService {
}
editCategory(category: Category) {
return this.http.put<{data: Category}>(this.API_PATH + '/' + category.id, category).pipe(
map(res => res.data)
);
return this.http.put<Category>(this.API_PATH + '/' + category.id, category);
}
deleteCategory(category: Category) {
......
......@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { map } from 'rxjs/operators';
import { Login } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -14,9 +13,7 @@ export class CoreService {
constructor(private http: HttpClient) { }
login(login: {email: string, password: string}): Observable<Login> {
return this.http.post<{data: Login}>(this.API_PATH + '/login', login).pipe(
map(res => res.data)
);
return this.http.post<Login>(this.API_PATH + '/login/token', login);
}
resetConnectionToLocalstorage() {
......
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { Database } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -13,9 +11,7 @@ export class DatabaseService {
constructor(private http: HttpClient) { }
retrieveDatabases() {
return this.http.get<{data: Database[]}>(this.API_PATH).pipe(
map(res => res.data)
);
return this.http.get<Database[]>(this.API_PATH);
}
retrieveTables(idDatabase: number) {
......@@ -27,9 +23,7 @@ export class DatabaseService {
}
editDatabase(database: Database) {
return this.http.put<{data: Database}>(this.API_PATH + '/' + database.id, database).pipe(
map(res => res.data)
);
return this.http.put<Database>(this.API_PATH + '/' + database.id, database);
}
deleteDatabase(database: Database) {
......
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { Dataset } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -13,9 +11,7 @@ export class DatasetService {
constructor(private http: HttpClient) { }
retrieveDatasets() {
return this.http.get<{data: Dataset[]}>(this.API_PATH).pipe(
map(res => res.data)
);
return this.http.get<Dataset[]>(this.API_PATH);
}
addDataset(dataset: Dataset) {
......@@ -23,9 +19,7 @@ export class DatasetService {
}
editDataset(dataset: Dataset) {
return this.http.put<{data: Dataset}>(this.API_PATH + '/' + dataset.name, dataset).pipe(
map(res => res.data)
);
return this.http.put<Dataset>(this.API_PATH + '/' + dataset.name, dataset);
}
deleteDataset(dataset: Dataset) {
......
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { DatasetFamily, Family } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -13,9 +11,7 @@ export class FamilyService {
constructor(private http: HttpClient) { }
retrieveFamilies(type) {
return this.http.get<{data: DatasetFamily[] | Family[]}>(this.API_PATH + '/' + type).pipe(
map(res => res.data)
);
return this.http.get<DatasetFamily[] | Family[]>(this.API_PATH + '/' + type);
}
addFamily(family: DatasetFamily | Family) {
......@@ -23,9 +19,7 @@ export class FamilyService {
}
editFamily(family: DatasetFamily | Family) {
return this.http.put<{data: Family}>(this.API_PATH + '/' + family.type + '/' + family.id, family).pipe(
map(res => res.data)
);
return this.http.put<Family>(this.API_PATH + '/' + family.type + '/' + family.id, family);
}
deleteFamily(family: DatasetFamily | Family) {
......
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { File } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -13,9 +11,7 @@ export class FileService {
constructor(private http: HttpClient) { }
retrieveFiles(datasetName: string) {
return this.http.get<{data: File[]}>(this.API_PATH + '/dataset/' + datasetName + '/file').pipe(
map(res => res.data)
);
return this.http.get<File[]>(this.API_PATH + '/dataset/' + datasetName + '/file');
}
addFile(datasetName: string, file: File) {
......@@ -23,9 +19,7 @@ export class FileService {
}
editFile(file: File) {
return this.http.put<{data: File}>(this.API_PATH + '/file/' + file.id, file).pipe(
map(res => res.data)
);
return this.http.put<File>(this.API_PATH + '/file/' + file.id, file);
}
deleteFile(file: File) {
......
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { Project } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -13,9 +11,7 @@ export class ProjectService {
constructor(private http: HttpClient) { }
retrieveProjects() {
return this.http.get<{data: Project[]}>(this.API_PATH).pipe(
map(res => res.data)
);
return this.http.get<Project[]>(this.API_PATH);
}
addProject(project: Project) {
......@@ -23,9 +19,7 @@ export class ProjectService {
}
editProject(project: Project) {
return this.http.put<{data: Project}>(this.API_PATH + '/' + project.name, project).pipe(
map(res => res.data)
);
return this.http.put<Project>(this.API_PATH + '/' + project.name, project);
}
deleteProject(project: Project) {
......
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { SettingsSelect, SettingsSelectOption } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -13,15 +11,11 @@ export class SettingsService {
constructor(private http: HttpClient) { }
retrieveSettingsSelectList() {
return this.http.get<{data: SettingsSelect[]}>(this.API_PATH + '/select').pipe(
map(res => res.data)
);
return this.http.get<SettingsSelect[]>(this.API_PATH + '/select');
}
retrieveSettingsSelectOptionList() {
return this.http.get<{data: SettingsSelectOption[]}>(this.API_PATH + '/option').pipe(
map(res => res.data)
);
return this.http.get<SettingsSelectOption[]>(this.API_PATH + '/option');
}
addSettingsSelect(settingsSelect: SettingsSelect) {
......@@ -29,9 +23,7 @@ export class SettingsService {
}
editSettingsSelect(settingsSelect: SettingsSelect) {
return this.http.put<{data: SettingsSelect}>(this.API_PATH + '/select/' + settingsSelect.id, settingsSelect).pipe(
map(res => res.data)
);
return this.http.put<SettingsSelect>(this.API_PATH + '/select/' + settingsSelect.id, settingsSelect);
}
deleteSettingsSelect(settingsSelect: SettingsSelect) {
......@@ -46,9 +38,7 @@ export class SettingsService {
}
editSettingsSelectOption(settingsSelectOption: SettingsSelectOption) {
return this.http.put<{data: SettingsSelectOption}>(this.API_PATH + '/option/' + settingsSelectOption.id, settingsSelectOption).pipe(
map(res => res.data)
);
return this.http.put<SettingsSelectOption>(this.API_PATH + '/option/' + settingsSelectOption.id, settingsSelectOption);
}
deleteSettingsSelectOption(settingsSelectOption: SettingsSelectOption) {
......
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { map } from 'rxjs/operators';
import { Group } from '../shared/model';
import { environment } from '../../environments/environment';
......@@ -13,9 +11,7 @@ export class GroupService {
constructor(private http: HttpClient) { }
retrieveGroups() {
return this.http.get<{data: Group[]}>(this.API_PATH).pipe(
map(res => res.data)
);
return this.http.get<Group[]>(this.API_PATH);
}
addGroup(group: Group) {
......@@ -23,9 +19,7 @@ export class GroupService {
}
editGroup(group: Group) {
return this.http.put<{data: Group}>(this.API_PATH + '/' + group.id, group).pipe(
map(res => res.data)
);
return this.http.put<Group>(this.API_PATH + '/' + group.id, group);
}
deleteGroup(group: Group) {
......
......@@ -13,9 +13,7 @@ export class UserService {
constructor(private http: HttpClient) { }
retrieveUsers() {
return this.http.get<{data: User[]}>(this.API_PATH).pipe(
map(res => res.data)
);
return this.http.get<User[]>(this.API_PATH);
}
addUser(user: User) {
......@@ -23,9 +21,7 @@ export class UserService {
}
editUser(user: User) {
return this.http.put<{data: User}>(this.API_PATH + '/' + user.email, user).pipe(
map(res => res.data)
);
return this.http.put<User>(this.API_PATH + '/' + user.email, user);
}
deleteUser(user: User) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment