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

Initial commit

parents
Pipeline #1078 failed with stages
in 3 minutes and 56 seconds
#--- OS ---#
.DS_Store
._*
#--- IDE ---#
.vscode/
.idea/
nbproject/
#--- COMPOSER ---#
vendor/
#--- NODE ---#
npm-debug.log*
yarn-debug.log*
yarn-error.log*
node_modules/
public/bower_components/
bower_components/
#--- LOGS ---#
logs/
*.log
#--- ANGULAR ---#
.editorconfig
dist
out-tsc
/e2e/*.js
/e2e/*.map
/typings
#--- OTHER ---#
tmp
npm-debug.log
yarn-error.log
stages:
- install
- build
- deploy
variables:
CONTAINER_IMAGE: portus.lam.fr/anis/anis-client
install:
image: node:11
stage: install
script:
- yarn global add @angular/cli
- yarn install
- ng build --prod
cache:
paths:
- dist
policy: push
only:
refs:
- develop
build:
image: docker:stable
stage: build
script:
- docker login -u fagneray -p $PORTUS_TOKEN portus.lam.fr
- docker pull $CONTAINER_IMAGE:latest-dev || true
- docker build --cache-from $CONTAINER_IMAGE:latest-dev -t $CONTAINER_IMAGE:latest-dev .
- docker push $CONTAINER_IMAGE:latest-dev
cache:
paths:
- dist
policy: pull
only:
refs:
- develop
deploy:
image: alpine
stage: deploy
script:
- apk add --update curl
- curl -XPOST $DEV_WEBHOOK
only:
refs:
- develop
\ No newline at end of file
# Changelog
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.0] - yyyy-mm-dd
### Added
- Pour les nouvelles fonctionnalités.
### Changed
- Pour les changements au sein des fonctionnalités déjà existantes.
### Deprecated
- Pour les fonctionnalités qui seront supprimées dans la prochaine publication.
### Removed
- Pour les anciennes fonctionnalités Deprecated qui viennent d’être supprimées.
### Fixed
- Pour les corrections de bugs.
### Security
- Pour encourager les utilisateurs à mettre à niveau afin d’éviter des failles de sécurité.
\ No newline at end of file
FROM nginx
COPY dist /usr/share/nginx/html
\ No newline at end of file
This diff is collapsed.
UID := $(shell id -u)
GID := $(shell id -g)
list:
@echo ""
@echo "Useful targets:"
@echo ""
@echo " install > install node modules dependancies (node_modules)"
@echo " start > run a dev server for anis client application (in memory)"
@echo " stop > stop the dev server for anis client application"
@echo " restart > restart the dev server for anis client (container)"
@echo " ng-build > generate the angular dist application (html, css, js)"
@echo " log > display anis client container logs"
@echo " debug > shell into anis client container"
@echo ""
install:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
-v $(CURDIR):/project \
-w /project anis-node yarn install
start:
@docker build -t anis-node conf-dev && docker run --init -it --rm --user $(UID):$(GID) \
--name anis-client \
-p 4200:4200 \
-v $(CURDIR):/project -d \
-w /project anis-node ng serve --host=0.0.0.0 --disable-host-check --port 4200
restart:
docker-compose stop
docker-compose start
stop:
@docker stop anis-client
restart: stop start
ng-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
log:
@docker logs -f -t anis-client
debug:
@docker exec -ti anis-client bash
# ANIS CLIENT
## Introduction
AstroNomical Information System est un outil web générique qui vise à faciliter
la mise à disposition de données (Astrophysiques), accessible depuis
une base de données, à une communauté de scientifiques.
ANIS-CLIENT est un composant de ANIS qui permet de visualiser les datasets dans un web browser.
ANIS-CLIENT est capable de générer des formulaires et d'interroger une ou plusieurs bases de données
à partir des informations contenues dans la base de metamodel.
## Auteurs
* `François Agneray` : Laboratoire d'Astrophysique de Marseille (CNRS)
* `Chrystel Moreau` : Laboratoire d'Astrophysique de Marseille (CNRS)
\ No newline at end of file
3.0.0
\ No newline at end of file
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"cli": {
"packageManager": "yarn"
},
"projects": {
"anis-v3-client": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/ngx-toastr/toastr.css",
"node_modules/@fortawesome/fontawesome-free/css/all.css",
"node_modules/@ng-select/ng-select/themes/default.theme.css",
"src/styles.css"
],
"scripts": [
"node_modules/@fortawesome/fontawesome-free/js/all.js"
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "anis-v3-client:build"
},
"configurations": {
"production": {
"browserTarget": "anis-v3-client:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "anis-v3-client:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"scripts": [],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"assets": [
"src/assets",
"src/favicon.ico"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"anis-v3-client-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "anis-v3-client:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "anis-v3-client",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
\ No newline at end of file
FROM node:11
RUN yarn global add @angular/cli
CMD ["bash"]
import { AppPage } from './app.po';
describe('anis-v3-client App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getParagraphText()).toEqual('Welcome to app!');
});
});
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/e2e",
"baseUrl": "./",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
// 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: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
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 { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { EffectsModule } from '@ngrx/effects';
import { CustomRouterStateSerializer } from './shared/utils';
import { reducers, metaReducers } from './app.reducer';
import { CoreModule } from './core/core.module';
import { StaticModule } from './static/static.module';
import { LoginModule } from './login/login.module';
import { SearchModule } from './search/search.module';
import { AppRoutingModule } from './app.routing';
import { AppComponent } from './core/containers/app.component';
import { environment } from '../environments/environment';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
StoreModule.forRoot(reducers, { metaReducers }),
StoreRouterConnectingModule,
!environment.production ? StoreDevtoolsModule.instrument() : [],
EffectsModule.forRoot([]),
CoreModule,
StaticModule,
LoginModule,
SearchModule,
AppRoutingModule
],
providers: [ { provide: RouterStateSerializer, useClass: CustomRouterStateSerializer } ],
bootstrap: [AppComponent]
})
export class AppModule { }
import { ActionReducerMap, ActionReducer, MetaReducer } from '@ngrx/store';
import { environment } from '../environments/environment';
import * as fromRouter from '@ngrx/router-store';
export interface State {
routerReducer: fromRouter.RouterReducerState;
}
export const reducers: ActionReducerMap<State> = {
routerReducer: fromRouter.routerReducer
};
export function logger(reducer: ActionReducer<State>): ActionReducer<State> {
return function(state: State, action: any): State {
console.group(action.type);
const nextState = reducer(state, action);
console.log(`%c prev state`, `color: #9E9E9E; font-weight: bold`, state);
console.log(`%c action`, `color: #03A9F4; font-weight: bold`, action);
console.log(`%c next state`, `color: #4CAF50; font-weight: bold`, nextState);
console.groupEnd();
return nextState;
};
}
export const metaReducers: MetaReducer<State>[] = !environment.production
? [logger]
: [];
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { NotFoundPageComponent } from './core/containers/not-found-page.component';
const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: '**', component: NotFoundPageComponent }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
export const routedComponents = [
NotFoundPageComponent
];
.dropdown-up {
top: 80% !important;
right: 5px !important;
}
.pointer {
cursor: pointer;
}
img {
height: 60px;
}
\ No newline at end of file