Commit cc53af32 authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch 'develop' into 'master'

Develop

See merge request !100
parents 8578a328 afed17c1
......@@ -2,13 +2,11 @@ stages:
- install
- test
- sonar
- build-coverage
- build
- deploy
- deploy-coverage
variables:
VERSION: "3.0"
VERSION: "3.1"
SONARQUBE_URL: https://sonarqube.lam.fr
CONTAINER_IMAGE: portus.lam.fr/anis/anis-client
COVERAGE_IMAGE: portus.lam.fr/anis/anis-client-coverage
......@@ -66,24 +64,6 @@ sonar_scanner:
refs:
- develop
build-coverage:
image: docker:stable
stage: build-coverage
script:
- echo "FROM nginx" > var/Dockerfile
- echo "COPY coverage /usr/share/nginx/html" >> var/Dockerfile
- docker login -u fagneray -p $PORTUS_TOKEN portus.lam.fr
- docker pull $COVERAGE_IMAGE:latest || true
- docker build --cache-from $COVERAGE_IMAGE:latest -t $COVERAGE_IMAGE:latest var
- docker push $COVERAGE_IMAGE:latest
cache:
paths:
- var
policy: pull
only:
refs:
- develop
build:
image: docker:stable
stage: build
......@@ -106,16 +86,6 @@ deploy:
script:
- apk add --update curl
- curl -XPOST $DEV_WEBHOOK
only:
refs:
- develop
deploy-coverage:
image: alpine
stage: deploy-coverage
script:
- apk add --update curl
- curl -XPOST $COVERAGE_WEBHOOK
only:
refs:
- develop
\ No newline at end of file
......@@ -4,14 +4,55 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.0.3] - 2019-10-21
## [3.2.0] - 2020-04
### Added
- Display anis-client and anis-server versions.
- Add detail page for an object.
- #69 => User can change the number of object displayable (10, 20, 50, 100) in result datatable
- #70 => User can sort columns in result datatable
- #71 => User can dowload results in CSV and ASCII formats
- #72 => Display information about available criteria and outputs in summary box
### Fixed
- #32 => Criteria components with default value did not work
- #79 => Repair and improve component checkbox + test
- #80 => Search type field + IN or NOT IN didn't work
- #63 => If no outputs selectionned, request cannot work
### Changed
- #76 => Adding label min and max for the between component
- #73 => Result page design improved
- #83 => Upgrade dependencies
- #86 => Renderers in result section optimizedS
### Security
- Migrate to Angular v8 to v9
- Migrate from anis-server v3.1 to 3.2
- Migrate from anis-auth v3.1 to 3.2
## [3.1.0] - 2020-03
### Added
- Unit tests added
- Scroll to top on new page added
- Operators are visible on search form
### Changed
- Detail-link and detail-btn renderers refactored
- Update datasets display to accordion
- Password fields can be visible
- Search form design updated to integrate operators
### Fixed
- Migrate from anis-server v3.0.3 to 3.1
- Migrate to anis-auth v3.1
## [3.0.3] - 2019-10
### Added
- Display anis-client and anis-server versions
- Add detail page for an object
### Changed
- Fix ordering by diplay for options in Criteria step.
- Design ouputs selection.
- Fix ordering by diplay for options in Criteria step
- Design ouputs selection
### Fixed
- Fix bug renderer external links.
\ No newline at end of file
- Fix bug renderer external links
\ No newline at end of file
......@@ -17,7 +17,7 @@ list:
@echo " test > run $(NAME_APP) tests"
@echo " test-watch > run $(NAME_APP) tests on every file change"
@echo " report > open the code coverage report in a browser (only available for Linux)"
@echo " dist > generate the angular dist application (html, css, js)"
@echo " build > generate the angular dist application (html, css, js)"
@echo " logs > display $(NAME_APP) container logs"
@echo " shell > shell into $(NAME_APP) container"
@echo ""
......@@ -54,7 +54,7 @@ test-watch:
report:
xdg-open var/coverage/index.html
dist:
build:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
-v $(CURDIR):/project \
-w /project anis-node ng build --prod
......
......@@ -18,7 +18,7 @@
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
......@@ -48,7 +48,6 @@
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
......@@ -81,7 +80,7 @@
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"codeCoverageExclude": ["node_modules/**", "src/settings/test-data/**"],
"codeCoverageExclude": ["node_modules/**", "src/settings/test-data/**", "src/**/*.spec.ts"],
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
......
......@@ -5,6 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive
# Yarn
RUN yarn global add @angular/cli
RUN ng config -g cli.packageManager yarn
RUN ng config -g cli.warnings.versionMismatch false
# Chromium
RUN apt-get update \
......
This diff is collapsed.
......@@ -11,36 +11,38 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~8.0.1",
"@angular/common": "~8.0.1",
"@angular/compiler": "~8.0.1",
"@angular/core": "~8.0.1",
"@angular/forms": "~8.0.1",
"@angular/platform-browser": "~8.0.1",
"@angular/platform-browser-dynamic": "~8.0.1",
"@angular/router": "~8.0.1",
"@fortawesome/fontawesome-free": "^5.9.0",
"@ng-select/ng-select": "^2.20.0",
"@ngrx/effects": "^8.0.1",
"@ngrx/router-store": "^8.0.1",
"@ngrx/store": "^8.0.1",
"@ngrx/store-devtools": "^8.0.1",
"bootstrap": "^4.3.1",
"ngx-bootstrap": "^4.3.0",
"@angular/animations": "~9.1.1",
"@angular/common": "~9.1.1",
"@angular/compiler": "~9.1.1",
"@angular/core": "~9.1.1",
"@angular/forms": "~9.1.1",
"@angular/platform-browser": "~9.1.1",
"@angular/platform-browser-dynamic": "~9.1.1",
"@angular/router": "~9.1.1",
"@fortawesome/fontawesome-free": "^5.13.0",
"@ng-select/ng-select": "^4.0.0",
"@ngrx/effects": "^9.1.0",
"@ngrx/router-store": "^9.1.0",
"@ngrx/store": "^9.1.0",
"@ngrx/store-devtools": "^9.1.0",
"bootstrap": "^4.4.1",
"d3": "^5.15.1",
"ngx-bootstrap": "^5.6.1",
"ngx-json-viewer": "^2.4.0",
"ngx-toastr": "^10.0.4",
"rxjs": "~6.4.0",
"ngx-toastr": "^12.0.1",
"rxjs": "~6.5.4",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.0",
"@angular/cli": "~8.0.3",
"@angular/compiler-cli": "~8.0.1",
"@angular/language-service": "~8.0.1",
"@angular-devkit/build-angular": "~0.901.1",
"@angular/cli": "~9.1.1",
"@angular/compiler-cli": "~9.1.1",
"@angular/language-service": "~9.1.1",
"@types/d3": "^5.7.2",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"@types/node": "^12.11.1",
"codelyzer": "^5.0.0",
"intl": "^1.2.5",
"jasmine-core": "~3.4.0",
......@@ -53,6 +55,6 @@
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
"typescript": "~3.7.5"
}
}
......@@ -4,7 +4,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule } from '@angular/common/http';
import { StoreModule } from '@ngrx/store';
import { StoreRouterConnectingModule, RouterStateSerializer } from '@ngrx/router-store';
import { StoreRouterConnectingModule, RouterState } from '@ngrx/router-store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { EffectsModule } from '@ngrx/effects';
......@@ -24,18 +24,30 @@ import { environment } from '../environments/environment';
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
StoreModule.forRoot(reducers, { metaReducers }),
StoreRouterConnectingModule.forRoot(),
!environment.production ? StoreDevtoolsModule.instrument() : [],
EffectsModule.forRoot([]),
CoreModule,
StaticModule,
LoginModule,
SearchModule,
DetailModule,
AppRoutingModule
StoreModule.forRoot(reducers, {
metaReducers,
runtimeChecks: {
strictStateImmutability: true,
strictActionImmutability: true,
strictStateSerializability: true,
strictActionSerializability: true,
strictActionWithinNgZone: true
}
}),
AppRoutingModule,
StoreRouterConnectingModule.forRoot({
serializer: CustomRouterStateSerializer,
routerState: RouterState.Minimal,
}),
!environment.production ? StoreDevtoolsModule.instrument() : [],
EffectsModule.forRoot([])
],
providers: [{ provide: RouterStateSerializer, useClass: CustomRouterStateSerializer }],
// providers: [{ provide: RouterStateSerializer, useClass: CustomRouterStateSerializer }],
bootstrap: [AppComponent]
})
export class AppModule { }
......@@ -2,7 +2,8 @@ import { NgModule, Optional, SkipSelf } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { CollapseModule, BsDropdownModule } from 'ngx-bootstrap';
import { CollapseModule } from 'ngx-bootstrap/collapse';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { AppComponent } from './containers/app.component';
import { NotFoundPageComponent } from './containers/not-found-page.component';
......
import { ObjectDisplayComponent } from './object-display.component';
import { SpectraGraphComponent } from './spectra-graph/spectra-graph.component';
export const dummiesComponents = [
ObjectDisplayComponent
ObjectDisplayComponent,
SpectraGraphComponent
];
<div class="row">
<table class="table table-striped table-bordered">
<tr *ngFor="let attribute of getAttributesVisible()">
<th>{{ attribute.form_label }}</th>
<td>{{ object[attribute.label] }}</td>
</tr>
</table>
<div *ngIf="getAttributeSpectraGraph()" class="col col-md-8 col-sm-12">
<div *ngIf="spectraIsLoading" id="div-spinner" class="text-center">
<span class="fas fa-circle-notch fa-spin fa-3x"></span>
<span class="sr-only">Loading...</span>
</div>
<app-spectra-graph *ngIf="spectraIsLoaded" [z]="getZ()" [spectraCSV]="spectraCSV"></app-spectra-graph>
</div>
<div [ngClass]="{'col-md-4 col-sm-12': getAttributeSpectraGraph()}" class="col mt-4">
<div *ngIf="getAttributeBySearchFlag('RA') && getAttributeBySearchFlag('DEC')" class="row">
<div class="col-12">
<table class="table">
<tr>
<th>Alpha</th>
<th>Delta</th>
<th class="text-center" rowspan="2"><img src="assets/cesam_anis80.png" alt="CeSAM logo" /></th>
</tr>
<tr>
<td>{{ object[getAttributeBySearchFlag('RA').label] }}</td>
<td>{{ object[getAttributeBySearchFlag('DEC').label] }}</td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="table-responsive">
<table class="table">
<tr *ngFor="let attribute of getAttributesVisible()">
<th>{{ attribute.form_label }}</th>
<td>{{ object[attribute.label] }}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -23,8 +23,8 @@ describe('[Detail] Component: ObjectDisplayComponent', () => {
max: null,
placeholder_min: null,
placeholder_max: null,
uri_action: null,
renderer: 'detail-btn',
renderer: 'detail',
renderer_config: null,
display_detail: 10,
selected: true,
order_by: false,
......@@ -58,8 +58,8 @@ describe('[Detail] Component: ObjectDisplayComponent', () => {
max: null,
placeholder_min: null,
placeholder_max: null,
uri_action: null,
renderer: null,
renderer_config: null,
display_detail: 20,
selected: true,
order_by: false,
......@@ -93,8 +93,8 @@ describe('[Detail] Component: ObjectDisplayComponent', () => {
max: null,
placeholder_min: null,
placeholder_max: null,
uri_action: null,
renderer: null,
renderer_config: null,
display_detail: 10,
selected: true,
order_by: false,
......@@ -130,8 +130,8 @@ describe('[Detail] Component: ObjectDisplayComponent', () => {
max: null,
placeholder_min: null,
placeholder_max: null,
uri_action: null,
renderer: null,
renderer_config: null,
display_detail: 10,
selected: true,
order_by: false,
......@@ -165,8 +165,8 @@ describe('[Detail] Component: ObjectDisplayComponent', () => {
max: null,
placeholder_min: null,
placeholder_max: null,
uri_action: null,
renderer: null,
renderer_config: null,
display_detail: 20,
selected: true,
order_by: false,
......
import { Component, Input, ChangeDetectionStrategy } from '@angular/core';
import { Component, Input, ChangeDetectionStrategy, Output, EventEmitter, OnInit } from '@angular/core';
import { Attribute } from '../../metamodel/model';
......@@ -7,13 +7,41 @@ import { Attribute } from '../../metamodel/model';
templateUrl: 'object-display.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ObjectDisplayComponent {
export class ObjectDisplayComponent implements OnInit {
@Input() attributeList: Attribute[];
@Input() object: any;
@Input() spectraIsLoading: boolean;
@Input() spectraIsLoaded: boolean;
@Input() spectraCSV: string;
@Output() getSpectraCSV: EventEmitter<string> = new EventEmitter();
getAttributesVisible() {
ngOnInit() {
const attributeSpectraGraph = this.getAttributeSpectraGraph();
if (attributeSpectraGraph) {
Promise.resolve(null).then(() => this.getSpectraCSV.emit(this.object[attributeSpectraGraph.label]));
}
}
getAttributesVisible(): Attribute[] {
return this.attributeList
.filter(a => a.detail)
.sort((a, b) => a.display_detail - b.display_detail);
}
getAttributeBySearchFlag(searchFlag: string): Attribute {
return this.getAttributesVisible().find(attribute => attribute.search_flag === searchFlag);
}
getAttributeSpectraGraph(): Attribute {
return this.getAttributesVisible().find(attribute => attribute.renderer_detail === 'spectra_graph');
}
getZ(): number {
const attributeZ = this.getAttributeBySearchFlag('Z');
if (attributeZ) {
return +this.object[attributeZ.label];
} else {
return 0;
}
}
}
export interface Point {
x: number,
y: number
}
\ No newline at end of file
export const emissionLines = [
{name: 'SII', wavelength: 10320},
{name: 'HeI', wavelength: 7065.2},
{name: 'SII', wavelength: 6732.68},
{name: 'SII', wavelength: 6718.39},
{name: 'NII', wavelength: 6585.27},
{name: '', wavelength: 6564.61},
{name: 'NII', wavelength: 6549.86},
{name: 'HeI', wavelength: 5876.0},
{name: 'OIII', wavelength: 5008.24},
{name: 'OIII', wavelength: 4960.29},
{name: '', wavelength: 4862.70},
{name: 'OIII', wavelength: 4364.44},
{name: '', wavelength: 4341.68},
{name: '', wavelength: 4102.89},
{name: 'SII', wavelength: 4072.0},
{name: 'Hksi', wavelength: 3890.15},
{name: 'NeIII', wavelength: 3869.81},
{name: 'H9', wavelength: 3836.47},
{name: '', wavelength: 3798.98},
{name: 'H11', wavelength: 3771.70},
{name: 'OII', wavelength: 3728.49},
{name: 'NeV', wavelength: 3426.5},
{name: 'NeV', wavelength: 3346.4},
{name: 'HeII', wavelength: 3204.03},
{name: 'FeII', wavelength: 2964.0},
{name: 'MgII', wavelength: 2799.0},
{name: 'NII', wavelength: 2142.0},
{name: 'CIII', wavelength: 1908.73},
{name: 'HeII', wavelength: 1640.42},
{name: 'CIV', wavelength: 1549.0},
{name: 'SiIV', wavelength: 1397.0},
{name: 'CII', wavelength: 1334.53},
{name: 'OI', wavelength: 1303.0},
{name: 'NV', wavelength: 1240.0},
{name: 'LyA', wavelength: 1215.67},
{name: 'OVI', wavelength: 1033.0},
{name: 'LyB', wavelength: 1025.72},
{name: 'LyG', wavelength: 972.53}
];
export const absorptionLines = [
{name: 'TiO', wavelength: 8863.0},
{name: 'TiO', wavelength: 8430.0},
{name: 'NaI', wavelength: 8197.05},
{name: 'NaI', wavelength: 8185.50},
{name: 'TiO', wavelength: 7590.0},
{name: 'HeI', wavelength: 7065.2},
{name: '', wavelength: 6564.61},
{name: 'TiO', wavelength: 6159.0},
{name: 'NaD', wavelength: 5892.5},
{name: 'TiO', wavelength: 5603.0},
{name: 'Ca,Fe', wavelength: 5269.0},
{name: 'MgI', wavelength: 5174.12},
{name: '', wavelength: 4862.70},
{name: '', wavelength: 4341.68},
{name: 'Gband', wavelength: 4304.4},
{name: 'CN', wavelength: 4216.0},
{name: '', wavelength: 4102.89},
{name: 'CaII_H', wavelength: 3969.59},
{name: 'CaII_K', wavelength: 3934.78},
{name: 'Hksi', wavelength: 3890.15},
{name: 'H9', wavelength: 3836.47},
{name: '', wavelength: 3798.98},
{name: 'H11', wavelength: 3771.70},
{name: 'FeI', wavelength: 3581.0},
{name: 'HeII', wavelength: 3204.03},
{name: 'FeII', wavelength: 2964.0},
{name: 'MgII', wavelength: 2796.35},
{name: 'MgII', wavelength: 2803.53},
{name: 'FeII', wavelength: 2626.45},
{name: 'FeII', wavelength: 2600.17},
{name: 'FeII', wavelength: 2586.65},
{name: 'FeII', wavelength: 2382.76},
{name: 'FeII', wavelength: 2374.46},
{name: 'FeII', wavelength: 2344.21},
{name: 'FeII', wavelength: 2260.78},
{name: 'AlIII', wavelength: 1854.72},
{name: 'AlII', wavelength: 1670.78},
{name: 'HeII', wavelength: 1640.42},
{name: 'FeII', wavelength: 1608.45},
{name: 'CIV', wavelength: 1548.20},
{name: 'CIV', wavelength: 1550.77},
{name: 'SiII', wavelength: 1533.43},
{name: 'SiII', wavelength: 1526.71},
{name: 'SiIV', wavelength: 1402.77},
{name: 'SiIV', wavelength: 1393.75},
{name: 'CII', wavelength: 1334.53},
{name: 'OI', wavelength: 1302.17},
{name: 'OI', wavelength: 1304.86},
{name: 'SiII', wavelength: 1260.42},
{name: 'NV', wavelength: 1238.82},
{name: 'NV', wavelength: 1242.80},
{name: 'LyA', wavelength: 1215.67},
{name: 'OVI', wavelength: 1037.62},
{name: 'OVI', wavelength: 1031.93},
{name: 'LyB', wavelength: 1025.72},
{name: 'LyG', wavelength: 972.53}
];
.titles text {
fill: #5a5a5a;
font-size: 24px;
}
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
.grid line {
fill: none;
stroke: lightgray;
shape-rendering: crispEdges;
}
.ray line {
stroke-dasharray: 3, 3;
stroke-width: 1.5px;
}
.emission line {
stroke: steelblue;
}
.emission text {
fill: steelblue;