Commit 92e34398 authored by Cédric Exbrayat's avatar Cédric Exbrayat
Browse files

chore: remove frontend module

parent 978810ee
.git/
frontend/node_modules/
backend/out
frontend/.gradle
.gradle/
......@@ -225,5 +225,4 @@ gradle-app.setting
**/build/
# End of https://www.gitignore.io/api/gradle,eclipse,intellij,visualstudiocode,kotlin,git,macos,linux
frontend/package-lock.json
/web/node_modules/
......@@ -182,7 +182,6 @@ restart-config-server-openstack:
changes:
- .gitlab-ci.yml
- backend/src/**/*
- frontend/**/*
allow_failure: false
deploy-to-beta:
......
frontend/src/assets/faidare/ABOUT.md
\ No newline at end of file
# About this data portal
The purpose of this portal is to facilitate the discoverability of public data on plant biology from a federation of established data repositories.
It is based on the [Breeding API (BrAPI)](https://brapi.org/) specifications and facilitates the access to genotype and phenotype datasets for crop and forest plants through an easy to use web interface.
It also provides a standard interface that can be accessed programatically through [web services](https://urgi.versailles.inra.fr/faidare/swagger-ui.html).
It is an extension of the generic [Data-Discovery portal](https://forgemia.inra.fr/urgi-is/data-discovery), a web portal that allows finding any type of data across several databases through a lightweight keyword based search.
FAIDARE offers more detailed search and data retrieval capabilities and it takes advantage of the growing adoption of the BrAPI.
It has been developed by [INRA-URGI](http://urgi.versailles.inra.fr/) in collaboration with [**Elixir Plant**](https://elixir-europe.org/communities/plant-sciences), [**Phenome-Emphasis.fr**](https://www.phenome-emphasis.fr/phenome_eng/Methodological-projects/MCP2-Distributed-Information-system) and [**Elixir-fr/IFB**](https://www.france-bioinformatique.fr).
If you want to join the FAIDARE federation, please read the "Join us" section and [contact us](mailto:urgi-contact@inra.fr?subject=%5BFAIDARE%5D).
......@@ -57,8 +57,8 @@
* Look at the [README.md](README.md) for installation and execution instructions.
* Recommanded IDE is [Intellij IDEA](https://www.jetbrains.com/idea/)
* Use linting to apply code standards within the team:
* Use `ng lint` (for frontend code only)
* Use [Checkstyle](https://checkstyle.org/) and [PMD](https://pmd.github.io/) (**TODO**: implement) for backend (+frontend?) code
* Use `yarn format` (for `web` code only)
* Use [Checkstyle](https://checkstyle.org/) and [PMD](https://pmd.github.io/) (**TODO**: implement) for backend code
* All runtime variables should be externalized from the code in order to facilitate the CI management (database host/port, application name, public URL, JSON location...) and the adoption by partners
* Configure [Yelp's detect-secrets](https://github.com/Yelp/detect-secrets) pre-commit hook to track any high entropy strings, which could possibly be leaked secrets.
* Run: `pip3 install pre-commit detect-secrets --user && pre-commit install` to configure you dev environment.
......
frontend/src/assets/faidare/HELP.md
\ No newline at end of file
# Help section
> Note: this application is responsive, meaning that its rendering will adapt to the screen's size of your device, hence location of items below can be different than stated.
You can find data by building your own query using the fields available in the two tabs of the form:
* The `Germplasm` tab allow you to add criteria on plant material/germplasm (_e.g._ its name, genus or species).
* The `Trait` tab allow you to add criteria on trait(s) and/or variable(s) name(s).
In each field, one or several term(s) can be entered.
As you begin to type, a list of relevant suggestions is proposed to guide you in your search.
The query is launched as soon as at least one parameter is selected in the form.
The results are automatically updated if a parameter is added or removed.
To refine your search, you can add more specific filters by using the facets/categories on the left side.
> Note: applying several filters in the same facet/category will search for documents related to any of the selected terms (resulting in a `OR` operator between all the category's terms).
> In contrary, applying filters in different facets/categories will search for documents having both filters (resulting in an `AND` operator for the different facets).
frontend/src/assets/faidare/HOW-TO-JOIN.md
\ No newline at end of file
# How to join FAIDARE federation?
If you want your information system to be part of the FAIDARE federation, we invite you to [contact us](mailto:urgi-contact@inra.fr?subject=%5BFAIDARE%5D) as soon as possible so that we can follow your progress and assist you if needed.
You will need to create a new `source` corresponding to your information system.
For this, you will have to set up your own [BrAPI](https://brapi.org/) endpoint and reference it in the sources of [Elixir's FAIDARE harvester](https://github.com/elixir-europe/plant-brapi-etl-data-lookup-gnpis).
General information and considerations can be found on the [Elixir Plant](https://elixir-europe.org/communities/plant-sciences) web page.
## Creation of a BrAPI endpoint
To create a new endpoint, you should implement the BrAPI calls needed to give access to the data of your information system.
Those calls are documented in various formats on the [Developer resources](https://www.brapi.org/developers#) section of the BrAPI web site.
The BrAPI calls currently used by FAIDARE are:
* germplasm
* location
* ontology
* program
* study
* study/{studyDbId}/observationVariable
* study/{studyDbId}/germplasm
* study/{studyDbId}/observationUnit (can be resource intensive and therefore not implemented)
* trial
> Note that since the tool makes a backlink to your information system, we need a URL in the `DocumentationURL` field of the BrAPI for researchers to get more detailed information about the indexed entry directly in your information system.
To ensure the quality of your BrAPI endpoint, you can use the validation tools provided by the BrAPI community, especially [Brava](http://webapps.ipk-gatersleben.de/brapivalidator/).
If you have any question or need help implementing BrAPI calls, you can [contact the BrAPI community](https://brapi.org/).
## Referencement of a BrAPI endpoint
For your endpoint to be visible on FAIDARE, you have to declare it in the sources of [Elixir's FAIDARE harvester](https://github.com/elixir-europe/plant-brapi-etl-data-lookup-gnpis).
To do this, you only have to create your own configuration file, according to the following template, and add it to the [`sources`](https://github.com/elixir-europe/plant-brapi-etl-data-lookup-gnpis/tree/master/sources) directory of the harvester:
```
{
"@context": {
"schema": "http://schema.org/",
"brapi": "https://brapi.org/"
},
"@type": "schema:DataCatalog",
"@id": "[information system URL]",
"schema:identifier": "[BrAPI endpoint name]",
"schema:name": "[information system name]",
"brapi:endpointUrl": "[BrAPI endpoint URL]"
}
```
Example: [URGI.json](https://github.com/elixir-europe/plant-brapi-etl-data-lookup-gnpis/blob/master/sources/URGI.json)
```
{
"@context": {
"schema": "http://schema.org/",
"brapi": "https://brapi.org/"
},
"@type": "schema:DataCatalog",
"@id": "https://urgi.versailles.inra.fr/gnpis",
"schema:identifier": "URGI",
"schema:name": "URGI GnpIS",
"brapi:endpointUrl": "https://urgi.versailles.inra.fr/faidare/brapi/v1/"
}
```
If you have any question or need help referencing your endpoint, you can [contact us](mailto:urgi-contact@inra.fr?subject=%5BFAIDARE%5D).
## Data availability & update
[Elixir's FAIDARE harvester](https://github.com/elixir-europe/plant-brapi-etl-data-lookup-gnpis) extract the metadata available from all declared sources (_i.e._ BrAPI endpoint) and index it into a centralised Elasticsearch cache.
The sources are reindexed regularly (once a month maximum) but if you want a reindexation following a major update on your side, please [inform us](mailto:urgi-contact@inra.fr?subject=%5BFAIDARE%5D).
frontend/src/assets/faidare/LEGAL-MENTIONS.md
\ No newline at end of file
# General Terms of Use
By browsing this web site, you acknowledge and accept its general terms of use described below.
## Intellectual property
Except where otherwise noted, content on this site is licensed under a [Creative Commons Attribution 4.0 International license](https://creativecommons.org/licenses/by/4.0/).
The logo is the property of INRAE and you are not allowed to re-use it for your own work and purpose.
## Content
The portal is maintained by URGI, an INRAE unit, and its [Data Management Plan (DOI: 10.15454/9HM5UI)](https://doi.org/10.15454/9HM5UI) has been defined in the frame of the [Plant Bioinformatics Facility (PlantBioinfoPF, DOI: 10.15454/1.5572414581735654E12)](https://doi.org/10.15454/1.5572414581735654E12) that hosts the portal.
Access to this web site can be interrupted at any time and without prior warning in case of force majeure.
In case of a planned service interruption, users will be notified in advance by the editor as far as possible.
The portal allows to find public data across a federation of databases.
The licences associated to data are therefore defined by the institutes in charge of them.
The portal links to external web sites.
INRAE does not take responsibility of the content of these web site.
Users are sole responsible for the searches they carry out, as well as for the interpretation and for the use they make of the results.
Users are informed that their use of the results should not infringe on current legislation or the recommendations of the French Data Protection Authority (CNIL) with respect to personal data.
Users are warned that the information must be used for strictly professional purposes only and downloading screen shots in order to constitute or enrich a database is contrary to French law and therefore forbidden, as is its use for commercial or advertising purposes (CNIL).
The portal may give access to personal and professional data concerning technical and scientific actors in relation with the data.
This information helps to identify and acknowledge the authors of the scientific works.
This personal information is attached to the produced datasets and follows the data life cycle.
## Personal data
Technical data (date, hour, IP address of the computer of the visitor, pages viewed) are collected only for the statistical analysis of the usage of the portal.
These data are kept confidential and not transmitted to any other party.
They are stored on INRA’s private servers for 5 years.
During visits on URGI web site and its hosted applications, a cookie can be automatically installed on visitor’s web browsers to retrieve statistics on the pages that are visited and support improvements of the services provided by the web site.
Visitors can configure their web browsers in order to be informed of the setting of cookies and refuse them.
According to the European Regulation on the protection of personal data (EU Regulation 2016/679), you have the right to access, rectify, oppose and delete information about yourself.
If you wish to exercise this right and obtain information about yourself, please contact us:
- By [email](mailto:urgi-contact@inra.fr?subject=%5BData%20Discovery%5D%20GPDR%20request)
- Or via any other way available on our [contact form](https://urgi.versailles.inra.fr/Contact-us)
## Modifications
The editor might change the terms of use and user’s rights without prior warning.
Last update: 2021 February 22th
# FAIDARE: FAIR Data-finder for Agronomic Research
This application provides web services (based on the BrAPI standard) and a web interface with easy to use filters to facilitates the access to plant datasets from a federation of sources.
This application provides web services (based on the BrAPI standard) and a web interface with easy to use filters to facilitate the access to plant datasets from a federation of sources.
[[_TOC_]]
......@@ -15,8 +15,8 @@ Installation via `nvm` is recommended for easier control of installed version:
https://github.com/creationix/nvm
```sh
nvm install 10.13.0
nvm use v10.13.0
nvm install 16.14.0
nvm use v16.14.0
```
- Install JS dependencies
......@@ -106,7 +106,7 @@ docker run -t --volume /path/to/local/data:/opt/data/ --network=container:elasti
Remove the `--help` parameter to run the loading with default params.
If you are depending of commited changes in indexing scripts under a specific branch (the docker image should have been automatically created by the CI), you need to change the tag of the docker image according to the branch name (ie. for branch `epic/merge-faidare-dd`, use tag `epic-merge-faidare-dd`, see `CI_COMMIT_REF_SLUG` [Gitlab predefined variable](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#predefined-variables-reference)), as following:
If you depend on committed changes in indexing scripts under a specific branch (the docker image should have been automatically created by the CI), you need to change the tag of the docker image according to the branch name (ie. for branch `epic/merge-faidare-dd`, use tag `epic-merge-faidare-dd`, see `CI_COMMIT_REF_SLUG` [Gitlab predefined variable](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html#predefined-variables-reference)), as following:
```sh
docker run -t --volume /path/to/local/data:/opt/data/ --network=container:elasticsearch-faidare registry.forgemia.inra.fr/urgi-is/docker-rare/faidare-loader:epic-merge-faidare-dd` -jsonDir /opt/data/ --help
......
# Created by https://www.gitignore.io/api/angular,sass
# Edit at https://www.gitignore.io/?templates=angular,sass
### Angular ###
## Angular ##
# compiled output
/dist
/tmp
/app/**/*.js
/app/**/*.js.map
# dependencies
/node_modules
/bower_components
# IDEs and editors
/.idea
# misc
/.sass-cache
/connect.lock
/coverage/*
/karma-junit-tests-report
/libpeerconnection.log
npm-debug.log
testem.log
/typings
# e2e
/e2e/*.js
/e2e/*.map
#System Files
.DS_Store
### Sass ###
.sass-cache/
*.css.map
*.sass.map
*.scss.map
# End of https://www.gitignore.io/api/angular,sass
# FAIDARE Frontend
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.6.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
[See official doc for more info](https://github.com/angular/angular-cli/wiki/generate).
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
If you get this error:
```
[firefox #11] [11:24:52] I/direct - Using FirefoxDriver directly...
[firefox #11] [11:24:52] E/direct - Error code: 135
[firefox #11] [11:24:52] E/direct - Error message: Could not find update-config.json. Run 'webdriver-manager update' to download binaries.
```
Try to update your web drivers using the following command:
```sh
./node_modules/protractor/bin/webdriver-manager update
```
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"frontend": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "faidare",
"schematics": {
"@schematics/angular:component": {
"styleext": "scss"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/frontend",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "src/assets/faidare",
"output": "/assets"
},
"src/assets"
],
"stylePreprocessorOptions": {
"includePaths": [
"src/assets/faidare/"
]
},
"styles": [
"src/styles.scss",
"node_modules/leaflet/dist/leaflet.css",
"node_modules/leaflet.markercluster/dist/MarkerCluster.css",
"node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css"
],
"scripts": [],
"baseHref": "/faidare-dev/",
"es5BrowserSupport": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": true,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2000kb",
"maximumError": "4000kb"
}
],
"stylePreprocessorOptions": {
"includePaths": [
"src/assets/faidare/"
]
},
"baseHref": "./"
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "frontend:build",
"proxyConfig": "proxy.conf.js"
},
"configurations": {
"production": {
"browserTarget": "frontend:build:production"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"browsers": "ChromeHeadlessNoSandbox",
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"assets": [
{
"glob": "**/*",
"input": "src/assets/faidare",
"output": "/assets"
},
"src/assets"
],
"stylePreprocessorOptions": {
"includePaths": [
"src/assets/faidare/"
]
},
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"test-multi-browsers": {
"browsers": "ChromeHeadlessNoSandbox,FirefoxHeadless"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"frontend-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "frontend:serve"
},
"configurations": {
"production": {
"devServerTarget": "frontend:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "frontend"
}
import com.moowork.gradle.node.npm.NpmTask
plugins {
base
id("com.moowork.node") version "1.2.0"
id("org.sonarqube")
}
val isCi = System.getenv("CI") != null
node {
version = "10.13.0"
npmVersion = "6.4.1"
if (isCi) {
// we specify a custom installation directory because of permission issues on Docker
workDir = file("/tmp/node")
}
download = true
}
tasks {
// Lint
val lint by creating {
dependsOn("npm_run_lint")
}
// Unit tests
val test by creating {
if (isCi) {
dependsOn("npm_run_test-multi-browsers")
} else {
dependsOn("npm_run_test")
}
}
// E2E tests
val clientIntegrationTest by creating {
dependsOn("npm_run_e2e")
}
val check by getting {
dependsOn(test)
dependsOn(lint)
}
// Build assemble
val assemble by getting {
dependsOn("npm_run_build")
}
}
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
multiCapabilities: [
{
browserName: 'chrome',
chromeOptions: {
args: ["--headless", "--disable-gpu"]
}
},
{
browserName: 'firefox',
'moz:firefoxOptions': {
args: ["--headless"]
}
}
],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function () {
}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(
new SpecReporter({
spec: { displayStacktrace: true }
})
);
}
};
import { AppPage } from './app.po';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display result page message', () => {
page.navigateTo();
expect(page.getLabel('crops')).toContain('Crops');
});
it('should display site card message', () => {
page.navigateTo('/sites/FOO');
expect(page.getTitleText()).toEqual('sites-card works!');
});
it('should display study card message', () => {
page.navigateTo('/studies/BAR');
expect(page.getTitleText()).toEqual('study-card works!');
});
it('should display germplasm card message', () => {
page.navigateTo('/germplasm/BAZ');
expect(page.getTitleText()).toEqual('germplasm-card works!');
});
});
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo(path = '/') {
return browser.get(path);
}
getTitleText() {
return element(by.css('faidare-root p')).getText();
}